Fix extraneous warning about executable stack.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
d8e60314
CC
12014-12-01 Cary Coutant <ccoutant@google.com>
2
3 PR gold/17578
4 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
5 is given.
6 (Layout::create_executable_stack_info): Warn when -z noexecstack is
7 given but some inputs require executable stack.
8
982bbd97
CC
92014-11-26 Cary Coutant <ccoutant@google.com>
10
11 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
12 .debug_str_offsets; strip .debug_gnu_pubnames and
13 .debug_gnu_pubtypes.
14 (lines_only_debug_sections): Strip all four new sections.
15
bb779192
HS
162014-11-26 Jing Yu <jingyu@google.com>
17
18 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
19 register to be x0 when to relax TLSDESC_LD64_LO12.
20
a3e60ddb
AM
212014-11-26 Alan Modra <amodra@gmail.com>
22
23 * powerpc.cc (struct Stub_table_owner): New.
24 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
25 unsigned int vector. Update all references.
26 (powerpc_relobj::set_stub_table): Take an unsigned int param
27 rather than a Stub_table. Update callers.
28 (Powerpc_relobj::clear_stub_table): New function.
29 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
30 stub_group_size_ vars.
31 (Target_powerpc::new_stub_table): Delete.
32 (max_branch_delta): New function, extracted from..
33 (Target_powerpc::Relocate::relocate): ..here..
34 (Target_powerpc::Branch_info::make_stub): ..and here. Return
35 status on whether stub created successfully.
36 (Stub_control::Stub_control): Add "no_size_errors" param. Move
37 default sizing to..
38 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
39 reduce on relax failure.
40 (Target_powerpc::group_sections): Add "no_size_errors" param.
41 Use stub_group_size_. Set up group info in a temp vector,
42 before building Stub_table vector. Account for input sections
43 possibly already converted to relaxed sections.
44 (Stub_table::init): Delete. Merge into..
45 (Stub_table::Stub_table): ..here.
46 (Stub_table::can_reach_stub): New function.
47 (Stub_table::add_plt_call_entry): Add "from" parameter and
48 return true iff stub could be reached.
49 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
50 param too.
51 (Stub_table::clear_stubs): Add "all" param.
52
a20605cf
AM
532014-11-26 Alan Modra <amodra@gmail.com>
54
55 * powerpc.cc (Stub_control::set_output_and_owner): New function.
56 (Target_powerpc::group_sections): Use it.
57
43b64deb
CC
582014-11-25 Cary Coutant <ccoutant@google.com>
59
60 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
61 (Binary_to_elf::write_symbol): Add st_size parameter.
62 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
63
c924eb67
CC
642014-11-25 Cary Coutant <ccoutant@google.com>
65
66 PR gold/17639
67 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
68 (Sized_relobj_file::do_layout): Handle deferred sections properly
69 during GC pass 1. Don't add reloc sections to deferred list twice.
70 * object.h (Sized_relobj_file::is_deferred_layout): New function.
71 (Sized_relobj_file::is_deferred_layout_): New data member.
72
9d585188
L
732014-11-21 H.J. Lu <hongjiu.lu@intel.com>
74
75 PR gold/17619
76 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
77 Check PC-relative offset overflow in PLT entry.
78
3ffaac20
AM
792014-11-21 Alan Modra <amodra@gmail.com>
80
81 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
82 for undefined weaks.
83
0cfb0717
AM
842014-11-20 Alan Modra <amodra@gmail.com>
85
86 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
87 from --stub-group-size parameter divided by 1024.
88 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
89 template parameter. Update all uses.
90 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
91 has_stub_value. Set for long branches. Don't report overflow for
92 branch to undefined weak symbols. Print info message on
93 overflowing branch to stub.
94
f9dffbf0
AM
952014-11-20 Alan Modra <amodra@gmail.com>
96
97 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
98
e88ba8d5
L
992014-11-13 H.J. Lu <hongjiu.lu@intel.com>
100
101 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
102 entry for R_X86_64_GOTPLT64.
103 (Target_x86_64<size>::Relocate::relocate): Update comments for
104 R_X86_64_GOTPLT64.
105
d37ffe25
ED
1062014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
107
108 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
109 * plugin.h: add lock definition
110
9726c3c1
HS
1112014-10-29 Han Shen <shenhan@google.com>
112 Jing Yu <jingyu@google.com>
113
114 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
115 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
116 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
117 Symbol::TLS_REF.
118 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
119 method.
120 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
121 (Target_aarch64::tls_ld_to_le): New method.
122 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
123 for 64bit targets.
124 (Output_data_plt_aarch64::irelative_rel_): New data member.
125 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
126 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
127 (Output_data_plt_aarch64::add_relocation): New method.
128 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
129 offset. Add got_irelative size to got size.
130 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
131 type string with the new typename.
132 (AArch64_relocate_functions::update_adr): Replace parameter x with
133 immed.
134 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
135 (AArch64_relocate_functions::reloc_common): New method.
136 (AArch64_relocate_funcsions::rela_general): Extract common part out
137 into reloc_common method.
138 (AArch64_relocate_functions::rela_general): Likewise.
139 (AArch64_relocate_functions::pcrela_general): Likewise.
140 (AArch64_relocate_functions::adr): New method.
141 (AArch64_relocate_functions::adrp): Calculate immed before calling
142 update_adr.
143 (AArch64_relocate_functions::adrp): Likewise.
144 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
145 comparing x to 0. Calculate immed from ~x when x < 0.
146 (Target_aarch64::optimize_tls_reloc): Add new cases for
147 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
148 TLSLD_MOVW_DTPREL_G0_NC.
149 (Target_aarch64::possible_function_pointer_reloc): Implement this
150 method.
151 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
152 comment.
153 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
154 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
155 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
156 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
157 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
158 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
159 (Target_aarch64::make_plt_entry): Call add_entry with two more
160 parameters.
161 (Target_aarch64::make_local_ifunc_plt_entry): New method.
162 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
163 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
164 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
165 (Target_aarch64::Relocate::relocate_tls): Add cases for
166 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
167 TLSLD_MOVW_DTPREL_G0_NC.
168 * testsuite/icf_safe_so_test.cc: Correct test comment.
169 * testsuite/icf_safe_test.sh: Add AArch64 arch.
170
80272b8c
AM
1712014-10-22 Alan Modra <amodra@gmail.com>
172
173 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
174 thread_starter.
175
998a69f4
AS
1762014-10-18 Andreas Schwab <schwab@linux-m68k.org>
177
178 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
179
aed56ec5
CC
1802014-10-17 Cary Coutant <ccoutant@google.com>
181
182 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
183 Add "typename" keyword.
184
bb779192 1852014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
186 Jing Yu <jingyu@google.com>
187
188 Patch for gold aarch64 backend to support relaxation.
189 * aarch64-reloc.def: Change format.
190 * aarch64.cc (class Reloc_stub): New class.
191 (class Stub_table): New class.
192 (class AArch64_relobj): New class.
193 (class AArch64_input_section): New class.
194 (class AArch64_output_section): New class.
195 (Target_aarch64::new_stub_table): New method.
196 (Target_aarch64::new_aarch64_input_section): New method.
197 (Target_aarch64::find_aarch64_input_section): New method.
198 (Target_aarch64::scan_section_for_stubs): New method.
199 (Target_aarch64::scan_reloc_section_for_stubs): New method.
200 (Target_aarch64::relocate_stub): New method.
201 (Target_aarch64::current_target): New method.
202 (Target_aarch64::do_make_elf_object): New method.
203 (Target_aarch64::do_may_relax): New method.
204 (Target_aarch64::do_relax): New method.
205 (Target_aarch64::group_sections): New method.
206 (Target_aarch64::scan_reloc_for_stub): New method.
207 (Target_aarch64::do_make_output_section): New method.
208 (Target_aarch64::stub_tables_): New data member.
209 (Target_aarch64::aarch64_input_section_map_): New data member.
210 (AArch64_relocate_functions::maybe_apply_stub): New method.
211
db4c9594
CC
2122014-09-30 Cary Coutant <ccoutant@google.com>
213
214 PR gold/17432
215 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
216
cd6da036
KC
2172014-09-30 Kito Cheng <kito@0xlab.org>
218
219 PR gold/13597
220 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
221 hash table before sysv-style hash table.
222
5f772412
ST
2232014-09-29 Sriraman Tallam <tmsriram@google.com>
224
225 * options.h (--pic-executable): Add negative to alias to -no-pie.
226
5efeedf6
CC
2272014-09-26 Cary Coutant <ccoutant@google.com>
228
229 PR gold/16773
230 * object.cc (Sized_relobj_file): Compute value of section symbols
231 for TLS sections the same as TLS symbols.
232
1707f183
CC
2332014-09-25 Cary Coutant <ccoutant@google.com>
234
235 PR gold/17432
236 * resolve.cc (Symbol_table::resolve): Override common placeholder
237 symbols, but adjust sizes.
238 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
239 symbols to common lists.
240
00cac886
AM
2412014-09-24 Alan Modra <amodra@gmail.com>
242
243 * po/POTFILES.in: Regenerate.
244
635aa30e
CC
2452014-09-23 Taiju Tsuiki <tzik@google.com>
246 Cary Coutant <ccoutant@google.com>
247
71b9b91b 248 PR gold/14860
635aa30e
CC
249 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
250 on input_sections_blocker.
251 * layout.cc (Write_sections_task::locks): Unblock
252 input_sections_blocker_.
253 * layout.h (Write_sections_task::Write_sections_task): Add
254 input_sections_blocker.
255 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
256 to DEPENDENCIES.
257 * testsuite/Makefile.in: Regenerate.
258
c0c71592
RÁE
2592014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
260
261 * testsuite/Makefile.am (plugin_test_10): New test.
262 * testsuite/Makefile.in: Regenerate
263 * testsuite/plugin_common_test_2.c (c1): Align to 8.
264 * testsuite/plugin_test_10.sh: New file.
265
6168c2a1
RÁE
2662014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
267
268 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
269 * resolve.cc (Symbol_table::resolve): Don't override common symbols
270 during the replacement phase.
271
3a531937
JY
2722014-09-17 Han Shen <shenhan@google.com>
273 Jing Yu <jingyu@google.com>
274
275 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
276 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
277 * aarch64.cc (Target_aarch64): Add data members
278 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
279 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
280 constructor.
281 (Target_aarch64::do_reloc_symbol_index): New method.
282 (Target_aarch64::do_reloc_addend): New method.
283 (Target_aarch64::add_tlsdesc_info): New method.
284 (Target_aarch64::do_dynsym_value): New method.
285 (Target_aarch64::do_make_data_plt): Add new parameters: got,
286 got_irelative. Pass them to Output_data_plt_aarch64_standard.
287 (Target_aarch64::make_data_plt): Add new parameters: got,
288 got_irelative. Pass them to do_make_data_plt.
289 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
290 (Target_aarch64::Relocate:tls_gd_to_le): New method.
291 (Target_aarch64::Relocate:tls_ie_to_le): New method.
292 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
293 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
294 (Target_aarch64::got_tlsdesc_section): New method.
295 (Target_aarch64::make_local_ifunc_plt_entry): New method.
296 (Target_aarch64::define_tls_base_symbol): New method.
297 (Target_aarch64::reserve_tlsdesc_entries): New method.
298 (Target_aarch64::got_mod_index_entry): New method.
299 (Target_aarch64::rela_tlsdesc_section): New method.
300 (Target_aarch64::rela_irelative_section): New method.
301 (Target_aarch64::Tlsdesc_info): New struct.
302 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
303 relocations and tlsdesc relocations.
304 (Target_aarch64::optimize_tls_reloc): Implement method.
305 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
306 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
307 in constructor.
308 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
309 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
310 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
311 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
312 (Output_data_plt_aarch64::rela_tlsdesc): New method.
313 (Output_data_plt_aarch64::rela_irelative): New method.
314 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
315 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
316 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
317 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
318 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
319 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
320 (Output_data_plt_aarch64_standard): New member variables:
321 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
322 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
323 New parameter: got, got_irelative.
324 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
325 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
326 (Output_data_plt_aarch64::do_write): Replace got_address with
327 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
328 (AArch64_relocate_functions::update_movnz): New method.
329 (AArch64_relocate_functions): Correct format.
330 (AArch64_relocate_functions::movnz): New method.
331 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
332 before the switch. Add new cases to switch.
00cac886 333 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
334 tlsgd tlsdesc cases.
335 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
336 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
337 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
338 Call reloc_name_in_error_message to print unsupported reloc.
339 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
340 make_data_plt.
341 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
342 relocs. Fill in some more dynamic tags.
343 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
344 Skip call tls_get_addr when tlsgd is relaxed.
345 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
346 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
347 tlsdesc->ie relaxation.
348
62661c93
SS
3492014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
350
351 * mips.cc (Target_mips_nacl): New class.
352 (Target_selector_mips_nacl): New class.
353 (target_selector_mips32): Rename from target_selector_mips32be and use
354 Target_selector_mips_nacl instead of Target_selector_mips.
355 (target_selector_mips32el): Rename from target_selector_mips32 and use
356 Target_selector_mips_nacl instead of Target_selector_mips.
357 (target_selector_mips64): Rename from target_selector_mips64be and use
358 Target_selector_mips_nacl instead of Target_selector_mips.
359 (target_selector_mips64el): Rename from target_selector_mips64 and use
360 Target_selector_mips_nacl instead of Target_selector_mips.
361 (Target_mips::mips_info): Add const attribute.
362
54674d38
CC
3632014-09-02 Cary Coutant <ccoutant@google.com>
364
365 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
366 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
367 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
368 (Sized_incr_dynobj::do_section_name): Likewise.
369 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
370 (Sized_incr_dynobj::do_section_name): Likewise.
371 * object.h (Object::section_name): Likewise.
372 (Object::do_section_name): Likewise.
373 (Sized_relobj_file::do_section_name): Likewise.
374 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
375 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
376
9860cbcf
CC
3772014-09-02 Cary Coutant <ccoutant@google.com>
378
379 PR gold/17005
380 * ehframe.cc (Fde::write): Add output_offset parameter.
381 (Cie::write): Likewise.
382 (Eh_frame::set_final_data_size): Account for offset within output
383 section.
384 (Eh_frame::do_sized_write): Likewise.
385 * ehframe.h (Fde::write): Add output_offset parameter.
386 (Cie::write): Likewise.
387 * output.cc (Output_section::Input_section_sort_entry): Remove
388 section_has_name_; add output_section_name parameter. Use
389 output section name for non-input sections.
390 (Output_section::Input_section_sort_entry::section_has_name): Remove.
391 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
392 (Output_section::Input_section_sort_compare): Remove logic for
393 sections without names.
394 (Output_section::Input_section_sort_init_fini_compare): Likewise.
395 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
396 Likewise.
397 (Output_section::Input_section_sort_section_name_compare): Likewise.
398
8e33481e
HS
3992014-08-29 Han Shen <shenhan@google.com>
400 Jing Yu <jingyu@google.com>
401
402 * aarch64-reloc-property.cc
403 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
404 reference reloc property in the table.
405 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
406 3 other entries.
407 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
408 2 new overloaded methods.
409 (Output_data_got_aarch64::do_write): Add code to write out
410 static relocs.
411 (class Output_data_got_aarch64::Static_reloc): New class to wrap
412 static relocs.
413 (Output_data_got_aarch64::static_relocs): New vector to
414 hold static relocs.
415 (Target_aarch64::TCB_SIZE): New const static memeber.
416 (Target_aarch64::tcb_size): New method.
417 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
418 (Target_aarch64::Relocate::relocate_tls): New method.
419 (Target_aarch64::Scan::local): Add code handling new reloc types.
420 (Target_aarch64::Scan::global): Add code handling new reloc types.
421
81233653
ST
4222014-08-13 Sriraman Tallam <tmsriram@google.com>
423
424 * options.h (-no-pie): Add option.
425
9363c7c3
JY
4262014-08-08 Jing Yu <jingyu@google.com>
427 Han Shen <shenhan@google.com>
428
429 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
430 (DEFFILES): add aarch64-reloc.def.
431 (TARGETSOURCES): Add aarch64-reloc-property.cc.
432 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
433 * Makefile.in: Regenerate.
434 * aarch64-reloc-property.cc: New file.
435 * aarch64-reloc-property.h: New file.
436 * aarch64-reloc.def: New file.
437 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
438 with tab to make the format consistent.
439 (Output_data_got_aarch64::symbol_table_): New method.
440 (Target_aarch64::do_plt_address_for_global): New method.
441 (Target_aarch64::do_plt_address_for_local): New method.
442 (Target_aarch64::do_select_as_default_target): New method.
443 (Target_aarch64::do_make_data_plt): New method.
444 (Target_aarch64::make_data_plt): New method.
445 (Output_data_plt_aarch64::has_irelative_section): New method.
446 (Output_data_plt_aarch64::address_for_global): New method.
447 (Output_data_plt_aarch64::address_for_local): New method.
448 (Output_data_plt_aarch64::irelative_rel_): New parameter.
449 (Output_data_plt_aarch64::add_entry): Implement contents.
450 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
451 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
452 the got_pov entry to plt0.
453 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
454 Implement contents.
455 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
456 (AArch64_howto): New struct.
457 (aarch64_howto[]): New static const array.
458 (AArch64_relocate_functions): New class.
459 (Target_aarch64::Scan::get_reference_flags): Remove method.
460 (Target_aarch64::Scan::local): Implement to support a few relocations.
461 (Target_aarch64::Scan::global): Implement to support a few relocations.
462 (Target_aarch64::make_plt_section): Implement contents.
463 (Target_aarch64::make_plt_entry): Implement contents.
464 (Target_aarch64::do_finalize_sections): Implement contents.
465 (Target_aarch64::Relocate::relocate): Implement a few relocations.
466 (Target_aarch64::relocate_section): Implement contents.
467
ad9fe6c1
AM
4682014-08-06 Alan Modra <amodra@gmail.com>
469
470 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
471
7cd4e5b7
AM
4722014-08-06 Alan Modra <amodra@gmail.com>
473
474 PR 13227
475 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
476
5ad9b0a7
ST
4772014-07-21 Sriraman Tallam <tmsriram@google.com>
478
479 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 480 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 481
e051745c
CC
4822014-07-08 Cary Coutant <ccoutant@google.com>
483
484 * expression.cc (struct Expression::Expression_eval_info): Add
485 new fields type_pointer, vis_pointer, and nonvis_pointer.
486 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
487 nonvis_pointer parameters. Adjust all calls.
488 (Symbol_expression::value): Update type, visibility, and nonvis bits
489 in caller.
490 * script.cc (Symbol_assignment::sized_finalize): Update type,
491 visibility, and remaining st_other bits for new symbol.
492 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
493 vis_pointer, and nonvis_pointer parameters.
494 * symtab.h (Symbol::set_type): New method.
495
496 * testsuite/Makefile.am (defsym_test): New test.
497 * testsuite/Makefile.in: Regenerate.
498 * testsuite/defsym_test.c: New file.
499 * testsuite/defsym_test.sh: New file.
500
f35c4853
CC
5012014-07-08 Cary Coutant <ccoutant@google.com>
502
503 PR gold/15639
504 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
505 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
506 (Sized_dynobj::base_read_symbols): ...new method.
507 * object.h (Sized_relobj_file::base_read_symbols): New method.
508 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
509 (Sized_relobj_file::base_read_symbols): ...new method.
510 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
511 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
512 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
513
2900af2d
AM
5142014-07-04 Alan Modra <amodra@gmail.com>
515
516 * po/POTFILES.in: Regenerate.
517
053a4d68
JY
5182014-07-02 Jing Yu <jingyu@google.com>
519
520 * aarch64.cc: New file
521 * Makefile.am (TARGETSOURCES): Add aarch64.cc
522 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
523 * Makefile.in: Regenerate.
524 * configure.tgt: Add entries for aarch64*.
525 * configure.ac: Likewise.
526 * configure: Likewise.
527
7b549045
AM
5282014-06-27 Alan Modra <amodra@gmail.com>
529
530 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
531
cb818dbf
CC
5322014-06-24 Cary Coutant <ccoutant@google.com>
533
534 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
535 sections.
536 (Dwo_file::sized_read_unit_index): Likewise.
537
9810d34d
SS
5382014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
539
540 * mips.cc: New file.
541 * Makefile.am (TARGETSOURCES): Add mips.cc
542 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
543 * configure.tgt: Add entries for mips*.
544 * configure.ac: Likewise.
545 * Makefile.in: Regenerate.
546 * configure: Likewise.
547
9baa787b
CC
5482014-06-09 Cary Coutant <ccoutant@google.com>
549
550 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
551 unit_length is within section bounds.
552
8f89af0a
CC
5532014-06-09 Cary Coutant <ccoutant@google.com>
554
555 PR gold/16980
556 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
557 map.
558
a47622ac
AM
5592014-06-07 Alan Modra <amodra@gmail.com>
560
561 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
562
4320c691
CC
5632014-06-06 Cary Coutant <ccoutant@google.com>
564
565 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
566 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
567 (Dwarf_pubnames_table::read_header): Likewise.
568 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
569 .debug_gnu_pubtypes.
570
270c9937
JB
5712014-06-05 Joel Brobecker <brobecker@adacore.com>
572
573 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
574 * Makefile.in, configure: Regenerate.
575
397998fc
AM
5762014-06-03 Alan Modra <amodra@gmail.com>
577
578 * powerpc.cc (addis_12_2): Define.
579 (Stub_table::do_write): Support fusion on ELFv2 stubs.
580
61f5c66f
AM
5812014-06-03 Alan Modra <amodra@gmail.com>
582
583 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
584 st_other output.
585
f6971787
AM
5862014-06-02 Alan Modra <amodra@gmail.com>
587
588 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
589 Only ignore relocs on ELFv1.
590 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
591
f6fb8322
CC
5922014-05-30 Cary Coutant <ccoutant@google.com>
593
594 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
595 * testsuite/Makefile.in: Regenerate.
596 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
597
c23dd342
L
5982014-05-27 H.J. Lu <hongjiu.lu@intel.com>
599
600 PR gold/16945
601 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
602 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
603
5fe7ffdc
AM
6042014-05-15 Alan Modra <amodra@gmail.com>
605
606 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
607 Compare FDE contents with DW_CFA_nop rather than 0.
608
a82bef93
ST
6092014-05-13 Sriraman Tallam <tmsriram@google.com>
610
611 * symtab.h (may_need_copy_reloc): Remove check for position independent
612 code.
613 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
614 position independence before pc absolute may_need_copy_reloc call.
615 Add check for executable output befor pc relative may_need_copy_reloc
616 call.
617 * i386.cc: Ditto.
618 * arm.cc: Ditto.
619 * sparc.cc: Ditto.
620 * tilegx.cc: Ditto.
621 * powerpc.cc: Add check for no position independence before
622 may_need_copy_reloc calls.
623 * testsuite/pie_copyrelocs_test.cc: New file.
624 * testsuite/pie_copyrelocs_shared_test.cc: New file.
625 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 626 * Makefile.in: Regenerate.
a82bef93 627
53c66605
ML
6282014-05-08 Martin Liška <mliska@suse.cz>
629
630 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
631
57b2284c
CC
6322014-05-06 Cary Coutant <ccoutant@google.com>
633
634 PR gold/16900
635 * i386.cc (Output_data_got_plt_i386): New class.
636 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
637 parameter. Change all callers.
638 (Output_data_plt_i386::layout_): Remove.
639 (Output_data_plt_i386::got_plt_): Change type.
640 (Target_i386::got_plt_): Change type. Change all references.
641 (Target_i386::got_section): Create instance of new class.
642 (Output_data_got_plt_i386::do_write): New function.
643 * x86_64.cc (Output_data_got_plt_x86_64): New class.
644 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
645 parameter. Change all callers.
646 (Output_data_plt_x86_64::layout_): Remove.
647 (Output_data_plt_x86_64::got_plt_): Change type.
648 (Target_x86_64::got_plt_): Change type. Change all references.
649 (Target_x86_64::got_section): Create instance of new class.
650 (Output_data_got_plt_x86_64::do_write): New function.
651 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
652 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
653 class.
654
6b97515d 6552014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 656
6b97515d
CC
657 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
658 if we have pubnames/pubtypes.
659
d1bddd3c
CC
6602014-05-02 Cary Coutant <ccoutant@google.com>
661
5fe7ffdc
AM
662 * defstd.cc (in_segment): Define __ehdr_start here...
663 * layout.cc (Layout::finalize): ...Instead of here. Set the
664 output segment when known.
665 * resolve.cc (Symbol::override_base_with_special): Remember
666 the original binding.
667 * symtab.cc (Symbol::set_output_segment): New function.
668 (Symbol::set_undefined): New function.
669 * symtab.h (Symbol::is_weak_undefined): Check original undef
670 binding.
671 (Symbol::is_strong_undefined): New function.
672 (Symbol::set_output_segment): New function.
673 (Symbol::set_undefined): New function.
674 * target-reloc.h (is_strong_undefined): Remove.
675 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
676 Check for hidden undefs.
677 (relocate_section): Call Symbol::is_strong_undefined.
678
679 * testsuite/Makefile.am (ehdr_start_test_1)
680 (ehdr_start_test_2, ehdr_start_test_3)
681 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
682 * testsuite/Makefile.in: Regenerate.
683 * testsuite/ehdr_start_def.cc: New source file.
684 * testsuite/ehdr_start_test.cc: New source file.
685 * testsuite/ehdr_start_test.t: New linker script.
686 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 687
7849f6d8
CC
6882014-04-23 Cary Coutant <ccoutant@google.com>
689
bf2cc635 690 PR gold/16870
7849f6d8
CC
691 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
692
99fd8cff
CC
6932014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
694
695 * layout.cc (Layout::include_section): Allow a target to decide
696 whether to include a section.
697 * target.h (Target::should_include_section): New function.
698 (Target::do_should_include_section): New function.
699
91f43acd
CC
7002014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
701
702 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
703 inline into ...
704 (Copy_relocs::emit): ... here.
705 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
706 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
707 (Copy_reloc_entry::entries_): Change from private to protected.
708
c4eb27e1
ST
7092014-04-02 Sriraman Tallam <tmsriram@google.com>
710
711 * icf.cc (get_section_contents): Replace copies of reloc
712 vectors with const references.
713
ae447ddd
CC
7142014-04-02 Cary Coutant <ccoutant@google.com>
715
716 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
717 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
718 * configure: Regenerate.
719 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
720 -fno-use-linker-plugin.
721 (LINK1, CXXLINK1): Add it to the link command.
722 * testsuite/Makefile.in: Regenerate.
723
fa47fa92
AM
7242014-03-12 Alan Modra <amodra@gmail.com>
725
726 * Makefile.in: Regenerate.
727
9b12c500
CC
7282014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
729
730 * symtab.h (Symbol::set_nonvis): New function.
731
beacaa96
CC
7322014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
733
734 * symtab.cc (Sized_symbol<32>::init_output_data):
735 Instantiate the template.
736 (Sized_symbol<64>::init_output_data): Likewise.
737
800d9823
CC
7382014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
739
740 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
741 adjust dynamic symbol value.
742 * target.h (Target::adjust_dyn_symbol): New function.
743 (Target::do_adjust_dyn_symbol): New function.
744
918fc1f8 7452014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 746
918fc1f8
CC
747 * output.cc (Output_data_dynamic::Dynamic_entry::write):
748 Get the value of DYNAMIC_CUSTOM dynamic entry.
749 * output.h (Output_data_dynamic::add_custom): New function.
750 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
751 dynamic entry.
752 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
753 * target.h (Target::dynamic_tag_custom_value): New function.
754 (Target::do_dynamic_tag_custom_value): New function.
755
98ff9231
CC
7562014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
757
758 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
759 dynsym indexes.
760 * target.h (Target::has_custom_set_dynsym_indexes): New function.
761 (Target::do_has_custom_set_dynsym_indexes): New function.
762 (Target::set_dynsym_indexes): New function.
763 (Target::do_set_dynsym_indexes): New function.
764
b80eed39
AM
7652014-03-07 Alan Modra <amodra@gmail.com>
766
767 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
768 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
769 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
770 (Powerpc_relocate_functions::has_overflow_bitfield,
771 overflowed): Use the above.
772 (Target_powerpc::Relocate::relocate): Correct overflow checking
773 for a number of relocations. Modify overflow test for 16-bit
774 fields in instructions to signed/unsigned according to whether
775 the field takes a signed or unsigned value.
776
4b95cf5c
AM
7772014-03-05 Alan Modra <amodra@gmail.com>
778
779 Update copyright years.
780
45965137
AM
7812014-03-05 Alan Modra <amodra@gmail.com>
782
783 * powerpc.cc (Target_powerpc::Scan::local, global): Support
784 R_PPC64_ADDR64_LOCAL.
785 (Target_powerpc::Relocate::relocate): Likewise.
786
2c80b753
AM
7872014-03-03 Alan Modra <amodra@gmail.com>
788
789 * dwp.cc (print_version): Update copyright year to current.
790
c1c69e83
AM
7912014-02-10 Alan Modra <amodra@gmail.com>
792
793 * po/gold.pot: Regenerate.
794
dd0c4e70
CC
7952014-02-06 Cary Coutant <ccoutant@google.com>
796
797 Fix problem where -u is ignored when a weak undef is seen.
798
799 * archive.cc (Library_base::should_include_member): Reorder
800 code to check for -u option if a weak undef has already been seen.
801 * testsuite/Makefile.am (weak_undef_test_2): New test case.
802 * testsuite/Makefile.in: Regenerate.
803 * testsuite/weak_undef_file3.cc: New file.
804 * testsuite/weak_undef_file4.cc: New file.
805 * testsuite/weak_undef_test_2.cc: New file.
806
1a221d3d
CC
8072014-02-05 Cary Coutant <ccoutant@google.com>
808
809 Fix issues with gold undefined symbol diagnostics.
810
811 PR binutils/15435
812 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
813 check to here.
814 * target-reloc.h (is_strong_undefined): New function.
815 (relocate_section): Move undef vtable symbol check from here.
816 Check for is_strong_undefined.
817
e889f0a4 8182014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 819
e889f0a4
CC
820 Fix problems with the --dynamic-list option.
821
822 PR gold/13577
823 * options.cc (General_options::parse_dynamic_list):
824 Set have_dynamic_list_.
825 (General_options::General_options): Initialize have_dynamic_list_.
826 (General_options::finalize): Turn off -Bsymbolic and
827 -Bsymbolic-functions if --dynamic-list provided.
828 * options.h (General_options::have_dynamic_list): New function.
829 (General_options::have_dynamic_list_): New data member.
830 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
831 correctly.
5fe7ffdc 832
e889f0a4
CC
833 PR gold/16530
834 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
835 in --dynamic-list, mark it.
5fe7ffdc 836
e889f0a4
CC
837 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
838 (dynamic_list_2): New test case.
839 * testsuite/Makefile.in: Regenerate.
840 * testsuite/dynamic_list_2.cc: New file.
841 * testsuite/dynamic_list_2.t: New file.
842 * testsuite/dynamic_list_lib1.cc: New file.
843 * testsuite/dynamic_list_lib2.cc: New file.
844 * testsuite/gc_dynamic_list_test.c: New file.
845 * testsuite/gc_dynamic_list_test.sh: New file.
846 * testsuite/gc_dynamic_list_test.t: New file.
847
ec673e64
CC
8482014-01-28 Cary Coutant <ccoutant@google.com>
849
850 Add .gdb_index version 7 support.
851
852 * gold/dwarf_reader.cc: include <utility> (for make_pair).
853 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
854 debug sections.
855 (Dwarf_ranges_table::read_ranges_table): Likewise.
856 (Dwarf_pubnames_table::read_section): Check for GNU-style
857 sections, and for compressed debug sections.
858 (Dwarf_pubnames_table::read_header): Compute end address of table.
859 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
860 for end of list by offset, not by offset == 0.
861 (Dwarf_info_reader::do_read_string_table): Check for compressed
862 debug sections.
863 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
864 Initialize new data members.
865 (Dwarf_pubnames_table::next_name): return flag_byte.
866 (Dwarf_pubnames_table::end_of_table_): New data member.
867 (Dwarf_pubnames_table::is_gnu_style_): New data member.
868 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
869 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
870 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
871 read skeleton type unit DIEs.
872 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
873 (Gdb_index::do_write): Write flag_byte.
874 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
875 (Gdb_index::Cu_vector): Store flags along with cu indexes.
876 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
877 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
878
221fd5d5
L
8792014-01-08 H.J. Lu <hongjiu.lu@intel.com>
880
881 * version.cc (print_version): Update copyright year to 2014.
882
6c09fb0b
ILT
8832013-12-19 Dimitry Andric <dimitry@andric.com>
884
885 * stringpool.cc (Stringpool_template::reserve): Add
886 HAVE_UNORDERED_MAP case.
887 * stringpool.cc (Stringpool_template::print_stats): Likewise.
888
8356f2d0
CC
8892013-12-18 Cary Coutant <ccoutant@google.com>
890
891 * configure.ac: Check for <unordered_set> and <unordered_map>.
892 * config.in: Regenerate.
893 * configure: Regenerate.
894 * system.h: Use <unordered_set> and <unordered_map> if available.
895
f2c7d7ee
RM
8962013-12-10 Roland McGrath <mcgrathr@google.com>
897
898 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
899 with $(INSTALL_PROGRAM_ENV).
900 * Makefile.in: Regenerate.
901
6632e8cc
CC
9022013-11-22 Cary Coutant <ccoutant@google.com>
903
904 * configure.ac: Add check for which library is needed for
905 dlopen.
906 * configure: Regenerate.
907
0c075858
CC
9082013-11-22 Cary Coutant <ccoutant@google.com>
909
910 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
911 assembler.
912 * testsuite/Makefile.in: Regenerate.
913
f49fe902
L
9142013-11-17 H.J. Lu <hongjiu.lu@intel.com>
915
916 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
917 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
918 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
919 (Target_x86_64<size>::Scan::local): Likewise.
920 (Target_x86_64<size>::Scan::global): Likewise.
921 (Target_x86_64<size>::Relocate::relocate): Likewise.
922 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
923 Likewise.
924 (Target_x86_64<size>::Scan::check_non_pic(): Handle
925 R_X86_64_PC32_BND.
926
927 * testsuite/Makefile.am (check_PROGRAMS): Add
928 exception_x86_64_bnd_test.
929 (exception_x86_64_bnd_test_SOURCES): New macro.
930 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
931 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
932 (exception_x86_64_bnd_test_LDADD): Likewise.
933 (exception_x86_64_bnd_1.o): New rule.
934 (exception_x86_64_bnd_2.o): Likewise.
935 * testsuite/Makefile.in: Regenerated.
936
9055360d
AM
9372013-11-15 Alan Modra <amodra@gmail.com>
938
939 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
940 accessor.
941 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
942 Only call ppc64_local_entry_offset for 64-bit. Restrict
943 symval_for_branch lookup to ELFv1.
944 (Stub_table::add_plt_call_entry): Use unsigned int off.
945 (Output_data_glink::Address, invalid_address): New.
946 (Output_data_glink::add_eh_frame): Move out of line. Add
947 support for ELFv2.
948 (Output_data_glink::add_global_entry, find_global_entry,
949 global_entry_address): New functions.
950 (Output_data_glink::global_entry_stubs_, end_branch_table_,
951 ge_size): New variables.
952 (Output_data_glink::set_final_data_size): Add global entry
953 stub sizing.
954 (Output_data_glink::do_write): Write global entry stubs.
955 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
956 parameter. Return true for ELFv2. Adjust callers.
957 (Target_powerpc::Scan::local, global): Restrict opd lookup to
958 ELFv1. Similarly for ifunc and dynamic relocation processing
959 specific to ELFv1. Recognize that symbols are defined on
960 their plt entries for ELFv2.
961 (Target_powerpc::symval_for_branch): Assert if called for
962 ELFv2 or ppc32.
963 (Target_powerpc::Relocate::relocate): Use global entry plt
964 stub for symbol value if such exists on ELFv2.
965 (Target_powerpc::Relocate::relocate): Don't call
966 symval_for_branch when ELFv2. Do adjust for local entry
967 offset when ELFv2.
968 (Target_powerpc::do_dynsym_value): Set symbols to global entry
969 plt stub for ELFv2.
970 (Target_powerpc::do_plt_address_for_global): Similarly.
971
cafdd569
CC
9722013-11-14 Cary Coutant <ccoutant@google.com>
973
974 Revert patch -- this did not fix the problem, and there is
975 no race there.
976
977 2013-11-14 Cary Coutant <ccoutant@google.com>
978
979 PR gold/14860
980 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
981 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
982 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
983 updating fde_offsets_.
984 (Eh_frame_hdr::lock_): New data member.
985
94e49e16
CC
9862013-11-14 Cary Coutant <ccoutant@google.com>
987
988 * dwp.cc (Dwo_file_entry): New type.
989 (File_list): Use Dwo_file_entry.
990 (Dwo_file::verify): New function.
991 (Dwo_file::verify_dwo_list): New function.
992 (Dwo_file::sized_verify_dwo_list): New function.
993 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
994 list.
995 (Dwp_options): New enum type.
996 (dwp_options): Add --verify-only.
997 (usage): Likewise.
998 (main): Likewise.
999 * dwp.h (gold_info): Add declaration.
1000
7cdd7d57
CC
10012013-11-14 Cary Coutant <ccoutant@google.com>
1002
1003 PR gold/14860
1004 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
1005 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
1006 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
1007 updating fde_offsets_.
1008 (Eh_frame_hdr::lock_): New data member.
1009
1d946cb3
CC
10102013-11-06 Cary Coutant <ccoutant@google.com>
1011
1012 PR gold/15758
1013 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
1014 before reloc sections.
1015
4f65b40e
AM
10162013-11-04 Alan Modra <amodra@gmail.com>
1017
1018 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1019 (Symbol::needs_dynamic_reloc): Test new flag.
1020 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1021 (Target_powerpc::Scan::get_reference_flags): Add target param.
1022 Return FUNC_DESC_ABI for 64-bit ELFv1.
1023 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1024 call.
1025 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1026 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1027
908794a9
CC
10282013-10-31 Cary Coutant <ccoutant@google.com>
1029
1030 Restore support for dwp v2 DWARF package file format.
1031
1032 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1033 tu_length parameter. Adjust all callers.
1034 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1035 * dwp.cc: Include dwarf.h.
1036 (Section_bounds): New struct type.
1037 (Unit_set): New struct type.
1038 (Dwo_file::Dwo_file): Initialize new data member.
1039 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1040 Combine and rename to...
1041 (Dwo_file::read_unit_index): ...this.
1042 (Dwo_file::sized_read_compunit_index)
1043 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1044 (Dwo_file::sized_read_unit_index): ...this.
1045 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1046 parameters; add section_id parameter.
1047 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1048 (Dwo_file::add_unit_set): ...this.
1049 (Dwo_file::shndx_map_): Remove.
1050 (Dwo_file::sect_offsets_): New data member.
1051 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1052 (Dwp_output_file::add_section): Rename to...
1053 (Dwp_output_file::add_contribution): ...this.
1054 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1055 (Dwp_output_file::add_tu_set): Likewise.
1056 (Dwp_output_file::Contribution): New type.
1057 (Dwp_output_file::Section::contributions): New data member.
1058 (Dwp_output_file::Cu_or_tu_set): Remove.
1059 (Dwp_output_file::Section::Section): New ctor.
1060 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1061 (Dwp_output_file::Dwp_index::Section_table): New type.
1062 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1063 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1064 parameter.
1065 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1066 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1067 (Dwp_output_file::Dwp_index::section_table): New member function.
1068 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1069 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1070 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1071 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1072 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1073 (Dwp_output_file::Dwp_index::section_table_): New data member.
1074 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1075 (Dwp_output_file::add_output_section): New member function.
1076 (Dwp_output_file::write_new_section): New member function.
1077 (Dwp_output_file::write_contributions): New member function.
1078 (Dwp_output_file::section_id_map_): New data member.
1079 (class Dwo_id_info_reader): Remove.
1080 (class Unit_reader): New class.
1081 (get_dwarf_section_name): New function.
1082 (Dwo_file::read_executable): Adjust initializations of class data.
1083 (Dwo_file::read): Add support for v2 package file format.
1084 (Dwo_file::read_unit_index): Likewise.
1085 (Dwo_file::sized_read_unit_index): Likewise.
1086 (Dwo_file::copy_section): Likewise.
1087 (Dwo_file::add_unit_set): Likewise.
1088 (Dwp_output_file::add_output_section): Likewise.
1089 (Dwp_output_file::add_contribution): Likewise.
1090 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1091 for empty slot.
1092 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1093 file format.
1094 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1095 slot.
1096 (Dwp_output_file::initialize): Remove unused function.
1097 (Dwp_output_file::finalize): Add support for v2 package file format.
1098 (Dwp_output_file::write_index): Likewise.
1099 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1100 function prototype.
1101
2500c017
CC
11022013-10-31 Cary Coutant <ccoutant@google.com>
1103
1104 * configure.ac: Fix check for -fmerge-constants.
1105 * configure.ac: Regenerate.
1106
dd0845d7
RM
11072013-10-30 Roland McGrath <mcgrathr@google.com>
1108
1109 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1110 Correct 9-byte nop sequence to match what the assembler generates.
1111
b4f7960d
AM
11122013-10-30 Alan Modra <amodra@gmail.com>
1113
1114 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1115 ppc64_local_entry_offset, ppc64_local_entry_offset,
1116 do_read_symbols): New functions.
1117 (Powerpc_relobj::e_flags_, st_other_): New vars.
1118 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1119 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1120 (Powerpc_relobj::e_flags_): New var.
1121 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1122 and adjust for ELFv2.
1123 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1124 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1125 (Powerpc_dynobj::do_find_special_sections): Likewise.
1126 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1127 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1128 to ELFv2 local entry.
1129 (Target_powerpc::do_relax): No thread safe barriers needed for
1130 ELFv2.
1131 (Output_data_plt_powerpc::initial_plt_entry_size_,
1132 plt_entry_size): Delete. Replace all uses with
1133 first_plt_entry_offset() and plt_entry_size().
1134 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1135 reserved_size parm. Update callers.
1136 (Output_data_plt_powerpc::entry_count): Update.
1137 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1138 and use Target_powerpc::first_plt_entry_offset().
1139 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1140 rename to plt_entry_size.
1141 (Output_data_plt_powerpc::add_ifunc_entry,
1142 add_local_ifunc_entry): Adjust reloc for ELFv2.
1143 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1144 (glink_eh_frame_fde_64v2): New.
1145 (Stub_table::plt_call_size): Support ELFv2 sizing.
1146 (Output_data_glink::add_eh_frame): Use the new FDE.
1147 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1148 (Stub_table::do_write): Write ELFv2 stubs and glink.
1149 (Target_powerpc::Relocate::relocate): Replaces nop after call
1150 with ld 2,24(1) and adjust local offset destination for ELFv2.
1151
f9c6b907
AM
11522013-10-30 Alan Modra <amodra@gmail.com>
1153
1154 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1155 (Target_powerpc::Scan::global, local): Likewise.
1156 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1157 on all ppc64 @h and @ha relocs.
1158
e84fe78f
AM
11592013-10-14 Alan Modra <amodra@gmail.com>
1160
1161 * output.h (Output_data_got::add_constant): Tidy.
1162 (Output_data_got::add_constant_pair): New function.
1163 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1164 methods used so as to first call reserve_ent().
1165
679e4abf
RM
11662013-10-11 Roland McGrath <mcgrathr@google.com>
1167
44dcb735
RM
1168 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1169 add_got_entry and add_got_entry_pair.
1170
13323c49
RM
1171 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1172 (HAVE_PUBNAMES): Likewise.
1173 * configure: Regenerate.
1174
1496b446
RM
1175 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1176 * testsuite/Makefile.in: Regenerate.
1177
cc84c10b
RM
1178 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1179 Remove const from declaration.
1180 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1181 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1182 * output.h (Output_file_header): Remove const from member target_
1183 and corresponding constructor argument.
1184 * output.cc (Output_file_header::Output_file_header): Update prototype.
1185 (Output_file_header::do_sized_write): Use this->target_ in place
1186 of parameters()->target().
1187
52f66a2c
RM
1188 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1189
2b64b551
RM
1190 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1191 * configure: Regenerate.
1192 * Makefile.in: Regenerate.
1193 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1194 * testsuite/merge_string_literals_2.c: Likewise.
1195 * testsuite/Makefile.am
1196 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1197 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1198 literal -fmerge-constants.
1199 * testsuite/Makefile.in: Regenerate.
1200
43819297
RM
1201 * i386.cc (Target_i386): Remove unused member dynbss_.
1202 * arm.cc (Target_arm): Likewise.
1203 * powerpc.cc (Target_powerpc): Likewise.
1204 * sparc.cc (Target_sparc): Likewise.
1205 * tilegx.cc (Target_tilegx): Likewise.
1206 * x86_64.cc (Target_x86_64): Likewise.
1207 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1208 type_signature_, type_offset_.
1209 * plugin.h (Plugin_hook): Remove unused member layout_.
1210 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1211 mapfile_.
1212 (Read_member): Remove unused members input_objects_, symtab_,
1213 mapfile_, layout_.
1214 (Check_library): Remove unused member symtab_.
1215 * archive.h (Lib_group): Remove unused member lib_.
1216 * archive.cc (Lib_group::Lib_group): Update initializer.
1217 * incremental.h (Incremental_binary): Remove unused member target_.
1218 (Incremental_script_entry): Removed unused member script_.
1219 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1220 * icf.h (Icf): Remove unused member num_tracked_relocs.
1221
39d9ead7
RM
1222 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1223 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1224 its only use.
1225 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1226
679e4abf
RM
1227 * archive.h: Use struct rather than class for forward declaration
1228 of Read_symbols_data.
1229
54de2ea6
CC
12302013-10-07 Cary Coutant <ccoutant@google.com>
1231
1232 PR gold/16010
1233 * testsuite/Makefile.am (icf_test): Fix dependencies.
1234 (icf_safe_test): Likewise.
1235 (icf_safe_so_test): Likewise.
1236 (large_symbol_alignment): Add empty _LDADD rule.
1237 * testsuite/Makefile.in: Regenerate.
1238
b14016f0
L
12392013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1240
1241 PR gold/15927
1242 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1243 relocation for R_X86_64_32 on x32.
1244
eb426534
RM
12452013-08-27 Roland McGrath <mcgrathr@google.com>
1246
1247 * output.cc (Output_segment::set_section_addresses): Take new
1248 Target* argument. If target->isolate_execinstr() and the segment
1249 is executable and starts at a target->abi_pagesize() boundary,
1250 pad its end out to a target->abi_pagesize() boundary with code fill.
1251 * output.h (Output_segment::set_section_addresses): Update decl.
1252 * layout.h (Layout::check_output_data_for_reset_values): Take new
1253 argument RELAX_OUTPUTS.
1254 (Layout): New member relax_output_list_.
1255 (Layout::add_relax_output): New method.
1256 * layout.cc (Layout::Layout): Update constructor.
1257 (Layout::reset_relax_output): New method.
1258 (Layout::clean_up_after_relaxation): Call it.
1259 (Layout::prepare_for_relaxation): Update caller.
1260 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1261 Call reset_relax_output before re-processing segments for
1262 isolate_execinstr case.
1263 (Layout::write_data): Handle relax_output_list_.
1264 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1265 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1266
9aff4b7a
NC
12672013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1268
1269 PR binutils/15834
1270 * object.h: Fix typos.
1271
93f8221c
RM
12722013-08-16 Roland McGrath <mcgrathr@google.com>
1273
1274 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1275 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1276
e44c3715
CC
12772013-08-07 Cary Coutant <ccoutant@google.com>
1278
1279 Revert support for v2 DWP files:
1280
1281 2013-03-01 Cary Coutant <ccoutant@google.com>
1282
1283 Add dwp support for v2 DWARF package file format.
1284 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1285 tu_length parameter. Adjust all callers.
1286 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1287 * dwp.cc: Include dwarf.h.
1288 (Section_bounds): New struct type.
1289 (Unit_set): New struct type.
1290 (Dwo_file::Dwo_file): Initialize new data member.
1291 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1292 Combine and rename to...
1293 (Dwo_file::read_unit_index): ...this.
1294 (Dwo_file::sized_read_compunit_index)
1295 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1296 (Dwo_file::sized_read_unit_index): ...this.
1297 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1298 parameters; add section_id parameter.
1299 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1300 (Dwo_file::add_unit_set): ...this.
1301 (Dwo_file::shndx_map_): Remove.
1302 (Dwo_file::sect_offsets_): New data member.
1303 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1304 (Dwp_output_file::add_section): Rename to...
1305 (Dwp_output_file::add_contribution): ...this.
1306 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1307 (Dwp_output_file::add_tu_set): Likewise.
1308 (Dwp_output_file::Contribution): New type.
1309 (Dwp_output_file::Section::contributions): New data member.
1310 (Dwp_output_file::Cu_or_tu_set): Remove.
1311 (Dwp_output_file::Section::Section): New ctor.
1312 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1313 (Dwp_output_file::Dwp_index::Section_table): New type.
1314 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1315 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1316 parameter.
1317 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1318 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1319 (Dwp_output_file::Dwp_index::section_table): New member function.
1320 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1321 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1322 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1323 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1324 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1325 (Dwp_output_file::Dwp_index::section_table_): New data member.
1326 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1327 (Dwp_output_file::add_output_section): New member function.
1328 (Dwp_output_file::write_new_section): New member function.
1329 (Dwp_output_file::write_contributions): New member function.
1330 (Dwp_output_file::section_id_map_): New data member.
1331 (class Dwo_id_info_reader): Remove.
1332 (class Unit_reader): New class.
1333 (get_dwarf_section_name): New function.
1334 (Dwo_file::read_executable): Adjust initializations of class data.
1335 (Dwo_file::read): Add support for v2 package file format.
1336 (Dwo_file::read_unit_index): Likewise.
1337 (Dwo_file::sized_read_unit_index): Likewise.
1338 (Dwo_file::copy_section): Likewise.
1339 (Dwo_file::add_unit_set): Likewise.
1340 (Dwp_output_file::add_output_section): Likewise.
1341 (Dwp_output_file::add_contribution): Likewise.
1342 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1343 for empty slot.
1344 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1345 file format.
1346 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1347 slot.
1348 (Dwp_output_file::initialize): Remove unused function.
1349 (Dwp_output_file::finalize): Add support for v2 package file format.
1350 (Dwp_output_file::write_index): Likewise.
1351 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1352 function prototype.
1353
c6905c28
CC
13542013-07-31 Cary Coutant <ccoutant@google.com>
1355
1356 * object.cc (Sized_relobj::do_output_section_address): New function.
1357 (Sized_relobj): Instantiate explicitly.
1358 * object.h (Object::output_section_address): New function.
1359 (Object::do_output_section_address): New function.
1360 (Sized_relobj::do_output_section_address): New function.
1361 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1362
13632013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1364 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1365
1366 * parameters.cc (Parameters::entry): Return target-specific entry
1367 symbol name.
1368 * target.h (Target::entry_symbol_name): New function.
1369 (Target_info::entry_symbol_name): New data member.
1370
1371 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1372 * i386.cc (Target_i386::i386_info): Likewise.
1373 (Target_i386_nacl::i386_nacl_info): Likewise.
1374 * sparc.cc (Target_sparc::sparc_info): Likewise.
1375 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1376 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1377 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1378 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1379
234d4ab8
SA
13802013-07-22 Sterling Augustine <saugustine@google.com>
1381
1382 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1383 Convert parameter shndx to local variable. Add parameters symtab
1384 and symtab_size. Scan over section names. Find relocation
1385 section corresponding to current section. Create and initialize
1386 reloc_mapper_ and reloc_type_.
1387 (Dwarf_pubnames_table::read_header): Add assertion. Change
1388 unit_length to off_t. Initialize member unit_length_. Fill in field
1389 cu_offset_.
1390 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1391 Initialize new fields unit_length_ and cu_offset_.
1392 (Dwarf_pubnames_table::read_section): Update prototype.
1393 (Dwarf_pubnames_table::cu_offset): New member function.
1394 (Dwarf_pubnames_table::subsection_size): Likewise.
1395 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1396 New fields.
1397 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1398 member functions public.
1399 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1400 Update comment. Rework logic. Move repeated parts to...
1401 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1402 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1403 pubtypes_table_, and stmt_list_offset.
1404 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1405 Gdb_index::find_pubtype_offset,
1406 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1407 (Gdb_index::pubnames_read): Update prototype and rework logic.
1408 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1409 Forward declare.
1410 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1411 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1412 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1413 Gdb_index::map_pubtable_to_dies):
1414 Declare functions.
1415 (Gdb_index::pubnames_read): Update declaration.
1416 (Gdb_index::Pubname_offset_map): New type.
1417 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1418 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1419 Gdb_index::stmt_list_offset): Declare.
1420 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1421 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1422 Gdb_index::pubtypes_offset_): Remove.
1423
a3ed37d8
RM
14242013-07-19 Roland McGrath <mcgrathr@google.com>
1425
1426 * options.h (General_options): Add -Trodata-segment option.
1427 * parameters.cc (Parameters::check_rodata_segment): New function.
1428 (Parameters::set_target_once): Call it.
1429 * parameters.h (Parameters): Declare it (private member function).
1430 * layout.cc (load_seg_unusable_for_headers): New function, broken
1431 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1432 then validate rodata segment rather than text segment.
1433 (relaxation_loop_body): Call that.
1434 (is_text_segment): New function. Don't admit a non-executable
1435 segment if TARGET->isolate_execinstr().
1436 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1437
eb5b4ded
CC
14382013-07-15 Shawn Landden <shawnlandden@gmail.com>
1439
1440 PR gold/15070
1441 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1442 * nacl.h (Sniff_file::View::View): Request aligned view.
1443
4d5effb9
CC
14442013-07-11 Cary Coutant <ccoutant@google.com>
1445
1446 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1447 correct BRLT entry size.
1448
ba8ca3e7
AM
14492013-07-03 Alan Modra <amodra@gmail.com>
1450
1451 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1452 comment.
1453
267257d2
CC
14542013-07-01 Cary Coutant <ccoutant@google.com>
1455
1456 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1457 reloc_type_.
1458 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1459 (Dwarf_ranges_table::lookup_reloc): New function.
1460 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1461 reloc_type_.
1462 (Dwarf_ranges_table::lookup_reloc): New function.
1463 (Dwarf_ranges_table::reloc_type_): New data member.
1464
06f30c9d
CC
14652013-06-27 Jing Yu <jingyu@google.com>
1466
1467 PR gold/15662
1468 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1469 function.
1470 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1471 (Target_powerpc::do_relax): Call the above.
1472
a2d7bf59
AM
14732013-06-27 Cary Coutant <ccoutant@google.com>
1474
1475 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1476 on garbage collected .opd section.
1477
14782013-06-27 Alan Modra <amodra@gmail.com>
1479
1480 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1481 is non-zero.
1482 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1483 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1484
32364e50
CC
14852013-06-14 Cary Coutant <ccoutant@google.com>
1486
1487 * resolve.cc (Symbol::override_base): Don't override st_type
1488 from plugin placeholder symbols.
1489 (Symbol_table::resolve): Likewise.
1490 (Symbol_table::should_override): Don't complain about TLS mismatch
1491 if the TO symbol is a plugin placeholder.
1492 * testsuite/Makefile.am (plugin_test_tls): New test.
1493 * testsuite/Makefile.in: Regenerate.
1494 * testsuite/plugin_test_tls.sh: New test script.
1495 * testsuite/two_file_test_2_tls.cc: New test source.
1496 * testsuite/two_file_test_tls.cc: New test source.
1497
7fb47cc9
CC
14982013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1499
1500 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1501 the maximum segment alignment is larger than the page size.
1502 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1503 correctly aligns the symbols with large alignemnt.
1504 * testsuite/Makefile.in: Regenerate.
1505 * testsuite/large_symbol_alignment.cc: New file.
1506
6934001a
CC
15072013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1508 Sriraman Tallam <tmsriram@google.com>
1509
1510 * options.h (sort_section): New option.
1511 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1512 Rename from Input_section_sort_section_name_special_ordering_compare.
1513 (Input_section_sort_section_name_compare): New struct.
1514 * output.cc (Output_section::Input_section_sort_section_name_compare::
1515 operator()): New function.
1516 (Output_section::sort_attached_input_sections): Use new sort function
1517 for .text if --sort-section=name is specified.
1518 * layout.cc (Layout::make_output_section):
1519 Add sorting by name when --sort-section=name is specified.
1520 * testsuite/Makefile.am (text_section_grouping): Test option
1521 --sort-section=name.
1522 * testsuite/Makefile.in: Regenerate.
1523 * testsuite/section_sorting_name.cc: New file.
1524 * testsuite/section_sorting_name.sh: New file.
1525
93acabad
CC
15262013-05-21 Cary Coutant <ccoutant@google.com>
1527
1528 * symtab.h (Symbol::is_cxx_vtable): New function.
1529 * target-reloc.h (relocate_section): Check for vtable symbol.
1530 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1531 * testsuite/Makefile.in: Regenerate.
1532 * testsuite/missing_key_func.cc: New test source.
1533 * testsuite/missing_key_func.sh: New test script.
1534
60e8b3fc
CC
15352013-05-21 Cary Coutant <ccoutant@google.com>
1536
2b64b551
RM
1537 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1538 type of enclosing symbol.
1539 (Relocate_info::location): Check symbol type when describing symbol.
1540 * object.h (Symbol_location_info): Remove unused line_number;
1541 add enclosing_symbol_type.
1542 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1543
9df9de2c
CC
15442013-05-13 Cary Coutant <ccoutant@google.com>
1545
2b64b551
RM
1546 * configure.ac: Export DEFAULT_TARGET.
1547 * configure: Regenerate.
1548 * Makefile.in: Regenerate.
1549 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1550 * testsuite/Makefile.in: Regenerate.
1551 * testsuite/debug_msg.sh: Delete duplicate tests.
1552 Don't check undef_int error message match for powerpc where the
1553 source file and line number aren't available.
9df9de2c 1554
bbc5ae17
RM
15552013-05-10 Roland McGrath <mcgrathr@google.com>
1556
1557 * options.h (General_options): Add --rosegment-gap option.
1558 * options.cc (finalize): --rosegment-gap implies --rosegment.
1559 * layout.cc (set_segment_offsets): Let user option override
1560 target->rosegment_gap().
1561
0c6e6c39
RM
15622013-05-10 Roland McGrath <mcgrathr@google.com>
1563
1564 * options.h (General_options): Remove leading space from help
1565 messages for -nostdlib and --rosegment.
1566
cde7cb01
MR
15672013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1568
1569 PR ld/15365
1570 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1571
f31ae5b8
AM
15722013-05-03 Alan Modra <amodra@gmail.com>
1573
1574 * merge.cc (Output_merge_string::do_add_input_section): Correct
1575 scan for number of strings. Rename vars to avoid shadowing.
1576 Include missing terminator in input_size_.
1577
d3a7cd45
L
15782013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1579
1580 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1581 Restore empty string handling.
1582
6ad3daba
CC
15832013-05-01 Cary Coutant <ccoutant@google.com>
1584
1585 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1586 uninitialized warning.
1587
e31908b6
CC
15882013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1589
1590 * output.cc (Output_section::add_merge_input_section): Allow
1591 to merge sections if the alignment is more than character size.
1592 * merge.h (Output_merge_string::Output_merge_string): Remove
1593 assert.
1594 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1595 only not-null strings. Check the alignment of strings.
1596 * stringpool.h
1597 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1598 alignment as the argument.
1599 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1600 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1601 Align non-zero length strings according to the addralign_.
1602 (Stringpool_template<Stringpool_char>::set_string_offsets):
1603 Updating offsets according to the given alignment.
1604 * testsuite/Makefile.am (text_section_grouping): Test if string
1605 literals are getting merged.
1606 * testsuite/Makefile.in: Regenerate.
1607 * testsuite/merge_string_literals_1.c: New file.
1608 * testsuite/merge_string_literals_2.c: Ditto.
1609 * testsuite/merge_string_literals.sh: Ditto.
1610
0e804863
ILT
16112013-04-26 Ian Lance Taylor <iant@google.com>
1612
1613 * target-reloc.h (relocate_section): If the reloc offset is out of
1614 range, pass VIEW as NULL to relocate.relocate.
1615 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1616 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1617 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1618 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1619 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1620 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1621
e7c5ea40
CC
16222013-04-26 Geoff Pike <gpike@chromium.org>
1623
1624 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1625 * layout.cc (Hash_task): New class.
1626 (Layout::queue_build_id_tasks): New function.
1627 (Layout::write_build_id): Handle single-thread portion of build ID
1628 computation. (In some cases, all of it is single-threaded.) Replace
1629 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1630 functionality in fewer lines of code.
1631 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1632 * options.h (General_options): make "--build-id" default to tree
1633 rather than sha1. Add two new options related to --build-id=tree:
1634 --build-id-chunk-size-for-treehash and
1635 --build-id-min-file-size-for-treehash.
1636 * Makefile.am: add testing of --build-id=tree and related new options
1637 (these tests will be invoked by "make check").
1638 * Makefile.in: Regenerate.
1639
49926cd0
AM
16402013-04-25 Alan Modra <amodra@gmail.com>
1641
1642 * configure.tgt: Add powerpcle and powerpc64le.
1643
a4034750
AM
16442013-04-22 Alan Modra <amodra@gmail.com>
1645
1646 PR gold/15355
1647 * layout.cc (Layout::segment_precedes): Allow more than one
1648 segment with the same type and flags.
1649
e79c84aa
CC
16502013-04-15 Cary Coutant <ccoutant@google.com>
1651
1652 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1653 allocate space in file for BSS sections.
1654
2199fbe7
CC
16552013-04-15 Cary Coutant <ccoutant@google.com>
1656
1657 * script-sections.cc (Orphan_output_section): Reset address
1658 to zero after each orphaned section for relocatable links.
1659
502e8a84
CC
16602013-04-15 Cary Coutant <ccoutant@google.com>
1661
a4034750
AM
1662 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1663 section starting address for relocatable link.
1664 * testsuite/Makefile.am (script_test_11): New test.
1665 * testsuite/Makefile.in: Regenerate.
1666 * testsuite/script_test_11.c: New source file.
1667 * testsuite/script_test_11.t: New linker script.
502e8a84 1668
0cfdc767
AM
16692013-04-13 Alan Modra <amodra@gmail.com>
1670
1671 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1672 owner when sections are not adjacent and exceed group size.
1673 (Target_powerpc::group_sections): Handle corner case.
1674 (Target_powerpc::Branch_info::make_stub): Handle case where
1675 stub table doesn't exist due to branches in non-exec sections.
1676 (Target_powerpc::Relocate::relocate): Likewise.
1677
6830ee24
AM
16782013-04-11 Alan Modra <amodra@gmail.com>
1679
1680 PR gold/15354
1681 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1682 .branch_lt to match bfd ld. Adjust comments throughout file.
1683
54a3d865
ILT
16842013-04-04 Ian Lance Taylor <iant@google.com>
1685
1686 GCC PR c++/56840
1687 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1688 sections before checking whether they are included in the link.
1689
9993ba11
ST
16902013-03-29 Sriraman Tallam <tmsriram@google.com>
1691
1692 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1693 object before calling the plugin claim_file handler. Pass the elf
1694 object of the archive to the plugin. Delete the elf object if the
1695 plugin claims the file.
1696
ebacd51e
AM
16972013-03-21 Alan Modra <amodra@gmail.com>
1698
1699 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1700 segment when omagic.
1701
117be58f
AM
17022013-03-21 Alan Modra <amodra@gmail.com>
1703
1704 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1705 comparison warning.
1706 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1707 uninitialized" warning.
1708
32e2b61d
AM
17092013-03-20 Alan Modra <amodra@gmail.com>
1710
1711 * symtab.h (Symbol::clear_version): New function.
1712 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1713 is_needed by weak references. Clear version for symbols defined
1714 in as-needed objects that are not needed.
1715
b3ccdeb5
AM
17162013-03-15 Alan Modra <amodra@gmail.com>
1717
1718 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1719 static and public. Add report_err param. Return false for data refs.
1720 (Target_powerpc::rela_dyn_section): New overloaded function.
1721 (Target_powerpc::plt_, iplt_): Elucidate.
1722 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1723 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1724 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1725 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1726 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1727 push_branch and make_plt_entry for ifunc syms when
1728 reloc_needs_plt_for_ifunc.
1729 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1730 for ifunc unless reloc_needs_plt_for_ifunc.
1731
ad3d8a2f
AM
17322013-03-15 Alan Modra <amodra@gmail.com>
1733
1734 * gc.h (gc_process_relocs): Don't look through function descriptors.
1735 * icf.cc (get_section_contents): Do so here instead.
1736
4d9aa155
AM
17372013-03-13 Alan Modra <amodra@gmail.com>
1738
1739 * powerpc.cc (is_branch_reloc): Forward declare.
1740 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1741 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1742 false for 64-bit, true for 32-bit non-branch relocs.
1743 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1744 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1745 nm output.
1746 (icf_safe_test): Generate linker map file as well as nm output.
1747 (icf_safe_so_test): Likewise.
1748 * testsuite/Makefile.in: Regenerate.
1749 * testsuite/icf_test.sh: Parse linker map file to determine
1750 section folding.
1751 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1752 * testsuite/icf_safe_so_test.sh: Likewise.
1753 (X86_32_or_ARM_specific_safe_fold): Merge into..
1754 (arch_specific_safe_fold): ..this.
1755 (X86_64_specific_safe_fold): Delete unused function.
1756
57420c20
AM
17572013-03-12 Alan Modra <amodra@gmail.com>
1758
1759 * gc.h (gc_process_relocs): Look through function descriptors
1760 to determine shndx, symvalue and addend used by ICF. Tidy
1761 variable duplication.
1762
dc3714f3
AM
17632013-03-11 Alan Modra <amodra@gmail.com>
1764
1765 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1766 * layout.cc (Layout_task_runner::run): ..to here.
1767 * symtab.h (struct Symbol_location): Extract from..
1768 (class Symbol_table): ..here.
1769 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1770 * target.h (class Target): Add function_location and
1771 do_function_location functions.
1772 (class Sized_target): Add do_function_location.
1773 * object.h (class Sized_relobj_file): Move find_shdr..
1774 (class Object): ..to here.
1775 * object.cc: Likewise. Update to suit. Instantiate.
1776 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1777 * powerpc.cc (class Powerpc_dynobj): New.
1778 (Target_powerpc::do_function_location): New function.
1779 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1780 (Powerpc_dynobj::do_read_symbols): New function.
1781 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1782
956b03bb
ILT
17832013-03-08 Ian Lance Taylor <iant@google.com>
1784
1785 * options.cc (General_options::string_to_object_format): Accept
1786 "default".
1787
4bead2d5
AM
17882013-03-08 Alan Modra <amodra@gmail.com>
1789
1790 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1791 pointer to Post_fde.
1792 (struct Post_fde): Move definition to here..
1793 * ehframe.cc (struct Post_fde): ..from here.
1794 (Cie::write): Don't alloc Post_fde.
1795 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1796
02e60bf7
AM
17972013-03-07 Alan Modra <amodra@gmail.com>
1798
1799 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1800 relocation referencing .LC0.
1801 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1802
8343f03a
AM
18032013-03-07 Alan Modra <amodra@gmail.com>
1804
1805 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1806 always_inline. Add assembly for powerpc to avoid GOT.
1807
3366d57c
AM
18082013-03-07 Alan Modra <amodra@gmail.com>
1809
1810 * testsuite/script_test_10.sh: Don't test .bss section
1811 header number.
1812
6c77229c
AM
18132013-03-06 Alan Modra <amodra@gmail.com>
1814
1815 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1816 (Target_powerpc::symval_for_branch): Add symtab param. Update
1817 all callers. Handle folded sections.
1818 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1819 to Powerpc_relobj.
1820 (Global_symbol_visitor_opd::operator()): Likewise.
1821
a39e4af6
AM
18222013-03-04 Alan Modra <amodra@gmail.com>
1823
1824 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1825 * testsuite/Makefile.in: Regenerate.
1826
d5834edb
CC
18272013-03-01 Cary Coutant <ccoutant@google.com>
1828
1829 Add dwp support for v2 DWARF package file format.
1830 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1831 tu_length parameter. Adjust all callers.
1832 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1833 * dwp.cc: Include dwarf.h.
1834 (Section_bounds): New struct type.
1835 (Unit_set): New struct type.
1836 (Dwo_file::Dwo_file): Initialize new data member.
1837 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1838 Combine and rename to...
1839 (Dwo_file::read_unit_index): ...this.
1840 (Dwo_file::sized_read_compunit_index)
1841 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1842 (Dwo_file::sized_read_unit_index): ...this.
1843 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1844 parameters; add section_id parameter.
1845 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1846 (Dwo_file::add_unit_set): ...this.
1847 (Dwo_file::shndx_map_): Remove.
1848 (Dwo_file::sect_offsets_): New data member.
1849 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1850 (Dwp_output_file::add_section): Rename to...
1851 (Dwp_output_file::add_contribution): ...this.
1852 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1853 (Dwp_output_file::add_tu_set): Likewise.
1854 (Dwp_output_file::Contribution): New type.
1855 (Dwp_output_file::Section::contributions): New data member.
1856 (Dwp_output_file::Cu_or_tu_set): Remove.
1857 (Dwp_output_file::Section::Section): New ctor.
1858 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1859 (Dwp_output_file::Dwp_index::Section_table): New type.
1860 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1861 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1862 parameter.
1863 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1864 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1865 (Dwp_output_file::Dwp_index::section_table): New member function.
1866 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1867 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1868 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1869 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1870 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1871 (Dwp_output_file::Dwp_index::section_table_): New data member.
1872 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1873 (Dwp_output_file::add_output_section): New member function.
1874 (Dwp_output_file::write_new_section): New member function.
1875 (Dwp_output_file::write_contributions): New member function.
1876 (Dwp_output_file::section_id_map_): New data member.
1877 (class Dwo_id_info_reader): Remove.
1878 (class Unit_reader): New class.
1879 (get_dwarf_section_name): New function.
1880 (Dwo_file::read_executable): Adjust initializations of class data.
1881 (Dwo_file::read): Add support for v2 package file format.
1882 (Dwo_file::read_unit_index): Likewise.
1883 (Dwo_file::sized_read_unit_index): Likewise.
1884 (Dwo_file::copy_section): Likewise.
1885 (Dwo_file::add_unit_set): Likewise.
1886 (Dwp_output_file::add_output_section): Likewise.
1887 (Dwp_output_file::add_contribution): Likewise.
1888 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1889 for empty slot.
1890 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1891 file format.
1892 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1893 slot.
1894 (Dwp_output_file::initialize): Remove unused function.
1895 (Dwp_output_file::finalize): Add support for v2 package file format.
1896 (Dwp_output_file::write_index): Likewise.
1897 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1898 function prototype.
1899
a68a081d
CC
19002013-03-01 Cary Coutant <ccoutant@google.com>
1901
1902 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1903 function into class definition in header file.
1904 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1905 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1906 New function.
1907 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1908
9d5781f8
AM
19092013-02-28 Alan Modra <amodra@gmail.com>
1910
1911 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1912 * target.cc (Target::do_plt_fde_location): New function.
1913 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1914 accessor function, and constructor param.
1915 (struct Post_fde, Post_fdes): Declare.
1916 (Cie::write): Add post_fdes param.
1917 * ehframe.cc (Fde::write): Use plt_fde_location.
1918 (struct Post_fde): Define.
1919 (Cie::write): Stash FDEs added post merge mapping.
1920 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1921 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1922 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1923 other FDEs.
1924 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1925 (Target_powerpc::has_glink): New function.
1926 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1927 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1928 glink_eh_frame_fde_32, default_fde): New data.
1929 (Stub_table::eh_frame_added_): New var.
1930 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1931 Make const.
1932 (Stub_table::add_eh_frame): New function.
1933 (Output_data_glink::add_eh_frame): New function.
1934 (Target_powerpc::make_glink_section): Call add_eh_frame.
1935
214383dd
ILT
19362013-02-15 Ian Lance Taylor <iant@google.com>
1937
1938 * options.h (DEFINE_uint64_alias): Define.
1939 (class General_options): Add -Ttext-segment as an alias for
1940 -Ttext.
1941
91c2b899
AM
19422013-02-15 Alan Modra <amodra@gmail.com>
1943
1944 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1945 (Stub_table::do_write): ..here, two places.
1946 (Stub_table::plt_call_size): Use it here too.
1947
20e2a8aa
ILT
19482013-02-11 Ian Lance Taylor <iant@google.com>
1949
1950 * descriptors.cc (Descriptors::close_all): New function.
1951 * descriptors.h (class Descriptors): Declare close_all.
1952 (close_all_descriptors): New inline function.
1953 * plugin.cc: Include "descriptors.h".
1954 (Plugin_manager::cleanup): Call close_all_descriptors.
1955
8952bc69
AM
19562013-02-06 Alan Modra <amodra@gmail.com>
1957
1958 * README: Update coding style link.
1959
29bd8b6b
CC
19602013-01-28 Cary Coutant <ccoutant@google.com>
1961
a4034750
AM
1962 * dwp.cc (File_list): New typedef.
1963 (Dwo_name_info_reader): New class.
1964 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1965 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1966 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1967 (Dwo_file::read_executable): New function.
1968 (Dwo_file::read): Move common setup code to ...
1969 (Dwo_file::make_object): ... here.
1970 (dwp_options): Add --exec/-e.
1971 (usage): Likewise.
1972 (main): Likewise.
29bd8b6b 1973
c6ac678d
ST
19742013-01-24 Sriraman Tallam <tmsriram@google.com>
1975
1976 * layout.cc (Layout::layout): Check for option text_reorder.
1977 (Layout::make_output_section): Ditto.
1978 * options.h (text_reorder): New option.
1979 * output.cc (Input_section_sort_compare): Remove special ordering
1980 of section names.
1981 (Output_section::
1982 Input_section_sort_section_name_special_ordering_compare::
1983 operator()): New function.
1984 (Output_section::sort_attached_input_sections): Use new sort function
1985 for .text.
1986 * output.h (Input_section_sort_section_name_special_ordering_compare):
1987 New struct.
1988 * testsuite/Makefile.am (text_section_grouping): Test option
1989 --no-text-reorder
1990 * testsuite/Makefile.in: Regenerate.
1991 * testsuite/text_section_grouping.sh: Check order of functions without
1992 default text reordering.
1993
50701cc1
MF
19942013-01-18 Mike Frysinger <vapier@gentoo.org>
1995
1996 * options.h (General_options): Change default to true for new_dtags.
1997
b1b00fcc
MF
19982013-01-18 Mike Frysinger <vapier@gentoo.org>
1999
2000 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
2001 when enable_new_dtags is false. Only add DT_RUNPATH when
2002 enable_new_dtags is true.
2003
ec5b8187
AM
20042013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
2005
2006 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
2007 used in declaration and definition consistent.
2008 (Target_powerpc::symval_for_branch): Ditto.
2009
a880d4c4
ST
20102013-01-16 Sriraman Tallam <tmsriram@google.com>
2011
2012 * testsuite/plugin_final_layout.cc: Fix comment.
2013
7c381248
ST
20142013-01-16 Sriraman Tallam <tmsriram@google.com>
2015
2016 * layout.cc (Layout::layout): Do not do default sorting for
2017 text sections when section ordering is specified.
2018 (make_output_section): Ditto.
2019 * testsuite/plugin_final_layout.cc: Name the function sections
2020 to catch reordering issues.
2021
e2458743
AM
20222013-01-15 Alan Modra <amodra@gmail.com>
2023
2024 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2025 plt-thread-safe.
2026
431ed302
AM
20272013-01-15 Alan Modra <amodra@gmail.com>
2028
2029 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2030 * testsuite/Makefile.in: Regenerate.
2031
0ec6429b
AM
20322013-01-14 Alan Modra <amodra@gmail.com>
2033
2034 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2035 * testsuite/Makefile.in: Regenerate.
2036
0bf402d5
ILT
20372013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2038
36af3926 2039 PR bfd/14430
0bf402d5
ILT
2040 Fix mingw gold build with plugins enabled
2041 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2042 * configure.ac: Export DLOPEN_LIBS and add headers check.
2043 * plugin.cc: Handle non-dlfcn case.
2044 * Makefile.in: Regenerate.
2045 * config.in: Regenerate.
2046 * configure: Regenerate.
2047 * testsuite/Makefile.in: Regenerate.
2048
9e9143bc
ST
20492013-01-09 Sriraman Tallam <tmsriram@google.com>
2050
2051 * output.h (sort_attached_input_sections): Change to be public.
2052 * script-sections.cc
2053 (Output_section_definition::set_section_addresses): Sort
2054 attached input sections according to section order before linker
2055 script assigns section addresses.
2056 (Orphan_output_section::set_section_addresses): Sort
2057 attached input sections according to section order before linker
2058 script assigns section addresses.
2059 * Makefile.am (final_layout.sh): Use a simple linker script to
2060 check if section ordering still works.
2061 * Makefile.in: Regenerate.
2062
679af368
ILT
20632013-01-09 Ben Cheng <bccheng@google.com>
2064
2065 * arm.cc (Target_arm::attributes_accept_div): New function.
2066 (Target_arm::attributes_forbid_div): New function.
2067 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2068 attribute using the same new functions as what bfd/elf32_arm.c
2069 does.
2070
3136a00e
CC
20712013-01-07 Cary Coutant <ccoutant@google.com>
2072
2073 PR gold/14993
2074 * output.cc (Output_section::add_input_section): For incremental
2075 updates, don't track input sections that are allocated from patch
2076 space.
2077
f2a6224b
L
20782013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2079 Ian Lance Taylor <iant@google.com>
2080
2081 PR gold/14897
2082 * configure.ac (--enable-ld): Removed.
2083 (install_as_default): Set to yes only for --enable-gold=default
2084 or --disable-ld.
2085 * configure: Regenerated.
2086
4f46f626
L
20872013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2088
2089 * options.h (General_options): Add -fuse-ld= for GCC linker
2090 option compatibility.
2091
26e4ef59
CC
20922013-01-04 Cary Coutant <ccoutant@google.com>
2093
2094 * configure.ac: Fix typo restoring CXXFLAGS.
2095 * configure: Regenerate.
2096
3d587466
CC
20972013-01-04 Cary Coutant <ccoutant@google.com>
2098
4f46f626
L
2099 * testsuite/Makefile.am (CXXLINK_S): New macro.
2100 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2101 * testsuite/Makefile.in: Regenerate.
3d587466 2102
44db6695
L
21032013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2104
2105 * version.cc (print_version): Update copyright year to 2013.
2106
edcac0c1
ILT
21072012-12-20 Ian Lance Taylor <iant@google.com>
2108
2109 * layout.cc (Layout::special_ordering_of_input_section): New
2110 function.
2111 (Layout::layout): If input section requires special ordering, must
2112 sort input sections.
2113 (Layout::make_output_section): May sort .text input sections.
2114 (Layout::is_section_name_prefix_grouped): Remove.
2115 * layout.h (class Layout): Declare
2116 special_ordering_of_input_section. Don't declare
2117 is_section_name_prefix_grouped.
2118 * output.cc (Output_section::add_input_section): Revert last
2119 change.
2120 (Output_section::Input_section_sort::match_file_name): Don't crash
2121 if called on output section data.
2122 (Output_section::Input_section_sort_compare): Sort based on
2123 special ordering.
2124 (Output_section::Input_section_sort_section_order_index_compare):
2125 Revert last patch.
2126 (Output_section::sort_attached_input_sections): Likewise.
2127
28f2a4ac
ST
21282012-12-18 Sriraman Tallam <tmsriram@google.com>
2129
edcac0c1 2130 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2131 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2132 * output.cc (Output_section::add_input_section): Check if section
2133 name contains special prefix. Keep input sections to sort such
2134 sections.
2135 (Output_section::Input_section_sort_section_order_index_compare
2136 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2137 (Output_section::sort_attached_input_sections): Add condition to
2138 Input_section_entry constructor call.
28f2a4ac
ST
2139 * testsuite/Makefile.am (text_section_grouping): New test.
2140 * testsuite/Makefile.in: Regenerate.
2141 * testsuite/text_section_grouping.cc: New file.
2142 * testsuite/text_section_grouping.sh: New file.
2143
5bf135a7
NC
21442012-12-17 Nick Clifton <nickc@redhat.com>
2145
2146 * Makefile.am: Add copyright notice.
2147 * NEWS: Likewise.
2148 * README: Likewise.
2149 * configure.ac: Likewise.
2150 * ftruncate.c: Likewise.
2151 * Makefile.in: Regenerate.
2152
59965708
CC
21532012-12-14 Cary Coutant <ccoutant@google.com>
2154
a4034750
AM
2155 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2156 --no-as-needed flag.
2157 (exception_separate_shared_12_test): Likewise.
2158 (incremental_copy_test): Likewise.
2159 * testsuite/Makefile.in: Regenerate.
59965708 2160
2a77e2ab
CC
21612012-12-14 Cary Coutant <ccoutant@google.com>
2162
2163 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2164 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2165
e3deeb9c
AM
21662012-12-12 Alan Modra <amodra@gmail.com>
2167
2168 * powerpc.cc (class Track_tls): New.
2169 (class Relocate, class Scan): Inherit Track_tls.
2170 (Target_powerpc::Scan::local, global): Track tls optimization
2171 and avoid creating plt entry for __tls_get_addr if all uses
2172 are optimized away.
2173 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2174
d8f5a274
AM
21752012-12-12 Alan Modra <amodra@gmail.com>
2176
2177 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2178 Replace no_toc_optimize with toc_optimize.
2179 * output.h (Output_section::input_sections): Provide non-const variant.
2180 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2181 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2182 accessors.
2183 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2184 (class Sort_toc_sections): New.
2185 (Target_powerpc::do_finalize_sections): Sort toc sections.
2186 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2187
4c8a1de1
RM
21882012-12-10 Roland McGrath <mcgrathr@google.com>
2189
2190 * testsuite/binary_unittest.cc (read_all): New function.
2191 (Sized_binary_test): Use it instead of ::read.
2192 * fileread.cc (do_read): Don't assume pread always reads the whole
2193 amount in a single call.
2194
edc27beb
AM
21952012-12-10 Alan Modra <amodra@gmail.com>
2196
2197 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2198 Set EM_PPC64 or EM_PPC here.
2199 (Target_selector_powerpc::do_recognize): Delete.
2200
906b9150
AM
22012012-12-10 Alan Modra <amodra@gmail.com>
2202
2203 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2204 stub_table_.
2205 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2206
418c15ae
RM
22072012-12-07 Roland McGrath <mcgrathr@google.com>
2208
2209 * testsuite/binary_unittest.cc (Sized_binary_test):
2210 Use open_descriptor rather than ::open.
2211
decdd3bc
AM
22122012-12-07 Alan Modra <amodra@gmail.com>
2213
2214 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2215 typedef and invalid_address constant.
2216 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2217 instantiate constants.
2218
db399005
ILT
22192012-12-06 Roland McGrath <mcgrathr@google.com>
2220
2221 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2222 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2223 * aclocal.m4: Regenerate.
2224 * configure: Regenerate.
2225 * Makefile.in: Regenerate.
2226 * testsuite/Makefile.in: Regenerate.
2227
aba6bc71
AM
22282012-12-07 Alan Modra <amodra@gmail.com>
2229
2230 * options.h (General_options): Add no_toc_optimize.
2231 * powerpc.cc (ok_lo_toc_insn): New function.
2232 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2233
9e69ed50
AM
22342012-12-06 Alan Modra <amodra@gmail.com>
2235
2236 * options.h (General_options): Add plt_align, plt_static_chain,
2237 plt_thread_safe. Update stub_group_size help text.
2238 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2239 for new plt_thread_safe_ var.
2240 (use_plt_offset): Correct comments.
2241 (Target_powerpc::do_relax): Look for thread creation symbols to
2242 determine default plt_thread_safe value. Clear plt call stubs
2243 as well as branch stubs each iteration.
2244 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2245 insn constants.
2246 (l, hi, ha, write_insn): Move earlier.
2247 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2248 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2249 plt stubs too.
2250 (Stub_table::update_size): Adjust.
2251 (Stub_table::prev_size, set_prev_size): Delete.
2252 (Stub_table::stub_align): Let --plt-align affect result.
2253 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2254 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2255 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2256 (Stub_table::do_write): Support more stub variants.
2257
f43ba157
AM
22582012-12-04 Alan Modra <amodra@gmail.com>
2259
2260 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2261 (Target_powerpc::do_define_standard_symbols): New function.
2262
34171bc5
AM
22632012-12-03 Alan Modra <amodra@gmail.com>
2264
2265 * output.h: Formatting, whitespace.
2266
dc9589e9 22672012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2268
2269 * layout.h (Layout::get_executable_sections): Declare.
2270 * layout.cc (Layout::get_executable_sections): New function.
2271 * arm.cc (Target_arm::group_sections): Use it.
2272 (Arm_output_section::group_sections): Delete now redundant test.
2273 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2274 param to handle relative relocs.
2275 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2276 (Output_data_reloc::add_absolute): Adjust.
2277 (Output_data_reloc::add_relative): New function.
2278 (Output_data::reset_data_size): New function.
2279 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2280 (Output_section::set_addralign): New function.
2281 (Output_section::checkpoint_set_addralign): New function.
2282 (Output_section::clear_section_offsets_need_adjustment): New function.
2283 (Output_section::input_sections): Make public.
2284 * powerpc.cc (class Output_data_brlt_powerpc): New.
2285 (class Stub_table, class Stub_control): New.
2286 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2287 stub_table_, set_stub_table, stub_table): New vectors and accessor
2288 functions.
2289 (Target_powerpc::do_may_relax, do_relax, push_branch,
2290 new_stub_table, stub_tables, brlt_section, group_sections,
2291 add_branch_lookup_table, find_branch_lookup_table,
2292 write_branch_lookup_table, make_brlt_section): New functions.
2293 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2294 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2295 branch_info_): New vars.
2296 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2297 make call stubs here.
2298 (Output_data_glink): Remove all call stub handling from this class.
2299 (Target_powerpc::Scan::local, global): Save interesting branch
2300 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2301 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2302 functions on final link.
2303 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2304 Handle long branch destinations too.
2305 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2306 do_plt_address_for_local): Adjust lookup of plt call stubs.
2307
627b30b7
AM
23082012-11-30 Alan Modra <amodra@gmail.com>
2309
2310 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2311 relocs against protected symbols when building 32-bit shared libs.
2312
40b469d7
AM
23132012-11-30 Alan Modra <amodra@gmail.com>
2314
2315 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2316 param. Call got_section() to make .got. Update all callers
2317 and their callers and so on.
2318
bb66a627
AM
23192012-11-30 Alan Modra <amodra@gmail.com>
2320
2321 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2322 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2323 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2324 value if it already exists.
2325
d2cf1c6c
L
23262012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2327
2328 PR gold/14858
2329 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2330
edccdf7c
RM
23312012-11-14 Roland McGrath <mcgrathr@google.com>
2332
2333 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2334 than bfc instruction for data sandboxing.
2335
6febeb74
AM
23362012-11-08 Alan Modra <amodra@gmail.com>
2337
2338 * po/POTFILES.in: Regenerate.
2339
0a6f1bf2
AM
23402012-11-05 Alan Modra <amodra@gmail.com>
2341
2342 * configure.ac: Apply 2012-09-10 change to config.in here.
2343 * configure: Regenerate.
2344
26a4e9cb
AM
23452012-11-05 Alan Modra <amodra@gmail.com>
2346
2347 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2348 (struct Opd_ent): Use "Address" rather than "Offset".
2349 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2350 (Target_powerpc::got_section): Make public.
2351 (Target_powerpc::scan_relocs): Move code setting symbols..
2352 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2353 Create _SDA_BASE_ only when referenced.
2354
cc928013
RM
23552012-11-02 Roland McGrath <mcgrathr@google.com>
2356
2357 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2358 from last change.
2359
50ed5eb1
RM
23602012-11-01 Roland McGrath <mcgrathr@google.com>
2361
62fe925a
RM
2362 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2363 for offset_in_output_section parameter.
2364 (Sized_target::relocate_special_relocatable): Likewise.
2365 * arm.cc (Target_arm::relocate_relocs): Likewise.
2366 (Target_arm::relocate_special_relocatable): Likewise.
2367 * i386.cc (Target_i386::relocate_relocs): Likewise.
2368 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2369 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2370 * target-reloc.h (relocate_relocs): Likewise.
2371 * testsuite/testfile.cc (Target_test): Likewise.
2372 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2373 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2374
2375 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2376 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2377
2378 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2379 parameter, which is unused in the [!F_SETFD] case.
2380
50ed5eb1
RM
2381 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2382 SYMNDX to off_t before comparing it to this->data_size().
2383 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2384 * incremental.cc (Output_section_incremental_inputs::do_write):
2385 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2386
2cadc0bf
RM
2387 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2388
3bfcb652
NC
23892012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2390
2391 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2392 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2393 in EABI_VER5.
2394
c1a8d56e
CC
23952012-10-29 Cary Coutant <ccoutant@google.com>
2396
2397 * dwp.cc (usage): Add file and exit status parameters;
2398 add --help and --version options.
2399 (print_version): New function.
2400 (main): Add --help and --version options.
2401
b2490a7b
L
24022012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2403
2404 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2405 final_layout_sequence.txt.
2406 * testsuite/Makefile.in: Regenerated.
2407
aa543512
L
24082012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2409
2410 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2411 COMPILE generated by automake.
2412 (LINK1): Likewise.
2413 (CXXCOMPILE1): Likewise.
2414 (CXXLINK1): Likewise.
2415 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2416 (LINK): Likewise.
2417 (CXXCOMPILE): Likewise.
2418 (CXXLINK): Likewise.
2419 * testsuite/Makefile.in: Regenerated.
2420
d361fafb
L
24212012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2422
2423 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2424 on bad fwrite return.
2425
598c7410
L
24262012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2427
2428 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2429 on val.
2430
35c813e2
CC
24312012-10-23 Cary Coutant <ccoutant@google.com>
2432
2433 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2434 * testsuite/Makefile.in: Regenerate.
2435 * testsuite/dwp_test.h: New source file.
2436 * testsuite/dwp_test_1.cc: New source file.
2437 * testsuite/dwp_test_1.s: New source file.
2438 * testsuite/dwp_test_1.sh: New source file.
2439 * testsuite/dwp_test_1b.cc: New source file.
2440 * testsuite/dwp_test_1b.s: New source file.
2441 * testsuite/dwp_test_2.cc: New source file.
2442 * testsuite/dwp_test_2.s: New source file.
2443 * testsuite/dwp_test_2.sh: New source file.
2444 * testsuite/dwp_test_main.cc: New source file.
2445 * testsuite/dwp_test_main.s: New source file.
2446
77429909
CC
24472012-10-23 Cary Coutant <ccoutant@google.com>
2448
2449 * dwp.h: New header file.
2450 * dwp.cc: New source file.
2451 * gold.h: Move shared declarations to system.h.
2452 * system.h: New header file.
2453 * Makefile.am: Add dwp.
2454 * Makefile.in: Regenerate.
2455
ed5d6712
CC
24562012-10-23 Cary Coutant <ccoutant@google.com>
2457
2458 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2459 Dwarf_info_reader::read_from_pointer.
2460 (Dwarf_pubnames_table::read_header): Likewise.
2461 (Dwarf_pubnames_table::next_name): Likewise.
2462 (Dwarf_die::read_attributes): Likewise.
2463 (Dwarf_die::skip_attributes): Likewise.
2464 (Dwarf_info_reader::read_from_pointer): New function template.
2465 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2466 (Dwarf_pubnames_table): Likewise.
2467 (Dwarf_info_reader::read_from_pointer): New function template.
2468 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2469 Dwarf_pubnames_table ctor.
2470
8787852d
CC
24712012-10-23 Cary Coutant <ccoutant@google.com>
2472
2473 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2474 abbrev_shndx.
2475 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2476 abbrev_shndx_.
2477 (Dwarf_info_reader::set_abbrev_shndx): New method.
2478 (Dwarf_info_reader::abbrev_shndx_): New data member.
2479
9fc236f3
CC
24802012-10-23 Cary Coutant <ccoutant@google.com>
2481
2482 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2483 from object, not parameters.
2484 (Dwarf_info_reader::parse): Likewise.
2485 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2486 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2487 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2488 methods.
2489
effe8365
CC
24902012-10-23 Cary Coutant <ccoutant@google.com>
2491
2492 * fileread.cc (Input_file::Input_file): New constructor.
2493 * fileread.h (class Input_file): Add new constructor.
2494
1698990d
AM
24952012-10-18 Alan Modra <amodra@gmail.com>
2496
2497 PR gold/14727
2498 * object.cc (Relobj::is_section_name_included): Also match
2499 .sdata personality section.
2500
168a4726
AM
25012012-10-18 Alan Modra <amodra@gmail.com>
2502
2503 * target-reloc.h (class Default_comdat_behavior): New, package up..
2504 (get_comdat_behaviour): ..this.
2505 (relocate_section): Add Relocate_comdat_behavior template arg,
2506 adjust code to suit.
2507 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2508 (Target_arm::scan_reloc_section): Likewise.
2509 * i386.cc (Target_i386::relocate_section): Likewise.
2510 * sparc.cc (Target_sparc::relocate_section): Likewise.
2511 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2512 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2513 * powerpc.cc (class Relocate_comdat_behavior): New.
2514 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2515 gold::relocate_section with new template arg.
2516
acc276d8
AM
25172012-10-18 Alan Modra <amodra@gmail.com>
2518
2519 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2520 dynamic relocs for GOT_TPREL got entries, without symbol if
2521 resolving locally.
2522 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2523 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2524 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2525
e10f9870
AM
25262012-10-17 Alan Modra <amodra@gmail.com>
2527
2528 PR gold/14726
2529 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2530
ae034989
ST
25312012-10-16 Sriraman Tallam <tmsriram@google.com>
2532
2533 * layout.cc (Layout::include_section): Keep sections marked
2534 SHF_EXCLUDE when doing relocatable links.
2535
f3a0ed29
AM
25362012-10-16 Alan Modra <amodra@gmail.com>
2537
2538 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2539 (Target_powerpc::do_finalize_sections): Call it.
2540 (Output_data_save_res): New class and supporting functions.
2541 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2542 normal symbols defined in object files.
2543
c6de8ed4
AM
25442012-10-12 Alan Modra <amodra@gmail.com>
2545
2546 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2547 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2548 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2549 section if scan_opd_relocs not yet called.
2550 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2551
03e25981
AM
25522012-10-12 Alan Modra <amodra@gmail.com>
2553
2554 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2555 add_local_ifunc_entry): Revert last change.
2556 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2557
c9824451
AM
25582012-10-05 Alan Modra <amodra@gmail.com>
2559
2560 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2561 do_plt_address_for_global): New functions.
2562 (Output_data_got_powerpc::do_write): Don't segfault when linking
2563 statically.
2564 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2565 add_local_ifunc_entry): Return true on adding entry..
2566 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2567 glink->add_entry call. Remove unused symtab param. Adjust calls.
2568 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2569 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2570 set up symbols here.
2571 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2572 syms here. Do so even when no .iplt. Don't segfault when linking
2573 statically.
2574 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2575 new variants without reloc param.
2576 (Glink_sym_ent::Glink_sym_ent): Likewise.
2577 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2578 reloc when refs will resolve to plt call stub.
2579 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2580 R_PPC_PLTREL24 to resolve locally.
2581 (Target_powerpc::Scan::global): Correct ifunc handling.
2582 (Target_powerpc::Relocate::relocate): Correct local sym glink
2583 lookup. Don't destroy "value" when we have a plt call stub,
2584 and when checking plt call validity.
2585 (Target_powerpc::do_dynsym_value): Simplify.
2586
19fec8c1
AM
25872012-10-05 Alan Modra <amodra@gmail.com>
2588
2589 * i386.cc (Output_data_plt_i386::address_for_global,
2590 address_for_local): Add plt offset to returned value. Adjust uses.
2591 * sparc.cc (Output_data_plt_sparc::address_for_global,
2592 address_for_local): Likewise.
2593 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2594 address_for_local): Likewise.
2595 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2596 address_for_local): Likewise.
2597 * target.h (Target::plt_address_for_global, plt_address_for_local):
2598 Update comment.
2599 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2600 (Output_data_got::Got_entry::write): Nor here.
2601 * output.h: Comment fix.
2602
e867b647
WL
26032012-10-02 Jiong Wang <jiwang@tilera.com>
2604
2605 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2606 global_offset_table_ value for larget got.
2607 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2608
e5d5f5ed
AM
26092012-09-29 Alan Modra <amodra@gmail.com>
2610
2611 * powerpc.cc (Target_powerpc::iplt_): New output section.
2612 (Target_powerpc::iplt_section, make_iplt_section,
2613 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2614 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2615 Target_powerpc::plt_entry_count): Count iplt entries too.
2616 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2617 reloc section in constructor. New params.
2618 (Target_powerpc::make_plt_section): Create reloc section here instead.
2619 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2620 functions.
2621 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2622 (Output_data_glink::add_entry, find_entry): New functions to
2623 deal with local syms.
2624 (Glink_sym_ent): Add support for local syms.
2625 (Output_data_glink::do_write): Handle ifunc plt entries.
2626 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2627 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2628 (Target_powerpc::Relocate::relocate): Likewise.
2629 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2630
ec4dbad3
AM
26312012-09-25 Alan Modra <amodra@gmail.com>
2632
2633 * object.h (Sized_relobj_file::adjust_local_symbol,
2634 do_adjust_local_symbol): New functions.
2635 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2636 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2637 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2638 and irregular opd entry spacing.
2639 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2640 (Global_symbol_visitor_opd): New functor.
2641 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2642 on deleted opd entries.
2643
5c0b3823
WL
26442012-09-15 Jiong Wang <jiwang@tilera.com>
2645
2646 * tilegx.cc: New file.
2647 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2648 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2649 * configure.tgt: Add entries for tilegx*.
2650 * configure.ac: Likewise.
2651 * Makefile.in: Rebuild.
2652 * configure: Likewise.
2653 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2654 tilegx.
2655
bfdfa4cd
AM
26562012-09-13 Alan Modra <amodra@gmail.com>
2657
2658 * target-reloc.h (scan_relocs): Call scan.local for relocs
2659 against symbols in discarded sections. Pass is_discarded
2660 param.
2661 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2662 Add is_discarded param.
2663 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2664 is_discarded to flag opd entry as discarded. Don't emit dyn
2665 relocs on such entries.
2666 (Target_powerpc::Scan::global): Similarly detect and handle
2667 such opd entries.
2668 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2669 opd_ent_. Update all uses.
2670 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2671 (Target_powerpc::relocate_section): Zero out discarded opd
2672 entry relocs.
2673
d77a0555
ILT
26742012-09-12 Ian Lance Taylor <iant@google.com>
2675
2676 PR gold/14570
2677 * output.cc: Rename Output_data_got template parameter from size
2678 to got_size for all functions. Compile all variants of
2679 Output_data_got.
2680 (Output_data_got::Got_entry::write): Correct use of size for
2681 symbol value. Use local_is_tls rather than casting to
2682 Sized_relobj_file.
2683 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2684 (class Sized_relobj_file): Add do_local_is_tls.
2685 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2686
815a1205
AM
26872012-09-11 Alan Modra <amodra@gmail.com>
2688
2689 PR gold/14566
2690 * layout.cc (Layout::set_segment_offsets): When using
2691 common-page-size alignment, ensure we are on a new max-page-size
2692 page.
2693 * output.cc (Output_segment::set_section_addresses): Use
2694 abi_pagesize, not common_pagesize for relro boundary.
2695 (Output_segment::set_offset): Likewise.
2696
bd73a62d
AM
26972012-09-11 Alan Modra <amodra@gmail.com>
2698
2699 * output.h (Output_data_got::add_global_tls, add_local_tls,
2700 add_local_tls_pair): New functions.
2701 (Output_data_got::add_local_pair_with_rel): Remove second
2702 reloc param. Expand comment.
2703 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2704 use_plt_or_tls_offset_, similarly for constructor param.
2705 (Output_data_got::Got_entry::write): Add got_index param.
2706 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2707 add_local_tls_pair): New functions.
2708 (Output_data_got::Got_entry::write): Handle tls symbols
2709 with use_plt_or_tls_offset_ set specially.
2710 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2711 (Output_data_got::do_write): Replace iterator with index, pass
2712 index to entry write function.
2713 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2714 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2715 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2716 call.
2717 * i386.cc (Target_i386::Scan::local): Likewise.
2718 * sparc.cc (Target_sparc::Scan::local): Likewise.
2719 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2720 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2721 do_tls_offset_for_global): New functions.
2722 (Target_powerpc::Scan::local): Correct TLS relocations and got
2723 entry values.
2724 (Target_powerpc::Scan::global): Don't emit unnecessary
2725 dynamic relocations on TLS GOT entries.
2726
00716ab1
AM
27272012-09-10 Matthias Klose <doko@ubuntu.com>
2728
2729 * config.in: Disable sanity check for kfreebsd.
2730
c891b3f9
SA
27312012-09-10 Sterling Augustine <saugustine@google.com>
2732
2733 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2734 (Gdb_index::pubtypes_read): New parameter.
2735 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2736 to calls.
2737 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2738 pubtypes_object_.
2739
e81fea4d
AM
27402012-09-09 Alan Modra <amodra@gmail.com>
2741
2742 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2743 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2744 * gc.h (gc_process_relocs): Call target gc_add_reference.
2745 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2746 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2747 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2748 unnecessary cast.
2749 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2750 to cater for when we don't need code offset. Update use.
2751 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2752 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2753 set_opd_valid): New functions.
2754 (Target_powerpc::do_gc_add_reference): New function.
2755 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2756 stashed refs.
2757 (Target_powerpc::do_gc_mark_symbol): New function.
2758
d2d60eef
CC
27592012-09-06 Cary Coutant <ccoutant@google.com>
2760
2761 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2762 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2763 (Dwarf_die::skip_attributes): Likewise.
2764 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2765 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2766 (main): Call it.
2767 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2768
32ed4573
L
27692012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2770
2771 * testsuite/script_test_3.t: Add .got.plt output section
2772 statement.
2773 * testsuite/script_test_4.t: Likewise.
2774
f4baf0d4
AM
27752012-09-05 Alan Modra <amodra@gmail.com>
2776
2777 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2778 update all uses and lose "enum" when using type.
2779
864a1b56
AM
27802012-09-05 Alan Modra <amodra@gmail.com>
2781
2782 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2783 * configure: Regenerate.
2784 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2785 (plugin_final_layout.stdout): Likewise.
2786 (memory_test): Set page sizes to 0x1000.
2787 * testsuite/Makefile.in: Regenerate.
2788 * testsuite/discard_locals_test.sh: Add FIXME comment.
2789 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2790 * testsuite/pr14265.t: Add .got output section statement.
2791 * testsuite/script_test_2.t: Likewise.
2792 * testsuite/script_test_3.t: Likewise.
2793 * testsuite/script_test_4.t: Likewise.
2794 * testsuite/script_test_5.t: Likewise.
2795 * testsuite/script_test_6.t: Likewise.
2796 * testsuite/script_test_7.t: Likewise.
2797 * testsuite/script_test_9.t: Likewise.
2798
3ea0a085
AM
27992012-09-05 Alan Modra <amodra@gmail.com>
2800
2801 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2802 (Powerpc_relocate_functions::Status): New typedef.
2803 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2804 (Target_powerpc::Scan::local): Handle REL64.
2805 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2806 for REL32 and REL64.
2807 (Target_powerpc::symval_for_branch): New function, extracted from..
2808 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2809 checks. Report overflow errors.
2810
7404fe1b
AM
28112012-09-05 Alan Modra <amodra@gmail.com>
2812
2813 * object.h (Sized_relobj_file::emit_relocs): Delete.
2814 (Sized_relobj_file::emit_relocs_reltype): Delete.
2815 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2816 relocate_relocs for --emit-relocs.
2817 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2818 * output.h: Update comment.
2819 (Output_segment::first_section): New function.
2820 (Output_segment::first_section_load_address): Use first_section.
2821 * output.cc (Output_segment::first_section): New function extracted..
2822 (Output_segment::first_section_load_address): ..from here. Delete.
2823 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2824 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2825 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2826 adjust call to target.h function.
2827 * i386.cc (Target_i386): Likewise.
2828 * sparc.cc (Target_sparc): Likewise.
2829 * x86_64.cc (Target_x86_64): Likewise.
2830 * powerpc.cc (Target_powerpc): Likewise.
2831 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2832 first tls section has section symbol for optimised local dynamic
2833 output relocs.
2834 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2835 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2836 optimised tls code.
2837 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2838 Rename to relocate_relocs. Update error message.
2839
957564c9
AS
28402012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2841
2842 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2843 --just-symbols.
2844
dd93cd0a
AM
28452012-08-31 Alan Modra <amodra@gmail.com>
2846
2847 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2848 (Powerpc_relobj::toc_base_offset): New stub function.
2849 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2850 got_mod_index_offset to tlsld_got_offset. Update all refs.
2851 (Target_powerpc::Relocate::enum skip_tls): New.
2852 (Target_powerpc::call_tls_get_addr_): New var.
2853 (Target_powerpc::is_branch_reloc): Move to file scope.
2854 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2855 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2856 New functions.
2857 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2858 (powerpc_info): Correct common_pagesize for ppc64.
2859 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2860 (Powerpc_relocate_functions): Add overflow check enums and functions.
2861 Add non-shift version of rela, rela_ua. Delete all rel public
2862 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2863 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2864 addr16_ha3, addr14 functions.
2865 (Output_data_got_powerpc::add_constant_pair): New function.
2866 (Output_data_got_powerpc::got_base_offset): Likewise.
2867 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2868 (instruction constants): Sort, add some more.
2869 (Output_data_glink::do_write): Add and use Address typedef. Use
2870 object->toc_base_offset() stub for 64-bit.
2871 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2872 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2873 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2874 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2875 Always treat .opd relocs as against locally defined symbol.
2876 Correct condition for RELATIVE relocs.
2877 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2878 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2879 for 32-bit syms with a plt entry. Correct ppc64 toc base
2880 calculations. Handle TLS relocs, and more. Add overflow
2881 checking and adjust for Powerpc_relocate_functions changes.
2882 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2883 Reinstate --emit-relocs code with FIXME.
2884
a1373b60
AM
28852012-08-30 Alan Modra <amodra@gmail.com>
2886
2887 * layout.cc (Layout::set_segment_offsets): Set p_align to
2888 abi_pagesize, not common_pagesize.
2889 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2890 to determine whether file header can go in segment.
2891
703d02da
AM
28922012-08-30 Alan Modra <amodra@gmail.com>
2893
2894 * output.h (Output_reloc::Output_reloc <output section>): Add
2895 is_relative param. Adjust calls.
2896 (Output_reloc::add_output_section_relative): New functions.
2897 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2898 is_relative.
2899 (Output_reloc::symbol_value): Handle SECTION_CODE.
2900
16164a6b
ST
29012012-08-24 Sriraman Tallam <tmsriram@google.com>
2902
2903 * gold.cc (queue_middle_tasks): Call layout again when unique
2904 segments for sections is desired.
2905 * layout.cc (Layout::Layout): Initialize new members.
2906 (Layout::get_output_section_flags): New function.
2907 (Layout::choose_output_section): Call get_output_section_flags.
2908 (Layout::layout): Make output section for mapping to a unique segment.
2909 (Layout::insert_section_segment_map): New function.
2910 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2911 output sections marked so.
16164a6b
ST
2912 (Layout::segment_precedes): Check for unique segments when sorting.
2913 * layout.h (Layout::Unique_segment_info): New struct.
2914 (Layout::Section_segment_map): New typedef.
2915 (Layout::insert_section_segment_map): New function.
2916 (Layout::get_output_section_flags): New function.
2917 (Layout::is_unique_segment_for_sections_specified): New function.
2918 (Layout::set_unique_segment_for_sections_specified): New function.
2919 (Layout::unique_segment_for_sections_specified_): New member.
2920 (Layout::section_segment_map_): New member.
2921 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2922 Rename is_gc_pass_one to is_pass_one.
2923 Rename is_gc_pass_two to is_pass_two.
2924 Rename is_gc_or_icf to is_two_pass.
2925 Check for which pass based on whether symbols data is present.
2926 Make it two pass when unique segments for sections is desired.
2927 * output.cc (Output_section::Output_section): Initialize new
2928 members.
2929 * output.h (Output_section::is_unique_segment): New function.
2930 (Output_section::set_is_unique_segment): New function.
2931 (Output_section::is_unique_segment_): New member.
2932 (Output_section::extra_segment_flags): New function.
2933 (Output_section::set_extra_segment_flags): New function.
2934 (Output_section::extra_segment_flags_): New member.
2935 (Output_section::segment_alignment): New function.
2936 (Output_section::set_segment_alignment): New function.
2937 (Output_section::segment_alignment_): New member.
2938 (Output_segment::Output_segment): Initialize is_unique_segment_.
2939 (Output_segment::is_unique_segment): New function.
2940 (Output_segment::set_is_unique_segment): New function.
2941 (Output_segment::is_unique_segment_): New member.
2942 * plugin.cc (allow_unique_segment_for_sections): New function.
2943 (unique_segment_for_sections): New function.
2944 (Plugin::load): Add new functions to transfer vector.
2945 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2946 * Makefile.in: Regenerate.
2947 * testsuite/plugin_final_layout.sh: Check if unique segment
2948 functionality works.
2949 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2950 are available.
2951 (allow_unique_segment_for_sections): New global.
2952 (unique_segment_for_sections): New global.
2953 (claim_file_hook): Call allow_unique_segment_for_sections.
2954 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2955
1e2bee4f
CC
29562012-08-22 Cary Coutant <ccoutant@google.com>
2957
2958 * layout.cc (Layout::include_section): Don't assert on GROUP
2959 sections with --emit-relocs.
2960
1d5dfe78
CC
29612012-08-21 Cary Coutant <ccoutant@google.com>
2962
2963 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2964 if --export-dynamic-symbol names an undef symbol.
2965
c9269dff
AM
29662012-08-18 Alan Modra <amodra@gmail.com>
2967
2968 * powerpc.cc: Formatting and white space.
2969 (Powerpc_relobj): Rename got2_section_ to special_.
2970 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2971 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2972 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2973 (Target_powerpc): Add Address typedef and invalid_address. Use
2974 throughout.
2975 (Target_powerpc::is_branch_reloc): New function.
2976 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2977 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2978 for dst_mask, value and addend.
2979 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2980 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2981 (Output_data_glink::do_write): Correct toc base. Don't try to use
2982 uint16_t for 24-bit offset. Use get_output_section_offset and
2983 check return.
2984 (Target_powerpc::Scan::local): Handle more relocs.
2985 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2986 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2987 Plug in toc restoring insn after plt calls. Translate branches
2988 to function descriptor symbols to corresponding entry point.
2989 (Target_powerpc::relocate_for_relocatable): Check return from
2990 get_output_section_offset.
2991 * symtab.h: Comment typo.
2992
b1759dce
ILT
29932012-08-14 Ian Lance Taylor <iant@google.com>
2994
2995 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2996 unsupported_relocal_local to call unsupported_reloc_global.
2997
b9b2ae8b
NC
29982012-08-14 Nick Clifton <nickc@redhat.com>
2999
3000 PR ld/14265
3001 * script-sections.cc (Sections_element::output_section_name): Add
3002 keep return parameter.
3003 (Output_section_element::match_name): Add keep return parameter.
3004 Return the value of the keep_ member.
3005 * script-sections.h (class Output_section): Update
3006 output_section_name prototype.
3007 * layout.cc (Layout::keep_input_section): New public member
3008 function.
3009 (Layout::choose_output_section): Pass keep parameter to
3010 output_section_name.
3011 * layout.h (class Layout): Add keep_input_section.
3012 * object.cc (Sized_relobj_file::do_layout): Check for kept input
3013 sections.
3014 * testsuite/Makefile.am: Add a test.
3015 * testsuite/Makefile.in: Regenerate.
3016 * testsuite/pr14265.c: Source file for the test.
3017 * testsuite/pr14265.t: Linker script for the test.
3018 * testsuite/pr14265.sh: Shell script for the test.
3019
921b5322
AM
30202012-08-14 Alan Modra <amodra@gmail.com>
3021
3022 * target.h (Target::output_section_name): New function.
3023 (Target::do_output_section_name): New function.
3024 * layout.cc (Layout::choose_output_section): Call the above.
3025 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3026
6ce78956
AM
30272012-08-14 Alan Modra <amodra@gmail.com>
3028
3029 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3030 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3031 for replace_constant call.
3032 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3033 (Output_data_glink::do_print_to_mapfile): New function.
3034 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3035 (Target_powerpc::Relocate::relocate): Likewise.
3036
d1a8cabd
AM
30372012-08-14 Alan Modra <amodra@gmail.com>
3038
3039 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3040 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3041 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3042 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3043 all references to shndx_. Handle special case for R_PPC_PLTREL24
3044 here.
3045 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3046 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3047 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3048 here.
3049 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3050 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3051
d83ce4e3
AM
30522012-08-12 Alan Modra <amodra@gmail.com>
3053
3054 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3055 (glink insn constants): Use uint32_t.
3056 (Output_data_glink::add_entry): Use insert, not [] operator.
3057
cf43a2fe
AM
30582012-08-11 Alan Modra <amodra@gmail.com>
3059
3060 * object.h (Sized_relobj_file::find_shdr): New function.
3061 (Sized_relobj_file::find_special_sections): New function.
3062 * object.cc (Sized_relobj_file::find_shdr): New function.
3063 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3064 (Sized_relobj_file::find_special_sections): New function, split out..
3065 (Sized_relobj_file::do_read_symbols): ..from here.
3066 * output.h (Output_data_got::replace_constant): New function.
3067 (Output_data_got::num_entries): New function.
3068 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3069 (Output_data_got::got_offset): Protected rather than private.
3070 (Output_data_got::replace_got_entry): New function.
3071 * output.cc (Output_data_got::replace_got_entry): New function.
3072 * powerpc.cc (class Powerpc_relobj): New.
3073 (class Powerpc_relocate_functions): Delete all psymval variants or
3074 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3075 Implement _ha functions using corresponding _hi function.
3076 (Powerpc_relobj::find_special_sections): New function.
3077 (Target_powerpc::do_make_elf_object): New function.
3078 (class Output_data_got_powerpc): New.
3079 (class Output_data_glink): New.
3080 (class Powerpc_scan_relocatable_reloc): New.
3081 Many more changes througout file.
3082
3c892704
NC
30832012-08-09 Nick Clifton <nickc@redhat.com>
3084
3085 * po/vi.po: Updated Vietnamese translation.
3086
82435b3b
ILT
30872012-08-07 Ian Lance Taylor <iant@google.com>
3088
3089 * layout.cc (Layout::add_target_dynamic_tags): If
3090 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3091 plt_rel.
3092
a6dc81d2
NC
30932012-07-30 Nick Clifton <nickc@redhat.com>
3094
3095 * po/gold.pot: Updated template.
3096 * po/es.po: Updated Spanish translation.
3097
f1415016
CC
30982012-07-18 Cary Coutant <ccoutant@google.com>
3099
3100 PR gold/14344
3101 * configure.ac: Add check for -gpubnames support.
3102 * configure: Regenerate.
3103 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3104 support; force -gno-pubnames.
3105 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3106 support.
3107 (gdb_index_test_4): New test.
3108 * testsuite/Makefile.in: Regenerate.
3109 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3110 * testsuite/gdb_index_test_2.sh: Likewise.
3111 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3112 * testsuite/gdb_index_test_4.sh: New script.
3113 * testsuite/gdb_index_test_comm.sh: New script with common code;
3114 don't look for space after colon.
3115
b7fd7c37
ST
31162012-07-16 Sriraman Tallam <tmsriram@google.com>
3117
3118 * gold.cc (queue_middle_tasks): Update function order only after
3119 deferred objects due to plugins are processed.
3120
1f3212db
ILT
31212012-07-11 Ian Lance Taylor <iant@google.com>
3122
3123 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3124 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3125 (Target_arm::scan_reloc_for_stub): Likewise.
3126 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3127 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3128 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3129 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3130 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3131
81c82a68
ILT
31322012-07-10 Dodji Seketeli <dodji@redhat.com>
3133 Ian Lance Taylor <iant@google.com>
3134
3135 PR gold/14309
3136 * configure.ac: Test whether std::tr1::hash<off_t> works.
3137 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3138 needed.
3139 * output.h (class Output_fill): Add virtual destructor.
3140 * configure, config.in: Rebuild.
3141
eabc84f4
RM
31422012-06-22 Roland McGrath <mcgrathr@google.com>
3143
3144 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3145
370e30b6
RÁE
31462012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3147
3148 * plugin.cc (Plugin::load): Handle position independent executables.
3149
fb1b895d
CC
31502012-06-06 Cary Coutant <ccoutant@google.com>
3151
3152 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3153 add .debug_macro.
3154 (lines_only_debug_sections): Likewise.
3155 (gdb_fast_lookup_sections): New static array.
3156 (is_gdb_debug_section): Rename formal parameter.
3157 (is_lines_only_debug_section): Likewise.
3158 (is_gdb_fast_lookup_section): New function.
3159 (Layout::include_section): Check for ".zdebug_" prefix; pass
3160 section name suffix to is_gdb_debug_section, et al.; check for
3161 fast-lookup sections when building .gdb_index.
3162 * options.h (--strip-debug-gdb): Update GDB version number.
3163
7c0640fa
CC
31642012-06-06 Cary Coutant <ccoutant@google.com>
3165
3166 * configure.ac: Add check for fallocate.
3167 * configure: Regenerate.
3168 * config.in: Regenerate.
3169
3170 * options.h (class General_options): Add --mmap-output-file and
3171 --posix-fallocate options.
3172 * output.cc: (posix_fallocate): Remove; replace with...
3173 (gold_fallocate): New function.
3174 (Output_file::map_no_anonymous): Call gold_fallocate.
3175 (Output_file::map): Check --mmap-output-file option.
3176
2a49eb69
DK
31772012-06-05 Jing Yu <jingyu@google.com>
3178
3179 * gold.h (textdomain): Add do {} to empty while(0).
3180 (bindtextdomain): Likewise.
3181
fad072ac
CC
31822012-06-04 Cary Coutant <ccoutant@google.com>
3183
3184 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3185 has_dynsym_index.
3186
8cc69fb6
ST
31872012-05-25 Sriraman Tallam <tmsriram@google.com>
3188
3189 * symtab.cc (Symbol_table::define_special_symbol):
3190 Initialize *poldsym to prevent uninitialized variable errors.
3191
1be75daa
CC
31922012-05-23 Cary Coutant <ccoutant@google.com>
3193
3194 * layout.cc (Layout::section_name_mapping): Add rules to handle
3195 exact match on .data.rel.ro.local or .data.rel.ro.
3196 (Layout::output_section_name): Check for exact matches.
3197
9b689de0
CC
31982012-05-23 Cary Coutant <ccoutant@google.com>
3199
3200 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3201 more carefully.
3202
b24fdbf5
CC
32032012-05-22 Cary Coutant <ccoutant@google.com>
3204
3205 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3206 object before exporting symbol.
3207
e550e1a2
L
32082012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3209
3210 * testsuite/tls_test.cc: Include "config.h" first.
3211 * testsuite/tls_test_c.c: Likewise.
3212
df7b86aa
NC
32132012-05-17 Daniel Richard G. <skunk@iskunk.org>
3214 Nick Clifton <nickc@redhat.com>
3215
3216 PR 14072
3217 * configure.in: Add check that sysdep.h has been included before
3218 any system header files.
3219 * configure: Regenerate.
3220 * config.in: Regenerate.
3221
1007b503
CC
32222012-05-14 Cary Coutant <ccoutant@google.com>
3223
3224 * layout.cc (Layout::make_output_section): Mark .tdata section
3225 as RELRO.
3226 * testsuite/relro_test.cc: Add a TLS variable.
3227
fd885f3a
L
32282012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3229
3230 PR gold/14091
3231 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3232 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3233 R_X86_64_64.
3234
80f5885c
CC
32352012-05-08 Cary Coutant <ccoutant@google.com>
3236
3237 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3238 (lines_only_debug_sections): Likewise.
3239
2e702c99
RM
32402012-05-02 Roland McGrath <mcgrathr@google.com>
3241
3242 * nacl.cc: New file.
3243 * nacl.h: New file.
3244 * Makefile.am (CCFILES, HFILES): Add them.
3245 * Makefile.in: Regenerate.
3246 * i386.cc (Output_data_plt_i386_nacl): New class.
3247 (Output_data_plt_i386_nacl_exec): New class.
3248 (Output_data_plt_i386_nacl_dyn): New class.
3249 (Target_i386_nacl): New class.
3250 (Target_selector_i386_nacl): New class.
3251 (target_selector_i386): Use it instead of Target_selector_i386.
3252 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3253 (Target_x86_64_nacl): New class.
3254 (Target_selector_x86_64_nacl): New class.
3255 (target_selector_x86_64, target_selector_x32): Use it instead of
3256 Target_selector_x86_64.
3257 * arm.cc (Output_data_plt_arm_nacl): New class.
3258 (Target_arm_nacl): New class.
3259 (Target_selector_arm_nacl): New class.
3260 (target_selector_arm, target_selector_armbe): Use it instead of
3261 Target_selector_arm.
3262
3263 * target-select.cc (select_target): Take new Input_file* and off_t
3264 arguments, pass them on to recognize method of selector.
3265 * object.cc (make_elf_sized_object): Update caller.
3266 * parameters.cc (parameters_force_valid_target): Likewise.
3267 * incremental.cc (make_sized_incremental_binary): Likewise.
3268 * target-select.h: Update decl.
3269 (Target_selector::recognize): Take new Input_file* argument,
3270 pass it on to do_recognize.
3271 (Target_selector::do_recognize): Take new Input_file* argument.
3272 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3273 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3274 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3275 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3276
3277 * target.h (Target::Target_info): New members isolate_execinstr
3278 and rosegment_gap.
3279 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3280 * arm.cc (Target_arm::arm_info): Update initializer.
3281 * i386.cc (Target_i386::i386_info): Likewise.
3282 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3283 * sparc.cc (Target_sparc::sparc_info): Likewise.
3284 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3285 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3286 * layout.cc (Layout::attach_allocated_section_to_segment):
3287 Take new const Target* argument. If target->isolate_execinstr(), act
3288 like --rosegment.
3289 (Layout::find_first_load_seg): Take new const Target* argument;
3290 if target->isolate_execinstr(), reject PF_X segments.
3291 (Layout::relaxation_loop_body): Update caller.
3292 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3293 reset file offset to zero when we hit LOAD_SEG, and then do a second
3294 loop over the segments before LOAD_SEG to reassign offsets after
3295 addresses have been determined. Handle target->rosegment_gap().
3296 (Layout::attach_section_to_segment): Take new const Target* argument;
3297 pass it to attach_allocated_section_to_segment.
3298 (Layout::make_output_section): Update caller.
3299 (Layout::attach_sections_to_segments): Take new const Target* argument;
3300 pass it to attach_section_to_segment.
3301 * gold.cc (queue_middle_tasks): Update caller.
3302 * layout.h (Layout): Update method decls with new arguments.
3303
3304 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3305 Target_info pointer to use.
3306 (Target_arm::do_make_data_plt): New virtual method.
3307 (Target_arm::make_data_plt): New method that calls it.
3308 (Target_arm::make_plt_entry): Use it.
3309 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3310 for the section alignment.
3311 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3312 method.
3313 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3314 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3315 method.
3316 (Output_data_plt_arm::get_plt_entry_size): Call it.
3317 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3318 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3319 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3320 method.
3321 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3322 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3323 method instead of sizeof(plt_entry).
3324 (Output_data_plt_arm::add_entry): Likewise.
3325 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3326 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3327 than static method.
3328 (Target_arm::plt_entry_size): Likewise.
3329 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3330 Move to ...
3331 (Output_data_plt_arm_standard): ... here, new class.
3332 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3333 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3334 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3335
3336 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3337 Take additional argument for the PLT entry size.
3338 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3339 Use get_plt_entry_size method rather than plt_entry_size variable.
3340 (Output_data_plt_x86_64::reserve_slot): Likewise.
3341 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3342 (Output_data_plt_x86_64::add_entry): Likewise.
3343 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3344 (Output_data_plt_x86_64::address_for_global): Likewise.
3345 (Output_data_plt_x86_64::address_for_local): Likewise.
3346 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3347 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3348 Make method non-static.
3349 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3350 method.
3351 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3352 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3353 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3354 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3355 virtual method.
3356 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3357 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3358 virtual method.
3359 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3360 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3361 virtual method.
3362 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3363 (Output_data_plt_x86_64::plt_entry_size)
3364 (Output_data_plt_x86_64::first_plt_entry)
3365 (Output_data_plt_x86_64::plt_entry)
3366 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3367 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3368 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3369 (Output_data_plt_x86_64_standard): ... here, new class.
3370 (Target_x86_64::Target_x86_64): Take optional argument for the
3371 Target_info pointer to use.
3372 (Target_x86_64::do_make_data_plt): New virtual method.
3373 (Target_x86_64::make_data_plt): New method to call it.
3374 (Target_x86_64::init_got_plt_for_update): Use that.
3375 Call this->plt_->add_eh_frame method here.
3376 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3377 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3378 rather than static method.
3379 (Target_x86_64::plt_entry_size): Likewise.
3380 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3381 rather than plt_entry_size variable. Move guts of PLT filling to...
3382 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3383 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3384 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3385
3386 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3387 additional argument for the section alignment.
3388 Don't do add_eh_frame_for_plt here.
3389 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3390 non-static. Use get_plt_entry_size method rather than plt_entry_size
3391 variable.
3392 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3393 method.
3394 (Output_data_plt_i386::get_plt_entry_size): Call it.
3395 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3396 (Output_data_plt_i386::add_eh_frame): New method to call it.
3397 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3398 method.
3399 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3400 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3401 method.
3402 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3403 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3404 method instead of plt_entry_size.
3405 (Output_data_plt_i386::plt_entry_size)
3406 (Output_data_plt_i386::plt_eh_frame_fde_size)
3407 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3408 (Output_data_plt_i386_standard): ... here, new class.
3409 (Output_data_plt_i386_exec): New class.
3410 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3411 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3412 (Output_data_plt_i386::exec_plt_entry): Move to ...
3413 (Output_data_plt_i386_exec::plt_entry): ... here.
3414 (Output_data_plt_i386_dyn): New class.
3415 (Output_data_plt_i386::first_plt_entry): Move to ...
3416 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3417 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3418 (Output_data_plt_i386_dyn::plt_entry): ... here.
3419 (Target_i386::Target_i386): Take optional argument for the Target_info
3420 pointer to use.
3421 (Target_i386::do_make_data_plt): New virtual method.
3422 (Target_i386::make_data_plt): New method to call it.
3423 (Target_i386::make_plt_section): Use that.
3424 Call this->plt_->add_eh_frame method here.
3425 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3426 rather than plt_entry_size variable.
3427 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3428 (Output_data_plt_i386::address_for_local): Likewise.
3429 (Output_data_plt_i386::do_write): Likewise.
3430 Move guts of PLT filling to...
3431 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3432 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3433 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3434 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3435
b9b9f2ee
CC
34362012-05-01 Cary Coutant <ccoutant@google.com>
3437
3438 * dwarf_reader.cc (Dwarf_die::read_attributes)
3439 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3440 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3441 * reduced_debug_output.cc
3442 (Output_reduced_debug_info_section::get_die_end): Remove
3443 DW_FORM_GNU_ref_index. Add default case.
3444
57923f48
MW
34452012-04-26 Mark Wielaard <mjw@redhat.com>
3446
3447 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3448 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3449 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3450 DW_AT_high_pc as offset from DW_AT_low_pc.
3451
3452 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3453 * testsuite/Makefile.in: Regenerate.
3454 * testsuite/gdb_index_test_3.c: New test source file.
3455 * testsuite/gdb_index_test_3.sh: New test source file.
3456
2c54b4f4
ILT
34572012-04-25 Ian Lance Taylor <iant@google.com>
3458
3459 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3460 pointer.
3461 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3462 as a class, not a struct.
3463 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3464 (Target_arm::apply_cortex_a8_workaround): Likewise.
3465 * gc.h: Declare Reloc_types as a struct, not a class.
3466 * object.h: Declare Symbols_data as a struct.
3467 * reloc.h: Declare Read_relocs_data as a struct.
3468 * target.h: Declare Relocate_info as a struct.
3469
a5a5f7a3
DM
34702012-04-24 David S. Miller <davem@davemloft.net>
3471
3472 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3473 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3474 and R_SPARC_WPLT30.
3475
f038d496
CC
34762012-04-24 Cary Coutant <ccoutant@google.com>
3477
3478 * incremental-dump.cc (find_input_containing_global): Replace
3479 magic number with symbolic constant.
3480 (dump_incremental_inputs): Update version number.
3481 * incremental.cc (Output_section_incremental_inputs): Update version
3482 number; import symbolic constants from Incremental_inputs_reader.
3483 (Incremental_inputs::create_data_sections): Align relocations
3484 section correctly for 64-bit targets.
3485 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3486 constants; add padding.
3487 (Output_section_incremental_inputs::write_header): Add assert for
3488 header_size.
3489 (Output_section_incremental_inputs::write_input_files): Add assert
3490 for input_entry_size.
3491 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3492 add assert for object_info_size, input_section_entry_size,
3493 global_sym_entry_size.
3494 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3495 for data structure sizes; use them.
3496 (Incremental_input_entry_reader): Import symbolic constants from
3497 Incremental_inputs_reader; use them.
3498
a4d85145
DM
34992012-04-23 David S. Miller <davem@davemloft.net>
3500
3501 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3502 and elf_flags_set_.
3503 (Target_sparc::Target_sparc): Initialize new fields.
3504 (Target_sparc::do_make_elf_object): New function.
3505 (Target_sparc::do_adjust_elf_header): New function.
3506
1d509098
CC
35072012-04-23 Cary Coutant <ccoutant@google.com>
3508
3509 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3510 CU range table of gdb index.
3511
7ebeff7f
DM
35122012-04-20 David S. Miller <davem@davemloft.net>
3513
3514 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3515 instead of false.
3516
13cf9988
DM
35172012-04-16 David S. Miller <davem@davemloft.net>
3518
2a1079e8
DM
3519 * sparc.cc (Target_sparc::got_address): New function.
3520 (Sparc_relocate_functions::gdop_hix22): New function.
3521 (Sparc_relocate_functions::gdop_lox10): New function.
3522 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3523 relocs.
3524 (Target_sparc::Scan::local): Likewise if the global symbol is not
3525 preemptible and is not IFUNC.
3526 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3527 transformations for local and non-preemptible non-IFUNC global
3528 symbols.
3529
0bc964fc
DM
3530 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3531 writing out 64-bit part of ranges.
3532
661d7a80
DM
3533 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3534 -fpic and -fpie respectively.
3535 * Makefile.in: Regenerate.
3536
8c2bf391
DM
3537 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3538 (Target_sparc::Target_sparc): Initialize new field.
3539 (Target_sparc::do_plt_section_for_global): New function.
3540 (Target_sparc::do_plt_section_for_local): New function.
3541 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3542 (Target_sparc::make_plt_section): New function, broken out of
3543 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3544 (Target_sparc::make_plt_entry): Call make_plt_section.
3545 (Target_sparc::make_local_ifunc_plt_entry): New function.
3546 (Target_sparc::rela_ifunc_section): New function.
3547 (Target_sparc::plt_section): Remove const.
3548 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3549 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3550 and ifunc_count_ fields.
3551 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3552 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3553 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3554 (Output_data_plt_sparc::rela_ifunc): New function.
3555 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3556 (Output_data_plt_sparc::has_ifunc_section): New function.
3557 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3558 (Output_data_plt_sparc::address_for_global): New function.
3559 (Output_data_plt_sparc::address_for_local): New function.
3560 (Output_data_plt_sparc::plt_index_to_offset): New function.
3561 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3562 and entry_count.
3563 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3564 entry_count.
3565 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3566 R_SPARC_JMP_IREL to switch.
3567 (Target_sparc::Scan::check_non_pic): Likewise.
3568 (Target_sparc::Scan::local): Handle IFUNC symbols.
3569 (Target_sparc::Scan::local): Likewise.
3570 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3571 and plt_address_for_local.
3572 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3573 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3574
13cf9988
DM
3575 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3576 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3577 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3578 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3579 global relocs too.
3580 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3581 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3582 calls.
3583 * sparc.cc (Target_sparc::Scan::global): Likewise.
3584 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3585
31821be0
CC
35862012-04-16 Cary Coutant <ccoutant@google.com>
3587
3588 * archive.cc (Library_base::should_include_member): Check for
3589 --export-dynamic-symbol.
3590 * options.h (class General_options): Add --export-dynamic-symbol.
3591 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3592 --export-dynamic-symbol.
3593 (Symbol_table::gc_mark_undef_symbols): Likewise.
3594 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3595
2615994e
DM
35962012-04-12 David S. Miller <davem@davemloft.net>
3597
3598 * sparc.cc (Reloc::wdisp10): New relocation method.
3599 (Reloc::h34): Likewise.
3600 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3601 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3602 R_SPARC_WDISP10.
3603 (Target_sparc::Scan::local): Likewise.
3604 (Target_sparc::Scan::global): Likewise.
3605 (Target_sparc::Relocate::relocate): Likewise.
3606
6782735d
CC
36072012-04-09 Cary Coutant <ccoutant@google.com>
3608
3609 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3610 low_pc == 0.
3611
8c7a0b00
ILT
36122012-04-06 Ian Lance Taylor <iant@google.com>
3613
3614 * timer.cc: #include <unistd.h>.
3615
58797674
RM
36162012-04-06 Roland McGrath <mcgrathr@google.com>
3617
3618 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3619 * config.in: Regenerate.
3620 * configure: Regenerate.
3621
44350750
NC
36222012-04-05 Nick Clifton <nickc@redhat.com>
3623
3624 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3625 (AM_LC_MESSAGES): Add.
3626 * aclocal.m4: Regenerate.
3627 * config.in: Regenerate.
3628 * configure: Regenerate.
3629
c1027032
CC
36302012-03-21 Cary Coutant <ccoutant@google.com>
3631
3632 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3633 * Makefile.in: Regenerate.
3634 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3635 (Sized_elf_reloc_mapper::symbol_section): New function.
3636 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3637 (make_elf_reloc_mapper): New function.
3638 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3639 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3640 (Dwarf_abbrev_table::do_get_abbrev): New function.
3641 (Dwarf_ranges_table::read_ranges_table): New function.
3642 (Dwarf_ranges_table::read_range_list): New function.
3643 (Dwarf_pubnames_table::read_section): New function.
3644 (Dwarf_pubnames_table::read_header): New function.
3645 (Dwarf_pubnames_table::next_name): New function.
3646 (Dwarf_die::Dwarf_die): New function.
3647 (Dwarf_die::read_attributes): New function.
3648 (Dwarf_die::skip_attributes): New function.
3649 (Dwarf_die::set_name): New function.
3650 (Dwarf_die::set_linkage_name): New function.
3651 (Dwarf_die::attribute): New function.
3652 (Dwarf_die::string_attribute): New function.
3653 (Dwarf_die::int_attribute): New function.
3654 (Dwarf_die::uint_attribute): New function.
3655 (Dwarf_die::ref_attribute): New function.
3656 (Dwarf_die::child_offset): New function.
3657 (Dwarf_die::sibling_offset): New function.
3658 (Dwarf_info_reader::check_buffer): New function.
3659 (Dwarf_info_reader::parse): New function.
3660 (Dwarf_info_reader::do_parse): New function.
3661 (Dwarf_info_reader::do_read_string_table): New function.
3662 (Dwarf_info_reader::lookup_reloc): New function.
3663 (Dwarf_info_reader::get_string): New function.
3664 (Dwarf_info_reader::visit_compilation_unit): New function.
3665 (Dwarf_info_reader::visit_type_unit): New function.
3666 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3667 Sized_elf_reloc_mapper.
3668 (Sized_dwarf_line_info::symbol_section): Remove function.
3669 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3670 (Sized_dwarf_line_info::read_line_mappings): Remove object
3671 parameter, adjust callers.
3672 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3673 * dwarf_reader.h: Include <sys/types.h>.
3674 (class Track_relocs): Remove forward declaration.
3675 (class Elf_reloc_mapper): New class.
3676 (class Sized_elf_reloc_mapper): New class.
3677 (class Dwarf_abbrev_table): New class.
3678 (class Dwarf_range_list): New class.
3679 (class Dwarf_ranges_table): New class.
3680 (class Dwarf_pubnames_table): New class.
3681 (class Dwarf_die): New class.
3682 (class Dwarf_info_reader): New class.
3683 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3684 (Sized_dwarf_line_info::symbol_section): Remove member function.
3685 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3686 base class.
3687 * gdb-index.cc: New source file.
3688 * gdb-index.h: New source file.
3689 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3690 and .debug_types sections, call Layout::add_to_gdb_index.
3691 (Sized_relobj_incr::do_section_name): Implement.
3692 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3693 return type; Implement.
3694 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3695 return type.
3696 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3697 parameter list and return type.
3698 (Sized_incr_dynobj::do_section_contents): Likewise.
3699 * layout.cc: Include gdb-index.h.
3700 (Layout::Layout): Initialize gdb_index_data_.
3701 (Layout::init_fixed_output_section): Check for .gdb_index section.
3702 (Layout::add_to_gdb_index): New function. Instantiate.
3703 * layout.h: Add forward declaration for class Gdb_index.
3704 (Layout::add_to_gdb_index): New member function.
3705 (Layout::gdb_index_data_): New data member.
3706 * main.cc: Include gdb-index.h.
3707 (main): Print statistics for gdb index.
3708 * object.cc (Object::section_contents): Move code into
3709 do_section_contents.
3710 (need_decompressed_section): Check for sections needed when building
3711 gdb index.
3712 (build_compressed_section_map): Likewise.
3713 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3714 gdb index.
3715 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3716 sections; call Layout::add_to_gdb_index.
3717 (Sized_relobj_file::do_decompressed_section_contents): Call
3718 do_section_contents directly.
3719 * object.h (Object::do_section_contents): Adjust parameter list and
3720 return type.
3721 (Object::do_decompressed_section_contents): Call do_section_contents
3722 directly.
3723 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3724 return type.
3725 * options.h (class General_options): Add --gdb-index option.
3726 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3727 list and return type.
3728 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3729 * reloc.h (Track_relocs::checkpoint): New function.
3730 (Track_relocs::reset): New function.
3731
3732 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3733 New test cases.
3734 * testsuite/Makefile.in: Regenerate.
3735 * testsuite/gdb_index_test.cc: New test source file.
3736 * testsuite/gdb_index_test_1.sh: New test source file.
3737 * testsuite/gdb_index_test_2.sh: New test source file.
3738
647f1574
DK
37392012-03-19 Doug Kwan <dougkwan@google.com>
3740
3741 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3742 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3743 __exidx_start and __exidx_end. Make symbol table parameter
3744 anonymous as it is not used.
3745 * gold.cc (queue_middle_tasks): Call target hook to define any
3746 target-specific symbols.
3747 * target.h (Target::define_standard_symbols): New method.
3748 (Target::do_define_standard_symbols): Same.
3749 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3750 * testsuite/Makefile.in: Regenerate.
3751 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3752 and __exidx_end.
3753 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3754 relocations are generated for __exidx_start and __exidx_end.
3755
7c6109da
DK
37562012-03-16 Doug Kwan <dougkwan@google.com>
3757
3758 * testsuite/Makefile.am: Disable test initpri3b.
3759 * testsuite/Makefile.in: Regenerate.
3760
7b8957f8
DK
37612012-03-15 Doug Kwan <dougkwan@google.com>
3762
3763 * arm.cc (Target_arm::got_section): Make .got section read-only
3764 if -z now is given.
3765
14dc9ef7
ILT
37662012-03-15 Ian Lance Taylor <iant@google.com>
3767
3768 PR gold/13850
3769 * layout.cc (Layout::make_output_section): Correctly mark
3770 SHT_INIT_ARRAY, et. al., as relro.
3771
fa40b62a
DK
37722012-03-14 Doug Kwan <dougkwan@google.com>
3773
3774 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3775 dynamic relocations for protected symbols in shared objects.
3776
fd325007
ILT
37772012-03-13 Ian Lance Taylor <iant@google.com>
3778
3779 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3780 keep the larger alignment.
3781
e8dd54e1
CC
37822012-03-12 Cary Coutant <ccoutant@google.com>
3783
3784 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3785 handling of DW_LNE_define_file.
3786
feb5f3b0
CC
37872012-03-12 Cary Coutant <ccoutant@google.com>
3788
3789 * reduced_debug_output.cc
3790 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3791 codes to switch.
3792
a1fb4256
CC
37932012-02-29 Cary Coutant <ccoutant@google.com>
3794
3795 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3796
5dd8762a
CC
37972012-02-29 Cary Coutant <ccoutant@google.com>
3798
3799 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3800 Call Object::decompressed_section_contents.
3801 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3802 New dtor.
3803 (Sized_dwarf_line_info::buffer_start_): New data member.
3804 * merge.cc (Output_merge_data::do_add_input_section): Call
3805 Object::decompressed_section_contents.
3806 (Output_merge_string::do_add_input_section): Likewise.
3807 * object.cc (need_decompressed_section): New function.
3808 (build_compressed_section_map): Decompress sections needed later.
3809 (Sized_relobj_file::do_decompressed_section_contents): New function.
3810 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3811 * object.h (Object::decompressed_section_contents): New function.
3812 (Object::discard_decompressed_sections): New function.
3813 (Object::do_decompressed_section_contents): New function.
3814 (Object::do_discard_decompressed_sections): New function.
3815 (Compressed_section_info): New type.
3816 (Compressed_section_map): Include decompressed section contents.
3817 (Sized_relobj_file::do_decompressed_section_contents): New function.
3818 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3819
7b5de7ee
CC
38202012-02-16 Cary Coutant <ccoutant@google.com>
3821
3822 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3823 * testsuite/Makefile.in: Regenerate.
3824
f9fa4a63
CC
38252012-02-14 Cary Coutant <ccoutant@google.com>
3826
3827 * options.cc (General_options::finalize): Disallow -pie and -static.
3828
2c175ebc
DK
38292012-02-03 Doug Kwan <dougkwan@google.com>
3830
3831 * arm.cc (Arm_relocate_functions::abs8,
3832 Arm_relocate_functions::abs16): Use
3833 Bits::has_signed_unsigned_overflow32.
3834 (Arm_relocate_functions::thm_abs8): Correct range of
3835 overflow check.
3836 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3837 in assertions.
3838
90cff06f
DK
38392012-02-02 Doug Kwan <dougkwan@google.com>
3840
3841 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3842 position independent outputs, not just shared objects.
3843
63887f3d
L
38442012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3845
3846 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3847 * configure: Regenerated.
3848
bef2b434
ILT
38492012-01-27 Ian Lance Taylor <iant@google.com>
3850
3851 * reloc.h (Bits): New class with static functions, copied from
3852 namespace utils in arm.cc.
3853 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3854 instead.
3855
c335b55d
L
38562012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3857
3858 * incremental.cc (write_info_blocks): Correct relocation offset.
3859
41194d9f
L
38602012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3861
3862 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3863 (Relocate::tls_gd_to_le): Likewise.
3864
1bae613c
L
38652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3866
3867 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3868
24482ca0
L
38692012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3870
3871 * configure.ac: Check if -mcmodel=medium works.
3872 * configure: Regenerated.
3873
c2c7840a
CC
38742012-01-24 Cary Coutant <ccoutant@google.com>
3875
3876 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3877 definition and ...
3878 (read_unsigned_LEB_128_x): ... this new function.
3879 (read_signed_LEB_128): Replaced with inline definition and ...
3880 (read_signed_LEB_128_x): ... this new function.
3881 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3882 (read_unsigned_LEB_128): Add inline definition.
3883 (read_signed_LEB_128_x): New function.
3884 (read_signed_LEB_128): Add inline definition.
3885 * testsuite/Makefile.am (leb128_unittest): New unit test.
3886 * testsuite/Makefile.in: Regenerate.
3887 * testsuite/leb128_unittest.cc: New unit test.
3888
833de760 38892012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3890
3891 PR gold/13617
3892 * i386.cc (Target_i386::do_code_fill): When using a jmp
3893 instruction, pad with nop instructions.
3894 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3895
618d6666
L
38962012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3897
3898 * x86_64.cc (gc_process_relocs): Add typename on types used in
3899 template.
3900 (scan_relocs): Likewise.
3901 (relocate_section): Likewise.
3902 (apply_relocation): Likewise.
3903
3660ff06
L
39042012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3905
3906 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3907 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3908 under x32.
3909
fc51264f
L
39102012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3911
3912 * x86_64.cc: Initial support for x32.
3913
dd74ae06
CC
39142012-01-03 Cary Coutant <ccoutant@google.com>
3915
3916 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3917 Use abstract base class for GOT.
3918 * gold/output.h (class Output_data_got_base): New abstract base class.
3919 (class Output_data_got): Derive from new base class, adjust ctors.
3920 (Output_data_got::reserve_slot): Make virtual; rename to
3921 do_reserve_slot; Adjust callers.
3922 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3923 pointer to abstract base class.
3924 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3925
83896202
ILT
39262011-12-18 Ian Lance Taylor <iant@google.com>
3927
3928 * object.h (Relobj::local_symbol_value): New function.
3929 (Relobj::local_plt_offset): New function.
3930 (Relobj::local_has_got_offset): New function.
3931 (Relobj::local_got_offset): New function.
3932 (Relobj::set_local_got_offset): New function.
3933 (Relobj::do_local_symbol_value): New pure virtual function.
3934 (Relobj::do_local_plt_offset): Likewise.
3935 (Relobj::do_local_has_got_offset): Likewise.
3936 (Relobj::do_local_got_offset): Likewise.
3937 (Relobj::do_set_local_got_offset): Likewise.
3938 (Sized_relobj::do_local_has_got_offset): Rename from
3939 local_has_got_offset.
3940 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3941 (Sized_relobj::do_set_local_got_offset): Rename from
3942 set_local_got_offset.
3943 (Sized_relobj_file::do_local_plt_offset): Rename from
3944 local_plt_offset.
3945 (Sized_relobj_file::do_local_symbol_value): New function.
3946 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3947 local_plt_offset.
3948 * output.cc (Output_data_got::Got_entry::write): Change object to
3949 Relobj. Use local_symbol_value.
3950 (Output_data_got::add_global_with_rel): Change rel_dyn to
3951 Output_data_reloc_generic*. Use add_global_generic.
3952 (Output_data_got::add_global_with_rela): Remove. Change all
3953 callers to use add_global_with_rel.
3954 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3955 Output_data_reloc_generic*. Use add_global_generic.
3956 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3957 callers to use add_global_pair_with_rel.
3958 (Output_data_got::add_local): Change object to Relobj*.
3959 (Output_data_got::add_local_plt): Likewise.
3960 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3961 change rel_dyn to Output_data_reloc_generic*. Use
3962 add_local_generic.
3963 (Output_data_got::add_local_with_rela): Remove. Change all
3964 callers to use all_local_with_rel.
3965 (Output_data_got::add_local_pair_with_rel): Change object to
3966 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3967 add_output_section_generic.
3968 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3969 callers to use add_local_pair_with_rel.
3970 (Output_data_got::reserve_local): Change object to Relobj*.
3971 * output.h: (class Output_data_reloc_generic): Add pure virtual
3972 declarations for add_global_generic, add_local_generic,
3973 add_output_section_generic.
3974 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3975 functions for Output_data_reloc_generic. Update declarations for
3976 changes listed in output.cc.
3977 (class Output_data_got): Change template parameter to got_size.
3978 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3979 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3980 function.
3981 (Sized_relobj_incr::do_local_plt_offset): New function.
3982 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3983 add_global_generic.
3984
76677ad0
CC
39852011-12-17 Cary Coutant <ccoutant@google.com>
3986
3987 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3988 * resolve.cc (Symbol_table::resolve): Likewise.
3989 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3990 arrays.
3991 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3992
8b8dd8d5
ILT
39932011-12-16 Ian Lance Taylor <iant@google.com>
3994
3995 * output.h (Output_data_reloc_generic::add): Only call
3996 add_dynamic_reloc if this is a dynamic reloc section.
3997
d55525b9
L
39982011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3999
4000 PR gold/13505
4001 * target-reloc.h (apply_relocation): Replace <64, false> with
4002 <size, big_endian>.
4003
ff81c7c1
NC
40042011-11-25 Nick Clifton <nickc@redhat.com>
4005
4006 * po/it.po: New Italian translation.
4007
628f39be
SA
40082011-11-17 Sterling Augustine <saugustine@google.com>
4009
4010 * script.cc (script_include_directive): Implement.
4011 (read_script_file): New local variables name and search_path. Update
4012 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
4013 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
4014 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4015
98ef3ea4
SA
40162011-11-11 Sterling Augustine <saugustine@google.com>
4017
4018 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4019 (file_or_sections_cmd): Likewise.
4020
f4a8b6d7
DK
40212011-11-11 Doug Kwan <dougkwan@google.com>
4022
4023 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4024 if --just-symbols is given.
4025
29ab395d
DK
40262011-11-10 Doug Kwan <dougkwan@google.com>
4027
4028 PR gold/13362
4029 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4030 when processing data relocs.
4031 * reloc.h (Relocate_functions::rel_unaligned): New method.
4032 (Relocate_functions::pcrel_unaligned): Ditto.
4033 (Relocate_functions::rel32_unaligned): Ditto.
4034 (Relocate_functions::pcrel32_unaligned): Ditto.
4035
2c339f71
DK
40362011-11-09 Doug Kwan <dougkwan@google.com>
4037
4038 PR gold/13362
4039 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4040 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4041 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4042 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4043 (Relocate_functions::rel_unaligned): New.
4044 (Relocate_functions::rel32_unaligned): New.
4045 * target-reloc.h (relocate_for_relocatable): Add code to handle
4046 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4047 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4048 arm_unaligned_reloc_r): New targets.
4049 * testsuite/Makefile.in: Regenerate.
4050 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4051 linking.
4052
3f3cddf1
ILT
40532011-11-02 Ian Lance Taylor <iant@google.com>
4054
4055 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4056 NATIVE_LINKER.
4057 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4058 * options.cc (General_options::finalize): Use library search path
4059 from configure script if specified. If not native and no sysroot,
4060 only search TOOLLIBDIR.
4061 * options.h (Search_directory::Search_directory): Change name to
4062 const std::string&.
4063 (General_options::add_to_library_path_with_sysroot): Change arg to
4064 const std::string&.
4065 * configure, Makefile.in, config.in: Rebuild.
4066
a8e2273b
ILT
40672011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4068
4069 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4070 we are working around the ARM1176 Erratum.
4071 * options.h (General_options::fix_arm1176): Add option.
4072 * testsuite/Makefile.am: Add testcases, and keep current ones
4073 working.
4074 * testsuite/Makefile.in: Regenerate.
4075 * testsuite/arm_fix_1176.s: New file.
4076 * testsuite/arm_fix_1176.sh: Likewise.
4077
cd6eab1c
ILT
40782011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4079
4080 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4081 may_use_blx_.
4082 (Target_arm::may_use_blx): Remove method.
4083 (Target_arm::set_may_use_blx): Likewise.
4084 (Target_arm::may_use_v4t_interworking): New method.
4085 (Target_arm::may_use_v5t_interworking): Likewise.
4086 (Target_arm::may_use_blx_): Remove member variable.
4087 (Arm_relocate_functions::arm_branch_common): Check for v5T
4088 interworking.
4089 (Arm_relocate_functions::thumb_branch_common): Likewise.
4090 (Reloc_stub::stub_type_for_reloc): Likewise.
4091 (Target_arm::do_finalize_sections): Correct interworking checks.
4092 * testsuite/Makefile.am: Add new tests.
4093 * testsuite/Makefile.in: Regenerate.
4094 * testsuite/arm_farcall_arm_arm.s: New test.
4095 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4096 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4097 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4098 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4099 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4100 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4101 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4102
286adcf4
CC
41032011-10-31 Cary Coutant <ccoutant@google.com>
4104
4105 PR gold/13023
4106 * expression.cc (Expression::eval_with_dot): Add
4107 is_section_dot_assignment parameter.
4108 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4109 absolute and assigning to dot within a section.
4110 * script-sections.cc
4111 (Output_section_element_assignment::set_section_addresses): Pass
4112 dot_section to set_if_absolute.
4113 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4114 as is_section_dot_assignment flag to eval_with_dot.
4115 (Output_section_element_dot_assignment::set_section_addresses):
4116 Likewise.
4117 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4118 parameter. Also set value if relative to dot_section; set the
4119 symbol's output_section.
4120 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4121 parameter. Adjust all callers.
4122 (Expression::eval_maybe_dot): Likewise.
4123 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4124 Adjust all callers.
4125 * testsuite/script_test_2.t: Test assignment of an absolute value
4126 to dot within an output section element.
4127
9634ed06
CC
41282011-10-31 Cary Coutant <ccoutant@google.com>
4129
4130 * options.h (class General_options): Add --[no-]gnu-unique options.
4131 * symtab.cc (Symbol_table::sized_write_globals): Convert
4132 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4133
de4101c7
CC
41342011-10-31 Cary Coutant <ccoutant@google.com>
4135
4136 PR gold/13359
4137 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4138 unnecessary assertion.
4139 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4140
7257cc92
ST
41412011-10-31 Sriraman Tallam <tmsriram@google.com>
4142
4143 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4144 gc_mark_symbol.
4145 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4146 gc_mark_symbol.
4147 Change to just keep the section associated with symbol.
4148 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4149 they are externally visible and --export-dynamic is turned on.
4150 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4151
bfc34b3f
ILT
41522011-10-19 Ian Lance Taylor <iant@google.com>
4153
4154 PR gold/13163
4155 * script-sections.cc
4156 (Output_section_element_dot_assignment::needs_output_section): New
4157 function.
4158
ea0d8c47
ILT
41592011-10-19 Ian Lance Taylor <iant@google.com>
4160
4161 PR gold/13204
4162 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4163 --section-start option was seen.
4164 * options.h (General_options::any_section_start): New function.
4165
abd242a9
DM
41662011-10-18 David S. Miller <davem@davemloft.net>
4167
4168 PR binutils/13301
4169 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4170 member to track relocation locations that have moved during TLS
4171 reloc optimizations.
4172 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4173 (Target_sparc::Relocate::relocate): Adjust view down by 4
4174 bytes if it matches reloc_adjust_addr_.
4175 (Target_sparc::Relocate::relocate_tls): Always move the
4176 __tls_get_addr call delay slot instruction forward 4 bytes when
4177 performing relaxation.
4178
bab9090f
CC
41792011-10-18 Cary Coutant <ccoutant@google.com>
4180
4181 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4182 (Output_file::map_no_anonymous): Check for non-zero
4183 return code from posix_fallocate.
4184
f7c5b166
CC
41852011-10-17 Cary Coutant <ccoutant@google.com>
4186
4187 PR gold/13245
4188 * plugin.cc (is_visible_from_outside): Check for symbols
4189 referenced from dynamic objects.
4190 * resolve.cc (Symbol_table::resolve): Don't count references
4191 from dynamic objects as references from real ELF files.
4192 * testsuite/plugin_test_2.sh: Adjust expected result.
4193
b490c0bb
CC
41942011-10-17 Cary Coutant <ccoutant@google.com>
4195
4196 * gold.cc: Include timer.h.
4197 (queue_middle_tasks): Stamp time.
4198 (queue_final_tasks): Likewise.
4199 * main.cc (main): Store timer in parameters. Print timers
4200 for each pass.
4201 * parameters.cc (Parameters::Parameters): Initialize timer_.
4202 (Parameters::set_timer): New function.
4203 (set_parameters_timer): New function.
4204 * parameters.h (Parameters::set_timer): New function.
4205 (Parameters::timer): New function.
4206 (Parameters::timer_): New data member.
4207 (set_parameters_timer): New function.
4208 * timer.cc (Timer::stamp): New function.
4209 (Timer::get_pass_time): New function.
4210 * timer.h (Timer::stamp): New function.
4211 (Timer::get_pass_time): New function.
4212 (Timer::pass_times_): New data member.
4213
f475cf7b
CC
42142011-10-17 Cary Coutant <ccoutant@google.com>
4215
4216 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4217 task for members of lib groups.
4218
cdd7e244
CC
42192011-10-17 Cary Coutant <ccoutant@google.com>
4220
4221 PR gold/13288
4f95c8b4 4222 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4223 (File_read::make_view): Move bounds check (replace with assert)...
4224 (File_read::find_or_make_view): ... to here.
4225
dfb45471
CC
42262011-10-12 Cary Coutant <ccoutant@google.com>
4227
4f95c8b4 4228 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4229 ::read returns less than requested size.
4230
53bbcc1b
CC
42312011-10-10 Cary Coutant <ccoutant@google.com>
4232
4f95c8b4 4233 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4234 Initialize defined_count_.
4235 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4236 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4237 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4238 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4239 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4240 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4241 member.
4242 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4243 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4244 Return zeroes instead of internal error.
4245
397b129b
CC
42462011-10-10 Cary Coutant <ccoutant@google.com>
4247
4248 PR gold/13249
4f95c8b4 4249 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4250 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4251 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4252 (Output_reloc::type_): Adjust size of bit field.
4253 (Output_reloc::use_plt_offset_): New bit field.
4254 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4255 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4256 flag. Adjust all callers.
4f95c8b4 4257 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4258 creating RELATIVE relocations.
4259
d5698657
NC
42602011-10-10 Nick Clifton <nickc@redhat.com>
4261
4262 * po/es.po: Updated Spanish translation.
4263 * po/fi.po: Updated Finnish translation.
4264
6a59a5c2
DN
42652011-10-03 Diego Novillo <dnovillo@google.com>
4266
4267 * options.cc (parse_uint): Fix dereference of RETVAL.
4268
f0558624
ST
42692011-09-29 Sriraman Tallam <tmsriram@google.com>
4270
4271 * layout.h (section_order_map_): New member.
4272 (get_section_order_map): New member function.
4273 * output.cc (Output_section::add_input_section): Check for patterns
4274 only when --section-ordering-file is specified.
4275 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4276 output_sections have been formed.
4277 * layout.cc (Layout_Layout): Initialize section_order_map_.
4278 * plugin.cc (update_section_order): Store order in order_map. Do not
4279 update the order.
4280 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4281 * testsuite/Makefile.in: Regenerate.
4282 * testsuite/plugin_section_order.c: New file.
4283 * testsuite/plugin_final_layout.cc: New file.
4284 * testsuite/plugin_final_layout.sh: New file.
4285
a7dac153
CC
42862011-09-29 Cary Coutant <ccoutant@google.com>
4287
4f95c8b4 4288 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4289 Check for NULL.
4f95c8b4 4290 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4291 symbols during incremental update.
4292 (Symbol_table::add_from_dynobj): Likewise.
4293
eebd87a5
ILT
42942011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4295 Ian Lance Taylor <iant@google.com>
4296
4297 * symtab.cc (Symbol_table::define_special_symbol): Always
4298 canonicalize version string.
4299
403a3331
CC
43002011-09-26 Cary Coutant <ccoutant@google.com>
4301
4f95c8b4
CC
4302 * gold.cc (queue_initial_tasks): Move option checks ...
4303 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4304 some options; make others fatal.
4305
235061c2
CC
43062011-09-26 Cary Coutant <ccoutant@google.com>
4307
4308 gcc PR lto/47247
4309 * plugin.cc (get_symbols_v2): New function.
4310 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4311 (is_referenced_from_outside): New function.
4312 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4313 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4314 (get_symbols): Pass version parameter.
4315 (get_symbols_v2): New function.
4316 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4317 parameter.
4318 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4319 (onload): Add LDPT_GET_SYMBOLS_V2.
4320 (all_symbols_read_hook): Use get_symbols_v2; check for
4321 LDPR_PREVAILING_DEF_IRONLY_EXP.
4322 * testsuite/plugin_test_3.sh: Update expected results.
4323
dc87f620
ILT
43242011-09-23 Simon Baldwin <simonb@google.com>
4325
4326 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4327 configuration options.
4328 * configure: Regenerate.
4329 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4330 * Makefile.in: Regenerate.
4331 * testsuite/Makefile.in: Regenerate.
4332
a8279f82
ST
43332011-09-19 Sriraman Tallam <tmsriram@google.com>
4334
4335 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4336
0c9350c8
CC
43372011-09-19 Cary Coutant <ccoutant@google.com>
4338
4339 * incremental.cc (can_incremental_update): Fix typo in comment.
4340 * incremental.h (can_incremental_update): Likewise.
4341
aa06ae28
CC
43422011-09-18 Cary Coutant <ccoutant@google.com>
4343
4344 * incremental.cc (can_incremental_update): New function.
4345 * incremental.h (can_incremental_update): New function.
4346 * layout.cc (Layout::init_fixed_output_section): Call it.
4347 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4348 * object.cc (Sized_relobj_file::do_layout): Call
4349 can_incremental_update.
4350
ebb300b2
CC
43512011-09-13 Cary Coutant <ccoutant@google.com>
4352
4353 * configure.ac: Check for glibc support for gnu_indirect_function
4354 support with static linking, setting automake conditional
4355 IFUNC_STATIC.
4356 * Makefile.in: Regenerate.
4357 * configure: Regenerate.
4358
4359 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4360 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4361 for IFUNC_STATIC.
4362 * testsuite/Makefile.in: Regenerate.
4363
1206d0d5
CC
43642011-09-13 Cary Coutant <ccoutant@google.com>
4365
4366 * incremental.cc (Sized_relobj_incr::do_layout): Call
4367 report_comdat_group for kept comdat sections.
4368 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4369 * testsuite/Makefile.in: Regenerate.
4370 * testsuite/incr_comdat_test_1.cc: New source file.
4371 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4372 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4373 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4374
40b29874
ILT
43752011-09-13 Ian Lance Taylor <iant@google.com>
4376
4377 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4378 variable external_symbols_offset.
4379
1b045aac
ILT
43802011-09-12 Ian Lance Taylor <iant@google.com>
4381
4382 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4383 triggered if object has no symbols.
4384
24c6c55a
DM
43852011-09-09 David S. Miller <davem@davemloft.net>
4386
4387 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4388 (Output_fill_debug_line::do_write): Likewise.
4389
66570254
CC
43902011-08-29 Cary Coutant <ccoutant@google.com>
4391
4392 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4393 casts to match formatting specs.
4394 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4395
8ea8cd50
CC
43962011-08-26 Cary Coutant <ccoutant@google.com>
4397
4398 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4399 remaining hole size when allocating.
4400 (Layout::make_output_section): Set fill methods for debug sections.
4401 * layout.h (Free_list::Free_list_node): Move from private to
4402 public.
4403 (Free_list::set_min_hole_size): New function.
4404 (Free_list::begin, Free_list::end): New functions.
4405 (Free_list::min_hole_): New data member.
4406 * output.cc: Include dwarf.h.
4407 (Output_fill_debug_info::do_minimum_hole_size): New function.
4408 (Output_fill_debug_info::do_write): New function.
4409 (Output_fill_debug_line::do_minimum_hole_size): New function.
4410 (Output_fill_debug_line::do_write): New function.
4411 (Output_section::Output_section): Initialize new data member.
4412 (Output_section::set_final_data_size): Ensure patch space is larger
4413 than minimum hole size.
4414 (Output_section::do_write): Fill holes in debug sections.
4415 * output.h (Output_fill): New class.
4416 (Output_fill_debug_info): New class.
4417 (Output_fill_debug_line): New class.
4418 (Output_section::set_free_space_fill): New function.
4419 (Output_section::free_space_fill_): New data member.
4420 * testsuite/Makefile.am (incremental_test_3): Add
4421 --incremental-patch option.
4422 (incremental_test_4): Likewise.
4423 (incremental_test_5): Likewise.
4424 (incremental_test_6): Likewise.
4425 (incremental_copy_test): Likewise.
4426 (incremental_common_test_1): Likewise.
4427 * testsuite/Makefile.in: Regenerate.
4428
7cf80422
NC
44292011-08-26 Nick Clifton <nickc@redhat.com>
4430
4431 * po/es.po: Updated Spanish translation.
4432
c3f7b0e5
CC
44332011-08-01 Cary Coutant <ccoutant@google.com>
4434
4435 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4436 * gold/testsuite/Makefile.in: Regenerate.
4437 * gold/testsuite/justsyms_exec.c: New source file.
4438 * gold/testsuite/justsyms_lib.c: New source file.
4439
9590bf25
CC
44402011-08-01 Cary Coutant <ccoutant@google.com>
4441
4442 * layout.cc (Layout::set_segment_offsets): Don't realign text
4443 segment if -Ttext was specified.
4444 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4445 file type.
4446 * object.h (Sized_relobj_file::e_type): New function.
4447 (Sized_relobj_file::e_type_): New data member.
4448 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4449 base address for ET_EXEC files.
4450 * target.cc (Target::do_make_elf_object_implementation): Allow
4451 ET_EXEC files with --just-symbols option.
4452
dcd8d12e
CC
44532011-07-28 Cary Coutant <ccoutant@google.com>
4454
4455 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4456 Add thread_number parameter.
4457 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4458 * workqueue-threads.cc
4459 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4460 current thread if its thread number is greater than desired thread
4461 count.
4462 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4463 Add thread_number parameter.
4464 (Workqueue::should_cancel_thread): Likewise.
4465 (Workqueue::find_runnable_or_wait): Pass thread_number to
4466 should_cancel_thread.
4467 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4468 parameter.
4469
804eb480
ST
44702011-07-22 Sriraman Tallam <tmsriram@google.com>
4471
4472 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4473 only after checking if it cannot be forced local.
4474 * symtab.h (is_externally_visible): Check if the symbol is not forced
4475 local.
4476
f1ddb600
ILT
44772011-07-15 Ian Lance Taylor <iant@google.com>
4478
4479 * options.h (class General_options): Add --print-output-format.
4480 Move -EL next to -EB, for better --help output.
4481 * target-select.cc: Include <cstdio>, "options.h", and
4482 "parameters.h".
4483 (Target_selector::do_target_bfd_name): New function.
4484 (print_output_format): New function.
4485 * target-select.h (class Target_selector): Update declarations.
4486 (Target_selector::target_bfd_name): New function.
4487 (print_output_format): Declare.
4488 * main.cc: Include "target-select.h".
4489 (main): Handle --print-output-format.
4490 * gold.cc: Include "target-select.h".
4491 (queue_initial_tasks): Handle --print-output-format when there are
4492 no input files.
4493 * parameters.cc (parameters_force_valid_target): Give a better
4494 error message if -EB/-EL does not match target.
4495 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4496 function.
4497
7d172687
ILT
44982011-07-15 Ian Lance Taylor <iant@google.com>
4499
4500 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4501 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4502 (Output_data_plt_i386::do_write): Write address of .dynamic
4503 section to first entry in .got.plt section.
4504 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4505 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4506 Initialize layout_.
4507 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4508 section to first entry in .got.plt section.
4509 * layout.h (Layout::dynamic_section): New function.
4510
e9552f7e
ST
45112011-07-13 Sriraman Tallam <tmsriram@google.com>
4512
4513 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4514 to claim_file call.
4515 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4516 input_section_position_, and input_section_glob_.
4517 (read_layout_from_file): Call function section_ordering_specified.
4518 * layout.h (is_section_ordering_specified): New function.
4519 (section_ordering_specified): New function.
4520 (section_ordering_specified_): New boolean member.
4521 * main.cc(main): Call load_plugins after layout object is defined.
4522 * output.cc (Output_section::add_input_section): Use
4523 function section_ordering_specified to check if section ordering is
4524 needed.
4525 * output.cc (Output_section::add_relaxed_input_section): Use
4526 function section_ordering_specified to check if section ordering is
4527 needed.
4528 (Output_section::update_section_layout): New function.
4529 (Output_section::sort_attached_input_sections): Check if input section
4530 must be reordered.
4531 * output.h (Output_section::update_section_layout): New function.
4532 * plugin.cc (get_section_count): New function.
4533 (get_section_type): New function.
4534 (get_section_name): New function.
4535 (get_section_contents): New function.
4536 (update_section_order): New function.
58797674 4537 (allow_section_ordering): New function.
e9552f7e
ST
4538 (Plugin::load): Add the new interfaces to the transfer vector.
4539 (Plugin_manager::load_plugins): New parameter.
4540 (Plugin_manager::all_symbols_read): New parameter.
4541 (Plugin_manager::claim_file): New parameter. Save the elf object for
4542 unclaimed objects.
4543 (Plugin_manager::get_elf_object): New function.
4544 (Plugin_manager::get_view): Change to directly use the bool to check
4545 if get_view is called from claim_file_hook.
4546 * plugin.h (input_objects): New function
4547 (Plugin__manager::load_plugins): New parameter.
4548 (Plugin_manager::claim_file): New parameter.
4549 (Plugin_manager::get_elf_object): New function.
4550 (Plugin_manager::in_claim_file_handler): New function.
4551 (Plugin_manager::in_claim_file_handler_): New member.
4552 (layout): New function.
4553 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4554 handler with an extra parameter. Make the elf object before calling
4555 claim_file handler.
4556 * testsuite/plugin_test.c (get_section_count): New function pointer.
4557 (get_section_type): New function pointer.
4558 (get_section_name): New function pointer.
4559 (get_section_contents): New function pointer.
4560 (update_section_order): New function pointer.
4561 (allow_section_ordering): New function pointer.
4562 (onload): Check if the new interfaces exist.
4563
9446efde
ILT
45642011-07-13 Ian Lance Taylor <iant@google.com>
4565
4566 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4567 relro section.
4568 * x86_64.cc (Target_x86_64::got_section): Likewise.
4569 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4570 (relro_now_test_SOURCES): New variable.
4571 (relro_now_test_DEPENDENCIES): New variable.
4572 (relro_now_test_LDFLAGS): New variable.
4573 (relro_now_test_LDADD): New variable.
4574 (relro_now_test.so): New target.
4575 * testsuite/Makefile.in: Rebuild.
4576
07aa62f2
ILT
45772011-07-12 Ian Lance Taylor <iant@google.com>
4578
4579 PR gold/12980
4580 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4581 GLOB_DAT relocation rather than a RELATIVE relocation for a
4582 protected symbol when creating a shared library.
4583 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4584 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4585 * testsuite/protected_main_1.cc (main): Test that protected
4586 function has same address.
4587
e2153196
ILT
45882011-07-11 Ian Lance Taylor <iant@google.com>
4589
4590 PR gold/12979
4591 * options.h (class General_options): Add -Bgroup.
4592 * options.cc (General_options::finalize): If -Bgroup is set,
4593 default to --unresolved-symbols=report-all.
4594 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4595 * target-reloc.h (issue_undefined_symbol_error): Handle
4596 --unresolved-symbols=report-all.
4597
6daf5215
ILT
45982011-07-08 Ian Lance Taylor <iant@google.com>
4599
4600 PR gold/11985
4601 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4602 if linker script discards key sections.
4603 (Layout::create_dynamic_symtab): Likewise.
4604 (Layout::assign_local_dynsym_offsets): Likewise.
4605 (Layout::sized_create_version_sections): Likewise.
4606 (Layout::create_interp): Likewise.
4607 (Layout::finish_dynamic_section): Likewise.
4608 (Layout::set_dynamic_symbol_size): Likewise.
4609
beabb2c6
ILT
46102011-07-08 Ian Lance Taylor <iant@google.com>
4611
4612 PR gold/12386
4613 * options.h (class General_options): Add --unresolved-symbols.
4614 * target-reloc.h (issue_undefined_symbol_error): Check
4615 --unresolved-symbols. Add comments.
4616
9c16daf1
ILT
46172011-07-08 Ian Lance Taylor <iant@google.com>
4618
4619 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4620 expression more complex.
4621
191f1a2d
ILT
46222011-07-08 Ian Lance Taylor <iant@google.com>
4623
4624 PR gold/11317
4625 * target-reloc.h (issue_undefined_symbol_error): New inline
4626 function, broken out of relocate_section.
4627 (relocate_section): Call issue_undefined_symbol_error.
4628 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4629 there is no TLS segment if we are about to issue an undefined
4630 symbol error.
4631 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4632
62855347
ILT
46332011-07-08 Ian Lance Taylor <iant@google.com>
4634
4635 PR gold/12279
4636 * resolve.cc (Symbol_table::should_override): Add fromtype
4637 parameter. Change all callers. Give error when linking together
4638 TLS and non-TLS symbol.
4639 (Symbol_table::should_override_with_special): Add fromtype
4640 parameter. Change all callers.
4641 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4642 there is no TLS segment if we have reported some errors.
4643 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4644
67181c72
ILT
46452011-07-08 Ian Lance Taylor <iant@google.com>
4646
4647 PR gold/12372
4648 * target.h (Target::plt_address_for_global): New function.
4649 (Target::plt_address_for_local): New function.
4650 (Target::plt_section_for_global): Remove.
4651 (Target::plt_section_for_local): Remove.
4652 (Target::do_plt_address_for_global): New virtual function.
4653 (Target::do_plt_address_for_local): New virtual function.
4654 (Target::do_plt_section_for_global): Remove.
4655 (Target::do_plt_section_for_local): Remove.
4656 (Target::register_global_plt_entry): Add Symbol_table and Layout
4657 parameters.
4658 * output.cc (Output_data_got::Got_entry::write): Use
4659 plt_address_for_global and plt_address_for_local.
4660 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4661 address of output section.
4662 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4663 got_irelative_, and irelative_count_ fields. Update
4664 declarations.
4665 (Output_data_plt_i386::has_irelative_section): New function.
4666 (Output_data_plt_i386::entry_count): Add irelative_count_.
4667 (Output_data_plt_i386::set_final_data_size): Likewise.
4668 (class Target_i386): Add got_irelative_ and rel_irelative_
4669 fields. Update declarations.
4670 (Target_i386::Target_i386): Initialize new fields.
4671 (Target_i386::do_plt_address_for_global): New function replacing
4672 do_plt_section_for_global.
4673 (Target_i386::do_plt_address_for_local): New function replacing
4674 do_plt_section_for_local.
4675 (Target_i386::got_section): Create got_irelative_.
4676 (Target_i386::rel_irelative_section): New function.
4677 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4678 fields. Don't define __rel_iplt_{start,end}.
4679 (Output_data_plt_i386::add_entry): Add symtab and layout
4680 parameters. Change all callers. Use different PLT and GOT for
4681 IFUNC symbols.
4682 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4683 layout parameters. Change all callers. Use different PLT and
4684 GOT.
4685 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4686 (Output_data_plt_i386::rel_irelative): New function.
4687 (Output_data_plt_i386::address_for_global): New function.
4688 (Output_data_plt_i386::address_for_local): New function.
4689 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4690 IRELATIVE GOT when changing IFUNC GOT entries.
4691 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4692 reloc.
4693 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4694 if we didn't create an IRELATIVE GOT.
4695 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4696 plt_address_for_local.
4697 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4698 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4699 got_irelative_, and irelative_count_ fields. Update
4700 declarations.
4701 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4702 Initialize new fields. Remove symtab parameter. Change all
4703 callers.
4704 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4705 irelative_count_.
4706 (Output_data_plt_x86_64::has_irelative_section): New function.
4707 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4708 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4709 fields. Update declarations.
4710 (Target_x86_64::Target_x86_64): Initialize new fields.
4711 (Target_x86_64::do_plt_address_for_global): New function replacing
4712 do_plt_section_for_global.
4713 (Target_x86_64::do_plt_address_for_local): New function replacing
4714 do_plt_section_for_local.
4715 (Target_x86_64::got_section): Create got_irelative_.
4716 (Target_x86_64::rela_irelative_section): New function.
4717 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4718 all callers. Don't create __rel_iplt_{start,end}.
4719 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4720 parameters. Change all callers. Use different PLT and GOT for
4721 IFUNC symbols.
4722 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4723 layout parameters. Change all callers. Use different PLT and
4724 GOT.
4725 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4726 parameters. Change all callers. Use different PLT and GOT for
4727 IFUNC symbols.
4728 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4729 (Output_data_plt_x86_64::rela_irelative): New function.
4730 (Output_data_plt_x86_64::address_for_global): New function.
4731 (Output_data_plt_x86_64::address_for_local): New function.
4732 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4733 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4734 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4735 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4736 parameters.
4737 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4738 reloc.
4739 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4740 symbols if we didn't create an IRELATIVE GOT.
4741 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4742 plt_address_for_local.
4743 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4744 * testsuite/ifuncvar1.c: New test file.
4745 * testsuite/ifuncvar2.c: New test file.
4746 * testsuite/ifuncvar3.c: New test file.
4747 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4748 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4749 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4750 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4751 * testsuite/Makefile.in: Rebuild.
4752
33c15b45
CC
47532011-07-07 Cary Coutant <ccoutant@google.com>
4754
4755 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4756 (two_file_test_1_ndebug.o): Likewise.
4757 (two_file_test_1b_ndebug.o): Likewise.
4758 (two_file_test_2_ndebug.o): Likewise.
4759 (two_file_test_main_ndebug.o): Likewise.
4760 (incremental_test_2): Link with no-debug versions.
4761
f48b5fb7
CC
47622011-07-06 Cary Coutant <ccoutant@google.com>
4763
4764 * gold/incremental.cc
4765 (Output_section_incremental_inputs::write_info_blocks): Check for
4766 hidden and internal symbols.
4767
221597a5
CC
47682011-07-06 Cary Coutant <ccoutant@google.com>
4769
4770 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4771 Check disposition for startup file.
4772 (Incremental_inputs::report_command_line): Ignore
4773 --incremental-startup-unchanged option.
4774 * options.cc (General_options::parse_incremental_startup_unchanged):
4775 New function.
4776 (General_options::General_options): Initialize new data member.
4777 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4778 (General_options): Add --incremental-startup-unchanged option.
4779 (General_options::incremental_startup_disposition): New function.
4780 (General_options::incremental_startup_disposition_): New data member.
4781
e24719f6
CC
47822011-07-06 Cary Coutant <ccoutant@google.com>
4783
4784 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4785 input file index to Script_info ctor.
4786 (Sized_incremental_binary::do_file_has_changed): Find the
4787 command-line argument for files named in scripts.
4788 * incremental.h (Script_info::Script_info): New ctor
4789 with input file index.
4790 (Script_info::input_file_index): New function.
4791 (Script_info::input_file_index_): New data member.
4792 (Incremental_binary::get_library): Add const.
4793 (Incremental_binary::get_script_info): Add const.
4794 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4795 * testsuite/Makefile.am (incremental_test_5): New test case.
4796 (incremental_test_6): New test case.
4797 * testsuite/Makefile.in: Regenerate.
4798
8f7c81e8
CC
47992011-07-06 Cary Coutant <ccoutant@google.com>
4800
4801 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4802 debug output when command lines differ.
4803
9fbd3822
CC
48042011-07-06 Cary Coutant <ccoutant@google.com>
4805
4806 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4807 --incremental-patch option.
4808 * layout.cc (Free_list::allocate): Extend allocation beyond original
4809 end if enabled.
4810 (Layout::make_output_section): Mark sections that should get
4811 patch space.
4812 * options.cc (parse_percent): New function.
4813 * options.h (parse_percent): New function.
4814 (DEFINE_percent): New macro.
4815 (General_options): Add --incremental-patch option.
4816 * output.cc (Output_section::Output_section): Initialize new data
4817 members.
4818 (Output_section::add_input_section): Print section name when out
4819 of patch space.
4820 (Output_section::add_output_section_data): Likewise.
4821 (Output_section::set_final_data_size): Add patch space when
4822 doing --incremental-full.
4823 (Output_section::do_reset_address_and_file_offset): Remove patch
4824 space.
4825 (Output_segment::set_section_list_addresses): Print debug output
4826 only if --incremental-update.
4827 * output.h (Output_section::set_is_patch_space_allowed): New function.
4828 (Output_section::is_patch_space_allowed_): New data member.
4829 (Output_section::patch_space_): New data member.
4830 * parameters.cc (Parameters::incremental_full): New function.
4831 * parameters.h (Parameters::incremental_full): New function
4832 * testsuite/Makefile.am (incremental_test_2): Add test for
4833 --incremental-patch option.
4834 * testsuite/Makefile.in: Regenerate.
4835 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4836 (t18): Remove function body.
4837
f6cccc2c
DK
48382011-07-05 Doug Kwan <dougkwan@google.com>
4839
4840 PR gold/12771
4841 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4842 Arm_Address type for relocation result.
4843 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4844 overflow check.
4845 (Arm_relocate_functions::abs32): Use unaligned access.
4846 (Arm_relocate_functions::rel32): Ditto.
4847 (Arm_relocate_functions::prel31): Ditto.
4848 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4849 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4850 static data relocations.
4851 * testsuite/Makefile.in: Regnerate.
4852 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4853
28a13fec
ILT
48542011-07-05 Ian Lance Taylor <iant@google.com>
4855
4856 PR gold/12392
4857 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4858 symbols if necessary.
4859 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4860
24d47b34
ILT
48612011-07-05 Ian Lance Taylor <iant@google.com>
4862
4863 PR gold/12952
4864 * resolve.cc (Symbol::override_base_with_special): Simply override
4865 version with special symbol version, ignoring previous version.
4866
41f9cbbe
ILT
48672011-07-05 Ian Lance Taylor <iant@google.com>
4868
4869 * object.cc (Sized_relobj_file::include_section_group): Add
4870 information to comment about signature location.
4871
886288f1
ILT
48722011-07-02 Ian Lance Taylor <iant@google.com>
4873
4874 PR gold/12957
4875 * options.h (class General_options): Add -f and -F.
4876 * options.cc (General_options::finalize): Fatal error if -f/-F
4877 are used without -shared.
4878 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4879
ae3a6d4f
ILT
48802011-07-02 Ian Lance Taylor <iant@google.com>
4881
4882 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4883
21131061
ILT
48842011-07-01 Ian Lance Taylor <iant@google.com>
4885
4886 PR gold/12525
4887 PR gold/12952
4888 * resolve.cc (Symbol::override_base_with_special): Don't override
4889 the version if the overriding symbol has a different name.
4890 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4891 all callers. If we give an error about an undefined version,
4892 define the base version if necessary.
4893 * dynobj.h (class Versions): Update declaration.
4894 * testsuite/weak_alias_test_5.cc: New file.
4895 * testsuite/weak_alias_test.script: New file.
4896 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4897 and versioned_alias have the right value, and call t2.
4898 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4899 weak_alias_test_5.so.
4900 (weak_alias_test_LDADD): Likewise.
4901 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4902 * testsuite/Makefile.in: Rebuild.
4903
611062c0
ILT
49042011-07-01 Ian Lance Taylor <iant@google.com>
4905
4906 PR gold/12525
4907 * options.h (class General_options): Support -z notext.
4908 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4909 -Wl,-z,notext.
4910 (two_file_shared_nonpic.so): Likewise.
4911 (two_file_shared_mixed.so): Likewise.
4912 (two_file_shared_mixed_1.so): Likewise.
4913 (weak_undef_lib_nonpic.so): Likewise.
4914 (alt/weak_undef_lib_nonpic.so): Likewise.
4915 (tls_test_shared_nonpic.so): Likewise.
4916 * testsuite/Makefile.in: Rebuild.
4917
328c7c2f
ILT
49182011-07-01 Ian Lance Taylor <iant@google.com>
4919
4920 PR gold/12525
4921 * configure.ac: Test whether static linking works, setting
4922 the automake conditional HAVE_STATIC.
4923 * testsuite/Makefile.am: Disable tests using -static if
4924 HAVE_STATIC is not true.
4925 * configure, testsuite/Makefile.in: Rebuild.
4926
02d7cd44
ILT
49272011-07-01 Ian Lance Taylor <iant@google.com>
4928
4929 PR gold/12525
4930 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4931 Assert if we see DW_EH_PE_indirect.
4932 * target.h (Target::ehframe_datarel_base): New function.
4933 (Target::do_ehframe_datarel_base): New target function.
4934 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4935 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4936 function.
4937
07a60597
ILT
49382011-07-01 Ian Lance Taylor <iant@google.com>
4939
4940 PR gold/12571
4941 * options.h (class General_options): Add
4942 --ld-generated-unwind-info.
4943 * ehframe.cc (Fde::write): Add address parameter. Change all
4944 callers. If associated with PLT, fill in address and size.
4945 (Cie::set_output_offset): Only add merge mapping if there is an
4946 object.
4947 (Cie::write): Add address parameter. Change all callers.
4948 (Eh_frame::add_ehframe_for_plt): New function.
4949 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4950 input_offset_ fields into union u_, with new plt field.
4951 (Fde::Fde): Adjust for new union field.
4952 (Fde::Fde) [Output_data version]: New constructor.
4953 (Fde::add_mapping): Only add merge mapping if there is an object.
4954 (class Cie): Update declarations.
4955 (class Eh_frame): Declare add_ehframe_for_plt.
4956 * layout.cc (Layout::layout_eh_frame): Break out code into
4957 make_eh_frame_section, and call it.
4958 (Layout::make_eh_frame_section): New function.
4959 (Layout::add_eh_frame_for_plt): New function.
4960 * layout.h (class Layout): Update declarations.
4961 * merge.cc (Merge_map::add_mapping): Add assertion.
4962 * i386.cc: Include "dwarf.h".
4963 (class Output_data_plt_i386): Make first_plt_entry,
4964 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4965 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4966 and plt_eh_frame_fde.
4967 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4968 boundary. Call add_eh_frame_for_plt if appropriate.
4969 * x86_64.cc: Include "dwarf.h".
4970 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4971 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4972 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4973 and plt_eh_frame_fde.
4974 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4975 appropriate.
4976
14788a3f
ILT
49772011-06-29 Ian Lance Taylor <iant@google.com>
4978
4979 PR gold/12629
4980 * object.cc (Sized_relobj_file::layout_section): Change shdr
4981 parameter to be const.
4982 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4983 out of do_layout.
4984 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4985 appropriate. Call layout_eh_frame_section.
4986 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4987 sections.
4988 * object.h (class Sized_relobj_file): Update declarations.
4989
6c21fce1
ILT
49902011-06-29 Ian Lance Taylor <iant@google.com>
4991
37e41b03 4992 PR gold/12652
6c21fce1
ILT
4993 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4994 modifier.
4995 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4996
4d5e4e62
ILT
49972011-06-29 Ian Lance Taylor <iant@google.com>
4998
4999 PR gold/12675
5000 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
5001 SHT_X86_64_UNWIND.
5002 * layout.cc (Layout::layout_eh_frame): Likewise.
5003
886f533a
ILT
50042011-06-29 Ian Lance Taylor <iant@google.com>
5005
5006 PR gold/12695
5007 * layout.cc (Layout::symtab_section_shndx): New function.
5008 * layout.h (class Layout): Declare symtab_section_shndx.
5009 * output.cc (Output_section::write_header): Call it.
5010
f3ae1b28
ILT
50112011-06-29 Ian Lance Taylor <iant@google.com>
5012
5013 PR gold/12818
5014 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5015 symbols which are not used in a relocation.
5016
aecf301f
ILT
50172011-06-28 Ian Lance Taylor <iant@google.com>
5018
5019 PR gold/12898
5020 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5021 script create indistinguishable segments.
5022 (Layout::set_segment_offsets): Use stable_sort when sorting
5023 segments. Pass this to Compare_segments constructor.
5024 * layout.h (class Layout): Make segment_precedes non-static.
5025 (class Compare_segments): Change from struct to class. Add
5026 layout_ field. Add constructor.
5027 * script-sections.cc
5028 (Script_sections::attach_sections_using_phdrs_clause): Rename
5029 local orphan to is_orphan. Don't report failure to put empty
5030 section in segment. On attachment failure, report name of
5031 section, and attach to first PT_LOAD segment.
5032
03ef7571
ILT
50332011-06-28 Ian Lance Taylor <iant@google.com>
5034
5035 PR gold/12934
5036 * target-select.cc (Target_selector::Target_selector): Add
5037 emulation parameter. Change all callers.
5038 (select_target_by_bfd_name): Rename from select_target_by_name.
5039 Change all callers.
5040 (select_target_by_emulation): New function.
5041 (supported_emulation_names): New function.
5042 * target-select.h (class Target_selector): Add emulation_ field.
5043 Update declarations.
5044 (Target_selector::recognize_by_bfd_name): Rename from
5045 recognize_by_name. Change all callers.
5046 (Target_selector::supported_bfd_names): Rename from
5047 supported_names. Change all callers.
5048 (Target_selector::recognize_by_emulation): New function.
5049 (Target_selector::supported_emulations): New function.
5050 (Target_selector::emulation): New function.
5051 (Target_selector::do_recognize_by_bfd_name): Rename from
5052 do_recognize_by_name. Change all callers.
5053 (Target_selector::do_supported_bfd_names): Rename from
5054 do_supported_names. Change all callers.
5055 (Target_selector::do_recognize_by_emulation): New function.
5056 (Target_selector::do_supported_emulations): New function.
5057 (select_target_by_bfd_name): Change name in declaration.
5058 (select_target_by_emulation): Declare.
5059 (supported_emulation_names): Declare.
5060 * parameters.cc (parameters_force_valid_target): Try to find
5061 target based on emulation from -m option.
5062 * options.h (class General_options): Change doc string for -m.
5063 * options.cc (help): Print emulations.
5064 (General_options::parse_V): Likewise.
5065 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5066 Add emulation parameter. Change all callers.
5067
200b2bb9
ILT
50682011-06-28 Ian Lance Taylor <iant@google.com>
5069
5070 * target.h (class Target): Add osabi_ field.
5071 (Target::osabi): New function.
5072 (Target::set_osabi): New function.
5073 (Target::Target): Initialize osabi_.
5074 (Target::do_adjust_elf_header): Make pure virtual.
5075 (Sized_target::do_adjust_elf_header): Declare.
5076 * target.cc (Sized_target::do_adjust_elf_header): New function.
5077 (class Sized_target): Instantiate all versions.
5078 * freebsd.h (class Target_freebsd): Remove.
5079 (Target_selector_freebsd::do_recognize): Call set_osabi on
5080 Target.
5081 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5082 (Target_selector_freebsd::set_osabi): Remove.
5083 * i386.cc (class Target_i386): Inherit from Sized_target rather
5084 than Target_freebsd.
5085 * x86_64.cc (class Target_x86_64): Likewise.
5086
b3ce541e
ILT
50872011-06-28 Ian Lance Taylor <iant@google.com>
5088
5089 * target.h (Target::can_check_for_function_pointers): Rewrite.
5090 Make non-virtual.
5091 (Target::can_icf_inline_merge_sections): Likewise.
5092 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5093 (Target::Target_info): Add can_icf_inline_merge_sections field.
5094 (Target::do_can_check_for_function_pointers): New virtual
5095 function.
5096 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5097 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5098 from can_check_for_function_pointers, move in file.
5099 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5100 section_may_have_icf_unsafe_poineters, move in file.
5101 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5102 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5103 Rename from can_check_for_function_pointers, move in file.
5104 (Target_i386::can_icf_inline_merge_sections): Remove.
5105 (Target_i386::i386_info): Initialize
5106 can_icf_inline_merge_sections.
5107 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5108 Initialize can_icf_inline_merge_sections.
5109 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5110 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5111 Rename from can_check_for_function_pointers, move in file.
5112 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5113 (Target_x86_64::x86_64_info): Initialize
5114 can_icf_inline_merge_sections.
5115 * testsuite/testfile.cc (Target_test::test_target_info):
5116 Likewise.
5117 * icf.cc (get_section_contents): Correct formatting.
5118
6d1c4efb
ILT
51192011-06-27 Ian Lance Taylor <iant@google.com>
5120
5121 * symtab.cc (Symbol::versioned_name): New function.
5122 (Symbol_table::add_to_final_symtab): Use versioned_name when
5123 appropriate.
5124 (Symbol_table::sized_write_symbol): Likewise.
5125 * symtab.h (class Symbol): Declare versioned_name.
5126 * stringpool.h (class Stringpool_template): Add variant of add
5127 which takes a std::basic_string.
5128 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5129 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5130 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5131 (ver_test_12.o): New target.
5132 * testsuite/Makefile.in: Rebuild.
5133
57eb9b50
DK
51342011-06-27 Doug Kwan <dougkwan@google.com>
5135
5136 * arm.cc (Arm_relocate_functions::thm_jump8,
5137 Arm_relocate_functions::thm_jump11): Use a wider signed
5138 type to compute offset.
5139 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5140 arm_thm_jump8.
5141 * testsuite/Makefile.in: Regenerate.
5142 * testsuite/arm_branch_in_range.sh: Check test results of
5143 arm_thm_jump11 and arm_thm_jump8.
5144 * testsuite/arm_thm_jump11.s: New test source file.
5145 * testsuite/arm_thm_jump11.t: New linker script.
5146 * testsuite/arm_thm_jump8.s: New test source file.
5147 * testsuite/arm_thm_jump8.t: New linker script.
5148
487b39df
ILT
51492011-06-24 Ian Lance Taylor <iant@google.com>
5150
5151 * layout.cc: Include "object.h".
5152 (ctors_sections_in_init_array): New static variable.
5153 (Layout::is_ctors_in_init_array): New function.
5154 (Layout::layout): Add entry to ctors_sections_in_init_array if
5155 appropriate.
5156 * layout.h (class Layout): Declare is_ctors_in_init_array.
5157 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5158 is_ctors_reverse_view is set.
5159 (Sized_relobj_file::write_sections): Add layout parameter. Change
5160 all callers. Set is_ctors_reverse_view field of View_size.
5161 (Sized_relobj_file::reverse_words): New function.
5162 * object.h (Sized_relobj_file::View_size): Add
5163 is_ctors_reverse_view field.
5164 (class Sized_relobj_file): Update declarations.
5165 * testsuite/initpri3.c: New test.
5166 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5167 initpri3b.
5168 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5169 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5170 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5171 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5172 * testsuite/Makefile.in: Rebuild.
5173
472076e4
CC
51742011-06-24 Cary Coutant <ccoutant@google.com>
5175
5176 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5177 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5178 (debug_msg_cdebug.err): New targets.
5179 * testsuite/Makefile.in: Regenerate.
5180 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5181 Fix checks for link with shared library.
5182
a60af0db
DK
51832011-06-24 Doug Kwan <dougkwan@google.com>
5184
5185 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5186 skip empty text sections.
5187 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5188
5393d741
ILT
51892011-06-22 Ian Lance Taylor <iant@google.com>
5190
5191 PR gold/12910
5192 * options.h (class General_options): Add --ctors-in-init-array.
5193 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5194 friends as SHT_PROGBITS for merging sections.
5195 (Layout::layout): Remove special handling of .init_array and
5196 friends. Don't sort if doing relocatable link. Sort for .ctors
5197 and .dtors if ctors_in_init_array.
5198 (Layout::make_output_section): Force correct section types for
5199 .init_array and friends. Don't sort if doing relocatable link,
5200 Don't sort .ctors and .dtors if ctors_in_init_array.
5201 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5202 (Layout::output_section_name): Add relobj parameter. Change all
5203 callers. Handle .ctors. and .dtors. in code rather than table.
5204 Handle .ctors and .dtors if ctors_in_init_array.
5205 (Layout::match_file_name): New function, moved from output.cc.
5206 * layout.h (class Layout): Update declarations.
5207 * output.cc: Include "layout.h".
5208 (Input_section_sort_entry::get_priority): New function.
5209 (Input_section_sort_entry::match_file_name): Just call
5210 Layout::match_file_name.
5211 (Output_section::Input_section_sort_init_fini_compare::operator()):
5212 Handle .ctors and .dtors. Sort by explicit priority rather than
5213 by name.
5214 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5215 * testsuite/initpri2.c: New test.
5216 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5217 (check_PROGRAMS): Add initpri2.
5218 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5219 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5220 * configure, testsuite/Makefile.in: Rebuild.
5221
e1f74f98
ILT
52222011-06-19 Ian Lance Taylor <iant@google.com>
5223
5224 PR gold/12880
5225 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5226 .interp section to a PT_INTERP segment even if we have seen a
5227 --dynamic-linker option. Don't do it if we have seen a PHDRS
5228 clause in a linker script.
5229 (Layout::finalize): Don't create a .interp section if we've
5230 already create a PT_INTERP segment.
5231 (Layout::create_interp): Always call choose_output_section (revert
5232 patch of 2011-06-17). Don't create PT_INTERP segment.
5233 * script-sections.cc
5234 (Script_sections::create_note_and_tls_segments): Add a .interp
5235 section to a PT_INTERP segment even if we have seen a
5236 --dynamic-linker option.
5237
766f91bb
ILT
52382011-06-18 Ian Lance Taylor <iant@google.com>
5239
5240 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5241 merely because a non-PT_LOAD segment has a dynamic reloc.
5242
0d212c3a
ILT
52432011-06-18 Ian Lance Taylor <iant@google.com>
5244
5245 * layout.cc (Layout::finish_dynamic_section): Don't create
5246 DT_FLAGS entry if not needed.
5247
911a5072
ILT
52482011-06-18 Ian Lance Taylor <iant@google.com>
5249
5250 PR gold/12745
5251 * layout.cc (Layout::layout_eh_frame): Correct handling of
5252 writable .eh_frame section.
5253
534b4e5f
ILT
52542011-06-17 Ian Lance Taylor <iant@google.com>
5255
5256 PR gold/12893
5257 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5258 symbol is redefined with the exact same object and value.
5259
10b4f102
ILT
52602011-06-17 Ian Lance Taylor <iant@google.com>
5261
5262 PR gold/12880
5263 * layout.h (class Layout): Add interp_segment_ field.
5264 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5265 (Layout::attach_allocated_section_to_segment): If making shared
5266 library, put .interp section in PT_INTERP segment.
5267 (Layout::finalize): Also call create_interp if -dynamic-linker
5268 option was used.
5269 (Layout::create_interp): Assert that there is no PT_INTERP
5270 segment. If not using a SECTIONS clause, use make_output_section.
5271 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5272 * script-sections.cc
5273 (Script_sections::create_note_and_tls_segments): If making shared
5274 library, put .interp section in PT_INTERP segment.
5275
a29b0dad
ILT
52762011-06-17 Ian Lance Taylor <iant@google.com>
5277
e588ea8d
ILT
5278 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5279 when making a shared library.
5280
52812011-06-17 Ian Lance Taylor <iant@google.com>
5282
5283 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5284 parameter. Change all callers. Don't issue warning about PC32
5285 against locally defined symbol.
a29b0dad 5286
9d3b0698
ILT
52872011-06-16 Ian Lance Taylor <iant@google.com>
5288
5289 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5290 occurs in same object.
5291
85b0f90c
AM
52922011-06-14 Alan Modra <amodra@gmail.com>
5293
5294 * po/POTFILES.in: Regenerate.
5295
a94907d9
ILT
52962011-06-09 Ian Lance Taylor <iant@google.com>
5297
5298 * script-sections.cc
5299 (Orphan_output_section::set_section_addresses): For a relocatable
5300 link set address to 0.
5301
4fb3a1c3
CC
53022011-06-09 Cary Coutant <ccoutant@google.com>
5303
5304 PR gold/12804
5305 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5306 used with --compress-debug-sections.
5307 * gold/object.cc (Sized_relobj_file::do_layout): Report
5308 uncompressed size of compressed input sections.
5309
61220854
CC
53102011-06-08 Cary Coutant <ccoutant@google.com>
5311
5312 PR gold/12804
5313 * testsuite/two_file_test_2_v1.cc: Change initialization of
5314 v2 to keep it in .data.
5315
e6455dfb
CC
53162011-06-07 Cary Coutant <ccoutant@google.com>
5317
5318 * common.cc (Symbol_table::do_allocate_commons_list): Call
5319 gold_fallback.
5320 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5321 (Errors::fallback): New function.
5322 (gold_fallback): New function.
5323 * errors.h (Errors::fallback): New function.
5324 * gold.cc (gold_exit): Change status parameter to enum; adjust
5325 all callers.
5326 (queue_initial_tasks): Call gold_fallback.
5327 * gold.h: Include cstdlib.
5328 (Exit_status): New enum type.
5329 (gold_exit): Change status parameter to enum.
5330 (gold_fallback): New function.
5331 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5332 (Layout::create_symtab_sections): Likewise.
5333 (Layout::create_shdrs): Likewise.
5334 * main.cc (main): Adjust call to gold_exit.
5335 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5336 (Output_data_got::add_got_entry_pair): Likewise.
5337 (Output_section::add_input_section): Likewise.
5338 (Output_section::add_output_section_data): Likewise.
5339 (Output_segment::set_section_list_addresses): Likewise.
5340 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5341
fb0e076f
CC
53422011-06-07 Cary Coutant <ccoutant@google.com>
5343
5344 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5345 for incremental links.
5346 * output.cc (Output_segment::set_section_list_addresses): Remove
5347 FIXME and test for TLS or BSS.
5348
a5ee4d5d
CC
53492011-06-07 Cary Coutant <ccoutant@google.com>
5350
5351 * testsuite/Makefile.am: Add incremental_copy_test,
5352 incremental_common_test_1.
5353 * testsuite/Makefile.in: Regenerate.
5354 * testsuite/common_test_1_v1.c: New source file.
5355 * testsuite/common_test_1_v2.c: New source file.
5356 * testsuite/copy_test_v1.cc: New source file.
5357
5146f448
CC
53582011-06-07 Cary Coutant <ccoutant@google.com>
5359
5360 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5361 update, allocate common from bss section's free list.
5362 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5363 linker-defined symbols.
5364 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5365 Skip GOT and PLT entries that are no longer referenced.
5366 (Output_section_incremental_inputs::write_info_blocks): Mark
5367 linker-defined symbols.
5368 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5369 * output.cc (Output_section::allocate): New function.
5370 * output.h (Output_section::allocate): New function.
5371 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5372 linker-defined symbols.
5373 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5374 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5375 (Symbol::init_base_output_data): Likewise.
5376 (Symbol::init_base_output_segment): Likewise.
5377 (Symbol::init_base_constant): Likewise.
5378 (Sized_symbol::init_output_data): Likewise.
5379 (Sized_symbol::init_output_segment): Likewise.
5380 (Sized_symbol::init_constant): Likewise.
5381 (Symbol_table::do_define_in_output_data): Likewise.
5382 (Symbol_table::do_define_in_output_segment): Likewise.
5383 (Symbol_table::do_define_as_constant): Likewise.
5384 * symtab.h (Symbol::is_predefined): New function.
5385 (Symbol::init_base_output_data): Add is_predefined parameter.
5386 (Symbol::init_base_output_segment): Likewise.
5387 (Symbol::init_base_constant): Likewise.
5388 (Symbol::is_predefined_): New data member.
5389 (Sized_symbol::init_output_data): Add is_predefined parameter.
5390 (Sized_symbol::init_output_segment): Likewise.
5391 (Sized_symbol::init_constant): Likewise.
5392 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5393
26d3c67d
CC
53942011-06-07 Cary Coutant <ccoutant@google.com>
5395
5396 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5397 instead of emit_copy_reloc.
5398 (Copy_relocs::emit_copy_reloc): Refactor.
5399 (Copy_relocs::make_copy_reloc): New function.
5400 (Copy_relocs::add_copy_reloc): Remove.
5401 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5402 section.
5403 (Copy_relocs::make_copy_reloc): New function.
5404 (Copy_relocs::add_copy_reloc): Remove.
5405 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5406 unchanged input files.
5407 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5408 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5409 Reserve BSS space for COPY relocations.
5410 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5411 (Output_section_incremental_inputs::write_info_blocks): Record
5412 whether a symbol is copied from a shared object.
5413 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5414 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5415 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5416 (Incremental_input_entry_reader::get_output_symbol_index): Add
5417 is_copy parameter.
5418 (Incremental_binary::emit_copy_relocs): New function.
5419 (Incremental_binary::do_emit_copy_relocs): New function.
5420 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5421 new data member.
5422 (Sized_incremental_binary::add_copy_reloc): New function.
5423 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5424 (Sized_incremental_binary::Copy_reloc): New struct.
5425 (Sized_incremental_binary::Copy_relocs): New typedef.
5426 (Sized_incremental_binary::copy_relocs_): New data member.
5427 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5428 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5429 * target.h (Sized_target::emit_copy_reloc): New function.
5430 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5431
7cdb37d9
CC
54322011-06-02 Cary Coutant <ccoutant@google.com>
5433
5434 PR gold/12163
5435 * gold/archive.cc (Archive::Archive): Initialize new data member.
5436 (Archive::include_all_members): Return if archive has already been
5437 included.
5438 * gold/archive.h (Archive::include_all_members_): New data member.
5439
cc643b88
NC
54402011-06-02 Nick Clifton <nickc@redhat.com>
5441
5442 * dynobj.h: Fix spelling mistake in comment.
5443 * output.cc: Likewise.
5444
f62a3ca7 54452011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5446 Asier Llano
f62a3ca7
DK
5447
5448 PR gold/12826
cc643b88 5449 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5450 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5451 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5452 redundant arm_exidx_test.so.
5453 * testsuite/Makefile.in: Regenerate.
5454 (check_SCRIPTS): Add pr12826.sh
5455 (check_DATA): Add pr12826.stdout
5456 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5457 * testsuite/pr12826.sh: New file.
5458 * testsuite/pr12826_1.s: Ditto.
5459 * testsuite/pr12826_1.s: Ditto.
5460
8dbe1edc
ILT
54612011-05-30 Ian Lance Taylor <iant@google.com>
5462
5463 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5464 sections.
5465
c49875be
ILT
54662011-05-29 Ian Lance Taylor <iant@google.com>
5467
5468 PR gold/12804
5469 * testsuite/Makefile.am: Use different file name for two_file_test
5470 temporary file for each incremental test.
5471 * testsuite/Makefile.in: Rebuild.
5472
69d53f7a
ILT
54732011-05-29 Ian Lance Taylor <iant@google.com>
5474
5475 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5476 binary input file is empty.
5477
41d0ab5f
ILT
54782011-05-27 Ian Lance Taylor <iant@google.com>
5479
5480 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5481 (ver_test_9.so): Likewise.
5482 * testsuite/Makefile.in: Rebuild.
5483
89d8a36b
CC
54842011-05-26 Cary Coutant <ccoutant@google.com>
5485
5486 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5487 * incremental.cc (Incremental_inputs::report_input_section): Fix
5488 comment, indentation.
5489 (Incremental_inputs::report_comdat_group): New function.
5490 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5491 of data for incremental input file entry.
5492 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5493 group count, COMDAT group signatures.
5494 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5495 an unchanged input file.
5496 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5497 Initialize new data member.
5498 (Incremental_object_entry::add_comdat_group): New function.
5499 (Incremental_object_entry::get_comdat_group_count): New function.
5500 (Incremental_object_entry::get_comdat_signature_key): New function.
5501 (Incremental_object_entry::groups_): New data member.
5502 (Incremental_inputs::report_comdat_group): New function.
5503 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5504 data for incremental input file entry.
5505 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5506 (Incremental_input_entry_reader::get_input_section): Adjust size of
5507 data for incremental input file entry.
5508 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5509 (Incremental_input_entry_reader::get_comdat_group_signature): New
5510 function.
5511 * object.cc (Sized_relobj::include_section_group): Report kept
5512 COMDAT groups for incremental links.
5513
1706a06f
ILT
55142011-05-24 David Meyer <pdox@google.com>
5515
5516 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5517 with name parameter. Add found_name parameter.
5518 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5519 * dirsearch.h (class Dirsearch): Update declaration.
5520
a10ae760
ILT
55212011-05-24 Ian Lance Taylor <iant@google.com>
5522
5523 * archive.cc (Library_base::should_include_member): Pull in object
5524 from archive if it defines the entry symbol.
5525 * parameters.cc (Parameters::entry): New function.
5526 * parameters.h (class Parameters): Declare entry.
5527 * output.h (class Output_file_header): Remove entry_ field.
5528 * output.cc (Output_file_header::Output_file_header): Remove entry
5529 parameter. Change all callers.
5530 (Output_file_header::entry): Use parameters->entry.
5531 * gold.cc (queue_middle_tasks): Likewise.
5532 * plugin.cc (Plugin_hook::run): Likewise.
5533
aa92d6ed
CC
55342011-05-24 Cary Coutant <ccoutant@google.com>
5535
5536 * gold.cc (queue_initial_tasks): Pass incremental base filename
5537 to Output_file::open_base_file; don't print error message.
5538 * incremental-dump.cc (main): Adjust call to
5539 Output_file::open_for_modification.
5540 * incremental-dump.cc (main): Likewise.
5541 * incremental.cc (Incremental_inputs::report_command_line):
5542 Ignore --incremental-base option when comparing command lines.
5543 Ignore parameter when given as separate argument.
5544 * options.h (class General_options): Add --incremental-base.
5545 * output.cc (Output_file::Output_file):
5546 (Output_file::open_base_file): Add base_name and writable parameters;
5547 read base file into new file; print error message here.
5548 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5549 callers.
5550 * output.h (Output_file::open_for_modification): Rename to...
5551 (Output_file::open_base_file): ...this; add base_name and
5552 writable parameters; adjust all callers.
5553 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5554 callers.
5555 * testsuite/Makefile.am (incremental_test_4): Test
5556 --incremental-base.
5557 * testsuite/Makefile.in: Regenerate.
5558
2eedd706
CC
55592011-05-24 Cary Coutant <ccoutant@google.com>
5560
5561 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5562 incremental_test_4.
5563 * testsuite/Makefile.in: Regenerate.
5564 * testsuite/two_file_test_1_v1.cc: New test source file.
5565 * testsuite/two_file_test_1b_v1.cc: New test source file.
5566 * testsuite/two_file_test_2_v1.cc: New test source file.
5567
0f1c85a6
CC
55682011-05-24 Cary Coutant <ccoutant@google.com>
5569
5570 * dynobj.h (Dynobj::do_dynobj): New function.
5571 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5572 flag and soname for shared objects.
5573 * incremental.cc (Incremental_inputs::report_object): Make
5574 either Incremental_object_entry or Incremental_dynobj_entry; add
5575 soname to string table.
5576 (Incremental_inputs::report_input_section): Add assertion.
5577 (Output_section_incremental_inputs::set_final_data_size): Adjust
5578 type of input file entry for shared libraries; adjust size of
5579 shared library info entry.
5580 (Output_section_incremental_inputs::write_input_files): Write
5581 as_needed flag for shared libraries.
5582 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5583 of input file entry for shared libraries; write soname.
5584 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5585 soname from incremental info.
5586 * incremental.h (enum Incremental_input_flags): Add
5587 INCREMENTAL_INPUT_AS_NEEDED.
5588 (Incremental_input_entry::Incremental_input_entry): Initialize new
5589 data member.
5590 (Incremental_input_entry::set_as_needed): New function.
5591 (Incremental_input_entry::as_needed): New function.
5592 (Incremental_input_entry::do_dynobj_entry): New function.
5593 (Incremental_input_entry::as_needed_): New data member.
5594 (Incremental_object_entry::Incremental_object_entry): Don't check
5595 for shared library.
5596 (Incremental_object_entry::do_type): Likewise.
5597 (class Incremental_dynobj_entry): New class.
5598 (Incremental_input_entry_reader::as_needed): New function.
5599 (Incremental_input_entry_reader::get_soname): New function.
5600 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5601 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5602 size of shared library info entry.
58797674 5603 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5604 incremental link when adding DT_NEEDED entries.
5605 * object.h (Object::Object): Initialize new data member.
5606 (Object::dynobj): New function.
5607 (Object::set_as_needed): New function.
5608 (Object::as_needed): New function.
5609 (Object::do_dynobj): New function.
5610 (Object::as_needed_): New data member.
5611
6fa2a40b
CC
56122011-05-24 Cary Coutant <ccoutant@google.com>
5613
5614 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5615 info; adjust display of GOT entries.
5616 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5617 vector of input objects; remove file_status_.
5618 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5619 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5620 got_plt reader; call target hooks to reserve GOT entries.
5621 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5622 of input file info header and GOT info entry.
5623 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5624 relocation info.
5625 (Got_plt_view_info::got_descriptor): Remove.
5626 (Got_plt_view_info::sym_index): New data member.
5627 (Got_plt_view_info::input_index): New data member.
5628 (Local_got_offset_visitor::visit): Write input file index.
5629 (Global_got_offset_visitor::visit): Write 0 for input file index.
5630 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5631 with sym_index and input_index.
5632 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5633 incremental info GOT entry; replace got_descriptor with input_index.
5634 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5635 map from input file index to object.
5636 (Sized_relobj_incr::do_layout): Replace direct data member reference
5637 with accessor function.
5638 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5639 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5640 Adjust size of input file info header.
5641 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5642 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5643 (Incremental_input_entry_reader::get_input_section): Adjust size of
5644 input file info header.
5645 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5646 of incremental info GOT entry.
5647 (Incremental_got_plt_reader::get_got_desc): Remove.
5648 (Incremental_got_plt_reader::get_got_symndx): New function.
5649 (Incremental_got_plt_reader::get_got_input_index): New function.
5650 (Sized_incremental_binary::Sized_incremental_binary): Remove
5651 file_status_; add input_objects_.
5652 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5653 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5654 (Sized_incremental_binary::file_is_unchanged): Remove.
5655 (Sized_incremental_binary::set_input_object): New function.
5656 (Sized_incremental_binary::input_object): New function.
5657 (Sized_incremental_binary::file_status_): Remove.
5658 (Sized_incremental_binary::input_objects_): New data member.
5659 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5660 references.
5661 (Sized_relobj_incr::invalid_address): Move to base class.
5662 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5663 class.
5664 (Sized_relobj_incr::do_output_section_offset): Likewise.
5665 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5666 (Sized_relobj_incr::section_offsets_): Likewise.
5667 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5668 function.
5669 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5670 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5671 with accessor function.
5672 (Sized_relobj_file::do_layout): Likewise.
5673 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5674 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5675 (Sized_relobj_file::compute_final_local_value): Replace refs to
5676 section_offsets_ with accessor function.
5677 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5678 * object.h (Relobj::Relobj): Initialize new data members.
5679 (Relobj::add_dyn_reloc): New function.
5680 (Relobj::first_dyn_reloc): New function.
5681 (Relobj::dyn_reloc_count): New function.
5682 (Relobj::first_dyn_reloc_): New data member.
5683 (Relobj::dyn_reloc_count_): New data member.
5684 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5685 references.
5686 (Sized_relobj::Address): New typedef.
5687 (Sized_relobj::invalid_address): Move here from child class.
5688 (Sized_relobj::Sized_relobj): Initialize new data members.
5689 (Sized_relobj::sized_relobj): New function.
5690 (Sized_relobj::is_output_section_offset_invalid): Move here from
5691 child class.
5692 (Sized_relobj::get_output_section_offset): Likewise.
5693 (Sized_relobj::local_has_got_offset): Likewise.
5694 (Sized_relobj::local_got_offset): Likewise.
5695 (Sized_relobj::set_local_got_offset): Likewise.
5696 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5697 (Sized_relobj::clear_got_offsets): New function.
5698 (Sized_relobj::section_offsets): Move here from child class.
5699 (Sized_relobj::do_output_section_offset): Likewise.
5700 (Sized_relobj::do_set_section_offset): Likewise.
5701 (Sized_relobj::Local_got_offsets): Likewise.
5702 (Sized_relobj::local_got_offsets_): Likewise.
5703 (Sized_relobj::section_offsets_): Likewise.
5704 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5705 references.
5706 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5707 class.
5708 (Sized_relobj_file::sized_relobj): New function
5709 (Sized_relobj_file::local_has_got_offset): Move to base class.
5710 (Sized_relobj_file::local_got_offset): Likewise.
5711 (Sized_relobj_file::set_local_got_offset): Likewise.
5712 (Sized_relobj_file::get_output_section_offset): Likewise.
5713 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5714 (Sized_relobj_file::do_output_section_offset): Likewise.
5715 (Sized_relobj_file::do_set_section_offset): Likewise.
5716 (Sized_relobj_file::Local_got_offsets): Likewise.
5717 (Sized_relobj_file::local_got_offsets_): Likewise.
5718 (Sized_relobj_file::section_offsets_): Likewise.
5719 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5720 (all constructors).
5721 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5722 (Output_reloc::get_symbol_index): Likewise.
5723 (Output_reloc::local_section_offset): Likewise.
5724 (Output_reloc::get_address): Likewise.
5725 (Output_reloc::symbol_value): Likewise.
5726 (Output_data_got::reserve_slot): Move to class definition.
5727 (Output_data_got::reserve_local): New function.
5728 (Output_data_got::reserve_slot_for_global): Remove.
5729 (Output_data_got::reserve_global): New function.
5730 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5731 (all constructors, two instantiations).
5732 (Output_reloc::get_relobj): New function (two instantiations).
5733 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5734 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5735 (Output_data_reloc::add_global): Adjust type of relobj.
5736 (Output_data_reloc::add_global_relative): Likewise.
5737 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5738 (Output_data_reloc::add_local): Likewise.
5739 (Output_data_reloc::add_local_relative): Likewise.
5740 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5741 (Output_data_reloc::add_local_section): Likewise.
5742 (Output_data_reloc::add_output_section): Likewise.
5743 (Output_data_reloc::add_absolute): Likewise.
5744 (Output_data_reloc::add_target_specific): Likewise.
5745 (Output_data_got::reserve_slot): Move definition here.
5746 (Output_data_got::reserve_local): New function.
5747 (Output_data_got::reserve_global): New function.
5748 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5749 section_offsets_ with accessor function.
5750 (Sized_relobj_file::write_sections): Likewise.
5751 (Sized_relobj_file::do_relocate_sections): Likewise.
5752 * target.h (Sized_target::reserve_local_got_entry): New function.
5753 (Sized_target::reserve_global_got_entry): New function.
5754 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5755 (Target_x86_64::reserve_global_got_entry): New function.
5756 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5757
4829d394
CC
57582011-05-23 Cary Coutant <ccoutant@google.com>
5759
5760 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5761 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5762 bit when checking got_type.
5763 * incremental.cc (Sized_incremental_binary::setup_readers):
5764 Store symbol table and string table locations; initialize bit vector
5765 of file status flags.
5766 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5767 unchanged files.
5768 (Sized_incremental_binary::do_process_got_plt): New function.
5769 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5770 (Output_section_incremental_inputs::set_final_data_size): Record
5771 file index for each input file.
5772 (Output_section_incremental_inputs::write_got_plt): Store file index
5773 instead of input entry offset for each GOT entry.
5774 * incremental.h
5775 (Incremental_input_entry::Incremental_input_entry): Initialize new
5776 data member.
5777 (Incremental_input_entry::set_offset): Store file index.
5778 (Incremental_input_entry::get_file_index): New function.
5779 (Incremental_input_entry::file_index_): New data member.
5780 (Incremental_binary::process_got_plt): New function.
5781 (Incremental_binary::do_process_got_plt): New function.
5782 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5783 data members.
5784 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5785 (Sized_incremental_binary::set_file_is_unchanged): New function.
5786 (Sized_incremental_binary::file_is_unchanged): New function.
5787 (Sized_incremental_binary::do_process_got_plt): New function.
5788 (Sized_incremental_binary::file_status_): New data member.
5789 (Sized_incremental_binary::main_symtab_loc_): New data member.
5790 (Sized_incremental_binary::main_strtab_loc_): New data member.
5791 * output.cc (Output_data_got::Got_entry::write): Add case
5792 RESERVED_CODE.
5793 (Output_data_got::add_global): Call add_got_entry.
5794 (Output_data_got::add_global_plt): Likewise.
5795 (Output_data_got::add_global_with_rel): Likewise.
5796 (Output_data_got::add_global_with_rela): Likewise.
5797 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5798 (Output_data_got::add_global_pair_with_rela): Likewise.
5799 (Output_data_got::add_local): Call add_got_entry.
5800 (Output_data_got::add_local_plt): Likewise.
5801 (Output_data_got::add_local_with_rel): Likewise.
5802 (Output_data_got::add_local_with_rela): Likewise.
5803 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5804 (Output_data_got::add_local_pair_with_rela): Likewise.
5805 (Output_data_got::reserve_slot): New function.
5806 (Output_data_got::reserve_slot_for_global): New function.
5807 (Output_data_got::add_got_entry): New function.
5808 (Output_data_got::add_got_entry_pair): New function.
5809 (Output_section::add_output_section_data): Edit FIXME.
5810 * output.h
5811 (Output_section_data_build::Output_section_data_build): New
5812 constructor with size parameter.
5813 (Output_data_space::Output_data_space): Likewise.
5814 (Output_data_got::Output_data_got): Initialize new data member; new
5815 constructor with size parameter.
5816 (Output_data_got::add_constant): Call add_got_entry.
5817 (Output_data_got::reserve_slot): New function.
5818 (Output_data_got::reserve_slot_for_global): New function.
5819 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5820 (Output_data_got::add_got_entry): New function.
5821 (Output_data_got::add_got_entry_pair): New function.
5822 (Output_data_got::free_list_): New data member.
5823 * target.h (Sized_target::init_got_plt_for_update): New function.
5824 (Sized_target::register_global_plt_entry): New function.
5825 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5826 Initialize new data member; call init; add constructor with PLT count.
5827 (Output_data_plt_x86_64::init): New function.
5828 (Output_data_plt_x86_64::add_relocation): New function.
5829 (Output_data_plt_x86_64::reserve_slot): New function.
5830 (Output_data_plt_x86_64::free_list_): New data member.
5831 (Target_x86_64::init_got_plt_for_update): New function.
5832 (Target_x86_64::register_global_plt_entry): New function.
5833 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5834 incremental updates.
5835 (Output_data_plt_x86_64::add_relocation): New function.
5836 * testsuite/object_unittest.cc (Object_test): Set default options.
5837
ec69d6da
ILT
58382011-05-16 Ian Lance Taylor <iant@google.com>
5839
5840 * options.h (class General_options): Make -i a synonym for -r.
5841
732e31de
ILT
58422011-05-16 Ian Lance Taylor <iant@google.com>
5843
5844 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5845
403676b5
CC
58462011-05-10 Cary Coutant <ccoutant@google.com>
5847
5848 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5849 strip_all (-s).
5850
5b7b7d6e
ILT
58512011-05-06 Ian Lance Taylor <iant@google.com>
5852
5853 * layout.cc (Layout::layout): If the output section flags change,
5854 update the ordering.
5855
f0f9babf
CC
58562011-04-25 Cary Coutant <ccoutant@google.com>
5857
5858 * incremental-dump.cc (dump_incremental_inputs): Print local
5859 symbol info for each input file.
5860 * incremental.cc
5861 (Output_section_incremental_inputs::set_final_data_size): Add local
5862 symbol info to input file entries in incremental info.
5863 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5864 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5865 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5866 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5867 implementation.
5868 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5869 (Sized_incr_relobj::do_relocate): Write the local symbols.
5870 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5871 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5872 Adjust size of input file header.
5873 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5874 (Incremental_inputs_reader::get_local_symbol_count): New function.
5875 (Incremental_inputs_reader::get_input_section): Adjust size of input
5876 file header.
5877 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5878 (Sized_incr_relobj::This): New typedef.
5879 (Sized_incr_relobj::sym_size): New const data member.
5880 (Sized_incr_relobj::Local_symbol): New struct.
5881 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5882 (Sized_incr_relobj::do_local_symbol_offset): New function.
5883 (Sized_incr_relobj::local_symbol_count_): New data member.
5884 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5885 (Sized_incr_relobj::local_symbol_index_): New data member.
5886 (Sized_incr_relobj::local_symbol_offset_): New data member.
5887 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5888 (Sized_incr_relobj::local_symbols_): New data member.
5889 * object.h (Relobj::output_local_symbol_count): New function.
5890 (Relobj::local_symbol_offset): New function.
5891 (Relobj::do_output_local_symbol_count): New function.
5892 (Relobj::do_local_symbol_offset): New function.
5893 (Sized_relobj::do_output_local_symbol_count): New function.
5894 (Sized_relobj::do_local_symbol_offset): New function.
5895
d0a9ace3
ILT
58962011-04-22 Vladimir Simonov <sv@sw.ru>
5897
5898 * descriptors.cc (set_close_on_exec): New function.
5899 (Descriptors::open): Use set_close_on_exec.
5900 * output.cc (S_ISLNK): Define if not defined.
5901
94a3fc8b
CC
59022011-04-22 Cary Coutant <ccoutant@google.com>
5903
5904 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5905 global symbol map.
5906 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5907 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5908 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5909 relocations.
5910 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5911 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5912 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5913 * incremental.h
5914 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5915 function.
5916 (Incremental_binary::apply_incremental_relocs): New function.
5917 (Incremental_binary::do_apply_incremental_relocs): New function.
5918 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5919 data member.
5920 (Sized_incremental_binary::add_global_symbol): New function.
5921 (Sized_incremental_binary::global_symbol): New function.
5922 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5923 (Sized_incremental_binary::symbol_map_): New data member.
5924 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5925 * target.h (Sized_target::apply_relocation): New function.
5926 * target-reloc.h (apply_relocation): New function.
5927 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5928
c87e4302
DK
59292011-04-22 Doug Kwan <dougkwan@google.com>
5930
5931 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5932 flag of a SHT_ARM_EXIDX section.
2e702c99 5933 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5934 * testsuite/Makefile.in: Regenerate.
5935 * testsuite/arm_exidx_test.s: New file.
5936 * testsuite/arm_exidx_test.sh: Same.
5937
e7782cf6
CC
59382011-04-20 Cary Coutant <ccoutant@google.com>
5939
5940 PR gold/12689
5941 * archive.h (Incremental_archive_entry::Archive_member):
5942 Initialize arg_serial_ (second constructor).
5943
308ecdc7
ILT
59442011-04-17 Ian Lance Taylor <iant@google.com>
5945
5946 * object.cc (Relocate_info::location): Simplify location string.
5947 * errors.cc (Errors::error_at_location): Don't print program
5948 name.
5949 (Errors::warning_at_location): Likewise.
5950 (Errors::undefined_symbol): Likewise.
5951 * testsuite/debug_msg.sh: Update accordingly.
5952
bec5b579
CC
59532011-04-14 Cary Coutant <ccoutant@google.com>
5954
5955 * gold/layout.cc (Layout::symtab_section_offset): New function.
5956 * gold/layout.h (Layout::symtab_section_offset): New function.
5957 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5958
88597d34
ILT
59592011-04-12 Ian Lance Taylor <iant@google.com>
5960
5961 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5962 with MREMAP_MAYMOVE.
5963 * output.h (class Output_file): Add map_is_allocated_ field.
5964 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5965 not available, provide stubs. If mremap is not available, #define
5966 it to gold_mremap.
5967 (MREMAP_MAYMOVE): Define if not defined.
5968 (Output_file::Output_file): Initialize map_is_allocated_.
5969 (Output_file::resize): Check map_is_allocated_.
5970 (Output_file::map_anonymous): If mmap fails, use malloc.
5971 (Output_file::unmap): Don't do anything for an anonymous map.
5972 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5973 is not available, provide stubs.
5974 (File_read::View::~View): Use free rather than delete[].
5975 (File_read::make_view): Use malloc rather than new[]. If mmap
5976 fails, use malloc.
5977 (File_read::find_or_make_view): Use malloc rather than new[].
5978 * gold.h: Remove HAVE_REMAP code.
5979 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5980 exists. Rename mremap to gold_mremap. If mmap is not available
5981 don't do anything.
5982 * configure, config.in: Rebuild.
5983
11e361bc
ILT
59842011-04-11 Ian Lance Taylor <iant@google.com>
5985
5986 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5987 initialize local variable v.
5988
cdc29364
CC
59892011-04-11 Cary Coutant <ccoutant@google.com>
5990
5991 * archive.cc (Archive::include_member): Adjust call to
5992 report_object.
5993 (Add_archive_symbols::run): Track argument serial numbers.
5994 (Lib_group::include_member): Likewise.
5995 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5996 * archive.h (Incremental_archive_entry::Archive_member):
5997 Initialize arg_serial_.
5998 (Archive_member::arg_serial_): New data member.
5999 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
6000 (Sized_dynobj::do_add_symbols): Track symbols when doing an
6001 incremental link.
6002 (Sized_dynobj::do_for_all_local_got_entries): New function.
6003 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
6004 function.
6005 * fileread.cc (get_mtime): New function.
6006 * fileread.h (get_mtime): New function.
6007 * gold.cc (queue_initial_tasks): Check for incremental update.
6008 (process_incremental_input): New function.
6009 (queue_middle_tasks): Don't force valid target for incremental
6010 update.
6011 * incremental-dump.cc (find_input_containing_global): Adjust
6012 size of symbol info entry.
6013 (dump_incremental_inputs): Dump argument serial number and
6014 in_system_directory flag; bias shndx by 1; print symbol names
6015 when dumping per-file symbol lists; use new symbol info readers.
6016 * incremental.cc
6017 (Output_section_incremental_inputs:update_data_size): New function.
6018 (Sized_incremental_binary::setup_readers): Setup input readers
6019 for each input file; build maps for files added from libraries
6020 and scripts.
6021 (Sized_incremental_binary::check_input_args): New function.
6022 (Sized_incremental_binary::do_check_inputs): Build map of argument
6023 serial numbers to input arguments.
6024 (Sized_incremental_binary::do_file_has_changed): Rename
6025 do_file_is_unchanged to this; compare file modification times.
6026 (Sized_incremental_binary::do_init_layout): New function.
6027 (Sized_incremental_binary::do_reserve_layout): New function.
6028 (Sized_incremental_binary::do_get_input_reader): Remove.
6029 (Sized_incremental_binary::get_symtab_view): New function.
6030 (Incremental_checker::can_incrementally_link_output_file): Remove.
6031 (Incremental_inputs::report_command_line): Exclude --debug options.
6032 (Incremental_inputs::report_archive_begin): Add parameter; track
6033 argument serial numbers; don't put input file entry for archive
6034 before archive members.
6035 (Incremental_inputs::report_archive_end): Put input file entry
6036 for archive after archive members.
6037 (Incremental_inputs::report_object): Add parameter; track argument
6038 serial numbers and in_system_directory flag.
6039 (Incremental_inputs::report_script): Add parameter; track argument
6040 serial numbers.
6041 (Output_section_incremental_inputs::set_final_data_size): Adjust
6042 size of symbol info entry; check for forwarding symbols.
6043 (Output_section_incremental_inputs::write_input_files): Write
6044 in_system_directory flag and argument serial number.
6045 (Output_section_incremental_inputs::write_info_blocks): Map section
6046 indices between incremental info and original input file; store
6047 input section index for each symbol.
6048 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6049 change operator() to visit().
6050 (class Global_got_offset_visitor): Likewise.
6051 (class Global_symbol_visitor_got_plt):
6052 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6053 classes.
6054 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6055 (Sized_incr_relobj::do_read_symbols): New function.
6056 (Sized_incr_relobj::do_layout): New function.
6057 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6058 (Sized_incr_relobj::do_add_symbols): New function.
6059 (Sized_incr_relobj::do_should_include_member): New function.
6060 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6061 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6062 (Sized_incr_relobj::do_section_size): New function.
6063 (Sized_incr_relobj::do_section_name): New function.
6064 (Sized_incr_relobj::do_section_contents): New function.
6065 (Sized_incr_relobj::do_section_flags): New function.
6066 (Sized_incr_relobj::do_section_entsize): New function.
6067 (Sized_incr_relobj::do_section_address): New function.
6068 (Sized_incr_relobj::do_section_type): New function.
6069 (Sized_incr_relobj::do_section_link): New function.
6070 (Sized_incr_relobj::do_section_info): New function.
6071 (Sized_incr_relobj::do_section_addralign): New function.
6072 (Sized_incr_relobj::do_initialize_xindex): New function.
6073 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6074 (Sized_incr_relobj::do_read_relocs): New function.
6075 (Sized_incr_relobj::do_gc_process_relocs): New function.
6076 (Sized_incr_relobj::do_scan_relocs): New function.
6077 (Sized_incr_relobj::do_count_local_symbols): New function.
6078 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6079 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6080 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6081 (Sized_incr_relobj::do_relocate): New function.
6082 (Sized_incr_relobj::do_set_section_offset): New function.
6083 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6084 (Sized_incr_dynobj::do_read_symbols): New function.
6085 (Sized_incr_dynobj::do_layout): New function.
6086 (Sized_incr_dynobj::do_add_symbols): New function.
6087 (Sized_incr_dynobj::do_should_include_member): New function.
6088 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6089 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6090 (Sized_incr_dynobj::do_section_size): New function.
6091 (Sized_incr_dynobj::do_section_name): New function.
6092 (Sized_incr_dynobj::do_section_contents): New function.
6093 (Sized_incr_dynobj::do_section_flags): New function.
6094 (Sized_incr_dynobj::do_section_entsize): New function.
6095 (Sized_incr_dynobj::do_section_address): New function.
6096 (Sized_incr_dynobj::do_section_type): New function.
6097 (Sized_incr_dynobj::do_section_link): New function.
6098 (Sized_incr_dynobj::do_section_info): New function.
6099 (Sized_incr_dynobj::do_section_addralign): New function.
6100 (Sized_incr_dynobj::do_initialize_xindex): New function.
6101 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6102 (make_sized_incremental_object): New function.
6103 (Incremental_library::copy_unused_symbols): New function.
6104 (Incremental_library::do_for_all_unused_symbols): New function.
6105 * incremental.h (enum Incremental_input_flags): New type.
6106 (class Incremental_checker): Remove.
6107 (Incremental_input_entry::Incremental_input_entry): Add argument
6108 serial number.
6109 (Incremental_input_entry::arg_serial): New function.
6110 (Incremental_input_entry::set_is_in_system_directory): New function.
6111 (Incremental_input_entry::is_in_system_directory): New function.
6112 (Incremental_input_entry::arg_serial_): New data member.
6113 (Incremental_input_entry::is_in_system_directory_): New data member.
6114 (class Script_info): Move here from script.h.
6115 (Script_info::Script_info): Add filename parameter.
6116 (Script_info::filename): New function.
6117 (Script_info::filename_): New data member.
6118 (Incremental_script_entry::Incremental_script_entry): Add argument
6119 serial number.
6120 (Incremental_object_entry::Incremental_object_entry): Likewise.
6121 (Incremental_object_entry::add_input_section): Build list of input
6122 sections with map to original shndx.
6123 (Incremental_object_entry::get_input_section_index): New function.
6124 (Incremental_object_entry::shndx_): New data member.
6125 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6126 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6127 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6128 serial number.
6129 (Incremental_inputs::report_archive_begin): Likewise.
6130 (Incremental_inputs::report_object): Likewise.
6131 (Incremental_inputs::report_script): Likewise.
6132 (class Incremental_global_symbol_reader): New class.
6133 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6134 and store flags and input file type.
6135 (Incremental_input_entry_reader::arg_serial): New function.
6136 (Incremental_input_entry_reader::type): Extract type from flags.
6137 (Incremental_input_entry_reader::is_in_system_directory): New function.
6138 (Incremental_input_entry_reader::get_input_section_count): Call
6139 accessor function for type.
6140 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6141 function for type; adjust size of global symbol entry.
6142 (Incremental_input_entry_reader::get_global_symbol_count): Call
6143 accessor function for type.
6144 (Incremental_input_entry_reader::get_object_count): Likewise.
6145 (Incremental_input_entry_reader::get_object_offset): Likewise.
6146 (Incremental_input_entry_reader::get_member_count): Likewise.
6147 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6148 (Incremental_input_entry_reader::get_member_offset): Likewise.
6149 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6150 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6151 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6152 (Incremental_input_entry_reader::get_global_symbol_reader): New
6153 function.
6154 (Incremental_input_entry_reader::get_output_symbol_index): New
6155 function.
6156 (Incremental_input_entry_reader::type_): Remove.
6157 (Incremental_input_entry_reader::flags_): New data member.
6158 (Incremental_inputs_reader::input_file_offset): New function.
6159 (Incremental_inputs_reader::input_file_index): New function.
6160 (Incremental_inputs_reader::input_file): Call input_file_offset.
6161 (Incremental_inputs_reader::input_file_at_offset): New function.
6162 (Incremental_relocs_reader::get_r_type): Reformat.
6163 (Incremental_relocs_reader::get_r_shndx): Reformat.
6164 (Incremental_relocs_reader::get_r_offset): Reformat.
6165 (Incremental_relocs_reader::data): New function.
6166 (Incremental_binary::Incremental_binary): Initialize new data members.
6167 (Incremental_binary::check_inputs): Add cmdline parameter.
6168 (Incremental_binary::file_is_unchanged): Remove.
6169 (Input_reader::arg_serial): New function.
6170 (Input_reader::get_unused_symbol_count): New function.
6171 (Input_reader::get_unused_symbol): New function.
6172 (Input_reader::do_arg_serial): New function.
6173 (Input_reader::do_get_unused_symbol_count): New function.
6174 (Input_reader::do_get_unused_symbol): New function.
6175 (Incremental_binary::input_file_count): New function.
6176 (Incremental_binary::get_input_reader): Change signature to use
6177 index instead of filename.
6178 (Incremental_binary::file_has_changed): New function.
6179 (Incremental_binary::get_input_argument): New function.
6180 (Incremental_binary::get_library): New function.
6181 (Incremental_binary::get_script_info): New function.
6182 (Incremental_binary::init_layout): New function.
6183 (Incremental_binary::reserve_layout): New function.
6184 (Incremental_binary::output_file): New function.
6185 (Incremental_binary::do_check_inputs): New function.
6186 (Incremental_binary::do_file_is_unchanged): Remove.
6187 (Incremental_binary::do_file_has_changed): New function.
6188 (Incremental_binary::do_init_layout): New function.
6189 (Incremental_binary::do_reserve_layout): New function.
6190 (Incremental_binary::do_input_file_count): New function.
6191 (Incremental_binary::do_get_input_reader): Change signature.
6192 (Incremental_binary::input_args_map_): New data member.
6193 (Incremental_binary::library_map_): New data member.
6194 (Incremental_binary::script_map_): New data member.
6195 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6196 new data members.
6197 (Sized_incremental_binary::output_section): New function.
6198 (Sized_incremental_binary::inputs_reader): Add const.
6199 (Sized_incremental_binary::symtab_reader): Add const.
6200 (Sized_incremental_binary::relocs_reader): Add const.
6201 (Sized_incremental_binary::got_plt_reader): Add const.
6202 (Sized_incremental_binary::get_symtab_view): New function.
6203 (Sized_incremental_binary::Inputs_reader): New typedef.
6204 (Sized_incremental_binary::Input_entry_reader): New typedef.
6205 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6206 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6207 (Sized_incremental_binary::do_file_has_changed): New function.
6208 (Sized_incremental_binary::do_init_layout): New function.
6209 (Sized_incremental_binary::do_reserve_layout): New function.
6210 (Sized_input_reader::Inputs_reader): Remove.
6211 (Sized_input_reader::Input_entry_reader): Remove.
6212 (Sized_input_reader::do_arg_serial): New function.
6213 (Sized_input_reader::do_get_unused_symbol_count): New function.
6214 (Sized_input_reader::do_get_unused_symbol): New function.
6215 (Sized_incremental_binary::do_input_file_count): New function.
6216 (Sized_incremental_binary::do_get_input_reader): Change signature;
6217 use index instead of filename.
6218 (Sized_incremental_binary::section_map_): New data member.
6219 (Sized_incremental_binary::input_entry_readers_): New data member.
6220 (class Sized_incr_relobj): New class.
6221 (class Sized_incr_dynobj): New class.
6222 (make_sized_incremental_object): New function.
6223 (class Incremental_library): New class.
6224 * layout.cc (Free_list::num_lists): New static data member.
6225 (Free_list::num_nodes): New static data member.
6226 (Free_list::num_removes): New static data member.
6227 (Free_list::num_remove_visits): New static data member.
6228 (Free_list::num_allocates): New static data member.
6229 (Free_list::num_allocate_visits): New static data member.
6230 (Free_list::init): New function.
6231 (Free_list::remove): New function.
6232 (Free_list::allocate): New function.
6233 (Free_list::dump): New function.
6234 (Free_list::print_stats): New function.
6235 (Layout_task_runner::run): Resize output file for incremental updates.
6236 (Layout::Layout): Initialize new data members.
6237 (Layout::set_incremental_base): New function.
6238 (Layout::init_fixed_output_section): New function.
6239 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6240 incremental updates.
6241 (Layout::create_gold_note): Do not create gold note section for
6242 incremental updates.
6243 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6244 for incremental updates.
6245 (Layout::set_section_offsets): For incremental updates, allocate space
6246 from free list.
6247 (Layout::create_symtab_sections): Layout with offsets relative to
6248 start of section; for incremental updates, allocate space from free
6249 list.
6250 (Layout::create_shdrs): For incremental updates, allocate space from
6251 free list.
6252 (Layout::finish_dynamic_section): For incremental updates, do not
6253 check --as-needed (fixed in subsequent patch).
6254 * layout.h (class Free_list): New class.
6255 (Layout::set_incremental_base): New function.
6256 (Layout::incremental_base): New function.
6257 (Layout::init_fixed_output_section): New function.
6258 (Layout::allocate): New function.
6259 (Layout::incremental_base_): New data member.
6260 (Layout::free_list_): New data member.
6261 * main.cc (main): Print Free_list statistics.
6262 * object.cc (Relobj::finalize_incremental_relocs): Add
6263 clear_counts parameter; clear counts only when clear_counts is set.
6264 (Sized_relobj::Sized_relobj): Initialize new base class.
6265 (Sized_relobj::do_layout): Don't report special sections.
6266 (Sized_relobj::do_for_all_local_got_entries): New function.
6267 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6268 symtab_off to all symbol table offsets.
6269 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6270 * object.h (class Got_offset_list): Move to top of file.
6271 (Object::Object): Allow case where input_file == NULL.
6272 (Object::~Object): Likewise.
6273 (Object::input_file): Assert that input_file != NULL.
6274 (Object::lock): Allow case where input_file == NULL.
6275 (Object::unlock): Likewise.
6276 (Object::is_locked): Likewise.
6277 (Object::token): Likewise.
6278 (Object::release): Likewise.
6279 (Object::is_incremental): New function.
6280 (Object::get_mtime): New function.
6281 (Object::for_all_local_got_entries): New function.
6282 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6283 (Object::set_is_in_system_directory): New function.
6284 (Object::is_in_system_directory): New function.
6285 (Object::do_is_incremental): New function.
6286 (Object::do_get_mtime): New function.
6287 (Object::do_for_all_local_got_entries): New function.
6288 (Object::is_in_system_directory_): New data member.
6289 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6290 (class Sized_relobj_base): New class.
6291 (class Sized_relobj): Derive from Sized_relobj_base.
6292 (class Sized_relobj::Symbols): Redeclare from base class.
6293 (class Sized_relobj::local_got_offset_list): Remove.
6294 (class Sized_relobj::Output_sections): Redeclare from base class.
6295 (class Sized_relobj::do_for_all_local_got_entries): New function.
6296 (class Sized_relobj::write_local_symbols): Add offset parameter.
6297 (class Sized_relobj::local_symbol_offset_): Update comment.
6298 (class Sized_relobj::local_dynsym_offset_): Update comment.
6299 * options.cc (Input_arguments::add_file): Remove const.
6300 * options.h (Input_file_argument::Input_file_argument):
6301 Initialize arg_serial_ (all constructors).
6302 (Input_file_argument::set_arg_serial): New function.
6303 (Input_file_argument::arg_serial): New function.
6304 (Input_file_argument::arg_serial_): New data member.
6305 (Input_arguments::Input_arguments): Initialize file_count_.
6306 (Input_arguments::add_file): Remove const.
6307 (Input_arguments::number_of_input_files): New function.
6308 (Input_arguments::file_count_): New data member.
6309 (Command_line::number_of_input_files): Call
6310 Input_arguments::number_of_input_files.
6311 * output.cc (Output_segment_headers::Output_segment_headers):
6312 Set current size.
6313 (Output_section::Input_section::current_data_size): New function.
6314 (Output_section::Output_section): Initialize new data members.
6315 (Output_section::add_input_section): Don't do merge sections for
6316 an incremental link; allocate space from free list for an
6317 incremental update.
6318 (Output_section::add_output_section_data): Allocate space from
6319 free list for an incremental update.
6320 (Output_section::update_data_size): New function.
6321 (Output_section::set_fixed_layout): New function.
6322 (Output_section::reserve): New function.
6323 (Output_segment::set_section_addresses): Remove const.
6324 (Output_segment::set_section_list_addresses): Remove const; allocate
6325 space from free list for an incremental update.
6326 (Output_segment::set_offset): Adjust size of RELRO segment for an
6327 incremental update.
6328 * output.h (Output_data::current_data_size): Move here from
6329 child classes.
6330 (Output_data::pre_finalize_data_size): New function.
6331 (Output_data::update_data_size): New function.
6332 (Output_section_headers::update_data_size): new function.
6333 (Output_section_data_build::current_data_size): Move to Output_data.
6334 (Output_data_strtab::update_data_size): New function.
6335 (Output_section::current_data_size): Move to Output_data.
6336 (Output_section::set_fixed_layout): New function.
6337 (Output_section::has_fixed_layout): New function.
6338 (Output_section::reserve): New function.
6339 (Output_section::update_data_size): New function.
6340 (Output_section::has_fixed_layout_): New data member.
6341 (Output_section::free_list_): New data member.
6342 (Output_segment::set_section_addresses): Remove const.
6343 (Output_segment::set_section_list_addresses): Remove const.
6344 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6345 New function.
6346 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6347 New function.
6348 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6349 parameter when calling Add_symbols constructor; store argument
6350 serial number for members of a lib group.
6351 (Add_symbols::locks): Allow case where token == NULL.
6352 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6353 (Read_member::~Read_member): New function.
6354 (Read_member::is_runnable): New function.
6355 (Read_member::locks): New function.
6356 (Read_member::run): New function.
6357 (Check_script::~Check_script): New function.
6358 (Check_script::is_runnable): New function.
6359 (Check_script::locks): New function.
6360 (Check_script::run): New function.
6361 (Check_library::~Check_library): New function.
6362 (Check_library::is_runnable): New function.
6363 (Check_library::locks): New function.
6364 (Check_library::run): New function.
6365 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6366 (Add_symbols::library_): New data member.
6367 (class Read_member): New class.
6368 (class Check_script): New class.
6369 (class Check_library): New class.
6370 * reloc.cc (Read_relocs::is_runnable): Allow case where
6371 token == NULL.
6372 (Read_relocs::locks): Likewise.
6373 (Scan_relocs::locks): Likewise.
6374 (Relocate_task::locks): Likewise.
6375 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6376 to clear counters.
6377 (Sized_relobj::incremental_relocs_scan): Fix comment.
6378 (Sized_relobj::do_relocate): Pass output file offset to
6379 write_local_symbols.
6380 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6381 from class declaration.
6382 * script.cc (read_input_script): Allocate Script_info; pass
6383 argument serial number to report_script.
6384 * script.h (class Script_info): Move to incremental.h.
6385 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6386 * symtab.h (Symbol_table::add_from_incrobj): New function.
6387 (Symbol_table::set_file_offset): New function.
6388
b961d0d7
CC
63892011-04-05 Cary Coutant <ccoutant@google.com>
6390
6391 * incremental-dump.cc (dump_incremental_inputs): Change signature
6392 to take a Sized_incremental_binary; change caller. Use readers
6393 in Sized_incremental_binary.
6394 * incremental.cc
6395 (Sized_incremental_binary::find_incremental_inputs_sections):
6396 Rename do_find_incremental_inputs_sections to this.
6397 (Sized_incremental_binary::setup_readers): New function.
6398 (Sized_incremental_binary::do_check_inputs): Check
6399 has_incremental_info_ flag; move setup code to setup_readers;
6400 use input readers.
6401 (Sized_incremental_binary::do_file_is_unchanged): New function.
6402 (Sized_incremental_binary::do_get_input_reader): New function.
6403 * incremental.h (class Incremental_binary): Move to end of file.
6404 (Incremental_binary::file_is_unchanged): New function.
6405 (Incremental_binary::do_file_is_unchanged): New function.
6406 (Incremental_binary::Input_reader): New class.
6407 (Incremental_binary::get_input_reader): New function.
6408 (class Sized_incremental_binary): Move to end of file.
6409 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6410 input section reader classes.
6411 (Sized_incremental_binary::has_incremental_info): New function.
6412 (Sized_incremental_binary::inputs_reader): New function.
6413 (Sized_incremental_binary::symtab_reader): New function.
6414 (Sized_incremental_binary::relocs_reader): New function.
6415 (Sized_incremental_binary::got_plt_reader): New function.
6416 (Sized_incremental_binary::do_file_is_unchanged): New function.
6417 (Sized_incremental_binary::Sized_input_reader): New class.
6418 (Sized_incremental_binary::get_input_reader): New function.
6419 (Sized_incremental_binary::find_incremental_inputs_sections):
6420 Rename do_find_incremental_inputs_sections to this.
6421 (Sized_incremental_binary::setup_readers): New function.
6422 (Sized_incremental_binary::has_incremental_info_): New data member.
6423 (Sized_incremental_binary::inputs_reader_): New data member.
6424 (Sized_incremental_binary::symtab_reader_): New data member.
6425 (Sized_incremental_binary::relocs_reader_): New data member.
6426 (Sized_incremental_binary::got_plt_reader_): New data member.
6427 (Sized_incremental_binary::current_input_file_): New data member.
6428
a869183f
PP
64292011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6430
6431 PR gold/12640
6432 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6433 violation.
6434
64352011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6436
6437 * archive.cc (Archive::include_member): Adjust call to report_object.
6438 (Add_archive_symbols::run): Add script_info to call to
6439 report_archive_begin.
6440 (Lib_group::include_member): Adjust call to report_object.
6441 (Add_lib_group_symbols::run): Adjust call to report_object.
6442 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6443 blocks. Add object count for script input files.
6444 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6445 script_info parameter; change all callers.
6446 (Incremental_inputs::report_object): Add script_info parameter;
6447 change all callers.
6448 (Incremental_inputs::report_script): Store backpointer to
6449 incremental info entry.
6450 (Output_section_incremental_inputs::set_final_data_size): Record
6451 additional information for scripts.
6452 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6453 * incremental.h (Incremental_script_entry::add_object): New function.
6454 (Incremental_script_entry::get_object_count): New function.
6455 (Incremental_script_entry::get_object): New function.
6456 (Incremental_script_entry::objects_): New data member; adjust
6457 constructor.
6458 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6459 (Incremental_inputs::report_object): Add script_info parameter.
6460 (Incremental_inputs_reader::get_object_count): New function.
6461 (Incremental_inputs_reader::get_object_offset): New function.
6462 * options.cc (Input_arguments::add_file): Return reference to
6463 new input argument.
6464 * options.h (Input_argument::set_script_info): New function.
6465 (Input_argument::script_info): New function.
6466 (Input_argument::script_info_): New data member; adjust all
6467 constructors.
6468 (Input_file_group::add_file): Return reference to new input argument.
6469 (Input_file_lib::add_file): Likewise.
6470 (Input_arguments::add_file): Likewise.
6471 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6472 * script.cc (Parser_closure::Parser_closure): Add script_info
6473 parameter; adjust all callers.
6474 (Parser_closure::script_info): New function.
6475 (Parser_closure::script_info_): New data member.
6476 (read_input_script): Report scripts earlier to incremental info.
6477 (script_add_file): Set script_info in Input_argument.
6478 (script_add_library): Likewise.
6479 * script.h (Script_options::Script_info): Rewrite class.
6480
a869183f 64812011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6482
6483 * archive.cc (Library_base::should_include_member): Move
6484 method here from class Archive.
6485 (Archive::Archive): Initialize base class.
6486 (Archive::should_include_member): Move to base class.
6487 (Archive::do_for_all_unused_symbols): New function.
6488 (Add_archive_symbols::run): Remove redundant access to
6489 incremental_inputs.
6490 (Lib_group::Lib_group): Initialize base class.
6491 (Lib_group::do_filename): New function.
6492 (Lib_group::include_member): Pass pointer to Lib_group to
6493 report_object.
6494 (Lib_group::do_for_all_unused_symbols): New function.
6495 (Add_lib_group_symbols::run): Report archive information for
6496 incremental links.
6497 * archive.h (class Library_base): New base class.
6498 (class Archive): Derive from Library_base.
6499 (Archive::filename): Move to base class.
6500 (Archive::set_incremental_info): Likewise.
6501 (Archive::incremental_info): Likewise.
6502 (Archive::Should_include): Likewise.
6503 (Archive::should_include_member): Likewise.
6504 (Archive::Armap_entry): Remove.
6505 (Archive::Unused_symbol_iterator): Remove.
6506 (Archive::unused_symbols_begin): Remove.
6507 (Archive::unused_symbols_end): Remove.
6508 (Archive::do_filename): New function.
6509 (Archive::do_get_mtime): New function.
6510 (Archive::do_for_all_unused_symbols): New function.
6511 (Archive::task_): Move to base class.
6512 (Archive::incremental_info_): Likewise.
6513 (class Lib_group): Derive from Library_base.
6514 (Lib_group::do_filename): New function.
6515 (Lib_group::do_get_mtime): New function.
6516 (Lib_group::do_for_all_unused_symbols): New function.
6517 (Lib_group::task_): Move to base class.
6518 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6519 function.
6520 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6521 function.
6522 * incremental.cc (Incremental_inputs::report_archive_begin):
6523 Use Library_base; call library's get_mtime; add incremental inputs
6524 entry before members.
6525 (class Unused_symbol_visitor): New class.
6526 (Incremental_inputs::report_archive_end): Use Library_base; use
6527 visitor class to record unused symbols; don't add incremental inputs
6528 entry after members.
6529 (Incremental_inputs::report_object): Use Library_base.
6530 * incremental.h
6531 (Incremental_archive_entry::Incremental_archive_entry): Remove
6532 unused Archive parameter.
6533 (Incremental_inputs::report_archive_begin): Use Library_base.
6534 (Incremental_inputs::report_archive_end): Likewise.
6535 (Incremental_inputs::report_object): Likewise.
6536 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6537 function.
6538 * object.h (Object::for_all_global_symbols): New function.
6539 (Object::do_for_all_global_symbols): New function.
6540 (Sized_relobj::do_for_all_global_symbols): New function.
6541 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6542 function.
6543 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6544 function.
6545
61ab3e40
ILT
65462011-03-27 Ian Lance Taylor <iant@google.com>
6547
6548 * archive.cc (Archive::interpret_header): Return -1 if something
6549 goes wrong. Change callers accordingly.
6550
30e1f9e6
CC
65512011-03-25 Cary Coutant <ccoutant@google.com>
6552
6553 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6554 * testsuite/Makefile.in: Regenerate.
6555
9370ce59 65562011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6557
6558 * plugin.cc (get_view): New.
6559 (Plugin::load): Pass get_view to the plugin.
6560 (Plugin_manager::get_view): New.
6561
9312bb0a
ILT
65622011-03-21 Ian Lance Taylor <iant@google.com>
6563
6564 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6565 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6566
7e12ba9e
ST
65672011-03-21 Sriraman Tallam <tmsriram@google.com>
6568
6569 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6570 Change == to -eq.
6571 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6572 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6573 Change == to -eq.
6574 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6575 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6576
fd7a005d
ILT
65772011-03-14 Ian Lance Taylor <iant@google.com>
6578
6579 * script-sections.cc (Sort_output_sections::script_compare):
6580 Rename from is_before, change return type.
6581 (Sort_output_sections::operator()): Adjust accordingly.
6582
ed16fd1b
ILT
65832011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6584
6585 PR gold/12572
6586 * testsuite/odr_violation2.cc: Add comment to make all error line
6587 numbers double digits.
6588 * testsuite/debug_msg.sh: Adjust expected errors.
6589
71ff8986
ILT
65902011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6591
6592 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6593 but mark earlier ones as non-canonical
6594 (offset_to_iterator): Update search target and example
6595 (do_addr2line): Return extra lines in a vector*
6596 (format_file_lineno): Extract from do_addr2line
6597 (one_addr2line): Add vector* out-param
6598 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6599 when a lineno entry appeared last for its instruction
6600 (Dwarf_line_info): Add vector* out-param
6601 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6602 * symtab.cc (Odr_violation_compare): Include the lineno in the
6603 comparison again.
6604 (linenos_from_loc): New. Combine the canonical line for an
6605 address with its other lines.
6606 (True_if_intersect): New. Helper functor to make
6607 std::set_intersection a query.
6608 (detect_odr_violations): Compare sets of lines instead of just
6609 one line for each function. This became less deterministic, but
6610 has fewer false positives.
6611 * symtab.h: Declarations.
6612 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6613 mix an optimized and non-optimized object in the same binary
6614 (odr_violation2.so): Same.
6615 * testsuite/Makefile.in: Regenerate from Makefile.am.
6616 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6617 * testsuite/debug_msg.sh: Update line numbers and add
6618 assertions.
6619 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6620 non-optimized context.
6621 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6622 isn't inlined, and use OdrDerived in an optimized context.
6623 * testsuite/odr_header1.h: Defines OdrDerived, where
6624 optimization will change the
6625 first-instruction-in-the-destructor's file and line number.
6626 * testsuite/odr_header2.h: Defines OdrBase.
6627
a19fefdc
ILT
66282011-03-09 Ian Lance Taylor <iant@google.com>
6629
6630 * fileread.cc (File_read::clear_views): Don't delete the whole
6631 file view.
6632
ecb351e9
ILT
66332011-03-08 Ian Lance Taylor <iant@google.com>
6634
6635 PR gold/12525
6636 * fileread.cc: #include <climits>.
6637 (GOLD_IOV_MAX): Define.
6638 (File_read::read_multiple): Limit number of entries by iov_max.
6639 * fileread.h (class File_read): Always set max_readv_entries to
6640 128.
6641
b821d13c
ILT
66422011-03-07 Ian Lance Taylor <iant@google.com>
6643
6644 PR gold/12525
6645 * options.h (class General_options): Add -dy and -dn.
6646
89243142
CC
66472011-03-02 Cary Coutant <ccoutant@google.com>
6648
6649 * testsuite/script_test_9.t: Add TLS segment.
6650
d0773f31
ILT
66512011-03-02 Simon Baldwin <simonb@google.com>
6652
6653 * configure.ac: Add check for gnu_indirect_function support in
6654 the toolchain building binutils.
6655 * configure: Rebuild.
6656
9370ce59 66572011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6658
6659 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6660 plugin only symbols.
6661 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6662 in plugin files as not needed in the symbol table.
6663
4cf7a849
ST
66642011-02-11 Sriraman Tallam <tmsriram@google.com>
6665
6666 * output.cc (Output_section::add_input_section): Delay fill
6667 generation for section ordering.
6668
b578bd7d
ILT
66692011-02-09 Ian Lance Taylor <iant@google.com>
6670
6671 PR gold/12316
6672 * object.h (class Sized_relobj): Remove clear_local_symbols.
6673 * reloc.cc (Sized_relobj::do_relocate): Don't call
6674 clear_local_symbols.
6675
9370ce59 66762011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6677
6678 * plugin.cc (is_visible_from_outside): Return true for symbols
6679 in the -u option.
6680
55382fb7
ILT
66812011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6682
6683 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6684 filename.
6685
4e271fff
ST
66862011-02-02 Sriraman Tallam <tmsriram@google.com>
6687
6688 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6689 to std::string.
4e271fff 6690 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6691 section_name to be std::string.
4e271fff
ST
6692 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6693
d433c3ac
ILT
66942011-01-25 Ian Lance Taylor <iant@google.com>
6695
6696 * script.cc (script_add_extern): Rewrite to use
6697 add_symbol_reference.
6698
880473a6
DK
66992011-01-25 Doug Kwan <dougkwan@google.com>
6700
d433c3ac 6701 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6702
f30f86fa
ILT
67032011-01-24 Ian Lance Taylor <iant@google.com>
6704
6705 * options.h (class General_options): Accept
6706 --no-detect-odr-violations.
6707
8e51a0b9
ILT
67082011-01-24 Ian Lance Taylor <iant@google.com>
6709
6710 * version.cc (version_string): Bump to 1.11.
6711
0f3b89d8
ILT
67122011-01-24 Ian Lance Taylor <iant@google.com>
6713
6714 * plugin.cc (class Plugin_rescan): Define new class.
6715 (Plugin_manager::claim_file): Set any_claimed_.
6716 (Plugin_manager::save_archive): New function.
6717 (Plugin_manager::save_input_group): New function.
6718 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6719 necessary.
6720 (Plugin_manager::new_undefined_symbol): New function.
6721 (Plugin_manager::rescan): New function.
6722 (Plugin_manager::rescannable_defines): New function.
6723 (Plugin_manager::add_input_file): Set any_added_.
6724 * plugin.h (class Plugin_manager): define new fields rescannable_,
6725 undefined_symbols_, any_claimed_, and any_added_. Declare
6726 Plugin_rescan as friend. Declare new functions.
6727 (Plugin_manager::Rescannable): Define type.
6728 (Plugin_manager::Rescannable_list): Define type.
6729 (Plugin_manager::Undefined_symbol_list): Define type.
6730 (Plugin_manager::Plugin_manager): Initialize new fields.
6731 * archive.cc (Archive::defines_symbol): New function.
6732 (Add_archive_symbols::run): Pass archive to plugins if any.
6733 * archive.h (class Archive): Declare defines_symbol.
6734 * readsyms.cc (Input_group::~Input_group): New function.
6735 (Finish_group::run): Pass input_group to plugins if any.
6736 * readsyms.h (class Input_group): Declare destructor.
6737 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6738 any.
6739
3bb951e5
ILT
67402011-01-10 Ian Lance Taylor <iant@google.com>
6741
6742 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6743 section as relro.
6744 (Layout::set_segment_offsets): Reset increase_relro before calling
6745 set_section_addresses a second time.
6746
0aa45fac
CC
67472011-01-04 Cary Coutant <ccoutant@google.com>
6748
6749 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6750 sections before NOBITS sections.
6751
0db46eb4
L
67522011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6753
6754 * version.cc (print_version): Update copyright to 2011.
6755
829c9745
CC
67562010-12-23 Cary Coutant <ccoutant@google.com>
6757
6758 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6759 of OS to this->add. Add OD parameter to second form of the function.
6760
7500420b
ILT
67612010-12-20 Ian Lance Taylor <iant@google.com>
6762
6763 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6764 second of two consecutive entries with same offset.
6765
f8e9a930
RW
67662010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6767
6768 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6769 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6770 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6771 to avoid unneeded links against $(LDADD).
6772 * testsuite/Makefile.in: Regenerate.
6773
2fbb4320
ILT
67742010-12-15 Ian Lance Taylor <iant@google.com>
6775
6776 PR gold/12324
6777 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6778 for R_X86_64_32 and R_X86_64_PC32.
6779 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6780 ver_matching_def_pic.o.
6781 (ver_matching_def_pic.o): New target.
6782
fedb228d
RW
67832010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6784
6785 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6786 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6787 Move definition before File_read::View member definitions.
6788 (File_read::View::~View): Initialize and hold lock before
6789 updating current_mapped_bytes.
6790
9b547ce6
RW
67912010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6792
6793 * dwarf_reader.cc: Remove outdated comment.
6794 * gold-threads.cc: Fix typo in error message.
6795 * archive.cc: Fix typos in comments.
6796 * archive.h: Likewise.
6797 * arm-reloc-property.cc: Likewise.
6798 * arm-reloc-property.h: Likewise.
6799 * arm-reloc.def: Likewise.
6800 * arm.cc: Likewise.
6801 * attributes.h: Likewise.
6802 * cref.cc: Likewise.
6803 * ehframe.cc: Likewise.
6804 * fileread.h: Likewise.
6805 * gold.h: Likewise.
6806 * i386.cc: Likewise.
6807 * icf.cc: Likewise.
6808 * incremental.h: Likewise.
6809 * int_encoding.cc: Likewise.
6810 * layout.h: Likewise.
6811 * main.cc: Likewise.
6812 * merge.h: Likewise.
6813 * object.cc: Likewise.
6814 * object.h: Likewise.
6815 * options.cc: Likewise.
6816 * readsyms.cc: Likewise.
6817 * reduced_debug_output.cc: Likewise.
6818 * reloc.cc: Likewise.
6819 * script-sections.cc: Likewise.
6820 * sparc.cc: Likewise.
6821 * symtab.h: Likewise.
6822 * target-reloc.h: Likewise.
6823 * target.cc: Likewise.
6824 * target.h: Likewise.
6825 * timer.cc: Likewise.
6826 * timer.h: Likewise.
6827 * x86_64.cc: Likewise.
6828
83e17bd5
CC
68292010-12-09 Cary Coutant <ccoutant@google.com>
6830
6831 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6832 stack.
6833 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6834 parameter; change all callers.
6835 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6836 * options.h (warn_execstack): New option.
6837
017257f8
DK
68382010-12-07 Doug Kwan <dougkwan@google.com>
6839
6840 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6841 like function call relocations.
6842
c20cbc06
ILT
68432010-12-07 Ian Lance Taylor <iant@google.com>
6844
6845 * archive.cc (Archive::get_elf_object_for_member): Permit
6846 punconfigured to be NULL.
6847 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6848 (Archive::include_member): Pass NULL to get_elf_object_for_member
6849 if we searched for the archive and this is the first included
6850 object.
6851
4dbfafcc
ILT
68522010-12-01 Ian Lance Taylor <iant@google.com>
6853
6854 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6855 track_relocs_type_ field.
6856 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6857 Set track_relocs_type_.
6858 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6859 contents when using RELA relocs.
6860 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6861 reloc_map_.
6862 * reloc.cc (Track_relocs::next_addend): New function.
6863 * reloc.h (class Track_relocs): Declare next_addend.
6864
e5e19edd
ILT
68652010-12-01 Ian Lance Taylor <iant@google.com>
6866
6867 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6868 virtual destructor.
6869
9a5ce24c
ILT
68702010-12-01 Ian Lance Taylor <iant@google.com>
6871
6872 * README: Update compilers known to work and fail.
6873
c7791212
NC
68742010-11-23 Matthias Klose <doko@ubuntu.com>
6875
6876 * configure.in: For --enable-gold, handle value `default' instead of
6877 `both*'. Always install ld as ld.bfd, install as ld if gold is
6878 not the default.
6879 * configure: Regenerate.
6880
0ad220c9
DK
68812010-11-18 Doug Kwan <dougkwan@google.com>
6882
6883 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6884 and right_alignment to be zero. Store result alignment only if it is
6885 greater than existing alignment.
6886
ab8056e0
CC
68872010-11-16 Cary Coutant <ccoutant@google.com>
6888
6889 PR gold/12220
6890 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6891 Check for ".zdebug_line".
6892
fd064a5b
CC
68932010-11-16 Doug Kwan <dougkwan@google.com>
6894 Cary Coutant <ccoutant@google.com>
6895
6896 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6897 by reference; adjust all callers.
6898 * output.cc (Output_segment::set_section_addresses): Adjust references
6899 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6900 list is empty.
6901 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6902 end at page boundary.
6903
6fc6ea19
CC
69042010-11-16 Cary Coutant <ccoutant@google.com>
6905
6906 PR gold/12220
6907 * layout.cc (Layout::choose_output_section): Transform names of
6908 compressed sections even when using a script with a SECTIONS clause.
6909 (Layout::output_section_name): Remove code to transform
6910 compressed debug section names.
6911 * output.cc (Output_section::add_input_section): Use uncompressed
6912 section size when tracking input sections.
6913
95a2c8d6
RS
69142010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6915
6916 * symtab.h (Symbol::NON_PIC_REF): Remove.
6917 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6918 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6919 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6920 (Symbol::use_plt_offset): Take a flags argument and pass it
6921 directly to needs_dynamic_reloc. Restrict check for undefined
6922 weak symbols to function calls.
6923 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6924 (Target_arm::Scan::global): Use it.
6925 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6926 (Target_arm::Relocate::relocate): Likewise.
6927 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6928 parameter with an r_type parameter. Use get_reference_flags
6929 to get the flags.
6930 (Target_arm::Relocate::relocate): Update accordingly.
6931 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6932 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6933 (Target_i386::Scan::global): Likewise.
6934 (Target_i386::Relocate::relocate): Likewise.
6935 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6936 parameter with an r_type parameter. Use get_reference_flags
6937 to get the flags.
6938 (Target_i386::Relocate::relocate): Update accordingly.
6939 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6940 (Target_powerpc::Scan::global): Use it.
6941 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6942 (Target_powerpc::Relocate::relocate): Likewise.
6943 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6944 (Target_sparc::Scan::global): Use it.
6945 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6946 (Target_sparc::Relocate::relocate): Likewise.
6947 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6948 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6949 (Target_x86_64::Scan::global): Likewise.
6950 (Target_x86_64::Relocate::relocate): Likewise.
6951
f625ae50
DK
69522010-11-08 Doug Kwan <dougkwan@google.com>
6953 Cary Coutant <ccoutant@google.com>
6954
6955 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6956 (Arm_exidx_merge_section::section_contents_): New data member.
6957 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6958 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6959 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6960 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6961 in parameters instead of calling Object::section_contents without
6962 locking.
6963 (Arm_output_section::group_section): New parameter TASK. Pass it
6964 to callees that need locking objects.
6965 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6966 to lock EXIDX input sections. Fix a formatting issue. Call
6967 Arm_exidx_merged_section::build_contents to create merged section
6968 contents.
6969 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6970 to lock object of stub table owner.
6971 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6972 TEXT_SIZE to initialize data member TEXT_SIZE_.
6973 (Arm_exidx_input_section::addralign): Fix typo in comment.
6974 (Arm_exidx_input_section::text_size): New method.
6975 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6976 that require locking objects. Lock objects before scanning for stubs
6977 and updating local symbols.
6978 (Arm_input_section<big_endian>::init): Copy contents of original
6979 input section.
2e702c99 6980 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6981 original input section instead of calling Object::section_contents
6982 without locking.
6983 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6984 size without calling Object::section_size().
6985 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6986 for size. Allocate a buffer for merged EXIDX entries.
6987 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6988 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6989 building code to Arm_exidx_merged_section::build_contetns. Write
6990 out contetns in buffer instead of building it on the fly.
6991 (Arm_relobj::make_exidx_input_section): Also pass text section size
6992 to Arm_exidx_input_section constructor.
6993 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6994 (Arm_dynobj::do_read_symbols): Fix memory leak.
6995 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6996 * target.h: (class Task): Add forward declaration.
6997 (Target::relax): Add new parameter TASK and pass it to
6998 Target::do_relax().
6999 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
7000
5f9bcf58
CC
70012010-11-05 Cary Coutant <ccoutant@google.com>
7002
7003 PR gold/10708
7004 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
7005 object when reading from the file.
7006 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
7007 second layout pass.
7008 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
7009 when reading section contents.
7010 (get_section_contents): Likewise.
7011 (icf::find_identical_sections): Likewise.
7012 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
7013 object when reading from the file.
7014 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7015 the object when doing deferred section layout.
7016
e597fa08
NC
70172010-11-03 Nick Clifton <nickc@redhat.com>
7018
7019 PR gold/12001
7020 * script.h (class Symbol_assignment: name): New member. Returns
7021 the name of the symbol.
7022 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7023 Returns true if the given symbol name is on the list of
7024 assignments wating to be processed.
7025 * archive.cc (should_incldue_member): If the symbol is undefined,
7026 check to see if it is on the list of symbols pending assignment.
7027
3f9a3278
ILT
70282010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7029
7030 * script-sections.cc (Script_sections::find_memory_region): Check
7031 for a NULL output section pointer.
7032
d06fb4d1
DK
70332010-10-29 Doug Kwan <dougkwan@google.com>
7034
7035 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7036 Output_section::add_relaxed_input_section.
7037 * output.cc (Output_section::add_relaxed_input_section): Add new
7038 arguments LAYOUT and NAME. Set section order index.
7039 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7040 Copy section order index.
7041 * output.h (Output_section::add_relaxed_input_section): Add new
7042 arguments LAYOUT and NAME.
7043
90e24de5
ILT
70442010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7045
7046 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7047 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7048 * testsuite/Makefile.in: Regenerate.
7049
c9484ea5
DK
70502010-10-20 Doug Kwan <dougkwan@google.com>
7051
7052 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7053 without SHF_LINK_ORDER flags.
7054 * layout.cc (Layout::choose_output_section): Do not filter
7055 SHF_LINK_ORDER flag in a relocatable link.
7056
5bc2f5be
CC
70572010-10-17 Cary Coutant <ccoutant@google.com>
7058
7059 * output.h (Output_segment::set_section_addresses): Change function
7060 signature. Update all callers.
7061 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7062 sections.
7063 (Output_segment::set_section_addresses): Align after last TLS
7064 section. Add padding before last relro section instead of after.
7065
0c91cf04
DK
70662010-10-17 Doug Kwan <dougkwan@google.com>
7067
7068 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7069 GOT output section to be writable.
7070
8c21d9d3
CC
70712010-10-14 Cary Coutant <ccoutant@google.com>
7072
7073 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7074 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7075 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7076 mode.
7077 * incremental.cc (report_command_line): Ignore all forms of
7078 --incremental.
7079 * layout.cc (Layout::Layout): Check parameters for incremental link
7080 mode.
7081 * options.cc (General_options::parse_incremental): New function.
7082 (General_options::parse_no_incremental): New function.
7083 (General_options::parse_incremental_full): New function.
7084 (General_options::parse_incremental_update): New function.
7085 (General_options::incremental_mode_): New data member.
7086 (General_options::finalize): Check incremental_mode_.
7087 * options.h (General_options): Update help text for --incremental.
7088 Add --no-incremental, --incremental-full, --incremental-update.
7089 (General_options::Incremental_mode): New enum type.
7090 (General_options::incremental_mode): New function.
7091 (General_options::incremental_mode_): New data member.
7092 * parameters.cc (Parameters::incremental_mode_): New data member.
7093 (Parameters::set_options): Set incremental_mode_.
7094 (Parameters::set_incremental_full): New function.
7095 (Parameters::incremental): New function.
7096 (Parameters::incremental_update): New function.
7097 (set_parameters_incremental_full): New function.
7098 * parameters.h (Parameters::set_incremental_full): New function.
7099 (Parameters::incremental): New function.
7100 (Parameters::incremental_update): New function.
7101 (Parameters::incremental_mode_): New data member.
7102 (set_parameters_incremental_full): New function.
7103 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7104 incremental link mode.
7105 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7106 (Sized_relobj::do_relocate_sections): Likewise.
7107 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7108 option.
7109 * testsuite/Makefile.in: Regenerate.
7110 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7111
bb32aa18 71122010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7113
7114 * script-sections.h (class Script_sections): Make
7115 Sections_elements typedef public.
7116 * script-sections.cc (class Sort_output_sections): Add elements_
7117 field. Add constructor which sets it; change all callers.
7118 (Sort_output_sections::is_before): New function.
7119 (Sort_output_sections::operator()): Call is_before.
7120 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7121 conditional.
7122 * testsuite/script_test_10.sh: New test. Test script section
7123 order.
7124 * testsuite/script_test_10.t: Likewise.
7125 * testsuite/script_test_10.s: Likewise.
7126 * testsuite/Makefile.am: Wrap the cross linker tests and the
7127 common tests into NATIVE_OR_CROSS_LINKER.
7128 (check_SCRIPTS): Add script_test_10.sh.
7129 (check_DATA): Add script_test_10.stdout.
7130 (script_test_10.o, script_test_10): New targets.
7131 (script_test_10.stdout): New target.
7132 * configure, testsuite/Makefile.in: Regenerate.
7133
3cef7179
ILT
71342010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7135
7136 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7137 error for the deprecated relocations.
7138 (Target_arm::Scan::global): Likewise.
7139 (Target_arm::Relocate::relocate): Likewise.
7140
7411e9a8
RS
71412010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7142
7143 * fileread.cc (Input_file::find_file): Initialize *found_name
7144 and *namep when using the fallback search for case 4.
7145
6a9da32a
CC
71462010-10-11 Cary Coutant <ccoutant@google.com>
7147
7148 * options.h (class General_options): Redefine -z lazy as an alias for
7149 the negation of -z now.
7150
ac897c20
ILT
71512010-10-11 Ian Lance Taylor <iant@google.com>
7152
7153 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7154 binding.
7155
ea5cae92
NC
71562010-10-06 Nick Clifton <nickc@redhat.com>
7157
7158 * script-sections.cc(class Memory_region): Remove
7159 current_lma_offset_ field. Rename current_vma_offset_ to
7160 current_offset_. Add last_section_ field.
7161 (Memory_region::get_current_vma_address): Rename to
7162 get_current_address.
7163 (Memory_region::get_current_lma_address): Delete.
7164 (Memory_region::increment_vma_offset): Rename to
7165 increment_offset.
7166 (Memory_region::increment_lma_offset): Delete.
7167 (Memory_region::attributes_compatible): New method. Returns
7168 true if the provided section is compatible with the region.
7169 (Memory_region::get_last_section): New method. Returns the last
7170 section to use the region.
7171 (Memory_region::set_last_section): New method. Stores the last
7172 section to use the region.
7173 (Script_sections::block_in_region): New method. Returns true if
7174 a block of memory is contained within a region.
7175 (Script_sections::find_memory_region): New method. Locates a
7176 memory region to be used to set a VMA or LMA address.
7177 (Output_section_definition::set_section_addresses): Add code to
7178 check for addresses set by memory regions.
7179 (Output_segment::set_section_addresses): Remove memory region
7180 walking code.
7181 (Script_sections::create_segment): Add a warning if a header
7182 segment is created outside of any region.
7183 * script-sections.h (class Script_sections): Add prototypes for
7184 find_memory_region and block_in_region methods.
7185 * testsuite/memory_test.s: Use .long instead of .word.
7186 * testsuite/memory_test.t: Add some more output sections.
7187 * testsuite/memory_test.sh: Update expected output.
7188
a9bfd952
DK
71892010-10-02 Doug Kwan <dougkwan@google.com>
7190
7191 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7192 defintion to symtab.h
7193 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7194 declaration to defintion.
7195
bacff3ab
NC
71962010-10-01 Nick Clifton <nickc@redhat.com>
7197
7198 * expression.cc (eval): Replace dummy argument with NULL.
7199 (eval_maybe_dot): Check for a NULL result section pointer.
7200 (Symbol_expression::value): Likewise.
7201 (Dot_expression::value): Likewise.
7202 (BINARY_EXPRESSION): Likewise.
7203 (Max_expression::value): Likewise.
7204 (Min_expression::value): Likewise.
7205 (Absolute_expression::value): Likewise.
7206 (Addr_expression::value_from_output_section): Likewise.
7207 (Loaddddr_expression::value_from_output_section): Likewise.
7208 (Segment_start_expression::value): Likewise.
7209 * script-sections.cc
7210 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7211 argument with NULL.
7212 (Sections_elememt_dot_assignment::set_section_addresses):
7213 Likewise.
7214 (Output_data_expression::do_write_to_buffer): Likewise.
7215 (Output_section_definition::finalize_symbols): Likewise.
7216 (Output_section_definition::set_section_addresses): Likewise.
7217
f81bc8b5
DK
72182010-09-30 Doug Kwan <dougkwan@google.com>
7219
7220 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7221
c95e9f27
ST
72222010-09-28 Sriraman Tallam <tmsriram@google.com>
7223
7224 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7225 function.
c95e9f27
ST
7226 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7227 virtual function.
7228 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7229 virtual function.
7230 * icf.cc (get_section_contents): Inline merge sections only when
7231 target allows it.
7232
3cac54d2
RW
72332010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7234
7235 * configure: Regenerate.
7236
2904037a
ILT
72372010-09-17 Ian Lance Taylor <iant@google.com>
7238
7239 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7240 * testsuite/Makefile.am (memory_test.o): New target.
7241 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7242 memory_test.t.
7243 * testsuite/Makefile.in: Rebuild.
2904037a 7244
bca7fb63
DK
72452010-09-17 Doug Kwan <dougkwan@google.com>
7246
7247 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7248 defintion if relocation uses GOT entries of the symbol.
7249 * testsuite/icf_safe_test.sh: Fix test.
7250 * testsuite/icf_safe_so_test.sh: Fix test.
7251
4ef28648
CC
72522010-09-16 Cary Coutant <ccoutant@google.com>
7253
7254 * script_sections.cc (class Memory_region): Remove "NULL" from
7255 vector initializations.
7256
793990de
CC
72572010-09-15 Cary Coutant <ccoutant@google.com>
7258
7259 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7260 Resolve forwarding symbols.
7261
81e015e2
DK
72622010-09-15 Doug Kwan <dougkwan@google.com>
7263
7264 * gold/testsuite/script_test_3.t: Add ARM special sections.
7265 * gold/testsuite/script_test_4.t: Same.
7266 * gold/testsuite/script_test_5.t: Same.
7267 * gold/testsuite/script_test_6.t: Same.
7268 * gold/testsuite/script_test_7.t: Same.
7269 * gold/testsuite/script_test_7.t: Same.
7270 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7271
36171d64
CC
72722010-09-14 Cary Coutant <ccoutant@google.com>
7273
7274 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7275 (Target_x86_64::Relocate::relocate_tls): Replace check for
7276 saw_tls_block_reloc_ with test for executable section.
7277
d89051bd
CC
72782010-09-12 Cary Coutant <ccoutant@google.com>
7279
7280 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7281 position-independent executables to shared libraries need dynamic
7282 relocations.
7283 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7284 position-independent executables.
7285 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7286 * testsuite/Makefile.in: Regenerate.
7287
fca41f0f
NC
72882010-09-10 Nick Clifton <nickc@redhat.com>
7289
7290 PR gold/11997
7291 * testsuite/memory_test.t: Discard any sections that are not
7292 needed.
7293
6695e4b3
L
72942010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7295
7296 PR gold/11996
7297 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7298 "This::" to work around a bug in gcc 4.2.
7299
7300 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7301
0f72bf6f
RÁE
73022010-09-09 Rafael Espindola <espindola@google.com>
7303
7304 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7305 sections with different PF_X flags in the same segment.
7306 (Layout::find_first_load_seg): Search all segments to find the first
7307 one.
7308 * options.h (rosegment): New.
7309
73102010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7311
05a79166 7312 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7313
aa98ff75
DK
73142010-09-08 Doug Kwan <dougkwan@google.com>
7315
7316 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7317 (Arm_relobj::do_relocate_sections): Add new parameter for output
7318 file to match the parent.
7319 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7320 of local symbols instead of input values. Update code to track
7321 changes in gold::relocate_section.
7322 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7323 (Sized_relobj::compute_final_local_value_internal): New methods.
7324 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7325 body into private version of Sized_relobj::compute_final_local_value.
7326 Call the inline method.
7327 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7328 merged symbol value if there is one.
7329 (Symbol_value::has_output_value): New method defintiion.
7330 (Sized_relobj::Compute_final_local_value_status): New enum type.
7331 (Sized_relobj::compute_final_local_value): New methods.
7332 (Sized_relobj::compute_final_local_value_internal): New methods.
7333 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7334 and arm_cortex_a8.sh.
7335 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7336 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7337 New tests.
7338 * Makefile.in: Regenerate.
7339 * testsuite/arm_bl_out_of_range.s: Update test.
7340 * testsuite/thumb_bl_out_of_range.s: Ditto.
7341 * testsuite/thumb_blx_out_of_range.s: Ditto.
7342 * testsuite/arm_branch_out_of_range.sh: New file.
7343 * testsuite/arm_cortex_a8.sh: Ditto.
7344 * testsuite/arm_cortex_a8_b.s: Ditto.
7345 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7346 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7347 * testsuite/arm_cortex_a8_bl.s: Ditto.
7348 * testsuite/arm_cortex_a8_blx.s: Ditto.
7349 * testsuite/arm_cortex_a8_local.s: Ditto.
7350 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7351 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7352
05a79166
L
73532010-09-08 Rafael Espindola <espindola@google.com>
7354
7355 * Makefile.am (memory_test.stdout): Run readelf with -W.
7356 * Makefile.in: Regenerate.
7357 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7358 64 bit output.
7359
33dbc701
RÁE
73602010-09-08 Rafael Espindola <espindola@google.com>
7361
7362 * script-sections.cc (Script_sections::add_memory_region): Convert
7363 field precision to int.
7364 * script.cc (script_set_section_region, script_set_section_region):
7365 Convert field precision to int.
7366
731ca54a
RÁE
73672010-09-08 Rafael Espindola <espindola@google.com>
7368
7369 * arm.cc (do_finalize_sections): Create the __exidx_start and
7370 __exdix_end symbols even when the section is missing.
7371
7f8cd844
NC
73722010-09-08 Nick Clifton <nickc@redhat.com>
7373
7374 * README: Remove claim that MEMORY is not supported.
7375 * expression.cc (script_exp_function_origin)
7376 (script_exp_function_length): Move from here to ...
7377 * script.cc: ... here.
7378 (script_set_section_region, script_add_memory)
7379 (script_parse_memory_attr, script_include_directive): New
7380 functions.
7381 * script-sections.cc
7382 (class Memory_region): New class.
7383 (class Output_section_definition): Add set_memory_region,
7384 set_section_vma, set_section_lma and get_section_name methods.
7385 (class Script_Sections): Add add_memory_region,
7386 find_memory_region, find_memory_region_origin,
7387 find_memory_region_length and set_memory_region methods.
7388 Have set_section_addresses method walk the list of set memory
7389 regions.
7390 Extend the print methos to display memory regions.
7391 * script-sections.h: Add prototypes for new methods.
7392 Add enum for MEMORY region attributes.
7393 * yyscript.y: Add support for parsing MEMORY regions.
7394 * script-c.h: Add prototypes for new functions.
7395 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7396 * testsuite/Makefile.in: Regenerate.
7397 * testsuite/memory_test.sh: New script.
7398 * testsuite/memory_test.s: New assembler source file.
7399 * testsuite/memory_test.t: New linker script.
7400
a4649286
DK
74012010-08-27 Doug Kwan <dougkwan@google.com>
7402
7403 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7404 reference override an existing dynamic weak reference.
7405 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7406 * testsuite/Makefile.in: Regenerate.
7407 * testsuite/dyn_weak_ref.sh: New file.
7408 * testsuite/dyn_weak_ref_1.c: Ditto.
7409 * testsuite/dyn_weak_ref_2.c: Ditto.
7410
b56648ad
ILT
74112010-08-27 Ian Lance Taylor <iant@google.com>
7412
7413 * incremental.h (class Incremental_input_entry): Add virtual
7414 destructor.
7415
809313cb
ILT
74162010-08-27 Ian Lance Taylor <iant@google.com>
7417
7418 * testsuite/start_lib_test_3.c: Mark t3 as used.
7419
11e32464
NC
74202010-08-27 Nick Clifton <nickc@redhat.com>
7421
7422 * options.cc (version_script): Fix small typo in previous
7423 whitespace tidyup.
7424
ca09d69a
NC
74252010-08-25 Nick Clifton <nickc@redhat.com>
7426
7427 * archive.cc: Formatting fixes: Remove whitespace between
7428 typename and following asterisk. Remove whitespace between
7429 function name and opening parenthesis.
7430 * archive.h: Likewise.
7431 * arm.cc: Likewise.
7432 * attributes.cc: Likewise.
7433 * attributes.h: Likewise.
7434 * common.cc: Likewise.
7435 * copy-relocs.cc: Likewise.
7436 * dirsearch.h: Likewise.
7437 * dynobj.cc: Likewise.
7438 * ehframe.cc: Likewise.
7439 * ehframe.h: Likewise.
7440 * expression.cc: Likewise.
7441 * fileread.cc: Likewise.
7442 * fileread.h: Likewise.
7443 * gc.h: Likewise.
7444 * gold-threads.cc: Likewise.
7445 * gold.cc: Likewise.
7446 * i386.cc: Likewise.
7447 * icf.h: Likewise.
7448 * incremental-dump.cc: Likewise.
7449 * incremental.cc: Likewise.
7450 * layout.cc: Likewise.
7451 * layout.h: Likewise.
7452 * main.cc: Likewise.
7453 * merge.cc: Likewise.
7454 * merge.h: Likewise.
7455 * object.cc: Likewise.
7456 * object.h: Likewise.
7457 * options.cc: Likewise.
7458 * options.h: Likewise.
7459 * output.cc: Likewise.
7460 * output.h: Likewise.
7461 * plugin.cc: Likewise.
7462 * plugin.h: Likewise.
7463 * powerpc.cc: Likewise.
7464 * reloc.cc: Likewise.
7465 * script-c.h: Likewise.
7466 * script-sections.cc: Likewise.
7467 * script.cc: Likewise.
7468 * stringpool.cc: Likewise.
7469 * symtab.cc: Likewise.
7470 * symtab.h: Likewise.
7471 * target.cc: Likewise.
7472 * timer.cc: Likewise.
7473 * timer.h: Likewise.
7474 * version.cc: Likewise.
7475 * x86_64.cc: Likewise.
7476
b8fa8750
NC
74772010-08-24 Nick Clifton <nickc@redhat.com>
7478
7479 PR 11899
7480 * layout.cc (segment_precedes): Sort segments by their physical
7481 addresses, if they have been set.
7482
9919d93b
CC
74832010-08-23 Cary Coutant <ccoutant@google.com>
7484
7485 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7486 symbols data.
7487 (Lib_group::include_member): Unlock object after deleting its
7488 symbols data.
7489 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7490 the bug fixed here.
7491
97b4be1c
CC
74922010-08-19 Neil Vachharajani <nvachhar@google.com>
7493 Cary Coutant <ccoutant@google.com>
7494
7495 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7496 constructor, and set_blocker.
7497 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7498 readsyms_blocker_.
7499 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7500 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7501 * testsuite/Makefile.am (start_lib_test): New test case.
7502 * testsuite/Makefile.in: Regenerate.
7503 * testsuite/start_lib_test_main.c: New file.
7504 * testsuite/start_lib_test_1.c: New file.
7505 * testsuite/start_lib_test_2.c: New file.
7506 * testsuite/start_lib_test_3.c: New file.
7507
dd0b1884
ILT
75082010-08-19 Ian Lance Taylor <iant@google.com>
7509
7510 * Makefile.in: Rebuild with automake 1.11.1.
7511 * aclocal.m4: Likewise.
7512 * testsuite/Makefile.in: Likewise.
7513
7223e9ca
ILT
75142010-08-19 Ian Lance Taylor <iant@google.com>
7515
7516 PR 10893
7517 * i386.cc (class Output_data_plt_i386): Update declarations.
7518 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7519 local_ifuncs_ fields.
7520 (Target_i386::do_plt_section_for_global): New function.
7521 (Target_i386::do_plt_section_for_local): New function.
7522 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7523 parameter; change all callers. Initialize global_ifuncs_ and
7524 local_ifuncs_. If doing a static link define __rel_iplt_start and
7525 __rel_iplt_end.
7526 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7527 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7528 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7529 symbols.
7530 (Target_i386::make_plt_section): New function, broken out of
7531 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7532 (Target_i386::make_plt_entry): Call make_plt_section.
7533 (Target_i386::make_local_ifunc_plt_entry): New function.
7534 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7535 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7536 R_386_IRELATIVE to switch.
7537 (Target_i386::Scan::global): Likewise.
7538 (Target_i386::Relocate::relocate): Likewise.
7539 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7540 switch.
7541 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7542 (Target_x86_64::do_plt_section_for_global): New function.
7543 (Target_x86_64::do_plt_section_for_local): New function.
7544 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7545 parameter; change all callers. If doing a static link define
7546 __rela_iplt_start and __rela_iplt_end.
7547 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7548 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7549 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7550 to point to .plt.
7551 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7552 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7553 switch.
7554 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7555 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7556 R_X86_64_IRELATIVE to switch.
7557 (Target_x86_64::Scan::global): Likewise.
7558 (Target_x86_64::Relocate::relocate): Likewise.
7559 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7560 switch.
7561 * target.h (class Target): Add plt_section_for_global and
7562 plt_section_for_local functions. Add do_plt_section_for_global
7563 and do_plt_section_for_local virtual functions.
7564 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7565 clarifying comments.
7566 (Symbol::use_plt_offset): Handle IFUNC symbol.
7567 * object.cc (Sized_relobj::Sized_relobj): Initialize
7568 local_plt_offsets_.
7569 (Sized_relobj::local_has_plt_offset): New function.
7570 (Sized_relobj::local_plt_offset): New function.
7571 (Sized_relobj::set_local_plt_offset): New function.
7572 (Sized_relobj::do_count): Handle IFUNC symbol.
7573 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7574 a bit away from input_shndx_ field. Add set_is_func_symbol and
7575 is_ifunc_symbol functions.
7576 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7577 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7578 local_plt_offsets_ field.
7579 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7580 * output.h (class Output_section_data): Add non-const
7581 output_section function.
7582 (class Output_data_got): Update declarations.
7583 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7584 Add use_plt_offset parameter to global and local constructors.
7585 Change all callers. Change local_sym_index_ field to 31 bits.
7586 Change GSYM_CODE and CONSTANT_CODE accordingly.
7587 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7588 doing a static link don't set sh_link field.
7589 (Output_data_got::Got_entry::write): Use PLT offset if
7590 appropriate.
7591 (Output_data_got::add_global_plt): New function.
7592 (Output_data_got::add_local_plt): New function.
7593 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7594 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7595 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7596 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7597 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7598 IFUNC conditional.
7599 * testsuite/ifunc-sel.h: New file.
7600 * testsuite/ifuncmain1.c: New file.
7601 * testsuite/ifuncmain1vis.c: New file.
7602 * testsuite/ifuncmod1.c: New file.
7603 * testsuite/ifuncdep2.c: New file.
7604 * testsuite/ifuncmain2.c: New file.
7605 * testsuite/ifuncmain3.c: New file.
7606 * testsuite/ifuncmod3.c: New file.
7607 * testsuite/ifuncmain4.c: New file.
7608 * testsuite/ifuncmain5.c: New file.
7609 * testsuite/ifuncmod5.c: New file.
7610 * testsuite/ifuncmain6pie.c: New file.
7611 * testsuite/ifuncmod6.c: New file.
7612 * testsuite/ifuncmain7.c: New file.
7613 * configure, testsuite/Makefile.in: Rebuild.
7614
56f75c03
ILT
76152010-08-18 Ian Lance Taylor <iant@google.com>
7616
7617 * incremental.cc
7618 (Output_section_incremental_inputs::write_input_files): Add cast
7619 to avoid signed/unsigned comparison warning.
7620 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7621
55455f89
CC
76222010-08-12 Cary Coutant <ccoutant@google.com>
7623
7624 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7625
e2054bcb
ILT
76262010-08-13 Ian Lance Taylor <iant@google.com>
7627
7628 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7629
74f67560
DK
76302010-08-12 Cary Coutant <ccoutant@google.com>
7631 Doug Kwan <dougkwan@google.com>
7632
7633 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7634 defintion overrides non-weak undef, remember that the original undef
7635 is not weak.
7636 * symtab.cc (Symbol_table::sized_write_global): For undef without
7637 an original weak binding, set binding to global in output.
7638 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7639 * testsuite/Makefile.in: Regenerate.
7640 * testsuite/strong_ref_weak_def.sh: New file.
7641 * testsuite/strong_ref_weak_def_1.c: Ditto.
7642 * testsuite/strong_ref_weak_def_2.c: Ditto.
7643
d1238d12
CC
76442010-08-12 Cary Coutant <ccoutant@google.com>
7645
7646 * testsuite/incremental_test.sh: Rewrite.
7647 * testsuite/incremental_test_1.c: Rewrite.
7648 * testsuite/incremental_test_2.c: Rewrite.
7649
0e70b911
CC
76502010-08-12 Cary Coutant <ccoutant@google.com>
7651
7652 * arm.cc (Target_arm::got_size): Add const.
7653 (Target_arm::got_entry_count): New function.
7654 (Target_arm::plt_entry_count): New function.
7655 (Target_arm::first_plt_entry_offset): New function.
7656 (Target_arm::plt_entry_size): New function.
7657 (Output_data_plt_arm::entry_count): New function.
7658 (Output_data_plt_arm::first_plt_entry_offset): New function.
7659 (Output_data_plt_arm::get_plt_entry_size): New function.
7660 * i386.cc (Target_i386::got_size): Add const.
7661 (Target_i386::got_entry_count): New function.
7662 (Target_i386::plt_entry_count): New function.
7663 (Target_i386::first_plt_entry_offset): New function.
7664 (Target_i386::plt_entry_size): New function.
7665 (Output_data_plt_i386::entry_count): New function.
7666 (Output_data_plt_i386::first_plt_entry_offset): New function.
7667 (Output_data_plt_i386::get_plt_entry_size): New function.
7668 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7669 find_incremental_inputs_sections. Dump incremental_got_plt section.
7670 * incremental.cc: Include target.h.
7671 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7672 parameter. Adjust all callers. Find incremental_got_plt section.
7673 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7674 section.
7675 (Output_section_incremental_inputs::set_final_data_size): Calculate
7676 size of incremental_got_plt section.
7677 (Output_section_incremental_inputs::do_write): Write the
7678 incremental_got_plt section.
7679 (Got_plt_view_info): New struct.
7680 (Local_got_offset_visitor): New class.
7681 (Global_got_offset_visitor): New class.
7682 (Global_symbol_visitor_got_plt): New class.
7683 (Output_section_incremental_inputs::write_got_plt): New function.
7684 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7685 Add parameter. Adjust all callers.
7686 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7687 (Incremental_inputs::got_plt_section): New function.
7688 (Incremental_inputs::got_plt_section_): New data member.
7689 (Incremental_got_plt_reader): New class.
7690 * layout.cc (Layout::create_incremental_info_sections): Add the
7691 incremental_got_plt section.
7692 * object.h (Got_offset_list::get_list): New function.
7693 (Got offset_list::for_all_got_offsets): New function.
7694 (Sized_relobj::local_got_offset_list): New function.
7695 * powerpc.cc (Target_powerpc::got_size): Add const.
7696 (Target_powerpc::got_entry_count): New function.
7697 (Target_powerpc::plt_entry_count): New function.
7698 (Target_powerpc::first_plt_entry_offset): New function.
7699 (Target_powerpc::plt_entry_size): New function.
7700 (Output_data_plt_powerpc::entry_count): New function.
7701 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7702 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7703 * sparc.cc (Target_sparc::got_size): Add const.
7704 (Target_sparc::got_entry_count): New function.
7705 (Target_sparc::plt_entry_count): New function.
7706 (Target_sparc::first_plt_entry_offset): New function.
7707 (Target_sparc::plt_entry_size): New function.
7708 (Output_data_plt_sparc::entry_count): New function.
7709 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7710 (Output_data_plt_sparc::get_plt_entry_size): New function.
7711 * symtab.h (Symbol::got_offset_list): New function.
7712 (Symbol_table::for_all_symbols): New function.
7713 * target.h (Sized_target::got_entry_count): New function.
7714 (Sized_target::plt_entry_count): New function.
7715 (Sized_target::plt_entry_size): New function.
7716 * x86_64.cc (Target_x86_64::got_size): Add const.
7717 (Target_x86_64::got_entry_count): New function.
7718 (Target_x86_64::plt_entry_count): New function.
7719 (Target_x86_64::first_plt_entry_offset): New function.
7720 (Target_x86_64::plt_entry_size): New function.
7721 (Output_data_plt_x86_64::entry_count): New function.
7722 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7723 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7724
09ec0418
CC
77252010-08-12 Cary Coutant <ccoutant@google.com>
7726
7727 * archive.cc: Include incremental.h.
7728 (Archive::Archive): Initialize incremental_info_.
7729 (Archive::include_member): Record archive members in incremental info.
7730 (Add_archive_symbols::run): Record begin and end of an archive in
7731 incremental info.
7732 (Lib_group::include_member): Record objects in incremental info.
7733 * archive.h (Incremental_archive_entry): Forward declaration.
7734 (Archive::set_incremental_info): New member function.
7735 (Archive::incremental_info): New member function.
7736 (Archive::Unused_symbol_iterator): New class.
7737 (Archive::unused_symbols_begin): New member function.
7738 (Archive::unused_symbols_end): New member function.
7739 (Archive::incremental_info_): New data member.
7740 * incremental-dump.cc (find_input_containing_global): New function.
7741 (dump_incremental_inputs): Dump new incremental info sections.
7742 * incremental.cc: Include symtab.h.
7743 (Output_section_incremental_inputs): New class.
7744 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7745 new incremental info sections.
7746 (Sized_incremental_binary::do_check_inputs): Likewise.
7747 (Incremental_inputs::report_archive): Remove.
7748 (Incremental_inputs::report_archive_begin): New function.
7749 (Incremental_inputs::report_archive_end): New function.
7750 (Incremental_inputs::report_object): New function.
7751 (Incremental_inputs::finalize_inputs): Remove.
7752 (Incremental_inputs::report_input_section): New function.
7753 (Incremental_inputs::report_script): Rewrite.
7754 (Incremental_inputs::finalize): Do nothing but finalize string table.
7755 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7756 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7757 (Incremental_inputs::create_data_sections): New function.
7758 (Incremental_inputs::relocs_entsize): New function.
7759 (Output_section_incremental_inputs::set_final_data_size): New function.
7760 (Output_section_incremental_inputs::do_write): New function.
7761 (Output_section_incremental_inputs::write_header): New function.
7762 (Output_section_incremental_inputs::write_input_files): New function.
7763 (Output_section_incremental_inputs::write_info_blocks): New function.
7764 (Output_section_incremental_inputs::write_symtab): New function.
7765 * incremental.h (Incremental_script_entry): Forward declaration.
7766 (Incremental_object_entry): Forward declaration.
7767 (Incremental_archive_entry): Forward declaration.
7768 (Incremental_inputs): Forward declaration.
7769 (Incremental_inputs_header_data): Remove.
7770 (Incremental_inputs_header): Remove.
7771 (Incremental_inputs_header_write): Remove.
7772 (Incremental_inputs_entry_data): Remove.
7773 (Incremental_inputs_entry): Remove.
7774 (Incremental_inputs_entry_write): Remove.
7775 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7776 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7777 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7778 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7779 Likewise.
7780 (Incremental_input_entry): New class.
7781 (Incremental_script_entry): New class.
7782 (Incremental_object_entry): New class.
7783 (Incremental_archive_entry): New class.
7784 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7785 (Incremental_inputs::report_inputs): Remove.
7786 (Incremental_inputs::report_archive): Remove.
7787 (Incremental_inputs::report_archive_begin): New function.
7788 (Incremental_inputs::report_archive_end): New function.
7789 (Incremental_inputs::report_object): Change prototype.
7790 (Incremental_inputs::report_input_section): New function.
7791 (Incremental_inputs::report_script): Change prototype.
7792 (Incremental_inputs::get_reloc_count): New function.
7793 (Incremental_inputs::set_reloc_count): New function.
7794 (Incremental_inputs::create_data_sections): New function.
7795 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7796 (Incremental_inputs::inputs_section): New function.
7797 (Incremental_inputs::symtab_section): New function.
7798 (Incremental_inputs::relocs_section): New function.
7799 (Incremental_inputs::get_stringpool): Add const.
7800 (Incremental_inputs::command_line): Add const.
7801 (Incremental_inputs::inputs): Remove.
7802 (Incremental_inputs::command_line_key): New function.
7803 (Incremental_inputs::input_file_count): New function.
7804 (Incremental_inputs::input_files): New function.
7805 (Incremental_inputs::relocs_entsize): New function.
7806 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7807 (Incremental_inputs::finalize_inputs): Remove.
7808 (Incremental_inputs::Input_info): Remove.
7809 (Incremental_inputs::lock_): Remove.
7810 (Incremental_inputs::inputs_): Change type.
7811 (Incremental_inputs::inputs_map_): Remove.
7812 (Incremental_inputs::current_object_entry_): New data member.
7813 (Incremental_inputs::inputs_section_): New data member.
7814 (Incremental_inputs::symtab_section_): New data member.
7815 (Incremental_inputs::relocs_section_): New data member.
7816 (Incremental_inputs::reloc_count_): New data member.
7817 (Incremental_inputs_reader): New class.
7818 (Incremental_symtab_reader): New class.
7819 (Incremental_relocs_reader): New class.
7820 * layout.cc (Layout::finalize): Move finalization of incremental info
7821 and creation of incremental info sections to follow finalization of
7822 symbol table. Set offsets for postprocessing sections.
7823 (Layout::create_incremental_info_sections): Call
7824 Incremental_inputs::create_data_sections. Add incremental symtab
7825 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7826 sections to layout after input sections.
7827 * layout.h (struct Timespec): Forward declaration.
7828 (Layout::incremental_inputs): Add const.
7829 (Layout::create_incremental_info_sections): Add parameter.
7830 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7831 * object.cc: Include incremental.h.
7832 (Relobj::finalize_incremental_relocs): New function.
7833 (Sized_relobj::do_layout): Record input sections in incremental info.
7834 * object.h (Object::output_section): New function.
7835 (Object::output_section_offset): Moved from Relobj.
7836 (Object::get_incremental_reloc_base): New function.
7837 (Object::get_incremental_reloc_count): New function.
7838 (Object::do_output_section): New function.
7839 (Object::do_output_section_offset): Moved from Relobj.
7840 (Object::do_get_incremental_reloc_base): New function.
7841 (Object::do_get_incremental_reloc_count): New function.
7842 (Object::Object): Initialize new data members.
7843 (Relobj::output_section): Renamed do_output_section and moved to
7844 protected.
7845 (Relobj::output_section_offset): Moved to Object.
7846 (Relobj::do_get_incremental_reloc_base): New function.
7847 (Relobj::do_get_incremental_reloc_count): New function.
7848 (Relobj::allocate_incremental_reloc_counts): New function.
7849 (Relobj::count_incremental_reloc): New function.
7850 (Relobj::finalize_incremental_relocs): New function.
7851 (Relobj::next_incremental_reloc_index): New function.
7852 (Relobj::reloc_counts_): New data member.
7853 (Relobj::reloc_bases_): New data member.
7854 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7855 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7856 (Sized_relobj::incremental_relocs_scan): New function.
7857 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7858 (Sized_relobj::incremental_relocs_write): New function.
7859 (Sized_relobj::incremental_relocs_write_reltype): New function.
7860 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7861 incremental link.
7862 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7863 archives and object files elsewhere.
7864 (Add_symbols::run): Report object files here.
7865 (Finish_group::run): Report end of archive at end of group.
7866 * reloc.cc: Include layout.h, incremental.h.
7867 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7868 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7869 (Sized_relobj::incremental_relocs_scan): New function.
7870 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7871 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7872 (Sized_relobj::incremental_relocs_write): New function.
7873 (Sized_relobj::incremental_relocs_write_reltype): New function.
7874 * script.cc (read_input_script): Rewrite test for incremental link.
7875 Change call to Incremental_inputs::report_script.
7876 * symtab.h (Symbol_table::first_global_index): New function.
7877 (Symbol_table::output_count): New function.
7878
ce0d1972
DK
78792010-08-12 Doug Kwan <dougkwan@google.com>
7880
7881 * arm.cc (Target_arm::merge_object_attributes): Check command line
7882 options --no-wchar-size-warning and --no-enum-size-warning.
7883 * options.h (General_options): Add ld-compatible options
7884 --no-enum-size-warning and --no-wchar-size-warning.
7885
6e5710ce
ILT
78862010-08-04 Ian Lance Taylor <iant@google.com>
7887
7888 * x86_64.cc (Target_x86_64::Scan::local): Use
7889 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7890 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7891 (Target_x86_64::Scan::global): Likewise.
7892 (Target_x86_64::Relocate::relocate): Likewise.
7893 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7894 Likewise.
7895
fef830db
CC
78962010-08-03 Cary Coutant <ccoutant@google.com>
7897
7898 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7899 to reserve space in merged_strings vector. Keep total input size
7900 for stats.
7901 (Output_merge_string::do_print_merge_stats): Print total input size.
7902 * merge.h (Output_merge_string): Add input_size_ field.
7903 * stringpool.cc (Stringpool_template::string_length): Move
7904 implementations out of Stringpool_template class and place in
7905 stringpool.h.
7906 * stringpool.h (string_length): Move out of Stringpool_template.
7907
1e3811b0
ILT
79082010-08-03 Ian Lance Taylor <iant@google.com>
7909
7910 PR 11712
7911 * layout.cc (relaxation_loop_body): If address of load segment is
7912 set, adjust address to include headers if possible.
7913
7af0c620
ILT
79142010-08-03 Ian Lance Taylor <iant@google.com>
7915
7916 * version.cc (version_string): Bump to 1.10.
7917
22f0da72
ILT
79182010-08-03 Ian Lance Taylor <iant@google.com>
7919
7920 PR 11805
7921 * layout.h (enum Output_section_order): Define.
7922 (class Layout): Update declarations.
7923 * layout.cc (Layout::get_output_section): Add order parameter.
7924 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7925 is_first_non_relro parameters. Change all callers.
7926 (Layout::choose_output_section): Likewise.
7927 (Layout::add_output_section_data): Likewise.
7928 (Layout::make_output_section): Likewise. Set order.
7929 (Layout::default_section_order): New function.
7930 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7931 * output.cc (Output_section::Output_section): Initialize order_.
7932 Don't initialize deleted fields.
7933 (Output_segment::Output_segment): Don't initialize deleted
7934 fields.
7935 (Output_segment::add_output_section_to_load): New function
7936 replacing add_output_section. Change all callers to call this or
7937 add_output_section_to_nonload.
7938 (Output_segment::add_output_section_to_nonload): New function.
7939 (Output_segment::remove_output_section): Rewrite.
7940 (Output_segment::add_initial_output_data): Likewise.
7941 (Output_segment::has_any_data_sections): Likewise.
7942 (Output_segment::is_first_section_relro): Likewise.
7943 (Output_segment::maximum_alignment): Likewise.
7944 (Output_segment::has_dynamic_reloc): New function replacing
7945 dynamic_reloc_count. Change all callers.
7946 (Output_segment::has_dynamic_reloc_list): New function replacing
7947 dynamic_reloc_count_list. Change all callers.
7948 (Output_segment::set_section_addresses): Rewrite.
7949 (Output_segment::set_offset): Rewrite.
7950 (Output_segment::find_first_and_last_list): Remove.
7951 (Output_segment::set_tls_offsets): Rewrite.
7952 (Output_segment::first_section_load_address): Likewise.
7953 (Output_segment::output_section_count): Likewise.
7954 (Output_segment::section_with_lowest_load_address): Likewise.
7955 (Output_segment::write_section_headers): Likewise.
7956 (Output_segment::print_sections_to_map): Likewise.
7957 * output.h (class Output_data): Remove dynamic_reloc_count_
7958 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7959 (Output_data::add_dynamic_reloc): Rewrite.
7960 (Output_data::has_dynamic_reloc): New function.
7961 (Output_data::dynamic_reloc_count): Remove.
7962 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7963 is_last_relro_, is_first_non_relro_, is_interp_,
7964 is_dynamic_linker_section_ fields. Add order and set_order
7965 functions. Remove is_relro_local, set_is_relro_local,
7966 is_last_relro, set_is_last_relro, is_first_non_relro,
7967 set_is_first_non_relro functions, is_interp, set_is_interp,
7968 is_dynamic_linker_section, and set_is_dynamic_linker_section
7969 functions.
7970 (class Output_segment): Change Output_data_list from std::list to
7971 std:;vector. Add output_lists_ field. Remove output_data_ and
7972 output_bss_ fields. Update declarations.
7973
3ff2ccb0
ILT
79742010-08-02 Ian Lance Taylor <iant@google.com>
7975
7976 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7977 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7978 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7979
88a4108b
ILT
79802010-08-02 Ian Lance Taylor <iant@google.com>
7981
7982 PR 11855
7983 * script.cc (Script_options::Script_options): Initialize
7984 symbol_definitions_ and symbol_references_.
7985 (Script_options::add_symbol_assignment): Update
7986 symbol_definitions_ and symbol_references_.
7987 (Script_options::add_symbol_reference): New function.
7988 (script_symbol): New function.
7989 * script.h (class Script_options): Add symbol_definitions_ and
7990 symbol_references_ fields.
7991 (Script_options::referenced_const_iterator): New type.
7992 (Script_options::referenced_begin): New function.
7993 (Script_options::referenced_end): New function.
7994 (Script_options::is_referenced): New function.
7995 (Script_options::any_unreferenced): New function.
7996 * script-c.h (script_symbol): Declare.
7997 * yyscript.y (exp): Call script_symbol.
7998 * symtab.cc: Include "script.h".
7999 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
8000 Change all callers. Check symbols referenced by scripts.
8001 (Symbol_table::add_undefined_symbols_from_command_line): Add
8002 layout parameter. Change all callers.
8003 (Symbol_table::do_add_undefined_symbols_from_command_line):
8004 Likewise. Break out loop body. Check symbols referenced by
8005 scripts.
8006 (Symbol_table::add_undefined_symbol_from_command_line): New
8007 function broken out of
8008 do_add_undefined_symbols_from_command_line.
8009 * symtab.h (class Symbol_table): Update declarations.
8010 * archive.cc: Include "layout.h".
8011 (Archive::should_include_member): Add layout parameter. Change
8012 all callers. Check for symbol mentioned in expression.
8013 * archive.h (class Archive): Update declaration.
8014 * object.cc (Sized_relobj::do_should_include_member): Add layout
8015 parameter.
8016 * object.h (Object::should_include_member): Add layout parameter.
8017 Change all callers.
8018 (Object::do_should_include_member): Add layout parameter.
8019 (class Sized_relobj): Update declaration.
8020 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8021 parameter.
8022 * dynobj.h (class Sized_dynobj): Update declaration.
8023 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8024 layout parameter.
8025 * plugin.h (class Sized_pluginobj): Update declaration.
8026
5f1ab67a
ILT
80272010-08-02 Ian Lance Taylor <iant@google.com>
8028
8029 PR 11866
8030 * output.cc (Output_segment::set_offset): Search for the first and
8031 last sections rather than assuming that the list is in order.
8032 (Output_segment::find_first_and_last_list): New function.
8033 * output.h (class Output_segment): Update declarations.
8034 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8035 (relro_strip_test_SOURCES): New variable.
8036 (relro_strip_test_DEPENDENCIES): New variable.
8037 (relro_strip_test_LDFLAGS): New variable.
8038 (relro_strip_test_LDADD): New variable.
8039 (relro_strip_test.so): New target.
8040
a8df5856
ILT
80412010-08-02 Ian Lance Taylor <iant@google.com>
8042
8043 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8044 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8045 (Target_i386::got_tlsdesc_section): New function.
8046 (Target_i386::got_section): Create space for GOT entries for
8047 TLSDESC relocations.
8048 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8049 R_386_TLS_GOTDESC.
8050 (Target_i386::Scan::global): Likewise.
8051 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8052 using TLSDESC GOT.
8053 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8054 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8055 (Target_x86_64::got_tlsdesc_section): New function.
8056 (Target_x86_64::got_section): Create space for GOT entries for
8057 TLSDESC relocations.
8058 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8059 R_386_TLS_GOTDESC.
8060 (Target_x86_64::Scan::global): Likewise.
8061 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8062 using TLSDESC GOT.
8063
0c10a0a6
ILT
80642010-08-02 Ian Lance Taylor <iant@google.com>
8065
8066 * testsuite/final_layout.sh: Use dc to convert from hex to
8067 decimal.
8068
41cbeecc
ST
80692010-07-29 Sriraman Tallam <tmsriram@google.com>
8070
8071 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8072 paramter to the call to gold::gc_process_relocs.
8073 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8074 paramter to the call to gold::gc_process_relocs.
8075 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8076 parameter to the call to gold::gc_process_relocs.
8077 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8078 template parameter to the call to gold::gc_process_relocs.
8079 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8080 paramter to the call to gold::gc_process_relocs.
8081 * gc.h (get_embedded_addend_size): New function.
8082 (gc_process_relocs): Save the size of the reloc for use by ICF.
8083 * icf.cc (get_section_contents): Get the addend from the text section
8084 for SHT_REL relocation sections.
8085 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8086 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8087 * int_encoding.h (read_from_pointer): New overloaded function.
8088 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8089 * testsuite/icf_sht_rel_addend_test.sh: New file.
8090 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8091 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8092
6ea55b82
RW
80932010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8094
8095 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8096 * Makefile.in: Regenerate.
8097 * testsuite/Makefile.in: Regenerate.
8098
9691462b
ILT
80992010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8100
8101 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8102 * gold/testsuite/debug_msg.cc: Likewise.
8103 * gold/testsuite/odr_violation1.cc
8104 * gold/testsuite/odr_violation2.cc
8105
76897331
CC
81062010-07-21 Cary Coutant <ccoutant@google.com>
8107
8108 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8109 string, and length fields.
8110 (Output_merge_string::Merged_strings_list): New type.
8111 (Output_merge_string::Merged_strings_lists): New typedef.
8112 (Output_merge_string): Replace merged_strings_ with
8113 merged_strings_lists_.
8114 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8115 Merged_strings_list per input object and section. Don't store pointer
8116 to the string. Don't store length with each merged string entry.
8117 (Output_merge_string::finalize_merged_data): Loop over list of merged
8118 strings lists. Recompute length of each merged string.
8119
78384e8f
CC
81202010-07-15 Cary Coutant <ccoutant@google.com>
8121
8122 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8123 here.
8124
783659f9
ILT
81252010-07-14 Ian Lance Taylor <iant@google.com>
8126
8127 * descriptors.cc (Descriptors::open): Report correct name in error
8128 message.
8129
131687b4
DK
81302010-07-13 Doug Kwan <dougkwan@google.com>
8131
8132 * arm.cc (Arm_input_section::Arm_input_section): For a
8133 SHT_ARM_EXIDX section, always keeps the input sections.
8134 (Arm_input_section::set_exidx_section_link): New method.
8135 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8136 has_errors_ to false.
8137 (Arm_exidx_input_section::has_errors,
8138 Arm_exidx_input_section::set_has_errors): New methods.
8139 (Arm_exidx_input_section::has_errors_): New data member.
8140 (Arm_relobj::get_exidx_shndx_list): New method.
8141 (Arm_output_section::append_text_sections_to_list): Do not skip
8142 section without SHF_EXECINSTR.
8143 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8144 errors.
2e702c99 8145 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8146 section header. Make error messages more verbose. Check for
8147 a non-executable section linked to an EXIDX section.
8148 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8149 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8150 check that there is no deferred EXIDX section if we exit early.
8151 Instead of not making an EXIDX section in case of an error, make one
8152 and set the has_errors flag of it.
8153 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8154 in a relocatable link.
8155 (Target_arm::do_relax): Look for the EXIDX output section instead of
8156 assuming that it is called .ARM.exidx.
2e702c99 8157 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8158 section list. Do not check for SHF_EXECINSTR section flags but
8159 skip any input section with errors.
8160 * output.cc (Output_section::Output_section): Initialize
8161 always_keeps_input_sections_ to false.
8162 (Output_section::add_input_section): Check for
8163 always_keeps_input_sections_.
8164 * output.h (Output_section::always_keeps_input_sections,
8165 Output_section::set_always_keeps_input_sections): New methods.
8166 (Output_section::always_keeps_input_sections): New data member.
8167
69517287
RÁE
81682010-07-13 Rafael Espindola <espindola@google.com>
8169
8170 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8171 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8172
82742395
ILT
81732010-07-13 Philip Herron <herron.philip@googlemail.com>
8174 Ian Lance Taylor <iant@google.com>
8175
8176 * output.h (Output_section_lookup_maps::add_merge_section):
8177 Correct check of whether value was inserted.
8178 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8179 (Output_section_lookup_maps::add_relaxed_input_section):
8180 Likewise.
8181 * arm.cc (Target_arm::got_section): Remove used local os.
8182 * i386.cc (Target_i386::got_section): Likewise.
8183 * x86_64.cc (Target_x86_64::got_section): Likewise.
8184 * sparc.cc (Target_sparc::got_section): Likewise.
8185 (Target_sparc::relocate): Remove unused local have_got_offset.
8186 * powerpc.cc (Target_powerpc::relocate): Likewise.
8187
f2d707b5
ILT
81882010-07-13 Ian Lance Taylor <iant@google.com>
8189
241531d6
ILT
8190 * compressed_output.cc (zlib_decompress): Fix signature in
8191 !HAVE_ZLIB_H case.
8192
f2d707b5
ILT
8193 * archive.cc (Archive::include_member): Unlock an external member
8194 of a thin archive. Don't bother to delete an object we know is
8195 NULL.
8196
a2e47362
CC
81972010-07-12 Cary Coutant <ccoutant@google.com>
8198
8199 * compressed_output.cc (zlib_decompress): New function.
8200 (get_uncompressed_size): New function.
8201 (decompress_input_section): New function.
8202 * compressed_output.h (get_uncompressed_size): New function.
8203 (decompress_input_section): New function.
8204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8205 Handle compressed debug sections.
8206 * layout.cc (is_compressed_debug_section): New function.
8207 (Layout::output_section_name): Map compressed section names to
8208 canonical names.
8209 * layout.h (is_compressed_debug_section): New function.
8210 (is_debug_info_section): Recognize compressed debug sections.
8211 * merge.cc: Include compressed_output.h.
8212 (Output_merge_data::do_add_input_section): Handle compressed
8213 debug sections.
8214 (Output_merge_string::do_add_input_section): Handle compressed
8215 debug sections.
8216 * object.cc: Include compressed_output.h.
8217 (Sized_relobj::Sized_relobj): Initialize new data members.
8218 (build_compressed_section_map): New function.
8219 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8220 * object.h (Object::section_is_compressed): New method.
8221 (Object::do_section_is_compressed): New method.
8222 (Sized_relobj::Compressed_section_map): New type.
8223 (Sized_relobj::do_section_is_compressed): New method.
8224 (Sized_relobj::compressed_sections_): New data member.
8225 * output.cc (Output_section::add_input_section): Handle compressed
8226 debug sections.
8227 * reloc.cc: Include compressed_output.h.
8228 (Sized_relobj::write_sections): Handle compressed debug sections.
8229
ce279a62
CC
82302010-07-08 Cary Coutant <ccoutant@google.com>
8231
8232 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8233 weak when resolving to a dynamic def.
8234 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8235 for weak undef/dynamic def cases. Adjust callers.
8236 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8237 undef_binding_weak_.
8238 (Symbol_table::sized_write_globals): Adjust symbol binding.
8239 (Symbol_table::sized_write_symbol): Add binding parameter.
8240 * symtab.h (Symbol::set_undef_binding): New method.
8241 (Symbol::is_undef_binding_weak): New method.
8242 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8243 (Symbol_table::should_override): Add new parameter.
8244 (Symbol_table::sized_write_symbol): Add new parameter.
8245
8246 * testsuite/weak_undef_file1.cc: Add new test case.
8247 * testsuite/weak_undef_file2.cc: Fix header comment.
8248 * testsuite/weak_undef_test.cc: Add new test case.
8249
b2286c10
DK
82502010-06-29 Doug Kwan <dougkwan@google.com>
8251
8252 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8253 Initialize USE_SYMBOL_.
8254 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8255 definition.
8256 (Arm_reloc_property::uses_symbol_): New data member declaration.
8257 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8258 uses symbol value and symbol is undefined but not weakly undefined.
8259
4802450a
RÁE
82602010-06-28 Rafael Espindola <espindola@google.com>
8261
8262 * plugin.cc (Plugin::load): Use dlerror.
8263
e5ca47ba
ILT
82642010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8265
8266 * symtab.cc (detect_odr_violations): When reporting an ODR
8267 violation, report an object where the symbol is defined.
8268
8a75a161
DK
82692010-06-25 Doug Kwan <dougkwan@google.com>
8270
8271 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8272 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8273 definition.
8274 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8275 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8276 target hook to detect function points.
8277 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8278 * icf.h (Icf::check_section_for_function_pointers): Change type of
8279 parameter SECTION_NAME to const reference to std::string. Use
8280 target hook to determine if section may have unsafe pointers.
8281 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8282 method definition.
8283
42218b9f
RÁE
82842010-06-21 Rafael Espindola <espindola@google.com>
8285
8286 * fileread.cc (Input_file::find_fie): New
8287 (Input_file::open): Use Input_file::find_fie.
8288 * fileread.h (Input_file::find_fie): New
8289 * plugin.cc (set_extra_library_path): New.
8290 (Plugin::load): Add set_extra_library_path to the transfer vector.
8291 (Plugin_manager::set_extra_library_path): New.
8292 (Plugin_manager::add_input_file): Use the extra search path if set.
8293 (set_extra_library_path(): New.
8294 * plugin.h (Plugin_manager): Add set_extra_library_path and
8295 extra_search_path_.
8296
a0506cca
CC
82972010-06-19 Cary Coutant <ccoutant@google.com>
8298
8299 * layout.cc (gdb_sections): Add .debug_types.
8300 (lines_only_debug_sections): Likewise.
8301
6508b958
RÁE
83022010-06-18 Rafael Espindola <espindola@google.com>
8303
8304 * plugin.cc (add_input_file,add_input_library)
8305 (Plugin_manager::add_input_file): Make filename arguments const.
8306 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8307 const.
8308
3e235302
DK
83092010-06-16 Doug Kwan <dougkwan@google.com>
8310
8311 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8312 .ARM.attributes section if we have not merged any input
8313 attributes sections.
8314
106e8a6c
DK
83152010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8316
8317 * arm.cc: Allow combining objects with no EABI version
8318 information.
8319
91ff43fe
RÁE
83202010-06-15 Rafael Espindola <espindola@google.com>
8321
8322 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8323
68ed838c
ILT
83242010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8325
8326 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8327 (struct iovec): Correct !HAVE_READV definition.
8328
f3a2388f
CC
83292010-06-10 Cary Coutant <ccoutant@google.com>
8330
8331 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8332 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8333 reloc sections.
8334 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8335
8336 PR 11683
8337 * symtab.h (Symbol::is_placeholder): New member function.
8338 * target-reloc.h (relocate_section): Check for placeholder symbols.
8339
8340 * testsuite/Makefile.am (plugin_test_8): New test.
8341 (plugin_test_9): New test.
8342 * testsuite/Makefile.in: Regenerate.
8343
e1df38aa
NC
83442010-06-09 Nick Clifton <nickc@redhat.com>
8345
8346 * yyscript.y (input_list_element): Allow strings prefixed with
8347 the '-' character. Treat these as libraries.
8348 * script.cc (script_add_library): New function. Adds a library
8349 specified by "-l<name>" found in an input script.
8350 * script-c.h: Add prototype for script_add_library.
8351
25bbe950
DK
83522010-06-07 Doug Kwan <dougkwan@google.com>
8353
8354 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8355 Restrict stub-group size to be within long conditional branch
8356 range when working around cortex-A8 erratum.
8357
0f32ea4c
ILT
83582010-06-07 Damien Diederen <dd@crosstwine.com>
8359
8360 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8361 #ifdef typo.
8362
8fe2a369
ST
83632010-06-03 Sriraman Tallam <tmsriram@google.com>
8364
8365 PR gold/11658
8366 * output.cc
8367 (Output_section::Input_section_sort_entry::compare_section_ordering):
8368 Change to return non-zero correctly.
8369 (Output_section::Input_section_sort_section_order_index_compare
8370 ::operator()): Change to fix ambiguity in comparisons.
8371
6e9ba2ca
ST
83722010-06-01 Sriraman Tallam <tmsriram@google.com>
8373
8374 * gold.h (is_wildcard_string): New function.
8375 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8376 (Layout::layout_eh_frame): Ditto.
8377 (Layout::find_section_order_index): New method.
8378 (Layout::read_layout_from_file): New method.
8379 * layout.h (Layout::find_section_order_index): New method.
8380 (Layout::read_layout_from_file): New method.
8381 (Layout::input_section_position_): New private member.
8382 (Layout::input_section_glob_): New private member.
8383 * main.cc (main): Call read_layout_from_file here.
8384 * options.h (--section-ordering-file): New option.
8385 * output.cc (Output_section::input_section_order_specified_): New
8386 member.
8387 (Output_section::Output_section): Initialize new member.
8388 (Output_section::add_input_section): Add new parameter.
8389 Keep input sections when --section-ordering-file is used.
8390 (Output_section::set_final_data_size): Sort input sections when
8391 section ordering file is specified.
8392 (Output_section::Input_section_sort_entry): Add new parameter.
8393 Check sorting type.
8394 (Output_section::Input_section_sort_entry::compare_section_ordering):
8395 New method.
8396 (Output_section::Input_section_sort_compare::operator()): Change to
8397 consider section_order_index.
8398 (Output_section::Input_section_sort_init_fini_compare::operator()):
8399 Change to consider section_order_index.
8400 (Output_section::Input_section_sort_section_order_index_compare
8401 ::operator()): New method.
8402 (Output_section::sort_attached_input_sections): Change to sort
8403 according to section order when specified.
e1df38aa
NC
8404 (Output_section::add_input_section<32, true>): Add new parameter.
8405 (Output_section::add_input_section<64, true>): Add new parameter.
8406 (Output_section::add_input_section<32, false>): Add new parameter.
8407 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8408 * output.h (Output_section::add_input_section): Add new parameter.
8409 (Output_section::input_section_order_specified): New
8410 method.
8411 (Output_section::set_input_section_order_specified): New method.
8412 (Input_section::Input_section): Initialize section_order_index_.
8413 (Input_section::section_order_index): New method.
8414 (Input_section::set_section_order_index): New method.
8415 (Input_section::section_order_index_): New member.
8416 (Input_section::Input_section_sort_section_order_index_compare): New
8417 struct.
8418 (Output_section::input_section_order_specified_): New member.
8419 * script-sections.cc (is_wildcard_string): Delete and move modified
8420 method to gold.h.
8421 (Output_section_element_input::Output_section_element_input): Modify
8422 call to is_wildcard_string.
8423 (Output_section_element_input::Input_section_pattern
8424 ::Input_section_pattern): Ditto.
8425 (Output_section_element_input::Output_section_element_input): Ditto.
8426 * testsuite/Makefile.am (final_layout): New test case.
8427 * testsuite/Makefile.in: Regenerate.
8428 * testsuite/final_layout.cc: New file.
8429 * testsuite/final_layout.sh: New file.
8430
3537c84b
RÁE
84312010-06-01 Rafael Espindola <espindola@google.com>
8432
8433 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8434
105b6afd
RÁE
84352010-06-01 Rafael Espindola <espindola@google.com>
8436
8437 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8438 visibility of symbols.
8439
29e11421
DK
84402010-05-27 Doug Kwan <dougkwan@google.com>
8441
8442 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8443 from start of output section instead of address for a local symbol
8444 in a merged or relaxed section when doing a relocatable link.
8445
5e0f337e
RÁE
84462010-05-26 Rafael Espindola <espindola@google.com>
8447
703d02da 8448 PR 11604
5e0f337e
RÁE
8449 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8450 adding sections the garbage collector removed.
8451 * gold/testsuite/Makefile.am: Add test.
8452 * gold/testsuite/Makefile.in: Regenerate.
8453 * gold/testsuite/plugin_test_7.sh: New.
8454 * gold/testsuite/plugin_test_7_1.c: New.
8455 * gold/testsuite/plugin_test_7_2.c: New.
8456
f4187277
RÁE
84572010-05-26 Rafael Espindola <espindola@google.com>
8458
8459 * script-sections.cc (Output_section_definition::set_section_addresses):
8460 Check for --section-start.
8461
5c388529
DK
84622010-05-26 Doug Kwan <dougkwan@google.com>
8463
8464 * arm.cc (Arm_scan_relocatable_relocs): New class.
8465 (Target_arm::relocate_special_relocatable): New method.
8466 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8467 (Arm_relocate_functions::thumb_branch_common): Same.
8468 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8469 instead of Default_scan_relocatable_relocs.
8470 * target-reloc.h (relocate_for_relocatable): Let target handle
8471 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8472 * target.h (Sized_target::relocate_special_relocatable): New method.
8473
bca1c3ae
ILT
84742010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8475
8476 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8477
0439c796
DK
84782010-05-23 Doug Kwan <dougkwan@google.com>
8479
8480 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8481 instead of a cast.
8482 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8483 with a direct branch, not a conditional branch, to a stub.
8484 * merge.cc (Output_merge_base::record_input_section): New method
8485 defintion.
8486 (Output_merge_data::do_add_input_section): Record input section if
8487 keeps-input-sections flag is set.
8488 (Output_merge_string::do_add_input_section): Ditto.
8489 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8490 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8491 INPUT_SECTIONS_.
8492 (Output_merge_base::keeps_input_sections,
8493 Output_merge_base::set_keeps_input_sections,
8494 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8495 method definitions.
8496 (Output_merge_base::Input_sections): New type declaration.
8497 (Output_merge_base::input_sections_begin,
8498 Output_merge_base::input_sections_end,
8499 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8500 (Output_merge_base::bool keeps_input_sections_,
8501 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8502 Output_merge_base::input_sections_): New data members.
8503 (Output_merge_data::do_set_keeps_input_sections): New method
8504 defintion.
8505 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8506 * output.cc (Output_section::Input_section::relobj): Move method
8507 defintion from class declaration to here and handle merge sections.
8508 (Output_section::Input_section::shndx): Ditto.
8509 (Output_section::Output_section): Remove initializations of removed
8510 data members and initialize new data member LOOKUP_MAPS_.
8511 (Output_section::add_input_section): Set keeps-input-sections flag
8512 for a newly created merge output section as appropriate. Adjust code
8513 to use Output_section_lookup_maps class.
8514 (Output_section::add_relaxed_input_section): Adjst code for lookup
8515 maps code refactoring.
2e702c99 8516 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8517 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8518 class. If adding input section to a newly created merge output
8519 section fails, remove the new merge section.
8520 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8521 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8522 (Output_section::find_merge_section): Ditto.
0439c796 8523 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8524 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8525 Output_section_lookup_maps class.
8526 (Output_section::get_input_sections): Export merge sections. Adjust
8527 code to use Output_section_lookup_maps class.
8528 (Output_section:::add_script_input_section): Adjust code to use
8529 Output_section_lookup_maps class. Update lookup maps for merge
8530 sections also.
8531 (Output_section::discard_states): Use Output_section_lookup_maps.
8532 (Output_section::restore_states): Same.
8533 * output.h (Merge_section_properties): Move class defintion out of
8534 Output_section.
8535 (Output_section_lookup_maps): New class.
8536 (Output_section::Input_section::is_merge_section): New method
8537 defintion.
8538 (Output_section::Input_section::relobj): Move defintion out of class
8539 defintion. Declare method only.
8540 (Output_section::Input_section::shndx): Ditto.
8541 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8542 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8543 (Output_section::Merge_section_by_properties_map,
8544 Output_section::Output_section_data_by_input_section_map,
8545 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8546 Remove types.
2e702c99 8547 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8548 KEEPS_INPUT_SECTIONS.
8549 (Output_section::build_lookup_maps): New method declaration.
8550 (Output_section::merge_section_map_,
8551 Output_section::merge_section_by_properties_map_,
8552 Output_section::relaxed_input_section_map_,
8553 Output_section::is_relaxed_input_section_map_valid_): Remove data
8554 members.
8555 (Output_section::lookup_maps_): New data member.
8556
76295588
L
85572010-05-21 Doug Kwan <dougkwan@google.com>
8558
8559 PR gold/11619
8560 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8561 avoid a compilation error.
8562
d103a984
RÁE
85632010-05-19 Rafael Espindola <espindola@google.com>
8564
8565 * script-sections.cc (Output_section_definition::allocate_to_segment):
8566 Update the phdrs_list even when the output section is NULL.
8567 * testsuite/Makefile.am: Add test.
8568 * testsuite/Makefile.in: Regenerate.
8569 * testsuite/script_test_9.cc: New.
8570 * testsuite/script_test_9.sh: New.
8571 * testsuite/script_test_9.t: New.
8572
6625d24e
DK
85732010-05-19 Doug Kwan <dougkwan@google.com>
8574
8575 * arm.cc (Arm_input_section::original_size): New method.
8576 (Arm_input_section::do_addralign): Add a cast.
8577 (Arm_input_section::do_output_offset): Remove static cast.
8578 (Arm_input_section::original_addralign,
8579 Arm_input_section::original_size_): Change type to uint32_t.
8580 (Arm_input_section::init): Add safe casts for section alignment
8581 and size.
8582 (Arm_input_section::set_final_data_size): Do not set address and
8583 offset of stub table.
8584 (Arm_output_section::fix_exidx_coverage): Change use of of
8585 Output_section::Simple_input_section to that of
8586 Output_section::Input_section.
8587 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8588 except for the first pass.
8589 * output.cc (Output_section::get_input_sections): Change type of
8590 input_sections to std::list<Input_section>.
8591 (Output_section::add_script_input_section): Rename from
8592 Output_section::add_simple_input_section. Change type of SIS
8593 parameter from Simple_input_section to Input_section.
8594 * output.h (Output_section::Simple_input_section): Remove class.
8595 (Output_section::Input_section): Change class visibility to public.
8596 (Output_section::Input_section::addralign): Use stored alignments
8597 for special input sections if set.
8598 (Output_section::Input_section::set_addralign): New method.
8599 (Output_section::get_input_sections): Change parameter type from
8600 list of Simple_input_section to list of Input_section.
8601 (Output_section::add_script_input_section): Rename from
8602 Output_section::add_simple_input_section. Change first parameter's
8603 type from Simple_input_section to Input_section and remove the
8604 second and third parameters.
8605 * script-sections.cc (Input_section::Input_section_list): Change
8606 type to list of Output_section::Input_section/
8607 (Input_section_info::Input_section_info): Change parameter type of
8608 INPUT_SECTION to Output_section::Input_section.
8609 (Input_section_info::input_section): Change return type.
8610 (Input_section_info::input_section_): Change type to
8611 Output_section::Input_section.
8612 (Output_section_element_input::set_section_addresses): Adjust code
8613 to use Output_section::Input_section instead of
8614 Output_section::Simple_input_section. Adjust code for renaming
8615 of Output_section::add_simple_input_section.
8616 (Orphan_output_section::set_section_addresses): Ditto.
8617
e1e82ea4
RW
86182010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8619
8620 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8621 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8622
91e75c8a
RÁE
86232010-05-18 Rafael Espindola <espindola@google.com>
8624
8625 * options.cc (General_options::finalize): Handle -nostdlib.
8626 * options.h (nostdlib): New option.
8627 * script.cc (script_add_search_dir): Handle -nostdlib.
8628
da59ad79
DK
86292010-05-12 Doug Kwan <dougkwan@google.com>
8630
8631 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8632 attributes section only if there no attributes section after merging.
8633 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8634 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8635 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8636 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8637 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8638 and arm_attr_merge_7.stdout.
8639 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8640 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8641 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8642 arm_attr_merge_7b.o): New rules.
8643 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8644 arm_attr_merge_7
8645 * testsuite/Makefile.in: Regenerate.
8646 * testsuite/arm_attr_merge.sh: New file.
8647 * testsuite/arm_attr_merge_[67][ab].s: Same.
8648
3e01a7fd
NC
86492010-05-05 Nick Clifton <nickc@redhat.com>
8650
8651 * po/es.po: Updated Spanish translation.
8652
7ad2014a
L
86532010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8654
8655 * Makefile.am (install-exec-local): Properly install gold as
8656 default cross linker.
8657 * Makefile.in: Regenerated.
8658
4fda8867
NC
86592010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8660 Nick Clifton <nickc@redhat.com>
8661
8662 * configure.ac (install_as_default): Define and set to false
8663 unless --enable-gold or --enable-gold=both/gold has been
8664 specified.
8665 * configure: Regenerate.
8666
8667 * Makefile.am (install-exec-local): Install the executable as
8668 'ld.gold'. If install_as_default is true then also install it as
8669 'ld'.
8670 * Makefile.in: Regenerated.
8671
bd288ea2
ILT
86722010-04-24 Ian Lance Taylor <iant@google.com>
8673
8674 * layout.cc (Layout::layout_reloc): In relocatable link don't
8675 combine reloc sections for grouped sections.
8676
ef38fd8a
ST
86772010-04-23 Sriraman Tallam <tmsriram@google.com>
8678
8679 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8680 sections that are not ordinary to icf.
8681 * icf.cc (get_section_contents): Handle relocation pointing to section
8682 with no object or shndx information.
8683 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8684 * testsuite/Makefile.in: Regenerate.
8685 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8686 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8687
f6973bdc
ILT
86882010-04-22 Ian Lance Taylor <iant@google.com>
8689
8690 * expression.cc (Expression::Expression_eval_info): Add
8691 result_alignment_pointer field.
8692 (Expression::eval_with_dot): Add result_alignment_pointer
8693 parameter. Change all callers.
8694 (Expression::eval_maybe_dot): Likewise.
8695 (class Binary_expression): Add alignment_pointer parameter to
8696 left_value and right_value. Change all callers.
8697 (BINARY_EXPRESSION): Set result alignment.
8698 (class Trinary_expression): Add alignment_pointer parameter to
8699 arg2_value and arg3_value. Change all callers.
8700 (Trinary_cond::value): Set result alignment.
8701 (Max_expression::value, Min_expression::value): Likewise.
8702 (Align_expression::value): Likewise.
8703 * script-sections.cc (class Sections_element): Add dot_alignment
8704 parameter to set_section_addresses virtual function. Update
8705 instantiations.
8706 (class Output_section_element): Likewise.
8707 (Script_sections::create_segments): Add dot_alignment parameter.
8708 Change all callers.
8709 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8710 (Script_sections::set_phdrs_clause_addresses): Likewise.
8711 * script-sections.h: Update declarations.
8712 * script.h: Update declarations.
8713 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8714 min_p_align.
8715 * testsuite/script_test_3.t: Set large alignment.
8716 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8717 segment has expected alignment.
8718
9c9c98a5
NC
87192010-04-22 Nick Clifton <nickc@redhat.com>
8720
8721 * po/gold.pot: Updated by the Translation project.
8722 * po/vi.po: Updated Vietnamese translation.
8723
2253bfba
L
87242010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8725
8726 * testsuite/Makefile.am (check_PROGRAMS): Add
8727 icf_virtual_function_folding_test.
8728 * testsuite/Makefile.in: Regenerated.
8729
85fdf906
AH
87302010-04-15 Andrew Haley <aph@redhat.com>
8731
8732 * options.h (merge_exidx_entries): New option.
8733 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8734 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8735 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8736 (Target_arm::merge_exidx_entries): New function.
8737 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8738 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8739 to Arm_exidx_fixup constructor.
8740 Add new arg, merge_exidx_entries.
8741 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8742 Arm_output_section::fix_exidx_coverage.
8743
ce97fa81
ST
87442010-04-18 Sriraman Tallam <tmsriram@google.com>
8745
8746 * icf.cc (get_section_contents): Check for preemptible functions.
8747 Ignore addend when appropriate.
8748 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8749 section folded.
8750 (add_from_relobj): Check for section folded.
8751 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8752 * symtab.h (should_add_dynsym_entry): Add new parameter.
8753 * target-reloc.h (scan_relocs): Check for section folded.
8754 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8755 Check reloc types for function pointers in shared objects.
8756 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8757 case.
8758 (icf_preemptible_functions_test): New test case.
8759 (icf_string_merge_test): New test case.
8760 * testsuite.Makefile.in: Regenerate.
8761 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8762 bar_glob. Refactor code.
8763 * testsuite/icf_preemptible_functions_test.cc: New file.
8764 * testsuite/icf_preemptible_functions_test.sh: New file.
8765 * testsuite/icf_string_merge_test.cc: New file.
8766 * testsuite/icf_string_merge_test.sh: New file.
8767 * testsuite/icf_virtual_function_folding_test.cc: New file.
8768 * testsuite/icf_virtual_function_folding_test.sh: New file.
8769
04ceb17c
DK
87702010-04-14 Doug Kwan <dougkwan@google.com>
8771
8772 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8773 for local symbol recounting if we remove a section due to ICF.
8774 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8775 there are no regular objects in input.
8776
153e7da4
DK
87772010-04-13 Doug Kwan <dougkwan@google.com>
8778
8779 * arm.cc (Arm_input_section::set_final_data_size): Compute
8780 accurate final data size instead of using current data size.
8781
4dbd9faf
DK
87822010-04-09 Doug Kwan <dougkwan@google.com>
8783
8784 * layout.cc (Layout::choose_output_section): Handle script section
8785 types.
8786 (Layout::make_output_section_for_script): Add section type parameter.
8787 Handle script section types.
8788 * layout.h (Layout::make_output_section_for_script): Add section
8789 type parameter.
8790 * output.cc (Output_section::Output_section): Initialize data member
8791 is_noload_.
8792 (Output_section::do_reset_address_and_file_offset): Do not set address
8793 to 0 if section is a NOLOAD section.
8794 * output.h (Output_section::is_noload): New method.
8795 (Output_section::set_is_noload): Ditto.
8796 (Output_section::is_noload_): New data member.
8797 * script-c.h (Script_section_type): New enum type.
8798 (struct Parser_output_section_header): Add new file section_type.
8799 * script-sections.cc (Sections_element::output_section_name): Add
8800 parameter for returning script section type.
8801 (Output_section_definition::output_section_name): Ditto.
8802 (Output_section_definition::section_type)P; New method.
8803 (Output_section_definiton::script_section_type_name): Ditto.
8804 (Output_section_definition::script_section_type_): New data member.
8805 (Output_section_definition::Output_section_definition): Initialize
8806 data member Output_section_definition::script_section_type_.
8807 (Output_section_definition::create_sections): Pass script section type
8808 to Layout::make_output_section_for_script.
8809 (Output_section_definition::output_section_name): Return script
8810 section type to caller.
8811 (Output_section_definition::set_section_address): Do not advance
8812 dot value and load address if section type is NOLOAD. Set address
8813 of NOLOAD sections regardless of section flags.
8814 (Output_section_definition::print): Print section type if it is
8815 not SCRIPT_SECTION_TYPE_NONE.
8816 (Output_section_definition::section_type): New method.
8817 (Output_section_definition::script_section_type_name): Ditto.
8818 (Script_sections::output_section_name): Add new parameter
8819 PSECTION_TYPE for returning script section type. Pass it to
8820 section elements. Handle discard sections.
8821 (Sort_output_sections::operator()): Handle NOLOAD sections.
8822 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8823 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8824 returning script section type.
8825 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8826 INFO and NOLOAD.
8827 * yyscript.y (union): Add new field SECTION_TYPE.
8828 (COPY, DSECT, INFO, NOLOAD): New tokens.
8829 (opt_address_and_section_type): Change type to output_section_header.
8830 (section_type): New non-terminal
8831 (section_header): Handle section type.
2253bfba 8832 (opt_address_and_section_type): Return section type value.
4dbd9faf 8833
721ea635
L
88342010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8835
8836 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8837 * testsuite/plugin_common_test_2.c (foo): Likewise.
8838
6bf924b0
DK
88392010-04-08 Doug Kwan <dougkwan@google.com>
8840
8841 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8842 Output_merge_data.
8843 * output.cc (Output_section::add_merge_input_section): Simplify
8844 code and return status of Output_merge_base::add_input_section.
e1df38aa 8845 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8846 returns true.
8847
24af6f92
DK
88482010-04-07 Doug Kwan <dougkwan@google.com>
8849
8850 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8851 if section is marked as containing instructions but has no mapping
8852 symbols.
8853 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8854 correct section index.
8855 (Arm_relobj::find_linked_text_section): Ditto.
8856
00698fc5
CC
88572010-04-07 Cary Coutant <ccoutant@google.com>
8858
8859 * archive.cc (include_member): Destroy Read_symbols_data object before
8860 releasing file.
8861 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8862 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8863 (Read_symbols_data::~Read_symbols_data) New destructor.
8864 (Section_relocs::Section_relocs) New constructor.
8865 (Section_relocs::~Section_relocs) New destructor.
8866 (Read_relocs_data::Read_relocs_data) New constructor.
8867 (Read_relocs_data::~Read_relocs_data) New destructor.
8868 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8869 pointers to NULL after deleting.
8870
7296d933
DK
88712010-04-07 Doug Kwan <dougkwan@google.com>
8872
8873 * arm.cc: Replace "endianity" with "endianness" in comments.
8874 (Arm_exidx_cantunwind): Ditto.
8875 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8876 (Arm_relobj::merge_flags_and_attributes): New method.
8877 (Arm_relobj::merge_flags_and_attributes_): New data member.
8878 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8879 (Arm_relobj::scan_sections_for_stubs): Ditto.
8880 (Arm_relobj::do_read_symbols): Check to see if we really want to
8881 merge processor-specific flags and attributes. Exit early if
8882 an object is empty except for section names and the undefined symbol.
8883 (Target_arm::do_finalize_sections): Move check for ELF format to
8884 Arm_relobj::do_read_symbols. Merge processor specific flags and
8885 attributes from a regular object only when we have determined that
8886 it is aapropriate. Do not create an .ARM.attributes section in
8887 output if there is no regular input object.
8888 (Target_arm::merge_processor_specific_flags): Check
8889 --warn-mismatch before printing any error.
8890 (Target_arm::merge_object_attributes): Ditto.
8891 * gold.cc (queue_middle_tasks): Handle the case in which there is
8892 no regular object in input.
8893 * options.cc (General_options::parse_EB): New method.
8894 (General_options::parse_EL): Same.
8895 (General_options::General_options): Initialize endianness_.
8896 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8897 New options.
8898 (General_options::Endianness): New enum.
8899 (General_options::endianness): New method.
8900 (General_options::endianness_): New data member.
8901 * parameters.cc (Parameters::set_options): Check target endianness.
8902 (Parameters::set_target_once): Ditto.
8903 (Parameters::check_target_endianness): New method.
8904 (parameters_force_valid_target): If either -EL or -EB is specified,
8905 use it to define endianness of default target.
8906 * parameters.h (Parameters::check_target_endianness): New method
8907 declaration.
8908 * target.h (class Target): Change "endianity" to "endianness"
8909 in comments.
8910
efc8d4f2
RW
89112010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8912
8913 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8914 * configure: Regenerate.
8915 * Makefile.in: Regenerate.
8916 * testsuite/Makefile.in: Regenerate.
8917
be234d88
CC
89182010-04-06 Cary Coutant <ccoutant@google.com>
8919
8920 gcc PR lto/42757
8921 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8922 prevailing definitions of common symbols.
8923 * testsuite/plugin_test_6.sh: New test case.
8924 * testsuite/plugin_common_test_1.c: New test case.
8925 * testsuite/plugin_common_test_2.c: New test case.
8926 * testsuite/Makefile.am (plugin_test_6): New test case.
8927 * testsuite/Makefile.in: Regenerate.
8928
bd32c6bd
NC
89292010-04-06 Nick Clifton <nickc@redhat.com>
8930
8931 * po/vi.po: New Vietnamese translation.
8932
323c532f
DK
89332010-03-30 Doug Kwan <dougkwan@google.com>
8934
8935 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8936
4fcd97eb
DK
89372010-03-25 Doug Kwan <dougkwan@google.com>
8938
8939 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8940 to avoid a conversion warning on a 32-bit host.
8941
4ebf39db
ILT
89422010-03-24 Ian Lance Taylor <iant@google.com>
8943
8944 * testsuite/script_test_3.t: Add a TLS segment.
8945 * testsuite/Makefile.am (check_PROGRAMS): Add
8946 tls_phdrs_script_test.
8947 (tls_phdrs_script_test_SOURCES): Define.
8948 (tls_phdrs_script_test_DEPENDENCIES): Define.
8949 (tls_phdrs_script_test_LDFLAGS): Define.
8950 (tls_phdrs_script_test_LDADD): Define.
8951 * testsuite/Makefile.in: Rebuild.
8952
4a599bdd
CC
89532010-03-23 Cary Coutant <ccoutant@google.com>
8954
8955 * fileread.cc (find_or_make_view): Fix comment.
8956
6c93b22c
ILT
89572010-03-23 Ian Lance Taylor <iant@google.com>
8958
8959 * script-sections.cc (class Orphan_section_placement): Define
8960 PLACE_TLS and PLACE_TLS_BSS.
8961 (Orphan_section_placement::Orphan_section_placement): Initialize
8962 new places.
8963 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8964 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8965 (tls_script_test_SOURCES): Define.
8966 (tls_script_test_DEPENDENCIES): Define.
8967 (tls_script_test_LDFLAGS): Define.
8968 (tls_script_test_LDADD): Define.
8969 * testsuite/Makefile.in: Rebuild.
8970
a2c7281b
DK
89712010-03-22 Doug Kwan <dougkwan@google.com>
8972
8973 * arm.cc (Arm_relocate_functions::abs8,
8974 Arm_relocate_functions::abs16): Use correct check for overflow
8975 specified in the ARM ELF specs.
8976 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8977 target of a BLX instruction specially.
8978 (Reloc_stub::stub_type_for_reloc): Ditto.
8979 (Relocate::relocate): Use symbolic names instead of numeric relocation
8980 codes to report error.
8981 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8982 workaround.
8983 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8984 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8985 thumb2_blx_out_of_range.stdout
8986 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8987 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8988 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8989 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8990 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8991 thumb2_blx_in_range, thumb2_blx_in_range.o,
8992 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8993 thumb2_blx_out_of_range.o): New rules.
2e702c99 8994 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8995 thumb2_blx_in_range and thumb2_blx_out_of_range.
8996 * testsuite/Makefile.in: Regenerate.
8997 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8998 * testsuite/thumb_blx_in_range.s: New file.
8999 * testsuite/thumb_blx_out_of_range.s: New file.
9000
b0193076
RÁE
90012010-03-22 Rafael Espindola <espindola@google.com>
9002
9003 * archive.cc (Should_include): Move to archive.h.
9004 (should_include_member): Make it a member of Archive.
9005 (Lib_group): New.
9006 (Add_lib_group_symbols): New.
9007 * archive.h: Include options.h.
9008 (Archive_member): Moved from Archive.
9009 (Should_include): Moved from archive.cc.
9010 (Lib_group): New.
9011 (Add_lib_group_symbols): New.
9012 * dynobj.cc (do_should_include_member): New.
9013 * dynobj.h (do_should_include_member): New.
9014 * gold.cc (queue_initial_tasks): Update call to queue.
9015 * main.cc (main): Print lib group stats.
9016 * object.cc (do_should_include_member): New.
9017 * object.h: Include archive.h.
9018 (Object::should_include_member): New.
9019 (Object::do_should_include_member): New.
9020 (Sized_relobj::do_should_include_member): New.
9021 * options.cc (General_options::parse_start_lib): New.
9022 (General_options::parse_end_lib): New.
9023 (Input_arguments::add_file): Handle lib groups.
9024 (Input_arguments::start_group): Check we are not in a lib.
9025 (Input_arguments::start_lib): New.
9026 (Input_arguments::end_lib): New.
9027 * options.h (General_options): Add start_lib and end_lib.
9028 (Input_argument::lib_): New.
9029 (Input_argument::lib): New.
9030 (Input_argument::is_lib): New.
9031 (Input_file_lib): New.
9032 (Input_arguments::in_lib_): New.
9033 (Input_arguments::in_lib): New.
9034 (Input_arguments::start_lib): New.
9035 (Input_arguments::end_lib_): New.
9036 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9037 in unused members as preempted.
9038 (Sized_pluginobj::do_should_include_member): New.
9039 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9040 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9041 return the blocker.
9042 (Read_symbols::do_whole_lib_group): New.
9043 (Read_symbols::do_lib_group): New.
9044 (Read_symbols::do_read_symbols): Handle lib groups.
9045 (Read_symbols::get_name): Handle lib groups.
9046 * readsyms.h (Read_symbols): Add an archive member pointer.
9047 (Read_symbols::do_whole_lib_group): New.
9048 (Read_symbols::do_lib_group): New.
9049 (Read_symbols::member_): New.
9050 * script.cc (read_input_script): Update call to queue_soon.
9051
d099120c
DK
90522010-03-19 Doug Kwan <dougkwan@google.com>
9053
9054 * arm.cc (Stub_table::Stub_table): Initialize new data members
9055 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9056 (Stub_table::add_reloc_stub): Assign stub offset and update
9057 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9058 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9059 New data members.
2e702c99 9060 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9061 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9062 instead of going over all reloc stubs.
2e702c99 9063 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9064 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9065 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9066 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9067 Stringpool_template::offset_.
9068 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9069 Stringpool_template::offset_ to zero.
9070
1aa37384
DK
90712010-03-15 Doug Kwan <dougkwan@google.com>
9072
9073 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9074 offset_.
9075 (Stringpool_template::new_key_offset): New method.
9076 (Stringpool_template::add_string): Assign offsets when adding new
9077 strings.
9078 (Stringpool_template::set_string_offsets): Do not set string offsets
9079 when not optimizing.
9080 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9081 member size_.
2e702c99
RM
9082 (Chunked_vector::clear): Clear size_.
9083 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9084 (Chunked_vector::size): Return size_.
9085 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9086 (Chunked_vector::size_): New data member.
1aa37384
DK
9087 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9088 (Stringpool_template::new_key_offset): New method declaration.
9089 (Stringpool_template::offset_): New data member.
9090
b672b057
RÁE
90912010-03-15 Rafael Espindola <espindola@google.com>
9092
9093 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9094 Add_symbols' constructor.
9095 * readsyms.h (Add_symbols): Remove the input_group member.
9096
b6848d3c
ILT
90972010-03-10 Ian Lance Taylor <iant@google.com>
9098
9099 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9100 target to ask whether a reference to a symbol requires a stack
9101 split.
9102 * target.h (Target::is_call_to_non_split): New function.
9103 (Target::do_is_call_to_non_split): Declare virtual function.
9104 * target.cc: Include "symtab.h".
9105 (Target::do_is_call_to_non_split): New function.
9106 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9107
a2a5469e
CC
91082010-03-10 Cary Coutant <ccoutant@google.com>
9109
9110 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9111 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9112 (File_read::open[2]): Add whole_file_view_ to list of views.
9113 (File_read::make_view): Remove test of whole_file_view_.
9114 (File_read::find_or_make_view): Create whole_file_view_ if
9115 necessary.
9116 (File_read::clear_views): Replace bool parameter with enum;
9117 adjust all callers. Don't delete views with permanent data;
9118 do delete cached views and views from archives if
9119 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9120 if clearing the corresponding view.
9121 * fileread.h (File_read::Clear_views_mode): New enum.
9122 (File_read::View::is_permanent_view): New method.
9123 (File_read::clear_views): Replace bool parameter
9124 with enum; adjust all callers.
9125 * options.h (General_options): Change keep_files_mapped option;
9126 add map_whole_files.
9127 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9128 releasing the file.
9129 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9130 the file.
9131
8861f32b
DM
91322010-03-10 David S. Miller <davem@davemloft.net>
9133
9134 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9135
d62d0f5f
ST
91362010-03-09 Sriraman Tallam <tmsriram@google.com>
9137
9138 * icf.cc (get_section_contents): Add '@' marker after processing the
9139 merge reloc.
9140
9177756d
DK
91412010-03-08 Doug Kwan <dougkwan@google.com>
9142
9143 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9144 due to a conversion warning.
9145 (Arm_relobj::update_output_local_symbol_count): Check for local
9146 symbol with unset output index.
9147
9e9e071b
ILT
91482010-03-05 Ian Lance Taylor <iant@google.com>
9149
9150 * options.h (class General_options): Add --spare-dynamic-tags.
9151 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9152 --spare-dynamic-tags.
9153
a81ee015
ILT
91542010-03-05 Ian Lance Taylor <iant@google.com>
9155
9156 * incremental.cc: Include "libiberty.h".
9157
44ec90b9
RO
91582010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9159
9160 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9161 function, is_info_ member.
9162 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9163 (Versions::Versions): Update caller.
9164 (Versions::define_base_version): Likewise.
9165 (Versions::add_def): Likewise.
9166
0897ed3b
ST
91672010-03-03 Sriraman Tallam <tmsriram@google.com>
9168
9169 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9170 (Scan::possible_function_pointer_reloc): New function.
9171 (Scan::local_reloc_may_be_function_pointer): Change to call
9172 possible_function_pointer_reloc.
9173 (Scan::global_reloc_may_be_function_pointer): Ditto.
9174 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9175 relocations in ".data.rel.ro._ZTV" section.
9176 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9177 * testsuite/icf_safe_so_test.cc: Ditto.
9178 * testsuite/icf_safe_test.cc: Ditto.
9179 * testsuite/icf_safe_test.sh: Ditto.
9180
d3bbad62
ILT
91812010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9182 Ian Lance Taylor <iant@google.com>
9183
9184 * target-reloc.h (relocate_section): Check the symbol table index
9185 for -1U before setting the local symbol index.
9186 (scan_relocatable_relocs): If copying the relocation, record that
9187 the local symbol is required.
9188 * object.h (Symbol_value::is_output_symtab_index_set): New
9189 function.
9190 (Symbol_value::may_be_discarded_from_output_symtab): New
9191 function.
9192 (Symbol_value::has_output_symtab_entry): New function.
9193 (Symbol_value::needs_output_symtab_entry): Remove.
9194 (Symbol_value::output_symtab_index): Make sure the symbol index is
9195 set.
9196 (Symbol_value::set_output_symtab_index): Make sure the symbol
9197 index is not set. Make sure the new index is valid.
9198 (Symbol_value::set_must_have_output_symtab_entry): New function.
9199 (Symbol_value::has_output_dynsym_entry): New function.
9200 (Symbol_value::set_output_dynsym_index): Make sure the new index
9201 is valid.
9202 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9203 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9204 local symbol if permitted.
9205 (Sized_relobj::do_finalize_local_symbols): Call
9206 is_output_symtab_index_set rather than needs_output_symtab_entry.
9207 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9208 rather than needs_output_symtab_entry. Call
9209 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9210 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9211 is_output_symtab_index_set rather than needs_output_symtab_entry.
9212 * testsuite/discard_locals_relocatable_test.c: New file.
9213 * testsuite/discard_locals_test.sh: Test -r.
9214 * testsuite/Makefile.am (check_DATA): Add
9215 discard_locals_relocatable_test1.syms,
9216 discard_local_relocatable_test2.syms.
9217 (MOSTLYCLEANFILES): Likewise. Also add
9218 discard_locals_relocatable_test1.lout and
9219 discard_locals_relocatable_test2.out.
9220 (discard_locals_relocatable_test1.syms): New target.
9221 (discard_locals_relocatable_test.o): New target.
9222 (discard_locals_relocatable_test1.out): New target.
9223 (discard_locals_relocatable_test2.syms): New target.
9224 (discard_locals_relocatable_test2.out): New target.
9225 (various): Add missing ../ld-new dependencies.
9226 * testsuite/Makefile.in: Rebuild.
9227
7e8ccf26
NC
92282010-03-03 Nick Clifton <nickc@redhat.com>
9229
9230 * po/fi.po: New Finnish translation.
9231
2a0ff005
DK
92322010-03-01 Doug Kwan <dougkwan@google.com>
9233
9234 * layout.cc (Layout::Layout): Force section types of .init_array*,
9235 .preinit_array* and .fini_array* sections.
9236 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9237 Fix check of return value of std::string::find.().
9238 (Output_section::Input_section_sort_compare::operator()): Remove
9239 comment about .init_array.
9240 (Output_section::Input_section_sort_init_fini_compare::operator()):
9241 New method.
9242 (Output_section::sort_attached_input_sections): Handle .init_array
9243 and .fini_array specially.
9244 * output.h (Output_section::Inut_section_sort_compare): Update
9245 comment.
9246 (Output_section::Input_section_sort_init_fini_compare): New struct.
9247
c3e4ae29
DK
92482010-02-26 Doug Kwan <dougkwan@google.com>
9249
9250 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9251 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9252 * testsuite/debug_msg.sh: Avoid matching source line number for
9253 use of global variable undef_int.
9254
2fd9ae7a
DK
92552010-02-26 Doug Kwan <dougkwan@google.com>
9256
9257 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9258 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9259 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9260 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9261 * options.cc (General_options::General_options): Initialize member
9262 fix_v4bx_.
9263 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9264 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9265 and rm_no_fix_v4bx.stdout
9266 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9267 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9268 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9269 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9270 and arm_no_fix_v4bx.
9271 * Makefile.in: Regenerate.
9272 * testsuite/arm_fix_v4bx.s: New file.
9273 * testsuite/arm_fix_v4bx.sh: Ditto.
9274
67ec7d0b
DK
92752010-02-24 Doug Kwan <dougkwan@google.com>
9276
9277 * arm.cc (Target_arm::got_section): Make the .got section the first
9278 non RELRO section in the data segment.
9279 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9280 suffixes of section names.
9281
10165461
DK
92822010-02-24 Doug Kwan <dougkwan@google.com>
9283
9284 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9285 flags and attributes merging if an input file is a binary file.
9286 * fileread.cc (Input_file::open): Record format of original file.
9287 * fileread.h (Input_file::Format): New enum type.
2e702c99 9288 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9289 (Input_file::format): New method definition.
9290 (Input_file::format_):: New data member.
9291
4a54abbb
DK
92922010-02-24 Doug Kwan <dougkwan@google.com>
9293
9294 * arm.cc (Arm_output_data_got): New class.
9295 (ARM_TCB_SIZE): New constant
9296 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9297 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9298 If user uses a script with a SECTIONS clause, issue only a warning
9299 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9300 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9301 garbage collection.
9302 (Target_arm::got_mode_index_entry): Handle static linking.
9303 (Target_arm::Scan::local): Ditto.
9304 (Target_arm::Scan::global): Ditto.
9305 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9306 all incorrectly implemented relocations.
e1df38aa 9307 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9308 Arm_output_section::fix_exidx_coverage.
9309 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9310 from ".ARM.exidx." and ".ARM.extab.".
9311
ca419a6f
ILT
93122010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9313
9314 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9315 section if it does not already exist.
9316 * attributes.cc (Attributes_section_data::Attributes_section_data):
9317 Don't crash if size is zero.
9318
135b9c78
ILT
93192010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9320 Ian Lance Taylor <iant@google.com>
9321
9322 * gold.cc (queue_middle_tasks): If no input files were opened,
9323 exit.
9324 * workqueue.h (Task_function::Task_function): Assert that there is
9325 a blocker.
9326
bb0bfe4f
DK
93272010-02-22 Doug Kwan <dougkwan@google.com>
9328
9329 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9330 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9331 types to avoid warnings due to different uint64_t implementations
9332 on different hosts.
9333
2a2b6d42
DK
93342010-02-21 Doug Kwan <dougkwan@google.com>
9335
9336 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9337 handling of the maximum backward branch offset.
2e702c99 9338 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9339 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9340 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9341 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9342 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9343 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9344 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9345 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9346 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9347 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9348 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9349 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9350 thumb2_bl_out_of_range.o): New rules.
9351 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9352 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9353 thumb2_bl_out_of_range
9354 * testsuite/Makefile.in: Regenerate.
9355 * testsuite/arm_bl_in_range.s: New file.
9356 * testsuite/arm_bl_out_of_range.s: Ditto.
9357 * testsuite/arm_branch_in_range.sh: Ditto.
9358 * testsuite/arm_branch_range.t: Ditto.
9359 * testsuite/thumb2_branch_range.t: Ditto.
9360 * testsuite/thumb_bl_in_range.s: Ditto.
9361 * testsuite/thumb_bl_out_of_range.s: Ditto.
9362 * testsuite/thumb_branch_range.t: Ditto.
9363
b487ad64
ST
93642010-02-20 Sriraman Tallam <tmsriram@google.com>
9365
9366 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9367 Add reloc offset information.
9368 * icf.cc (get_section_contents): Change iterators to point to the new
9369 vectors. Add reloc offset information to the contents.
9370 * icf.h (Icf::Sections_reachable_info): New typedef.
9371 (Icf::Sections_reachable_list): New typedef.
9372 (Icf::Offset_info): New typedef.
9373 (Icf::Reloc_info): New struct typedef.
9374 (Icf::Reloc_info_list): New typedef.
9375 (Icf::symbol_reloc_list): Delete method.
9376 (Icf::addend_reloc_list): Delete method.
9377 (Icf::section_reloc_list): Delete method.
9378 (Icf::reloc_info_list): New method.
9379 (Icf::reloc_info_list_): New member.
9380
f96accdf
DK
93812010-02-19 Doug Kwan <dougkwan@google.com>
9382
9383 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9384 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9385 * arm.cc (Arm_relocation_functions): New forward declaration.
9386 (Target_arm::Target_arm): Initialize new data members
9387 got_mod_index_offset_ and tls_base_symbol_defined_.
9388 (Target_arm::Relocate::relocate_tls): New method.
9389 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9390 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9391 New methods.
2e702c99 9392 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9393 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9394 (Target_arm::got_mod_index_offset_,
9395 Target_arm::tls_base_symbol_defined_): New data members.
9396 (Target_arm::Scan::local, Target::Scan::global,
9397 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9398 relocations.
9399
c8761b9a
DK
94002010-02-18 Doug Kwan <dougkwan@google.com>
9401
9402 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9403 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9404 text section as a parameter becuase some broken tools may not set
9405 the link in section header.
9406 (Target_arm::has_got_section): New method.
9407 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9408 without any mapping symbol as data only. Remove warning.
9409 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9410 link in its section header, try to discover the link by inspecting the
9411 REL31 relocation at the beginning of the section.
9412 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9413 in error message.
9414 (Target_arm::Scan::global): Treat any reference to the symbol
9415 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9416
21bb3914
ST
94172010-02-12 Sriraman Tallam <tmsriram@google.com>
9418
9419 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9420 (Scan::global_reloc_may_be_function_pointer): New function.
9421 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9422 (Scan::global_reloc_may_be_function_pointer): New function.
9423 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9424 (Scan::global_reloc_may_be_function_pointer): New function.
9425 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9426 (Scan::global_reloc_may_be_function_pointer): New function.
9427 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9428 (Scan::global_reloc_may_be_function_pointer): New function.
9429 (Scan::possible_function_pointer_reloc): New function.
9430 (Target_x86_64::can_check_for_function_pointers): New function.
9431 * gc.h (gc_process_relocs): Scan relocation types to determine if
9432 function pointers were taken for targets that support it.
9433 * icf.cc (Icf::find_identical_sections): Include functions for
9434 folding in safe ICF whose pointer is not taken.
9435 * icf.h (Secn_fptr_taken_set): New typedef.
9436 (fptr_section_id_): New member.
9437 (section_has_function_pointers): New function.
9438 (set_section_has_function_pointers): New function.
9439 (check_section_for_function_pointers): New function.
9440 * options.h: Fix comment for safe ICF option.
9441 * target.h (can_check_for_function_pointers): New function.
9442 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9443 Modify icf_safe_test for X86-64.
9444 * testsuite/Makefile.in: Regenerate.
9445 * testsuite/icf_safe_so_test.cc: New file.
9446 * testsuite/icf_safe_so_test.sh: New file.
9447 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9448 (main): Change to take pointer to function kept_func_3.
9449 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9450 folding is done correctly for X86-64.
9451
0da6fa6c
DM
94522010-02-12 David S. Miller <davem@davemloft.net>
9453
9454 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9455 is_symbolless parameter.
9456 (Output_reloc<SHT_REL>::is_symbolless): New.
9457 (Output_reloc<SHT_REL>::is_symbolless_): New.
9458 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9459 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9460 (Output_reloc<SHT_RELA>::is_symbolless): New.
9461 (Output_data_reloc::add_global): Handle is_symbolless.
9462 (Output_data_reloc::add_global_relative): Likewise.
9463 (Output_data_reloc::add_local): Likewise.
9464 (Output_data_reloc::add_local_relative): Likewise.
9465 (Output_data_reloc::add_symbolless_global_addend): New.
9466 (Output_data_reloc::add_symbolless_local_addend): New.
9467 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9468 is_symbolless.
9469 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9470 instead of ->is_relative_
9471 (Output_reloc::write): Likewise.
9472 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9473 (Output_reloc::write_rel): Simplify.
9474
9475 * sparc.cc (Target_sparc::Scan::local): Use
9476 ->add_symbolless_local_addend as needed.
9477 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9478 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9479 based upon relocation offset.
9480
e4782e83
DK
94812010-02-11 Doug Kwan <dougkwan@google.com>
9482
9483 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9484 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9485 beginning of function.
9486 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9487 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9488 parameter is_32bit in calls to should_apply_static_reloc.
9489 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9490 (check_DATA): Add arm_abs_global.stdout.
9491 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9492 arm_abs_global.stdout): New rules.
9493 (MOSTLLYCLEANFILES): Add arm_abs_global
9494 * Makefile.in: Regenerate.
9495 * testsuite/arm_abs_global.s: New file.
9496 * testsuite/arm_abs_global.sh: Ditto.
9497 * testsuite/arm_abs_lib.s: Ditto.
9498
93ceb764
ILT
94992010-02-11 Ian Lance Taylor <iant@google.com>
9500
9501 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9502 Read_relocs task.
9503 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9504 Allocate_commons_task first.
9505 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9506 task, rather than symtab_lock_.
9507 (Gc_process_relocs::~Gc_process_relocs): New function.
9508 (Gc_process_relocs::is_runnable): Check this_blocker_.
9509 (Gc_process_relocs::locks): Use next_blocker_ rather than
9510 blocker_.
9511 (Scan_relocs::~Scan_relocs): New function.
9512 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9513 symtab_lock_.
9514 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9515 next_blocker_.
9516 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9517 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9518 constructor accordingly.
9519 (class Gc_process_relocs): Likewise.
9520 (class Scan_relocs): Likewise.
9521 * common.h (class Allocate_commons_task): Remove symtab_lock_
9522 field, and corresponding constructor parameter.
9523 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9524 symtab_lock_.
9525 (Allocate_commons_task::locks): Likewise.
9526
114dfbe1
ILT
95272010-02-11 Ian Lance Taylor <iant@google.com>
9528
9529 * gold-threads.h (class Once): Define.
9530 (class Initialize_lock): Rewrite as child of Once.
9531 * gold-threads.cc (class Once_initialize): Define.
9532 (once_pointer_control): New static variable.
9533 (once_pointer, once_arg): New static variables.
9534 (c_run_once): New static function.
9535 (Once::Once, Once::run_once, Once::internal_run): New functions.
9536 (class Initialize_lock_once): Remove.
9537 (initialize_lock_control): Remove.
9538 (initialize_lock_pointer): Remove.
9539 (initialize_lock_once): Remove.
9540 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9541 (Initialize_lock::initialize): Rewrite.
9542 (Initialize_lock::do_run_once): New function.
9543 * archive.cc (Archive::interpret_header): Only clear name if it is
9544 not already empty.
9545 * fileread.cc: Include "gold-threads.h"
9546 (file_counts_lock): New static variable.
9547 (file_counts_initialize_lock): Likewise.
9548 (File_read::release): Only increment counts when using --stats.
9549 Use a lock around the increment.
9550 * parameters.cc (class Set_parameters_target_once): Define.
9551 (set_parameters_target_once): New static variable.
9552 (Parameters::Parameters): Move here from parameters.h.
9553 (Parameters::set_target): Rewrite.
9554 (Parameters::set_target_once): New function.
9555 (Parameters::clear_target): Move here and rewrite.
9556 * parameters.h (class Parameters): Update declarations. Add
9557 set_parameters_target_once_ field.
9558 (Parameters::Parameters): Move to parameters.cc.
9559 (Parameters::clear_target): Likewise.
9560 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9561 task.
9562 (Start_group::~Start_group): New function.
9563 (Start_group::is_runnable): New function.
9564 (Start_group::locks, Start_group::run): New functions.
9565 (Finish_group::run): Change saw_undefined to size_t.
9566 * readsyms.h (class Start_group): Define.
9567 (class Finish_group): Change saw_undefined_ field to size_t.
9568 (Finish_group::Finish_group): Remove saw_undefined and
9569 this_blocker parameters. Change all callers.
9570 (Finish_group::set_saw_undefined): New function.
9571 (Finish_group::set_blocker): New function.
9572 * symtab.h (class Symbol_table): Change saw_undefined to return
9573 size_t. Change saw_undefined_ field to size_t.
9574 * target-select.cc (Set_target_once::do_run_once): New function.
9575 (Target_selector::Target_selector): Initialize set_target_once_
9576 field. Don't initialize lock_ and initialize_lock_ fields.
9577 (Target_selector::instantiate_target): Rewrite.
9578 (Target_selector::set_target): New function.
9579 * target-select.h (class Set_target_once): Define.
9580 (class Target_selector): Update declarations. Make
9581 Set_target_once a friend. Remove lock_ and initialize_lock_
9582 fields. Add set_target_once_ field.
9583
fa17a3f4
ILT
95842010-02-10 Ian Lance Taylor <iant@google.com>
9585
9586 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9587 queueing any tasks.
9588 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9589 (queue_middle_tasks): Add all blockers before queueing any tasks.
9590 (queue_final_tasks): Likewise.
9591 * token.h (Task_token::add_blockers): New function.
9592 * object.h (Input_objects::number_of_relobjs): New function.
9593
c7177d31
ILT
95942010-02-10 Ian Lance Taylor <iant@google.com>
9595
5de0e392
ILT
9596 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9597 shared, not if not position independent.
9598 * x86_64.cc (Relocate::relocate_tls): Likewise.
9599 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9600 (tls_pie_pic_test): New target.
9601 * testsuite/Makefile.in: Rebuild.
9602
c7177d31
ILT
9603 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9604 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9605 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9606 * testsuite/Makefile.in: Rebuild.
9607
684b268a
DM
96082010-02-09 David S. Miller <davem@davemloft.net>
9609
9610 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9611 R_SPARC_RELATIVE using ->add_local_relative().
9612 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9613
612a8d3d
DM
9614 * output.h (Output_data_dynamic::add_section_size): New method
9615 that takes two Output_data objects.
9616 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9617 entry param. Handle it in initializers.
9618 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9619 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9620 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9621 arg.
9622 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9623 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9624 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9625 for dynrel_includes_plt.
9626 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9627 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9628 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9629 before .rela.plt
9630 (Target_sparc::do_finalize_sections): Update to pass true for
9631 dynrel_includes_plt.
9632 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9633 output before .rela.plt
9634 (Target_powerpc::do_finalize_sections): Update to pass true for
9635 dynrel_includes_plt when 32-bit.
9636
cb1be87e
DK
96372010-02-08 Doug Kwan <dougkwan@google.com>
9638
9639 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9640 method.
9641 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9642 Arm_relobj::scan_section_for_cortex_a8_stubs,
9643 Arm_relobj::do_relocation_section): Instead of calling
9644 Output_section::output_address, use faster
9645 Arm_relobj::simple_input_section_output_address.
9646
705b5121
DM
96472010-02-08 David S. Miller <davem@davemloft.net>
9648
9649 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9650 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9651 relocation helper function.
9652
024c4466
DM
9653 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9654 just like R_SPARC_GOT{10,13,22}.
9655 (Target_sparc::Scan::local): Likewise.
9656 (Target_sparc::Relocate:relocate): Likewise.
9657
9109c078
ILT
96582010-02-06 Ian Lance Taylor <iant@google.com>
9659
9660 * configure.ac: Rewrite targetobjs duplicate removal code to use
9661 only shell constructs.
9662 * configure: Rebuild.
9663
cf846138
DK
96642010-02-05 Doug Kwan <dougkwan@google.com>
9665
9666 PR 11247
9667 * arm.cc (Arm_relobj::section_is_scannable): New method.
9668 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9669 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9670
6cfaf60b
DK
96712010-02-04 Doug Kwan <dougkwan@google.com>
9672
9673 PR 11247
9674 * arm-reloc-property.cc (cstdio): Include.
9675 * configure.ac (targetobjs): Remove duplicates.
9676 * configure: Regenerate.
9677 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9678 big and little endian version for a given address size.
9679
5c57f1be
DK
96802010-02-03 Doug Kwan <dougkwan@google.com>
9681
9682 * arm-reloc-property.cc
9683 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9684 definition.
9685 * arm-reloc-property.h
9686 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9687 New method definition.
9688 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9689 declaration.
9690 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9691 overflow to N.
9692 (GOT_PREL): Change implemented to Y.
9693 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9694 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9695 (Arm_relocate_functions::movw_abs_nc): Remove method.
9696 (Arm_relocate_functions::movt_abs): Ditto.
9697 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9698 (Arm_relocate_functions::thm_movt_abs): Ditto.
9699 (Arm_relocate_functions::movw_rel_nc): Ditto.
9700 (Arm_relocate_functions::movw_rel): Ditto.
9701 (Arm_relocate_functions::movt_rel): Ditto.
9702 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9703 (Arm_relocate_functions:thm_movw_rel): Ditto.
9704 (Arm_relocate_functions:thm_movt_rel): Ditto.
9705 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9706 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9707 New method definitions.
9708 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9709 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9710 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9711 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9712 (Target_arm::Relocate::relocate): Check for non-static or
9713 unimplemented relocation code and exit early. Change calls to
9714 Target_arm::reloc_uses_thumb_bit and
9715 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9716 instead. Refactor code to handle similar relocations to increase
9717 code sharing. Remove check for unsupported relocation code in switch
9718 statement.
9719 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9720 relocation property table to find out size. Change error message to
9721 print out the name of a relocation code instead of the numeric value.
9722 (Target_arm::scan_reloc_for_stub): Use relocation property table
9723 instead of calling Target_arm::reloc_uses_thumb_bit().
9724
218c5831
DK
97252010-02-02 Doug Kwan <dougkwan@google.com>
9726
9727 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9728 types of relaxed input section.
9729
0d31c79d
DK
97302010-02-02 Doug Kwan <dougkwan@google.com>
9731
9732 * Makefile.am (HFILES): Add arm-reloc-property.h.
9733 (DEFFILES): New.
2e702c99
RM
9734 (TARGETSOURCES): Add arm-reloc-property.cc
9735 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9736 (libgold_a_SOURCES): $(DEFFILES)
9737 * Makefile.in: Regenerate.
9738 * arm-reloc-property.cc: New file.
9739 * arm-reloc-property.h: New file.
9740 * arm-reloc.def: New file.
9741 * arm.cc: Update comments.
9742 (arm-reloc-property.h): New included header.
9743 (arm_reloc_property_table): New global variable.
9744 (Target_arm::do_select_as_default_target): New method definition.
9745 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9746 arm-reloc-property to targ_extra_obj.
9747 * parameters.cc (set_parameters_target): Call
9748 Target::select_as_default_target().
9749 * target.h (Target::select_as_default_target): New method definition.
9750 (Target::do_select_as_default_target): Same.
9751
546c7457
DK
97522010-02-01 Doug Kwan <dougkwan@google.com>
9753
9754 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9755 first_output_text_section_.
9756 (Arm_exidx_fixup::first_output_text_section): New method definition.
9757 (Arm_exidx_fixup::first_output_text_section_): New data member.
9758 (Arm_exidx_fixup::process_exidx_section): Record the first text
9759 output section seen.
9760 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9761 and entsize in output section header.
9762
11b861d5
DK
97632010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9764
9765 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9766 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9767 (Arm_relocate_functions::thm_alu11): New Method.
9768 (Arm_relocate_functions::thm_pc8): New Method.
9769 (Arm_relocate_functions::thm_pc12): New Method.
9770 (Target_arm::Scan::local): Handle the relocations.
9771 (Target_arm::Scan::global): Likewise.
9772 (Target_arm::Relocate::relocate): Likewise.
9773 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9774
c9a2c125
DK
97752010-01-29 Doug Kwan <dougkwan@google.com>
9776
9777 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9778 of relocation types as ld.
9779
1521477a
DK
97802010-01-29 Doug Kwan <dougkwan@google.com>
9781
9782 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9783 to public.
9784 (Arm_relocate_functions::thumb_branch_common): Ditto.
9785 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9786 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9787 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9788 Arm_relocate_functions::jump24): Remove.
9789 (Target_arm::Relocate::relocate): Adjust code to call
9790 Arm_relocation_functions::arm_branch_common and
9791 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9792 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9793
e7eca48c
DK
97942010-01-29 Doug Kwan <dougkwan@google.com>
9795
9796 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9797 output_local_symbol_count_needs_update_.
9798 (Arm_relobj::output_local_symbol_count_needs_update,
9799 Arm_relobj::set_output_local_symbol_count_needs_update,
9800 Arm_relobj::update_output_local_symbol_count): New methods.
9801 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9802 member.
9803 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9804 of pointed function as in a R_ARM_PREL31 relocation.
9805 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9806 for output local symbol count updating.
9807 (Target_arm::do_relax): Update output local symbol counts in objects
9808 if necessary.
9809 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9810
02961d7e
ILT
98112010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9812
9813 * arm.cc: Added support for the ARM relocations:
9814 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9815 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9816 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9817 movw_prel_nc).
9818 (Arm_relocate_functions::movw_rel): New method.
9819 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9820 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9821 thm_movw_prel_nc).
9822 (Arm_relocate_functions::thm_movw_rel): New method.
9823 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9824 thm_movt_prel).
9825 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9826 relocations.
9827 (Target_arm::Scan::global): Likewise.
9828 (Target_arm::Relocate::relocate): Likewise.
9829 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9830 Likewise.
9831
b10d2873
ILT
98322010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9833
9834 * arm.cc: Added support for ARM group relocations.
9835 (Target_arm::reloc_needs_sym_origin): New method.
9836 (Arm_relocate_functions::calc_grp_kn): New method.
9837 (Arm_relocate_functions::calc_grp_residual): New method.
9838 (Arm_relocate_functions::calc_grp_gn): New method.
9839 (Arm_relocate_functions::arm_grp_alu): New Method.
9840 (Arm_relocate_functions::arm_grp_ldr): New Method.
9841 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9842 (Arm_relocate_functions::arm_grp_ldc): New Method.
9843 (Target_arm::Scan::local): Handle the ARM group relocations.
9844 (Target_arm::Scan::global): Likewise.
9845 (Target_arm::Relocate::relocate): Likewise.
9846 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9847 Likewise.
9848
2b328d4e
DK
98492010-01-26 Doug Kwan <dougkwan@google.com>
9850
9851 * arm.cc (set): Include.
9852 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9853 pointer type.
2e702c99 9854 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9855 (Arm_output_section::append_text_sections_to_list): New method.
9856 (Arm_output_section::fix_exidx_coverage): Ditto.
9857 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9858 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9859 Relobj::set_section_offset() instead of
9860 Sized_relobj::invalidate_section_offset().
2e702c99 9861 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9862 parameter for section headers. Ignore relocation sections for
9863 unallocated sections and EXIDX sections.
9864 (Target_arm::fix_exidx_coverage): New method.
9865 (Target_arm::output_section_address_less_than): New type.
9866 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9867 linked text section instead of the EXIDX section.
9868 (Arm_output_section::create_stub_group): Add an assertion to check
9869 that this is not an EXIDX output section.
9870 (Arm_output_section::append_text_sections_to_list): New method.
9871 (Arm_output_section::fix_exidx_coverage): Ditto.
9872 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9873 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9874 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9875 first pass.
9876 (Target_arm::fix_exidx_coverage): New method.
9877 * object.h (Relobj::set_output_section): New method.
9878 (Sized_relobj::invalidate_section_offset): Remove method.
9879 (Sized_relobj::do_invalidate_section_offset): Remove method.
9880 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9881
c7f3c371
DK
98822010-01-25 Doug Kwan <dougkwan@google.com>
9883
9884 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9885 Fix warning due to signed and unsigned comparison on a 32-bit host.
9886
8923b24c
DK
98872010-01-22 Doug Kwan <dougkwan@google.com>
9888
9889 * arm.cc (Target_arm::do_relax): Record an output section for section
9890 offset adjustment it contains any stub table that has changed.
9891 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9892 offsets in an output section if necessary.
9893 * output.cc (Output_section::Output_section): Initialize
9894 section_offsets_need_adjustments_.
9895 (Output_section::add_input_section_for_script): Renamed to
9896 Output_section::add_simple_input_section.
9897 (Output_section::save_states): Add a comment.
9898 (Output_section::discard_states): New method defintion.
9899 (Output_section::adjust_section_offsets): Same.
9900 * output.h (Output_section::add_input_section_for_script): Renamed to
9901 Output_section::add_simple_input_section.
9902 (Output_section::discard_states): New method declaration.
9903 (Output_section::adjust_section_offsets): Same.
9904 (Output_section::section_offsets_need_adjustment,
9905 Output_section::set_section_offsets_need_adjustment): New method
9906 definitions.
9907 (Output_section::section_offsets_need_adjustment_): New data member.
9908 * script-sections.cc
9909 (Output_section_element_input::set_section_address): Adjust code for
9910 renaming of Output_section::add_input_section_for_script.
9911 (Orphan_output_section::set_section_address): Same.
9912
9b2fd367
DK
99132010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9914
9915 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9916 Fix_v4bx enum values .
9917 * gold/options.h (General_options): New option definitions.
9918 (General_options::fix_v4bx): New method.
9919 (General_options::Fix_v4bx): New enum.
9920 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9921 (General_options::parse_fix_v4bx_interworking): New method.
9922
80d0d023
DK
99232010-01-22 Doug Kwan <dougkwan@google.com>
9924
9925 * arm.cc (Arm_exidx_fixup): New class.
9926
af2cdeae
DK
99272010-01-21 Doug Kwan <dougkwan@google.com>
9928
9929 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9930 classes.
9931 (Arm_exidx_section_offset_map): New type.
9932
993d07c1
DK
99332010-01-21 Doug Kwan <dougkwan@google.com>
9934
9935 * arm.cc (Arm_exidx_input_section): New class.
9936 (Arm_relobj::exidx_input_section_by_link,
9937 Arm_relobj::exidx_input_section_by_shndx,
9938 Arm_relobj::make_exidx_input_section): New methods.
9939 (read_arm_attributes_section): Remove.
9940 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9941 information about them.
9942 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9943 to here.
9944
5ac169d4
DK
99452010-01-20 Doug Kwan <dougkwan@google.com>
9946
9947 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9948 Input_section_specifier to Section_id.
9949 (Target_arm::new_arm_input_section: Adjust code for change of key
9950 type.
9951 (Target_arm::find_arm_input_section): Ditto.
9952 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9953 (Section_id): Remove.
9954 (Garbage_collection::Section_id_hash): Remove.
9955 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9956 (Section_id): Remove.
9957 (Icf::Section_id_hash): Remove.
9958 * object.h (Section_id, Const_section_id, Section_id_hash,
9959 Const_section_id_hash): New type definitions.
9960 * output.cc (Output_section::add_relaxed_input_section): Change to
9961 use Const_section_id instead of Input_section_specifier as key type.
9962 (Output_section::add_merge_input_section): Ditto.
9963 (Output_section::build_relaxation_map): Change to use Section_id
9964 instead of Input_section_specifier as key type.
2e702c99 9965 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9966 Ditto.
9967 (Output_section::convert_input_sections_to_relaxed_sections): Change
9968 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9969 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9970 (Output_section::find_relaxed_input_section): Ditto.
9971 * output.h (Input_section_specifier): Remove class.
9972 (Output_section::Output_section_data_by_input_section_map): Change
9973 key type to Const_section_id.
9974 (Output_section::Output_relaxed_input_section_by_input_section_map):
9975 Ditto.
9976 (Output_section::Relaxation_map): Change key type to Section_id.
9977
a2162063
ILT
99782010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9979
9980 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9981 (class Arm_v4bx_stub): New class.
9982 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9983 (Stub_factory::make_arm_v4bx_stub): New method.
9984 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9985 (Stub_table::empty): Handle v4bx stubs.
9986 (Stub_table::add_arm_v4bx_stub): New method.
9987 (Stub_table::find_arm_v4bx_stub): New method.
9988 (Arm_relocate_functions::v4bx): New method.
9989 (Target_arm::fix_v4bx): New method.
9990 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9991 (Stub_table::relocate_stubs): Likewise.
9992 (Stub_table::do_write): Likewise.
9993 (Stub_table::update_data_size_and_addralign): Likewise.
9994 (Stub_table::finalize_stubs): Likewise.
9995 (Target_arm::Scan::local): Likewise.
9996 (Target_arm::Scan::global): Likewise.
9997 (Target_arm::do_finalize_sections): Likewise.
9998 (Target_arm::Relocate::relocate): Likewise.
9999 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10000 Likewise.
10001 (Target_arm::scan_reloc_for_stub): Likewise.
10002 (Target_arm::scan_reloc_section_for_stubs): Likewise.
10003
5696ab0b
ILT
100042010-01-19 Ian Lance Taylor <iant@google.com>
10005
10006 * output.cc (Output_section_headers::do_sized_write): Write large
10007 segment count to sh_info field.
10008 (Output_file_header::do_sized_write): For large segment count,
10009 write PN_XNUM to e_phnum field.
10010
800d0f56
ILT
100112010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10012
10013 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
10014 (Arm_relocate_functions::thm_jump8): New function.
10015 (Arm_relocate_functions::thm_jump11): New function.
10016 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10017 R_ARM_THM_JUMP11.
10018 (Target_arm::Scan::global): Likewise.
10019 (Target_arm::Relocate::relocate): Likewise.
10020 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10021 Likewise.
10022
41263c05
DK
100232010-01-14 Doug Kwan <dougkwan@google.com>
10024
10025 * arm.cc (map, utility): Include headers.
10026 (Target_arm::apply_cortex_a8_workaround): New method.
10027 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10028 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10029 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10030 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10031 the --[no-]fix-cortex-a8 command line options.
10032 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10033 (Target_arm::relocate_stub): Use addend in instruction template.
10034 * options.h (DEFINE_bool): Set the user-set flag.
10035 (General_options): Add --[no-]-fix-cortex options.
10036 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10037 : Update fast look-up map after conversion.
41263c05 10038
459e9b03
ST
100392010-01-14 Sriraman Tallam <tmsriram@google.com>
10040
10041 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10042 in the first pass of do_layout.
10043
b521dfe4
DK
100442010-01-13 Doug Kwan <dougkwan@google.com>
10045
10046 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10047 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10048 apparent compiler problem of not folding static constant integral
10049 data members of elfcpp::Elf_sizes<32>.
10050
44272192
DK
100512010-01-13 Doug Kwan <dougkwan@google.com>
10052
10053 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10054 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10055 Arm_relobj::scan_section_for_cortex_a8_erratum,
10056 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10057 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10058 sections to scan for relocation stubs into a new method
10059 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10060 relocation and Cortex-A8 stub scanning.
10061 (Target_arm::do_relax): Force stubs to be after stubbed sections
10062 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10063 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10064 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10065
44b71ece
ILT
100662010-01-12 Ian Lance Taylor <iant@google.com>
10067
10068 * target-reloc.h (visibility_error): New inline function.
10069 (relocate_section): Call visibility_error.
10070 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10071 (MOSTLYCLEANFILES): Likewise.
10072 (protected_4_pic.o, protected_3.err): New targets.
10073 * testsuite/protected_4.cc: New file.
10074
a120bc7f
DK
100752010-01-12 Doug Kwan <dougkwan@google.com>
10076
10077 * arm.cc (Cortex_a8_reloc): New class.
10078 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10079 and cortex_a8_relocs_info_.
10080 (Target_arm::fix_cortex_a8): New method definition.
10081 (Target_arm::Cortex_a8_relocs_info): New type.
10082 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10083 New data member declarations.
10084 (Target_arm::scan_reloc_for_stub): Record information about
10085 relocations for THUMB branches that might be exempted from the
10086 Cortex-A8 workaround.
10087 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10088 at the beginning of a relaxation pass.
10089
20138696
DK
100902010-01-12 Doug Kwan <dougkwan@google.com>
10091
10092 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10093 (Arm_relobj::Mapping_symbol_position,
10094 Arm_reloj::Mapping_symbol_position_less,
10095 Arm_relobj::Mapping_symbols_info): New types.
10096 (Target_arm::is_mapping_symbol_name): New method definition.
10097 (Arm_relobj::do_count_local_symbols): Save information about mapping
10098 symbols.
10099
089d69dc
DK
101002010-01-11 Doug Kwan <dougkwan@google.com>
10101
10102 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10103 Arm_relocate_functions::thumb32_branch_upper,
10104 Arm_relocate_functions::thumb32_branch_lower,
10105 Arm_relocate_functions::thumb32_cond_branch_offset,
10106 Arm_relocate_functions::thumb32_cond_branch_upper,
10107 Arm_relocate_functions::thumb32_cond_branch_lower,
10108 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10109 branch offset encoding.
10110 (Arm_relocate_functions::thumb_branch_common): Use new branch
10111 offset encoding methods to avoid code duplication.
10112 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10113 (Stub_addend_reader::operator()): Use new branch encoding method
10114 to avoid code duplication.
10115
99e5bff2
DK
101162010-01-11 Doug Kwan <dougkwan@google.com>
10117
10118 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10119 (Target_arm::do_finalize_sections): Define special EXIDX section
10120 symbols only if referenced.
10121 * gc.h (Garbage_collection::add_reference): New method.
10122 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10123 code duplication.
10124
98e090bd
ILT
101252010-01-11 Ian Lance Taylor <iant@google.com>
10126
d0a91bd8
ILT
10127 * script.cc (Version_script_info::build_expression_list_lookup):
10128 Change complaing about duplicate wildcard match from error to
10129 warning.
10130
98e090bd
ILT
10131 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10132 of 2009-12-30.
10133 (Version_script_info::Version_script_info): Initialize globs_,
10134 default_version_, default_is_global_, and exact_. Don't
10135 initialize globals_ or locals_.
10136 (Version_script_info::build_lookup_tables): Build local symbols
10137 first.
10138 (Version_script_info::unquote): New function.
10139 (Version_script_info::add_exact_match): New function.
10140 (Version_script_info::build_expression_list_lookup): Remove lookup
10141 parameter. Add is_global parameter. Change all callers. Handle
10142 wildcard pattern specially. Unquote pattern. Call
10143 add_exact_match.
10144 (Version_script_info::get_name_to_match): New function.
10145 (Version_script_info::get_symbol_version): New function.
10146 (Version_script_info::get_symbol_version_helper): Remove.
10147 (Version_script_info::check_unmatched_names): Call unquote.
10148 * script.h (class Version_script_info): Change get_symbol_version
10149 to be non-inline and add is_global parameter; change all callers.
10150 Rewrite symbol_is_local. Update declarations. Define struct
10151 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10152 Remove globals_ and locals_ members. Add exact_, globs_,
10153 default_version_, is_global_.
10154 (Version_script_info::Glob): Remove pattern, add expression and
10155 is_global. Update constructor. Change all callers.
10156 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10157 default version.
10158 (Versions::symbol_section_contents): If a symbol is undefined, or
10159 defined in a dynamic object, set the version index to
10160 VER_NDX_LOCAL.
10161 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10162 symbol_is_local.
10163 (Symbol_table::add_from_pluginobj): Likewise.
10164 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10165
d56962d3
DK
101662010-01-11 Doug Kwan <dougkwan@google.com>
10167
10168 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10169 (incremental_dump_LDADD): Add linking option for libintl.
10170 * Makefile.in: Regenerate.
10171
94e6ee91
L
101722010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10173
10174 PR gold/11144
10175 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10176 instead of -Ds.
10177 * testsuite/Makefile.in: Regenerated.
10178
e96c574b
DK
101792010-01-10 Doug Kwan <dougkwan@google.com>
10180
10181 * options.h (DEFINE_var): Use parentheses around argument varname__
10182 in macro body to avoid any unintended subsequent substitutions.
10183
7198066b
ILT
101842010-01-10 Ian Lance Taylor <iant@google.com>
10185
ba4d53bf
ILT
10186 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10187 candidates before doing symbol resolution.
10188
7198066b
ILT
10189 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10190 ODR candidates if only one is weak.
10191
a2beed37
ILT
101922010-01-08 Ian Lance Taylor <iant@google.com>
10193
10194 * script.cc (Version_script_info::build_expression_list_lookup):
10195 Don't warn about ambiguous version, just record the ambiguity.
10196 (Version_script_info::get_symbol_version_helper): Give error if
10197 version is ambiguous.
10198
2fb7225c
DK
101992010-01-08 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10202 prev_data_size_ and prev_addralign_. Remove initializer for
10203 deleted data member has_been_changed_.
10204 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10205 to determine if the table is empty.
10206 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10207 Remove.
10208 (Stub_table::add_reloc_stub): Define method in class definition
10209 instead of just declaring it there.
10210 (Stub_table::add_cortex_a8_stub): New method definition.
10211 (Stub_table::update_data_size_and_addralign): Ditto.
10212 (Stub_table::finalize_stubs): Ditto.
10213 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10214 (Stub_table::do_addralign_): Return address alignment in the
10215 (Stub_table::do_reset_address_and_file_offset): Define method in
10216 class definition instead of declaring it there. Set current data
10217 size to be the data size of the previous pass.
10218 (Stub_table::set_final_data_size): Use current data size as the
10219 final data size.
10220 (Stub_table::relocate_stub): Change parameter type of stub from
10221 Reloc_stub pointer to Stub pointer.
10222 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10223 (Stub_table::Cortex_a8_stub_list): New typedef.
10224 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10225 Stub_table::prev_addralign_): New data member.
10226 (Arm_relobj::Arm_relobj): Initialize data member
10227 section_has_cortex_a8_workaround_.
10228 (Arm_relobj::section_has_cortex_a8_workaround,
10229 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10230 definitions.
10231 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10232 declarations.
10233 (Target_arm::relocate_stub): Change parameter type of stub from
10234 Reloc_stub pointer to Stub pointer.
10235 (Insn_template::size, Insn_template::alignment): Handle
10236 THUMB16_SPECIAL_TYPE.
10237 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10238 Stub_table::update_data_size_and_addralign,
10239 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10240 definitions.
10241 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10242 (Stub_table::do_write): Ditto.
10243 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10244
880cd20d
ILT
102452010-01-08 Ian Lance Taylor <iant@google.com>
10246
10247 PR 11108
10248 * symtab.h (class Symbol): Remove fields is_target_special_ and
10249 has_plt_offset_. Add field is_defined_in_discarded_section_.
10250 (Symbol::is_defined_in_discarded_section): New function.
10251 (Symbol::set_is_defined_in_discarded_section): New function.
10252 (Symbol::has_plt_offset): Rewrite.
10253 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10254 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10255 Don't initialize is_target_special_ or has_plt_offset_.
10256 Initialize is_defined_in_discarded_section_.
10257 (Symbol_table::add_from_relobj): If appropriate, set
10258 is_defined_in_discarded_section.
10259 * resolve.cc (Symbol::override_base_with_special): Don't test
10260 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10261 * target-reloc.h (relocate_section): Do special handling for
10262 symbols defined in discarded sections for global symbols as well
10263 as local symbols.
10264
2703e3eb
ILT
102652010-01-08 Ian Lance Taylor <iant@google.com>
10266
10267 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10268 the SHT_SYMTAB case.
10269
339d40a3
ILT
102702010-01-08 Ian Lance Taylor <iant@google.com>
10271
10272 * object.cc (Sized_relobj::do_layout): Don't get confused if
10273 layout_eh_frame returns NULL.
10274
abecea76
ILT
102752010-01-08 Ian Lance Taylor <iant@google.com>
10276
10277 PR 11084
10278 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10279 dynamic symbol table, use the normal symbol table.
10280 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10281 symbol table.
10282
6b7dd3f3
ILT
102832010-01-08 Ian Lance Taylor <iant@google.com>
10284
10285 PR 11072
10286 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10287 sections.
10288
36c50e63
L
102892010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10290
10291 * version.cc (print_version): Change to "Copyright 2010".
10292
e291e7b9
ILT
102932010-01-08 Ian Lance Taylor <iant@google.com>
10294
10295 PR 10287
10296 PR 11063
10297 * i386.cc (class Target_i386): Change return type of plt_section
10298 to be non-const.
10299 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10300 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10301 tls_desc_rel_ field.
10302 (Output_data_plt_i386::rel_tls_desc): New function.
10303 (Target_i386::rel_tls_desc_section): New function.
10304 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10305 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10306 R_386_TLS_DESC reloc in rel_tls_desc_section.
10307 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10308 Define struct Tlsdesc_info.
10309 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10310 (Target_x86_64::do_reloc_symbol_index): New function.
10311 (Target_x86_64::add_tlsdesc_info): New function.
10312 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10313 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10314 tlsdesc_rel_ field.
10315 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10316 all callers.
10317 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10318 (Target_x86_64::rela_tlsdesc_section): New function.
10319 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10320 handling.
10321 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10322 (Target_x86_64::do_reloc_addend): New function.
10323 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10324 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10325 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10326 (Output_reloc::type): New function.
10327 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10328 (Output_reloc::is_target_specific): New function.
10329 (Output_reloc::target_arg): New function.
10330 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10331 absolute relocs and target specific relocs.
10332 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10333 add_target_specific.
10334 (class Output_data_reloc) [SHT_RELA]: Likewise.
10335 * output.cc (Output_reloc::Output_reloc): Add four new versions
10336 for absolute relocs and target specific relocs.
10337 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10338 (Output_reloc::get_symbol_index): Likewise.
10339 (Output_reloc::local_section_offset): Check that local_sym_index_
10340 is not TARGET_CODE or 0.
10341 (Output_reloc::symbol_value): Likewise.
10342 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10343 reloc.
10344 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10345 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10346 functions.
10347 * layout.cc (add_target_dynamic_tags): Use output section for
10348 DT_PLTRELSZ and DT_JMPREL.
10349
3a44184e
ILT
103502010-01-07 Ian Lance Taylor <iant@google.com>
10351
10352 PR 11061
10353 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10354 function.
10355 (class Output_data_reloc_generic): Define.
10356 (class Output_data_reloc_base): Change base class to
10357 Output_data_reloc_generic. Change add() method to call
10358 bump_relative_reloc_count for a relative reloc. Remove
10359 sort_relocs_ field.
10360 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10361 to sort_relocs().
10362 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10363 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10364 appropriate.
10365 * layout.h (class Layout): Update declaration.
10366
ea715a34
ILT
103672010-01-07 Ian Lance Taylor <iant@google.com>
10368
10369 * output.h (class Output_data): Add const version of
10370 output_section and do_output_section.
10371 (class Output_section_data): Add const version of
10372 do_output_section.
10373 (class Output_section): Likewise.
10374 * layout.cc (Layout::add_target_dynamic_tags): New function.
10375 * layout.h (class Layout): Update declarations.
10376 * arm.cc (Target_arm::do_finalize_sections): Use
10377 add_target_dynamic_tags.
10378 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10379 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10380 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10381 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10382
659948a4
ILT
103832010-01-07 Ian Lance Taylor <iant@google.com>
10384
10385 PR 11042
10386 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10387 object as needed.
10388
9d3b86f6
ILT
103892010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10390 Ian Lance Taylor <iant@google.com>
10391
10392 PR 11019
10393 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10394 Xindex::read_symtab_xindex.
10395
bb0d3eb0
DK
103962010-01-07 Doug Kwan <dougkwan@google.com>
10397
10398 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10399 (Insn_template::thumb16_bcond_insn): New method declaration.
10400 (Insn_template): Fix spelling.
10401 (Stub::thumb16_special): New method declaration.
10402 (Stub::do_write): Define virtual method which was previously pure
10403 virtual.
10404 (Stub::do_thumb16_special): New method declaration.
10405 (Stub::do_fixed_endian_write): New template member.
10406 (Reloc_stub::do_write): Remove.
10407 (Reloc_stub::do_fixed_endian_write): Remove.
10408 (Cortex_a8_stub): New class definition.
10409 (Stub_factory::make_cortex_a8_stub): New method definition.
10410 (Stub_factory::Stub_factory): Add missing static storage class
10411 qualifier for elf32_arm_stub_a8_veneer_blx.
10412
ffeef7df
ILT
104132010-01-07 Ian Lance Taylor <iant@google.com>
10414
dc3f80fe
ILT
10415 PR 10980
10416 * options.h (class General_options): Add --warn-unresolved-symbols
10417 and --error-unresolved-symbols.
10418 * errors.cc (Errors::undefined_symbol): Implement
10419 --warn-unresolved-symbols.
10420
ffeef7df
ILT
10421 * options.h (class General_options): Add -z text and -z textoff.
10422 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10423
f1ec9ded
ST
104242010-01-06 Sriraman Tallam <tmsriram@google.com>
10425
10426 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10427 (Garbage_collection::cident_sections): New function.
10428 (Garbage_collection::add_cident_section): New function.
10429 (Garbage_collection::cident_sections_): New member.
10430 (gc_process_relocs): Add references to sections whose names are C
10431 identifiers.
10432 * gold.h (cident_section_start_prefix): New constant.
10433 (cident_section_stop_prefix): New constant.
10434 (is_cident): New function.
10435 * layout.cc (Layout::define_section_symbols): Replace string constants
10436 with the newly defined constants.
10437 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10438 C identifiers.
10439 * testsuite/Makefile.am: Add gc_orphan_section_test.
10440 * testsuite/Makefile.in: Regenerate.
10441 * testsuite/gc_orphan_section_test.cc: New file.
10442 * testsuite/gc_orphan_section_test.sh: New file.
10443
6eda8c29
ILT
104442010-01-06 Ian Lance Taylor <iant@google.com>
10445
b9674e17
ILT
10446 PR 10980
10447 * options.h (class General_options): Add --warn-shared-textrel.
10448 * layout.cc (Layout::finish_dynamic_section): Implement
10449 --warn-shared-textrel.
10450
6eda8c29
ILT
10451 PR 10980
10452 * options.h (class General_options): Add --warn-multiple-gp.
10453
32dcd44e
ILT
104542010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10455
10456 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10457 $(THREADSLIB) and $(LIBDL).
10458 * Makefile.in: Rebuild.
10459
a192ba05
ILT
104602010-01-06 Ian Lance Taylor <iant@google.com>
10461
10462 PR 10980
10463 * options.cc (General_options::parse_section_start): New function.
10464 (General_options::section_start): New function.
10465 (General_options::General_options): Initialize all members.
10466 * options.h: Include <map>
10467 (class General_options): Add --section-start. Add section_starts_
10468 member.
10469 * layout.cc (Layout::attach_allocated_section_to_segment): If
10470 --section-start was used, set the address of the segment. Remove
10471 local sort_sections.
10472 (Layout::relaxation_loop_body): If the address of the load segment
10473 has been set by --section-start, don't use it.
10474 * output.h (Output_segment::update_flags_for_output_section): New
10475 function.
10476 * output.cc (Output_segment::add_output_section): Call
10477 update_flags_for_output_section.
10478
dde3f402
ILT
104792010-01-05 Ian Lance Taylor <iant@google.com>
10480
62dfdd4d
ILT
10481 PR 10980
10482 * options.h (class General_options): Add --undefined-version.
10483 * script.cc (struct Version_expression): Add was_matched_by_symbol
10484 field.
10485 (Version_script_info::matched_symbol): New function.
10486 (Version_script_info::get_symbol_version_helper): Call
10487 matched_symbol.
10488 (Version_script_info::check_unmatched_names): New function.
10489 * script.h (class Version_script_info): Update declarations.
10490 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10491
9c4ae156
ILT
10492 * options.h (class General_options): Use DEFINE_bool_alias for
10493 allow_multiple_definition.
10494 * resolve.cc (Symbol_table::should_override): Don't test
10495 allow_multiple_definition.
10496
dde3f402
ILT
10497 PR 10980
10498 * options.h (class General_options): Add --cref.
10499 * main.cc (main): Print cref table if --cref. Don't close mapfile
10500 until after printing cref table.
10501 * cref.cc: Include "symtab.h".
10502 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10503 (Cref_table_compare::operator()): New function.
10504 (Cref_inputs::gather_cref): New function.
10505 (filecol): New static const.
10506 (Cref_inputs::print_cref): New function.
10507 (Cref::print_cref): New function.
10508 * cref.h: Include <cstdio>.
10509 (class Cref): Update declarations.
10510 * mapfile.h (Mapfile::file): New function.
10511 * object.h (class Object): Define Symbols. Declare virtual
10512 do_get_global_symbols.
10513 (Object::get_global_symbols): New function.
10514 * object.cc (Input_objects::add_object): Pass object to cref_ if
10515 --cref.
10516 (Input_objects::archive_start): Likewise.
10517 (Input_objects::archive_stop): Likewise.
10518 (Input_objects::print_cref): New function.
10519 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10520 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10521 --cref.
10522 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10523 function.
10524 * plugin.h (class Sized_pluginobj): Update declarations.
10525
8781f709
ILT
105262010-01-05 Ian Lance Taylor <iant@google.com>
10527
10528 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10529 to is_default_version. Rename insdef to insdefault.
10530 (Symbol_table::add_from_relobj): Rename def to is_default_version
10531 and local to is_forced_local.
10532 (Symbol_table::add_from_pluginobj): Likewise.
10533 (Symbol_table::add_from_dynobj): Likewise.
10534 (Symbol_table::define_special_symbol): Rename insdef to
10535 insdefault.
10536
fe35d28d
ILT
105372010-01-04 Ian Lance Taylor <iant@google.com>
10538
30bc8c46
ILT
10539 PR 10980
10540 * options.h (class General_options): Add
10541 --allow-multiple-definition and -z muldefs.
10542 * resolve.cc (Symbol_table::should_override): Don't warn about a
10543 multiple symbol definition if --allow-multiple-definition or -z
10544 muldefs.
10545
7eaea549
ILT
10546 PR 10980
10547 * options.h (class General_options): Add --add-needed and
10548 --copy-dt-needed-entries. Tweak --as-needed help entry.
10549 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10550 error if --copy-dt-needed-entries aka --add-needed is used and
10551 would cause a change in behaviour.
10552
fe35d28d
ILT
10553 PR 10980
10554 * options.h (class General_options): Add -G as a short version of
10555 --shared. Add no-op options -assert, -g, and -i.
10556
55a2bb35
ST
105572010-01-04 Sriraman Tallam <tmsriram@google.com>
10558
10559 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10560 check for .text or .gnu.linkonce.t sections.
10561 * icf.cc (Icf::find_identical_sections): Ditto.
10562 Change the detection for mangled function name within the section
10563 name.
10564 * icf.h (is_section_foldable_candidate): New function.
10565
719328e1
ILT
105662009-12-30 Ian Lance Taylor <iant@google.com>
10567
10568 PR 10980
10569 * options.h (class General_options): Permit two dashes with
10570 --retain-symbols-file.
10571
d7bb5745
ILT
105722009-12-30 Ian Lance Taylor <iant@google.com>
10573
403a15dd
ILT
10574 PR 10979
10575 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10576 don't put the file header and segment headers in the text
10577 segment.
10578
eda294df
ILT
10579 PR 10979
10580 * common.cc (Sort_commons::operator()): Stabilize sort when both
10581 entries are NULL.
10582 (Symbol_table::do_allocate_commons_list): When allocating common
10583 symbols, skip a symbol which is no longer common.
10584 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10585 an object before checking its type.
10586 * testsuite/common_test_2.c: New file.
10587 * testsuite/common_test_3.c: New file.
10588 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10589 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10590 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10591 (common_test_2_pic.o, common_test_2.so): New targets.
10592 (common_test_3_pic.o, common_test_3.so): New targets.
10593 * testsuite/Makefile.in: Rebuild.
10594
d7bb5745
ILT
10595 PR 10979
10596 * script.cc (read_input_script): If we see a new SECTIONS clause,
10597 and we have added an input section, give an error.
10598 * layout.h (class Layout): Add have_added_input_section function.
10599 Add have_added_input_section_ field.
10600 * layout.cc (Layout::Layout): Initialize
10601 have_added_input_section_.
10602 (Layout::layout): Set have_added_input_section_.
10603 (Layout::layout_eh_frame): Likewise.
10604
fc59c572
ILT
106052009-12-30 Ian Lance Taylor <iant@google.com>
10606
10607 PR 10931
10608 * options.h (class General_options): Add --sort-common option.
10609 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10610 * common.cc (Sort_common): Add sort_order parameter to
10611 constructor. Add sort_order_ field.
10612 (Sort_commons::operator): Check sort_order_.
10613 (Symbol_table::allocate_commons): Determine the sort order.
10614 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10615 Change all callers.
10616 (Symbol_table::do_allocate_commons_list): Likewise.
10617
1c74fab0
ILT
106182009-12-30 Ian Lance Taylor <iant@google.com>
10619
10620 PR 10916
10621 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10622 symbols from this object, don't change the visibility of an
10623 undefined symbol.
10624 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10625
6affe781
ILT
106262009-12-30 Ian Lance Taylor <iant@google.com>
10627
10628 PR 10861
10629 * script.h (class Version_script_info): Define Language enum.
10630 Update declarations. Define Glob, Exact, and Lookup types. Add
10631 new fields globals_, locals_, and is_finalized_.
10632 * script.cc: Various formatting fixes.
10633 (class Parser_closure): Change language_stack_ from a vector of
10634 std::string to one of Version_script_info::Language. Adjust all
10635 uses accordingly.
10636 (class Lazy_demangler): Remove.
10637 (struct Version_expression): Change language from std::string to
10638 Version_script_info::Language.
10639 (Version_script_info::Version_script_info): New function.
10640 (Version_script_info::~Version_script_info): Don't call clear.
10641 (Version_script_info::finalize): New function.
10642 (Version_script_info::build_lookup_tables): New function.
10643 (Version_script_info::build_expression_list_lookup): New
10644 function.
10645 (Version_script_info::get_symbol_version_helper): Rewrite to use
10646 lookup tables.
10647 (Version_script_info::print_expression_list): Adjust to use
10648 Version_script_info::Language.
10649 (script_push_lex_into_version_mode): Check that the version script
10650 has not been finalized.
10651 (version_script_push_lang): Change language string to
10652 Version_script_info::Language.
10653 * options.cc (Command_line::version_script): New function.
10654 * options.h (class General_options): Add finalize_dynamic_list
10655 function. Change version_script from declaration to definition.
10656 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10657 * testsuite/version_script.map: Remove duplicate def of foo.
10658 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10659 version_script.map.
10660 * testsuite/Makefile.in: Rebuild.
10661
818bf354
ILT
106622009-12-30 Ian Lance Taylor <iant@google.com>
10663
10664 PR 10843
10665 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10666 if the input symbol index is 0, make the output symbol index 0.
10667
ebcc8304
ILT
106682009-12-30 Ian Lance Taylor <iant@google.com>
10669
10670 PR 10670
10671 * options.h (class General_options): Add -x/--discard-all.
10672 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10673 --discard-all. If the local symbol needs a dynamic entry, check
10674 that before handling --discard-locals.
10675
176fe33f
ILT
106762009-12-30 Ian Lance Taylor <iant@google.com>
10677
bb321bb1
ILT
10678 PR 10450
10679 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10680 flags to PF_R.
10681 (Output_segment::add_output_section): Don't change the flags if
10682 the type is PT_TLS.
10683
176fe33f
ILT
10684 PR 10450
10685 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10686 GNU hash table if they need a dynamic value. Otherwise, don't add
10687 them if they are defined in a dynamic object or are forced local.
10688
e8cd95c7
ILT
106892009-12-29 Ian Lance Taylor <iant@google.com>
10690
1b81fb71
ILT
10691 PR 10450
10692 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10693 .gnu.hash table for a 32-bit target.
10694
8d6d383d
ILT
10695 PR 10450
10696 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10697 regular and a dynamic object only needs a dynamic symbol table
10698 entry if it is externally visible.
10699
e785ec03
ILT
10700 PR 10450
10701 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10702 constructor. Add global_offset_table_ field.
10703 (Target_i386::got_section): Set global_offset_table_.
10704 (Target_i386::do_finalize_sections): Set global_offset_table_
10705 size.
10706 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10707 in constructor. Add global_offset_table_ field.
10708 (Target_x86_64::got_section): Set global_offset_table_.
10709 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10710 size.
10711
1a2dff53
ILT
10712 * layout.cc (Layout::Layout): Initialize increase_relro_.
10713 (Layout::get_output_section): Add is_relro, is_last_relro, and
10714 is_first_non_relro parameters. Change all callers.
10715 (Layout::choose_output_section): Likewise.
10716 (Layout::add_output_section_data): Likewise.
10717 (Layout::make_output_section): Likewise.
10718 (Layout::set_segment_offsets): Clear increase_relro when using a
10719 linker script.
10720 * layout.h (class Layout): Add increase_relro method. Add
10721 increase_relro_ field. Update declarations.
10722 * output.cc (Output_section::Output_section): Initialize
10723 is_last_relro_ and is_first_non_relro_.
10724 (Output_segment::add_output_section): Group relro sections is
10725 do_sort is true. Handle is_last_relro and is_first_non_relro.
10726 (Output_segment::maximum_alignment): Remove relro handling.
10727 (Output_segment::set_section_addresses): Add increase_relro
10728 parameter. Change all callers. Add initial alignment to align
10729 relro sections on separate page. Remove old relro handling.
10730 (Output_segment::set_section_list_addresses): Remove in_relro
10731 parameter. Change all callers.
10732 (Output_segment::set_offset): Add increase parameter. Change all
10733 callers. Remove old relro handling.
10734 * output.h (class Output_section): Add new methods: is_last_relro,
10735 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10736 Add is_last_relro_ and is_first_non_relro_ fields.
10737 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10738 Create separate .got.plt section. Call increase_relro.
10739 * x86_64.cc (Target_x86_64::got_section): Likewise.
10740 * testsuite/relro_script_test.t: Add .got.plt.
10741
f0ba79e2
ILT
10742 PR 10450
10743 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10744 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10745 (Layout::finalize): Call set_dynamic_symbol_size.
10746 (Layout::set_dynamic_symbol_size): New function.
10747 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10748 set_dynamic_symbol_size.
10749
e8cd95c7
ILT
10750 PR 10450
10751 * output.h (class Output_section): Add is_entsize_zero_ field.
10752 * output.cc (Output_section::Output_section): Initialize
10753 is_entsize_zero_.
10754 (Output_section::set_entsize): If two different entsizes are
10755 requested, force it to zero.
10756 (Output_section::add_input_section): Set flags for .debug_str
10757 before updating section flags. Set entsize.
10758 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10759 and SHF_STRING if all input sections have those flags.
10760
3e1b9a8a
RÁE
107612009-12-29 Rafael Espindola <espindola@google.com>
10762
10763 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10764 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10765 reporting.
3e1b9a8a 10766
3dcad376
ST
107672009-12-29 Sriraman Tallam <tmsriram@google.com>
10768
10769 * options.cc (General_options::parse_version): Allow -v to exit
10770 without an error if there is nothing to link.
10771
084e2665
ILT
107722009-12-29 Ian Lance Taylor <iant@google.com>
10773
10774 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10775 using a version of gcc before 4.1.
10776 * configure: Rebuild.
10777
250acde3
CD
107782009-12-28 Chris Demetriou <cgd@google.com>
10779
10780 * attributes.cc (Output_attributes_section_data::do_write): Use
10781 std::vector::front rather than std::vector::data.
10782
99fff23b
ILT
107832009-12-28 Ian Lance Taylor <iant@google.com>
10784
10785 * symtab.h (class Symbol_table): Add enum Defined.
10786 * resolve.cc (Symbol_table::should_override): Add defined
10787 parameter. Change all callers. Test whether object is NULL
10788 before calling a method on it.
10789 (Symbol_table::report_resolve_problem): Add defined parameter.
10790 Change all callers.
10791 (Symbol_table::should_override_with_special): Likewise.
10792 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10793 parameter. Change all callers.
10794 (Symbol_table::do_define_in_output_data): Likewise.
10795 (Symbol_table::define_in_output_segment): Likewise.
10796 (Symbol_table::do_define_in_output_segment): Likewise.
10797 (Symbol_table::define_as_constant): Likewise.
10798 (Symbol_table::do_define_as_constant): Likewise.
10799 * script.h (class Symbol_assignment): Add is_defsym parameter to
10800 constructor; change all callers.
10801 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10802 parameter. Change all callers. Add is_defsym_ field.
10803 (class Parser_closure): Add parsing_defsym parameter to
10804 constructor; change all callers. Add parsing_defsym accessor
10805 function. Add parsing_defsym_ field.
10806
556bd683
ILT
108072009-12-28 Ian Lance Taylor <iant@google.com>
10808
10809 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10810 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10811
1782c879
ILT
108122009-12-23 Ian Lance Taylor <iant@google.com>
10813
10814 * i386.cc (Target_i386::do_calls_non_split): Recognize
10815 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10816 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10817 -fsplit-stack prologue when using %r11.
1782c879 10818
329ca2b1
ST
108192009-12-21 Sriraman Tallam <tmsriram@google.com>
10820
10821 * options.cc (General_options::parse_version): Make -v continue and do
10822 the link like GNU ld does.
10823
d675ff46
RÁE
108242009-12-17 Rafael Avila de Espindola <espindola@google.com>
10825
10826 * Makefile.am (CCFILES): Add timer.cc.
10827 (HFILES): Add timer.h.
10828 * configure.ac: Check for sysconf and times.
10829 * main.cc: include timer.h.
10830 (main): Use Timer instead of get_run_time.
10831 * timer.cc: New.
10832 * timer.h: New.
10833 * workqueue.cc: include timer.h.
10834 (Workqueue::find_and_run_task):
10835 Report user, sys and wall time.
10836 * Makefile.in: Regenerate.
10837 * config.in: Regenerate.
10838 * configure: Regenerate.
10839
d6344fb5
DK
108402009-12-16 Doug Kwan <dougkwan@google.com>
10841
10842 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10843 sections.
10844 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10845 relaxed input sections.
10846 * output.cc (Output_section::find_relaxed_input_section): Change
10847 return type to Output_relaxed_input_section pointer. Adjust code
10848 for new type of relaxed_input_section_map_.
10849 * output.h (Output_section::find_relaxed_input_section): Change
10850 return type to Output_relaxed_input_section pointer.
10851 (Output_section::Output_relaxed_input_section_by_input_section_map):
10852 New type.
10853 (Output_section::relaxed_input_section_map_): Change type to
10854 Output_section::Output_relaxed_input_section_by_input_section_map.
10855 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10856 input section.
10857
0e0d5469
ILT
108582009-12-15 Ian Lance Taylor <iant@google.com>
10859
10860 * layout.cc (Layout::create_shstrtab): Only write out after input
10861 sections if we are compressing debug sections.
10862
0649a889
ILT
108632009-12-15 Ian Lance Taylor <iant@google.com>
10864
10865 * archive.cc (Archive::add_symbols): Only look up a symbol without
10866 a version if there is, in fact, a version.
10867
2ea97941
ILT
108682009-12-14 Ian Lance Taylor <iant@google.com>
10869
10870 Revert -Wshadow changes, all changes from:
10871 2009-12-11 Doug Kwan <dougkwan@google.com>
10872 2009-12-11 Nick Clifton <nickc@redhat.com>
10873 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10874
b0eec2cc
DK
108752009-12-11 Doug Kwan <dougkwan@google.com>
10876
10877 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10878 due to -Wshadow.
10879 * attributes.cc (Object_attribute::size): Ditto.
10880 (Attributes_section_data::size): Ditto.
10881 (Attributes_section_data::Attributes_section_data): Ditto.
10882 (Output_attributes_section_data::do_write): Ditto.
10883 * attributes.h (Object_attribute::set_type): Ditto.
10884 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10885
91d6fa6a
NC
108862009-12-11 Nick Clifton <nickc@redhat.com>
10887
10888 * archive.cc: Fix shadowed variable warnings.
10889 * arm.cc: Likewise.
10890 * compressed_output.cc: Likewise.
10891 * compressed_output.h: Likewise.
10892 * configure: Likewise.
10893 * dwarf_reader.cc: Likewise.
10894 * dynobj.cc: Likewise.
10895 * dynobj.h: Likewise.
10896 * ehframe.cc: Likewise.
10897 * ehframe.h: Likewise.
10898 * errors.cc: Likewise.
10899 * expression.cc: Likewise.
10900 * fileread.cc: Likewise.
10901 * fileread.h: Likewise.
10902 * freebsd.h: Likewise.
10903 * i386.cc: Likewise.
10904 * icf.cc: Likewise.
10905 * incremental.h: Likewise.
10906 * layout.cc: Likewise.
10907 * layout.h: Likewise.
10908 * mapfile.cc: Likewise.
10909 * merge.cc: Likewise.
10910 * merge.h: Likewise.
10911 * object.cc: Likewise.
10912 * object.h: Likewise.
10913 * options.h: Likewise.
10914 * output.cc: Likewise.
10915 * output.h: Likewise.
10916 * parameters.cc: Likewise.
10917 * plugin.cc: Likewise.
10918 * powerpc.cc: Likewise.
10919 * reduced_debug_output.cc: Likewise.
10920 * reduced_debug_output.h: Likewise.
10921 * reloc.cc: Likewise.
10922 * reloc.h: Likewise.
10923 * resolve.cc: Likewise.
10924 * script-sections.cc: Likewise.
10925 * script.cc: Likewise.
10926 * script.h: Likewise.
10927 * sparc.cc: Likewise.
10928 * symtab.cc: Likewise.
10929 * symtab.h: Likewise.
10930 * target-select.cc: Likewise.
10931 * target-select.h: Likewise.
10932 * token.h: Likewise.
10933 * workqueue.cc: Likewise.
10934 * workqueue.h: Likewise.
10935 * x86_64.cc: Likewise.
10936
a0351a69
DK
109372009-12-10 Doug Kwan <dougkwan@google.com>
10938
10939 * arm.cc (attributes.h): New include.
10940 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10941 (Arm_relobj::~Arm_relobj): Delete object pointed by
10942 attributes_section_data_.
10943 (Arm_relobj::attributes_section_data): New method definition.
10944 (Arm_relobj::attributes_section_data_): New data member declaration.
10945 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10946 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10947 attributes_section_data_.
10948 (Arm_dynobj::attributes_section_data): New method definition.
10949 (Arm_dynobj::attributes_section_data_): New data member declaration.
10950 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10951 initialization value of may_use_blx_ to false.
2e702c99 10952 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10953 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10954 object attributes to compute results instead of hard-coding.
10955 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10956 Target_arm::get_secondary_compatible_arch,
10957 Target_arm::set_secondary_compatible_arch
10958 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10959 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10960 New method declarations.
10961 (Target_arm::get_aeabi_object_attribute): New method definition.
10962 (Target_arm::attributes_section_data_): New data member declaration.
10963 (read_arm_attributes_section): New template definition.
10964 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10965 (Arm_dynobj::do_read_symbols): Ditto.
10966 (Target_arm::do_finalize_sections): Merge attributes sections from
10967 input. Check for BLX use after attributes section merging.
10968 Fix __exidx_start and __exidx_end visibility. Create an
10969 .ARM.attributes section if necessary.
10970 (Target_arm::get_secondary_compatible_arch,
10971 Target_arm::set_secondary_compatible_arch,
10972 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10973 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10974 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10975 New method definitions.
10976
b59befec
ILT
109772009-12-09 Ian Lance Taylor <iant@google.com>
10978
10979 * plugin.cc (Plugin::load): Don't cast from void* to a function
10980 pointer.
10981
1276bc89
ILT
109822009-12-09 Ian Lance Taylor <iant@google.com>
10983
10984 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10985 information fields.
10986
2f2de248
L
109872009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10988
10989 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10990 Replace two_file_shared_1.so with two_file_shared_2.so.
10991 * testsuite/Makefile.in: Regenerated.
10992
4f787271
DK
109932009-12-08 Doug Kwan <dougkwan@google.com>
10994
10995 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10996 (HFILES): Add attributes.h and int_encoding.h.
10997 * Makefile.in: Regenerate.
10998 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10999 function definitions to int_encoding.cc
11000 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
11001 prototypes to int_encoding.h
11002 * reduced_debug_output.cc (int_encoding.h): New include.
11003 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
11004 function definitions to int_encoding.cc
11005 (insert_into_vector, read_from_pointer): Move template definitions to
11006 int_encoding.h
11007 * attributes.cc: New file.
11008 * attributes.h: New file.
11009 * int_encoding.cc: New file.
11010 * int_encoding.h: New file.
11011
20b52f1a
RÁE
110122009-12-07 Rafael Avila de Espindola <espindola@google.com>
11013
11014 PR gold/11055
11015 * incremental-dump.cc (dump_incremental_inputs): New.
11016 (main): Use dump_incremental_inputs.
11017
53d7974c
L
110182009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11019
11020 PR gold/10893
11021 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11022 checking elfcpp::STT_FUNC.
11023 (Target_i386::Relocate::relocate): Likewise.
11024 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11025
11026 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11027 symbols from shared libraries into normal FUNC symbols.
11028
11029 * symtab.h (Symbol): Add is_func and use it.
11030
05a352e6
DK
110312009-12-05 Doug Kwan <dougkwan@google.com>
11032
11033 * arm.cc (Target_arm::arm_info): Initialize new fields
11034 attributes_section and attributes_vendor.
11035 * i386.cc (Target_i386::i386_info): Same.
11036 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11037 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11038 fields attributes_section and attributes_vendor.
53d7974c 11039 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11040 * target.h (Target::attributes_section, Target::attributes_vendor,
11041 Target::is_attributes_section, Target::attribute_arg_type,
11042 Target::attributes_order): New method definitions.
11043 (Target::Target_info::attributes_section,
11044 Target::Target_info::attributes_vendor): New fields.
11045 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11046 virtual method definitions.
11047 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11048 attributes_section and attributes_vendor.
11049 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11050
f4e5969c
DK
110512009-12-05 Doug Kwan <dougkwan@google.com>
11052
11053 * arm.cc: Update comments about interworking and stub generation.
11054 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11055 considered as non-PIC.
11056 (Arm_relocate_functions::base_abs): Fix formatting.
11057 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11058 of function to use GOT entry address instead of offset.
11059 (Target_arm::Scan::global): Issue an error if a symbol would need a
11060 PLT does not get one because it is untyped. Remove code to create
11061 dynamic symbols for relative branches.
11062 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11063 takes unsigned integer instead of boolean.
11064
1abce4a6
L
110652009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11066
11067 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11068 (two_file_test_LDADD): Likewise.
11069 (common_test_1_LDADD): Likewise.
11070 (exception_test_LDADD) Likewise.
11071 (weak_test_LDADD): Likewise.
11072 (many_sections_test_LDADD): Likewise.
11073 (initpri1_LDADD): Likewise.
11074 (script_test_1_LDADD): Likewise.
11075 (script_test_2_LDADD): Likewise.
11076 (justsyms_LDADD): Likewise.
11077 (binary_test_LDADD): Likewise.
11078 (large_LDADD): Likewise.
11079 * testsuite/Makefile.in: Regenerated.
11080
adcf2816 110812009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11082
adcf2816
L
11083 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11084 (Symbol_table::override_with_special): Likewise.
11085 (Symbol_table::add_from_object): Likewise.
11086
28e67f5d
RÁE
110872009-12-04 Rafael Avila de Espindola <espindola@google.com>
11088
11089 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11090 Don't set the data_offset twice.
11091
ae10a101
RÁE
110922009-12-04 Rafael Avila de Espindola <espindola@google.com>
11093
11094 * testsuite/Makefile.in: Regenerate.
11095
f59f41f3
DK
110962009-12-03 Doug Kwan <dougkwan@google.com>
11097
11098 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11099 (Target_arm::do_finalize_sections): Add parameter for symbol table
11100 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11101 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11102 parameter for symbol table pointer.
11103 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11104 an additional parameter for a pointer to symbol table.
11105 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11106 parameter for a symbol table pointer.
11107 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11108 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11109 Ditto.
11110 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11111 parameter for a symbol table pointer.
11112
ca55d848
RÁE
111132009-12-03 Rafael Avila de Espindola <espindola@google.com>
11114
11115 * incremental.cc (Incremental_inputs_header)
11116 (Incremental_inputs_header_write, Incremental_inputs_entry)
11117 (Incremental_inputs_entry_write): Move ...
11118 * incremental.h (Incremental_inputs_header)
11119 (Incremental_inputs_header_write, Incremental_inputs_entry)
11120 (Incremental_inputs_entry_write): here.
11121
3aec4f9c
RÁE
111222009-12-02 Rafael Avila de Espindola <espindola@google.com>
11123
11124 * incremental.cc (make_sized_incremental_binary): Set the target.
11125 Error if it is incompatible.
11126 * output.h (Output_file): Add filename method.
11127
9c0ae74d
RÁE
111282009-12-02 Rafael Avila de Espindola <espindola@google.com>
11129
11130 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11131 from the get_* methods.
11132
a45500ae
RÁE
111332009-12-02 Rafael Avila de Espindola <espindola@google.com>
11134
11135 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11136 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11137 Write 0 for the data_offset of scripts.
11138
325e6408
RÁE
111392009-12-02 Rafael Avila de Espindola <espindola@google.com>
11140
11141 * testsuite/Makefile.am: Add the incremental_test.sh test.
11142 * testsuite/incremental_test.sh: New.
11143 * testsuite/incremental_test_1.c: New.
11144 * testsuite/incremental_test_2.c: New.
11145
954c3e2e
RÁE
111462009-12-01 Rafael Avila de Espindola <espindola@google.com>
11147
703d02da 11148 * incremental-dump.cc (main): Fix typos.
954c3e2e 11149
f8086623
RÁE
111502009-11-27 Rafael Avila de Espindola <espindola@google.com>
11151
11152 PR gold/11025
11153 * incremental-dump.cc (main): Use llu to print 64 bit values.
11154
3b0dd6ac
L
111552009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11156 H.J. Lu <hongjiu.lu@intel.com>
11157
11158 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11159 $(LIBDL).
11160 (incremental_dump_LDADD): Likewise.
11161 * Makefile.in: Regenerated.
11162
a6d1ef57 111632009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11164
a6d1ef57
DK
11165 Revert:
11166
11167 2009-11-25 Doug Kwan <dougkwan@google.com>
11168
11169 * arm.cc (Target_arm::Target_arm): Move method definition
11170 outside of class definition. Add code to handle
11171 --target1-rel, --target1-abs and --target2= options.
11172 (Target_arm::get_reloc_reloc_type): Change method to be
11173 non-static and const.
11174 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11175 New data member declaration.
11176 (Target_arm::Scan::local, Target_arm::Scan::global,
11177 Target_arm::Relocate::relocate,
11178 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11179 Adjust call to Target_arm::get_real_reloc_type.
11180 (Target_arm::get_real_reloc_type): Use command line options
11181 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11182 * options.h (--target1-rel, --target1-abs, --target2): New
11183 ARM-only options.
11184
50aeb7d4
DK
111852009-11-25 Doug Kwan <dougkwan@google.com>
11186
11187 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11188 class definition. Add code to handle --target1-rel, --target1-abs
11189 and --target2= options.
11190 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11191 and const.
11192 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11193 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): Adjust
11197 call to Target_arm::get_real_reloc_type.
11198 (Target_arm::get_real_reloc_type): Use command line options to
11199 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11200 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11201 options.
11202
51938283
DK
112032009-11-25 Doug Kwan <dougkwan@google.com>
11204
11205 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11206 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11207 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11208 formatting.
11209 (Arm_relocate_functions::thm_call): Replace body with a call to
11210 Arm_relocate_functions::thumb_branch_common.
11211 (Arm_relocate_functions::thm_jump24,
11212 Arm_relocate_functions::thm_xpc22): New method definitions.
11213 (Arm_relocate_functions::thumb_branch_common): New method definition.
11214 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11215 operator.
11216 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11217 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11218
e2b8f3c4
RÁE
112192009-11-24 Rafael Avila de Espindola <espindola@google.com>
11220
11221 * Makefile.am: Build incremental-dump
11222 * Makefile.in: Regenerate.
11223 * incremental-dump.cc: New.
11224 * incremental.cc (Incremental_inputs_header_data,
11225 Incremental_inputs_entry_data): Move to incremental.h
11226 * incremental.h: (Incremental_inputs_header_data,
11227 Incremental_inputs_entry_data): Move from incremental.cc
11228
bcba9aec
RÁE
112292009-11-24 Rafael Avila de Espindola <espindola@google.com>
11230
11231 * incremental.cc (Incremental_inputs_header,
11232 Incremental_inputs_header_write, Incremental_inputs_entry,
11233 Incremental_inputs_entry_write): Add a typedef with the data type.
11234
7c3afe08
RÁE
112352009-11-24 Rafael Avila de Espindola <espindola@google.com>
11236
11237 * incremental.cc (Incremental_inputs_header,
11238 Incremental_inputs_header_write, Incremental_inputs_entry,
11239 Incremental_inputs_entry_write): Update comment about which
11240 type has the filed descriptions.
11241
d204b6e9
DK
112422009-11-15 Doug Kwan <dougkwan@google.com>
11243
11244 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11245 (Arm_relocate_functions::arm_branch_common): Change method defintion
11246 in class definition to a method declaration and update list of formal
11247 parameters.
11248 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11249 Arm_relocation_functions::jump24): Adjust call to
11250 Arm_relocate_functions::arm_branch_common. Update list of formal
11251 parameters.
11252 (Arm_relocate_functions::xpc25): New method definition.
11253 (Arm_relocate_functions::arm_branch_common): Move method defintion
11254 out from class definition. Use stubs for mode-switching and extending
11255 branch ranges.
11256 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11257 specially. Change code to enable use of stubs in ARM branches.
11258
43d12afe
DK
112592009-11-10 Doug Kwan <dougkwan@google.com>
11260
11261 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11262 in method declaration.
11263 (Target_arm::relocate_stub): New method declaration.
11264 (Target_arm::default_target): Change to return a pointer instead of
11265 a const reference.
11266 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11267 Target_arm::default_target.
11268 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11269 method definition.
11270 (Target_arm::relocate_section): Adjust view.
11271 (Target_arm::relocate_stub): New method definition.
11272
ac33a407
DK
112732009-11-10 Doug Kwan <dougkwan@google.com>
11274
11275 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11276 a format warning.
11277 * incremental.cc (open_incremental_binary): Initialized local
11278 variables to avoid warnings.
11279 * object.cc (make_elf_object): Ditto.
11280 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11281 a format warning.
e1df38aa 11282
88ee28e9
L
11283009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11284
11285 PR gold/10930
11286 * testsuite/plugin_test.c: Include "config.h".
11287
2daedcd6
DK
112882009-11-09 Doug Kwan <dougkwan@google.com>
11289
11290 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11291 (arm_symbol_value): Remove.
11292 (Arm_relocate_functions::arm_branch_common,
11293 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11294 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11295 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11296 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11297 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11298 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11299 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11300 Arm_relocate_functions::thm_mobw_abs_nc,
11301 Arm_relocate_functions::thm_mov_abs,
11302 Arm_relocate_functions::movw_prel_nc,
11303 Arm_relocate_functions::thm_movt_abs,
11304 Arm_relocate_functions::movt_prel,
11305 Arm_relocate_functions::thm_movw_prel_nc,
11306 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11307 (Target_arm::Relocate::relocate): Only decompose address into two
11308 parts if relocation type uses the thumb-bit and pass the actual
11309 bit instead of a flag indicating that the thumb-bit is used. Adjust
11310 calls to methods in Arm_relocate_functions for this change.
11311
1276bc89 113122009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11313
11314 PR 10925
11315 * reloc.cc: Instantiate
11316 Sized_relobj::initialize_input_to_output_maps and
11317 Sized_relobj:free_input_to_output_maps.
11318
e53ad1b5
ILT
113192009-11-06 Ian Lance Taylor <iant@google.com>
11320
11321 PR 10876
11322 * defstd.cc (in_segment): Set only_if_ref true for "end".
11323
eb44217c
DK
113242009-11-06 Doug Kwan <dougkwan@google.com>
11325
11326 * arm.cc (class Reloc_stub): Correct a comment.
11327 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11328 (Target_arm::scan_section_for_stubs): New method declaration.
11329 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11330 Change methods from private to protected.
11331 (Target_arm::do_may_relax): New method definition.
11332 (Target_arm::do_relax, Target_arm::group_sections,
11333 Target_arm::scan_reloc_for_stub,
11334 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11335 (Target_arm::arm_input_section_map_): New data member declaration.
11336 (Target_arm::scan_reloc_for_stub,
11337 Target_arm::scan_reloc_section_for_stubs,
11338 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11339 Target_arm::do_relax): New method definitions.
11340
5d329b7d
ILT
113412009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11342
11343 * configure.ac: Check for (struct stat)::st_mtim
11344 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11345 * config.in: Regenerate.
11346 * configure: Regenerate.
11347
96a0d71b
ILT
113482009-11-05 Ian Lance Taylor <iant@google.com>
11349
11350 PR 10910
11351 * output.cc (Output_segment::add_output_section): Add missing
11352 return statement.
11353
594c8e5e
ILT
113542009-11-04 Ian Lance Taylor <iant@google.com>
11355
11356 PR 10880
11357 * object.h (class Object): Add is_needed and set_is_needed
11358 methods. Add is_needed_ field. Make bool fields into bitfields.
11359 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11360 defined in a dynamic object and referenced by a regular object,
11361 set is_needed for the dynamic object.
11362 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11363 if the file is marked with as_needed and it is not needed.
11364
22b127cc
ILT
113652009-11-04 Ian Lance Taylor <iant@google.com>
11366
11367 PR 10887
11368 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11369 tags if data is discarded by linker script.
11370 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11371 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11372 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11373 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11374
f5c870d2
ILT
113752009-11-04 Ian Lance Taylor <iant@google.com>
11376
11377 * layout.cc (Layout::get_output_section): Add is_interp and
11378 is_dynamic_linker_section parameters. Change all callers.
11379 (Layout::choose_output_section): Likewise.
11380 (Layout::make_output_section): Likewise.
11381 (Layout::add_output_section_data): Add is_dynamic_linker_section
11382 parameter. Change all callers.
11383 * layout.h (class Layout): Update declarations.
11384 * output.h (class Output_section): Add is_interp, set_is_interp,
11385 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11386 Add is_interp_, is_dynamic_linker_section_ fields. Change
11387 generate_code_fills_at_write_ to a bitfield.
11388 * output.cc (Output_section::Output_sections): Initialize new
11389 fields.
11390 (Output_segment::add_output_section): Add do_sort parameter.
11391 Change all callers.
11392
1ae4d23b
ILT
113932009-11-03 Ian Lance Taylor <iant@google.com>
11394
11395 PR 10860
11396 * options.h (class General_options): Add --warn-common.
11397 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11398 merging two common symbols.
11399 (Symbol_table::should_override): Handle --warn-common when merging
11400 a common symbol with a defined symbol. Use report_resolve_problem
11401 for multiple definitions.
11402 (Symbol_table::report_resolve_problem): New function.
11403 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11404
55da9579
DK
114052009-11-03 Doug Kwan <dougkwan@google.com>
11406
11407 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11408 stub_factory_.
11409 (Target_arm::stub_factory): New method definition.
11410 (Target_arm::new_arm_input_section,
11411 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11412 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11413 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11414 New type definitions.
11415 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11416 member declarations.
11417 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11418 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11419 New method definitions.
11420
37a9ac43
ILT
114212009-11-03 Ian Lance Taylor <iant@google.com>
11422
11423 * options.h (class General_options): Add --warn_constructors.
11424
b3d6a3d4
ILT
114252009-11-03 Ian Lance Taylor <iant@google.com>
11426
11427 PR 10893
11428 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11429 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11430
934b01dd
ILT
114312009-11-03 Ian Lance Taylor <iant@google.com>
11432
11433 PR 10895
11434 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11435 --msgid-bugs-address.
11436 (install-pdf): New target.
11437 (install-data_yes): Look up one directory to find mkinstalldirs.
11438
03c1939b
L
114392009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11440
11441 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11442 tree.
11443
ebd95253
DK
114442009-10-30 Doug Kwan <dougkwan@google.com>
11445
11446 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11447
e9bbb538
DK
114482009-10-30 Doug Kwan <dougkwan@google.com>
11449
11450 * arm.cc (Stub_addend_reader): New struct template definition
11451 and partial specializations.
11452 (Stub_addend_reader::operator()): New method definition for a
11453 partially specialized template.
11454
d5b40221
DK
114552009-10-30 Doug Kwan <dougkwan@google.com>
11456
11457 * arm.cc (Arm_relobj::processor_specific_flags): New method
11458 definition.
11459 (Arm_relobj::do_read_symbols): New method declaration.
11460 (Arm_relobj::processor_specific_flags_): New data member declaration.
11461 (Arm_dynobj): New class definition.
11462 (Target_arm::do_finalize_sections): Add input_objects parameter.
11463 (Target_arm::do_adjust_elf_header): New method declaration.
11464 (Target_arm::are_eabi_versions_compatible,
11465 (Target_arm::merge_processor_specific_flags): New method declaration.
11466 (Target_arm::do_make_elf_object): New overloaded method definitions
11467 and declaration.
11468 (Arm_relobj::do_read_symbols): New method definition.
11469 (Arm_dynobj::do_read_symbols): Ditto.
11470 (Target_arm::do_finalize_sections): Add input_objects parameters.
11471 Merge processor-specific flags from all input objects.
11472 (Target_arm::are_eabi_versions_compatible,
11473 Target_arm::merge_processor_specific_flags,
11474 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11475 New method definitions.
11476 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11477 Input_objects pointer type parameter.
11478 * layout.cc (Layout::finalize): Pass input objects to target's.
11479 finalize_sections function.
11480 * output.cc (Output_file_header::do_sized_write): Set ELF file
11481 header's processor-specific flags.
11482 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11483 Input_objects pointer type parameter.
11484 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11485 * target.h (Input_objects): New forward class declaration.
11486 (Target::processor_specific_flags,
11487 Target::are_processor_specific_flags_sect): New method definitions.
11488 (Target::finalize_sections): Add input_objects parameter.
11489 (Target::Target): Initialize processor_specific_flags_ and
11490 are_processor_specific_flags_set_.
11491 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11492 parameter.
11493 (Target::set_processor_specific_flags): New method definition.
11494 (Target::processor_specific_flags_,
11495 Target::are_processor_specific_flags_set_): New data member
11496 declarations.
11497 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11498 Input_objects pointer type parameter.
11499
ebabffbd
DK
115002009-10-30 Doug Kwan <dougkwan@google.com>
11501
11502 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11503
ad0f2072
ILT
115042009-10-28 Ian Lance Taylor <iant@google.com>
11505
11506 * object.h (class Relobj): Drop options parameter from
11507 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11508 do_scan_relocs, do_relocate. Change all callers.
11509 (class Sized_relobj): Drop options parameters from
11510 do_gc_process_relocs, do_scan_relocs, do_relocate,
11511 do_relocate_sections, relocate_sections, emit_relocs_scan,
11512 emit_relocs_scan_reltype. Change all callers.
11513 (struct Relocate_info): Remove options field and all references to
11514 it.
11515 * reloc.h (class Read_relocs): Remove options constructor
11516 parameter and options_ field. Change all callers.
11517 (class Gc_process_relocs, class Scan_relocs): Likewise.
11518 (class Relocate_task): Likewise.
11519 * target-reloc.h (scan_relocs): Remove options parameter. Change
11520 all callers.
11521 (scan_relocatable_relocs): Likewise.
11522 * target.h (class Sized_target): Remove options parameter from
11523 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11524 all callers.
11525 * gc.h (gc_process_relocs): Remove options parameter. Change all
11526 callers.
11527 * arm.cc: Update functions to remove options parameters.
11528 * i386.cc: Likewise.
11529 * powerpc.cc: Likewise.
11530 * sparc.cc: Likewise.
11531 * x86_64.cc: Likewise.
11532 * testsuite/testfile.cc: Likewise.
11533
8ffa3667
DK
115342009-10-28 Doug Kwan <dougkwan@google.com>
11535
11536 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11537 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11538 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11539 New method definitions.
11540
40f36857
CC
115412009-10-28 Cary Coutant <ccoutant@google.com>
11542
11543 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11544 (Plugin::cleanup_done_): New member.
11545 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11546 (Plugin_manager::cleanup_done_): Remove.
11547 (Plugin_manager::add_input_file): Edit error message.
11548 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11549 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11550
2c849493
ILT
115512009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11552
11553 * fileread.cc: (File_read::View::~View): Use the new
11554 data_ownership_ filed.
11555 (File_read::~File_read): Dispose the new whole_file_view_.
11556 (File_read::open): Mmap the whole file if needed.
11557 (File_read::open): Use whole_file_view_ instead of contents_.
11558 (File_read::find_view): Use whole_file_view_ if applicable.
11559 (File_read::do_read): Use whole_file_view_ instead of contents_.
11560 (File_read::make_view): Use whole_file_view_ instead of contents_,
11561 update File_read::View::View call.
11562 (File_read::find_or_make_view): Update File_read::View::View
11563 call.
11564 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11565 remove contents_
11566 (File_read::View::Data_ownership): New enum.
11567 (File_read::View::View): Replace bool mapped_ with Data_ownership
11568 argument.
11569 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11570 (File_read::View::data_ownership_): New field.
11571 (File_read::contents_): Remove (replaced by whole_file_view_).
11572 (File_read::whole_file_view_): New field.
11573 * options.h (class General_options): Add --keep-files-mapped.
11574
24998053
CC
115752009-10-27 Cary Coutant <ccoutant@google.com>
11576
11577 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11578 * testsuite/Makefile.am (plugin_test_5): New test case.
11579 * testsuite/Makefile.in: Regenerate.
11580
72adc4fa
DK
115812009-10-25 Doug Kwan <dougkwan@google.com>
11582
11583 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11584 from private to protected to allow access by child class.
11585 (Sized_relobj::do_relocate_sections): New method declaration.
11586 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11587 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11588 Sized_relobj::relocate_sections. Instantiate template explicitly
11589 for different target sizes and endianity.
11590
07f508a2
DK
115912009-10-24 Doug Kwan <dougkwan@google.com>
11592
11593 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11594 (Arm_input_section::as_arm_input_section): New method.
11595 (Arm_output_section): New class definition.
11596 (Arm_output_section::create_stub_group,
11597 Arm_output_section::group_sections): New method definitions.
11598
10ad9fe5
DK
115992009-10-22 Doug Kwan <dougkwan@google.com>
11600
11601 * arm.cc (Arm_input_section): New class definition.
11602 (Arm_input_section::init, Arm_input_section:do_write,
11603 Arm_input_section::set_final_data_size,
11604 Arm_input_section::do_reset_address_and_file_offset): New method
11605 definitions.
11606
56ee5e00
DK
116072009-10-21 Doug Kwan <dougkwan@google.com>
11608
11609 * arm.cc (Stub_table, Arm_input_section): New forward class
11610 declarations.
11611 (Stub_table): New class defintion.
11612 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11613 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11614 New method definition.
11615
b569affa
DK
116162009-10-21 Doug Kwan <dougkwan@google.com>
11617
11618 * arm.cc: Update copyright comments.
11619 (Target_arm): New forward class template declaration.
11620 (Arm_address): New type.
11621 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11622 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11623 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11624 constants.
11625 (Insn_template): Same.
11626 (DEF_STUBS): New macro.
11627 (Stub_type): New enum type.
11628 (Stub_template): New class definition.
11629 (Stub): Same.
11630 (Reloc_stub): Same.
11631 (Stub_factory): Same.
11632 (Target_arm::Target_arm): Initialize may_use_blx_ and
11633 should_force_pic_veneer_.
11634 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11635 Target_arm::should_force_pic_veneer,
11636 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11637 Target_arm::using_thumb_only, Target_arm:;default_target): New
11638 method defintions.
11639 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11640 New data member declarations.
11641 (Insn_template::size, Insn_template::alignment): New method defintions.
11642 (Stub_template::Stub_template): New method definition.
11643 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11644 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11645 (Stub_factory::Stub_factory): New method definition.
11646 * gold.h (string_hash): New template.
11647 * output.h (Input_section_specifier::hash_value): Use
11648 gold::string_hash.
11649 (Input_section_specifier::string_hash): Remove.
11650 * stringpool.cc (Stringpool_template::string_hash): Use
11651 gold::string_hash.
11652
6c172549
DK
116532009-10-20 Doug Kwan <dougkwan@google.com>
11654
11655 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11656 symbols of relaxed input sections.
11657 * output.h (Output_section::find_relaxed_input_section): Make
11658 method public.
11659
c5617f2f
DK
116602009-10-16 Doug Kwan <dougkwan@google.com>
11661
11662 * dynobj.cc (Versions::Versions): Initialize version_script_.
11663 Only insert base version symbol definition for a shared object
11664 if version script defines any version versions.
11665 (Versions::define_base_version): New method definition.
11666 (Versions::add_def): Check that base version is not needed.
11667 (Versions::add_need): Define base version lazily.
11668 * dynobj.h (Versions::define_base_version): New method declaration.
11669 (Versions::needs_base_version_): New data member declaration.
11670 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11671 (check_DATA): Add no_version_test.stdout.
11672 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11673 New make rules.
11674 * testsuite/Makefile.in: Regenerate.
11675 * testsuite/no_version_test.c: New file.
11676 * testsuite/no_version_test.sh: Ditto.
11677
3c12dcdb
DK
116782009-10-16 Doug Kwan <dougkwan@google.com>
11679
11680 * expression.cc (class Segment_start_expression): New class definition.
11681 (Segment_start_expression::value): New method definition.
11682 (script_exp_function_segment_start): Return a new
11683 Segment_start_expression.
11684 * gold/script-c.h (script_saw_segment_start_expression): New function
11685 prototype.
11686 * script-sections.cc (Script_sections::Script_sections): Initialize
11687 SAW_SEGMENT_START_EXPRESSION_ to false.
11688 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11689 and -Tbbs options to specify section addresses if given in
11690 command line and no SEGMENT_START expression is seen in a script.
11691 * script-sections.h (Script_sections::saw_segment_start_expression,
11692 Script_sections::set_saw_segment_start_expression): New method
11693 definition.
11694 (Script_sections::saw_segment_start_expression_): New data member
11695 declaration.
11696 * script.cc (script_saw_segment_start_expression): New function.
11697 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11698 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11699 script_test_7.sh and script_test_8.sh.
11700 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11701 script_test_8.stdout.
11702 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11703 (script_test_6, script_test_6.stdout, script_test_7,
11704 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11705 * Makefile.in: Regenerate.
11706 * testsuite/script_test_6.sh: New file.
11707 * testsuite/script_test_6.t: Same.
11708 * testsuite/script_test_7.sh: Same.
11709 * testsuite/script_test_7.t: Same.
11710 * testsuite/script_test_8.sh: Same.
11711
64b1ae37
DK
117122009-10-16 Doug Kwan <dougkwan@google.com>
11713
11714 * output.cc (Output_segment::set_section_list_address): Cast
11715 expressions to unsigned long long type to avoid format warnings.
11716
661be1e2
ILT
117172009-10-15 Ian Lance Taylor <iant@google.com>
11718
12edd763 11719 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11720 dot assignment to script_sections_.
12edd763
ILT
11721 * script-sections.cc (Script_sections::add_dot_assignment):
11722 Initialize if necessary.
11723
68b6574b
ILT
11724 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11725 program headers with no load segment if there is a linker script.
11726
661be1e2
ILT
11727 * layout.cc (Layout::set_segment_offsets): Align the file offset
11728 to the segment aligment for -N or -n with no load segment.
11729 * output.cc (Output_segment::add_output_section): Don't crash if
11730 the first section is a TLS section.
11731 (Output_segment::set_section_list_addresses): Print an error
11732 message if the address moves backward in a linker script.
11733 * script-sections.cc
11734 (Output_section_element_input::set_section_addresses): Don't
11735 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11736 (Orphan_output_section::set_section_addresses): Likewise.
11737
f15f61a7
DK
117382009-10-15 Doug Kwan <dougkwan@google.com>
11739
11740 * layout.cc (Layout::finish_dynamic_section): Generate tags
11741 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11742 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11743 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11744
82bb573a
ILT
117452009-10-14 Ian Lance Taylor <iant@google.com>
11746
11747 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11748 fields.
11749 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11750 data_shdr fields of relinfo.
11751 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11752 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11753 R_386_TLS_LDO_32, adjust based on section flags.
11754 (Target_i386::Relocate::fix_up_ldo): Remove.
11755
374ad285
ILT
117562009-10-13 Ian Lance Taylor <iant@google.com>
11757
11758 Add support for -pie.
11759 * options.h (class General_options): Add -pie and
11760 --pic-executable.
11761 (General_options::output_is_position_independent): Test -pie.
11762 (General_options::output_is_executable): Return true if not shared
11763 and not relocatable.
11764 (General_options::output_is_pie): Remove.
11765 * options.cc (General_options::finalize): Reject incompatible uses
11766 of -pie.
11767 * gold.cc (queue_middle_tasks): A -pie link is not static.
11768 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11769 * symtab.cc (Symbol::final_value_is_known): Return false if
11770 output_is_position_independent.
11771 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11772 output_is_position_independent.
11773 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11774 output_is_position_independent.
11775 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11776 output_is_position_independent.
11777 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11778 two_file_pie_test.
11779 (basic_pie_test.o, basic_pie_test): New targets.
11780 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11781 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11782 (two_file_pie_test): New target.
11783 * testsuite/Makefile.in: Rebuild.
11784 * README: Remove note saying that -pie is not supported.
11785
c6585162
ILT
117862009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11787
11788 * options.h (class General_options): Add -init and -fini.
11789 * layout.cc (Layout::finish_dynamic_section): Emit
11790 given init and fini functions.
11791
032ce4e9
ST
117922009-10-13 Sriraman Tallam <tmsriram@google.com>
11793
11794 * gc.h (gc_process_relocs): Check if icf is enabled using new
11795 function.
11796 * gold.cc (queue_initial_tasks): Likewise.
11797 (queue_middle_tasks): Likewise.
11798 * object.cc (do_layout): Likewise.
11799 * symtab.cc (is_section_folded): Likewise.
11800 * main.cc (main): Likewise.
11801 * reloc.cc (Read_relocs::run): Likewise.
11802 (Sized_relobj::do_scan_relocs): Likewise.
11803 * icf.cc (is_function_ctor_or_dtor): New function.
11804 (Icf::find_identical_sections): Check if function is ctor or dtor when
11805 safe icf is chosen.
11806 * options.h (General_options::icf): Change option to be an enum.
11807 (Icf_status): New enum.
11808 (icf_enabled): New method.
11809 (icf_safe_folding): New method.
11810 (set_icf_status): New method.
11811 (icf_status_): New variable.
11812 * (options.cc) (General_options::finalize): Set icf_status_.
11813 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11814 icf_test and icf_keep_unique_test to use the --icf enum flag.
11815 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11816 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11817
f345227a
ST
118182009-10-12 Sriraman Tallam <tmsriram@google.com>
11819
11820 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11821 includes to gc.h and icf.h.
11822 * arm.cc: Include gc.h.
11823 * gold.cc: Likewise.
11824 * i386.cc: Likewise.
11825 * powerpc.cc: Likewise.
11826 * sparc.cc: Likewise.
11827 * x86_64.cc: Likewise.
11828 * gc.h: Include icf.h.
11829
1c7814ed
ILT
118302009-10-11 Ian Lance Taylor <iant@google.com>
11831
11832 * plugin.cc: Include "gold.h" before other header files.
11833
ae3b5189
CD
118342009-10-10 Chris Demetriou <cgd@google.com>
11835
11836 * options.h (Input_file_argument::Input_file_type): New enum.
11837 (Input_file_argument::is_lib_): Replace with...
11838 (Input_file_argument::type_): New member.
11839 (Input_file_argument::Input_file_argument): Take Input_file_type
11840 'type' rather than boolean 'is_lib' as second argument.
11841 (Input_file_argument::is_lib): Use type_.
11842 (Input_file_argument::is_searched_file): New function.
11843 (Input_file_argument::may_need_search): Handle is_searched_file.
11844 * options.cc (General_options::parse_library): Support -l:filename.
11845 (General_options::parse_just_symbols): Update for Input_file_argument
11846 changes.
11847 (Command_line::process): Likewise.
11848 * archive.cc (Archive::get_file_and_offset): Likewise.
11849 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11850 * script.cc (read_script_file, script_add_file): Likewise.
11851 * fileread.cc (Input_file::Input_file): Likewise.
11852 (Input_file::will_search_for): Handle is_searched_file.
11853 (Input_file::open): Likewise.
11854 * readsyms.cc (Read_symbols::get_name): Likewise.
11855 * testsuite/Makefile.am (searched_file_test): New test.
11856 * testsuite/Makefile.in: Regenerate.
11857 * testsuite/searched_file_test.cc: New file.
11858 * testsuite/searched_file_test_lib.cc: New file.
11859
f3048a1d
ILT
118602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11861 Ian Lance Taylor <iant@google.com>
11862
11863 * descriptor.cc: Include <cstdio> and "binary-io.h".
11864 (Descriptors::open): Open the files in binary mode always.
11865 * script.cc (Lex::get_token): Treat \r as whitespace.
11866
d4780e57
ILT
118672009-10-09 Ian Lance Taylor <iant@google.com>
11868
11869 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11870
d9a893b8
ILT
118712009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11872 Ian Lance Taylor <iant@google.com>
11873
11874 * configure.ac: Check for readv function also.
11875 * fileread.cc (readv): Define if not HAVE_READV.
11876 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11877 does not exist.
11878 * config.in: Regenerate.
11879 * configure: Regenerate.
11880
c0a62865
DK
118812009-10-09 Doug Kwan <dougkwan@google.com>
11882
11883 * layout.cc (Layout::make_output_section): Call target hook to make
11884 ordinary output section.
11885 (Layout::finalize): Adjust parameter list of call the
11886 Target::may_relax().
11887 * layout.h (class Layout::section_list): New method.
11888 * merge.h (Output_merge_base::entsize): Change visibility to public.
11889 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11890 New methods.
11891 (Output_merge_string::do_is_string): New method.
11892 * object.cc (Sized_relobj::do_setup): renamed from
11893 Sized_relobj::set_up.
11894 * object.h (Sized_relobj::adjust_shndx,
11895 Sized_relobj::initializ_input_to_output_maps,
11896 Sized_relobj::free_input_to_output_maps): Change visibilities to
11897 protected.
11898 (Sized_relobj::setup): Virtualize.
11899 (Sized_relobj::do_setup): New method declaration.
11900 (Sized_relobj::invalidate_section_offset,
11901 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11902 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11903 * options.cc (parse_int): New function.
11904 * options.h (parse_int): New declaration.
11905 (DEFINE_int): New macro.
11906 (stub_group_size): New option.
11907 * output.cc (Output_section::Output_section): Initialize memebers
11908 merge_section_map_, merge_section_by_properties_map_,
11909 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11910 (Output_section::add_input_section): Handled deferred code-fill
11911 generation and remove an old comment.
11912 (Output_section::add_relaxed_input_section): New method definition.
11913 (Output_section::add_merge_input_section): Use merge section by
11914 properties map to speed to search. Update merge section maps
11915 as appropriate.
11916 (Output_section::build_relaxation_map): New method definition.
11917 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11918 Same.
11919 (Output_section::relax_input_section): Renamed to
11920 Output_section::convert_input_sections_to_relaxed_sections and change
11921 interface to take a vector of pointers to relaxed sections.
11922 (Output_section::find_merge_section,
11923 Output_section::find_relaxed_input_section): New method definitions.
11924 (Output_section::is_input_address_mapped,
11925 Output_section::output_offset, Output_section::output_address):
11926 Use output section data maps to speed up searching.
11927 (Output_section::find_starting_output_address): Add comments.
11928 (Output_section::do_write,
11929 Output_section::write_to_postprocessing_buffer): Do code-fill
11930 generation as appropriate.
11931 (Output_section::get_input_sections): Invalidate relaxed input section
11932 map.
11933 (Output_section::restore_states): Adjust type of checkpoint .
11934 Invalidate relaxed input section map.
11935 * output.h (Output_merge_base): New class declaration.
11936 (Input_section_specifier): New class defintion.
11937 (class Output_relaxed_input_section) Change base class to
11938 Output_section_data_build.
11939 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11940 base class initializer.
11941 (Output_section::add_relaxed_input_section): New method declaration.
11942 (Output_section::Input_section): Change visibility to protected.
2e702c99 11943 (Output_section::Input_section::relobj,
c0a62865
DK
11944 Output_section::Input_section::shndx): Handle relaxed input sections.
11945 Output_section::input_sections) Change visibility to protected. Also
11946 define overload to return a non-const pointer.
11947 (Output_section::Merge_section_properties): New class defintion.
11948 (Output_section::Merge_section_by_properties_map,
11949 Output_section::Output_section_data_by_input_section_map,
11950 Output_section::Relaxation_map): New types.
11951 (Output_section::relax_input_section): Rename method to
11952 Output_section::convert_input_sections_to_relaxed_sections and change
11953 interface to take a vector of relaxed section pointers.
11954 (Output_section::find_merge_section,
11955 Output_section::find_relaxed_input_section,
11956 Output_section::build_relaxation_map,
11957 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11958 New method declarations.
11959 (Output_section::merge_section_map_
11960 Output_section::merge_section_by_properties_map_,
11961 Output_section::relaxed_input_section_map_,
11962 Output_section::is_relaxed_input_section_map_valid_,
11963 Output_section::generate_code_fills_at_write_): New data members.
11964 * script-sections.cc
11965 (Output_section_element_input::set_section_addresses): Call
11966 current_data_size and addralign methods of relaxed input sections.
11967 (Orphan_output_section::set_section_addresses): Call current_data_size
11968 and addralign methods of relaxed input sections.
11969 * symtab.cc (Symbol_table::compute_final_value): Extract template
11970 from the body of Symbol_table::sized_finalize_symbol.
11971 (Symbol_table::sized_finalized_symbol): Call
11972 Symbol_table::compute_final_value.
11973 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11974 (Symbol_table::compute_final_value): New templated method declaration.
11975 * target.cc (Target::do_make_output_section): New method defintion.
11976 * target.h (Target::make_output_section): New method declaration.
11977 (Target::relax): Add more parameters for input objects, symbol table
11978 and layout. Adjust call to do_relax.
11979 (Target::do_make_output_section): New method declaration.
11980 (Target::do_relax): Add parameters for input objects, symbol table
11981 and layout.
11982
d446d6c4
ILT
119832009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11984
11985 * pread.c: Include stdio.h.
11986
bc06c745
ILT
119872009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11988
11989 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11990 defined.
11991
75aea3d0
ILT
119922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11993
11994 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11995 Change read_shndx type to unsigned int.
11996 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11997 int.
11998 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11999 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
12000 Change read_shndx type to unsigned int.
12001 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
12002 int.
12003 (Sized_dwarf_line_info::read_line_mappings): Likewise.
12004 * layout.cc (Layout::create_symtab_sections): Cast the result of
12005 local_symcount * symsize to off_t in the gold_assert.
12006
be8fcb75
ILT
120072009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12008
12009 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
12010 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
12011 R_ARM_BASE_ABS.
12012 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
12013 (Arm_relocate_functions::thm_abs5): New function.
12014 (Arm_relocate_functions::abs12): New function.
12015 (Arm_relocate_functions::abs16): New function.
12016 (Arm_relocate_functions::base_abs): New function.
12017 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12018 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12019 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12020 R_ARM_BASE_ABS.
12021 (Scan::global): Likewise.
12022 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12023 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12024 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12025 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12026 R_ARM_BASE_ABS.
12027
c2a122b6
ILT
120282009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12029
12030 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12031 (Arm_relocate_functions::movt_prel): New function.
12032 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12033 (Arm_relocate_functions::thm_movt_prel): New function.
12034 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12035 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12036 (Scan::global, Relocate::relocate): Likewise.
12037 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12038
c4aa1e2d
ILT
120392009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12040
12041 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12042 Incremental_checker.
12043 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12044 unsigned int.
12045 (class Incremental_inputs_header): New class.
12046 (Incremental_inputs_header_writer): Edit comment.
12047 (Incremental_inputs_entry): New class.
12048 (Incremental_inputs_entry_writer): Edit comment.
12049 (Sized_incremental_binary::do_find_incremental_inputs_section):
12050 Add *strtab_shndx parameter, fill it.
12051 (Sized_incremental_binary::do_check_inputs): New method.
12052 (Incremental_checker::can_incrementally_link_output_file): Use
12053 Sized_incremental_binary::check_inputs.
12054 (Incremental_inputs::report_command_line): Save command line in
12055 command_line_.
12056 * incremental.h:
12057 (Incremental_binary::find_incremental_inputs_section): New
12058 method.
12059 (Incremental_binary::do_find_incremental_inputs_section): Add
12060 strtab_shndx parameter.
12061 (Incremental_binary::do_check_inputs): New pure virtual method.
12062 (Sized_incremental_binary::do_check_inputs): Declare.
12063 (Incremental_checker::Incremental_checker): Add incremental_inputs
12064 parameter, use it to initialize incremental_inputs_.
12065 (Incremental_checker::incremental_inputs_): New field.
12066 (Incremental_checker::command_line): New method.
12067 (Incremental_checker::inputs): New method.
12068 (Incremental_checker::command_line_): New field.
12069
c549a694
ILT
120702009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12071
12072 * incremental.cc: Include <cstdarg> and "target-select.h".
12073 (vexplain_no_incremental): New function.
12074 (explain_no_incremental): New function.
12075 (Incremental_binary::error): New method.
12076 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12077 method.
12078 (make_sized_incremental_binary): New function.
12079 (open_incremental_binary): New function.
12080 (can_incrementally_link_file): Add checks if output is ELF and has
12081 inputs section.
12082 * incremental.h: Include "elfcpp_file.h" and "output.h".
12083 (Incremental_binary): New class.
12084 (Sized_incremental_binary): New class.
12085 (open_incremental_binary): Declare.
12086 * object.cc (is_elf_object): Use
12087 elfcpp::Elf_recognizer::is_elf_file.
12088 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12089 * output.h (Output_file::filesize): New method.
12090
fd3c5f0b
ILT
120912009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12092
12093 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12094 New function.
12095 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12096 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12097 function.
12098 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12099 function.
12100 (Arm_relocate_functions::movw_abs_nc): New function.
12101 (Arm_relocate_functions::movt_abs): New function.
12102 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12103 (Arm_relocate_functions::thm_movt_abs): New function.
12104 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12105 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12106 (Scan::global): Likewise.
12107 (Relocate::relocate): Likewise.
12108 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12109
7f5309a5
ILT
121102009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12111
12112 * arm.cc (Arm_relocate_functions::got_prel) New function.
12113 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12114 (Relocate::relocate): Likewise.
12115 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12116
364c7fa5
ILT
121172009-10-06 Ian Lance Taylor <iant@google.com>
12118
12119 * options.h (class General_options): Define
12120 split_stack_adjust_size parameter.
12121 * object.h (class Object): Add uses_split_stack_ and
12122 has_no_split_stack_ fields. Add uses_split_stack and
12123 has_no_split_stack accessor functions. Declare
12124 handle_split_stack_section.
12125 (class Reloc_symbol_changes): Define.
12126 (class Sized_relobj): Define Function_offsets. Declare
12127 split_stack_adjust, split_stack_adjust_reltype, and
12128 find_functions.
12129 * object.cc (Object::handle_split_stack_section): New function.
12130 (Sized_relobj::do_layout): Call handle_split_stack_section.
12131 * dynobj.cc (Sized_dynobj::do_layout): Call
12132 handle_split_stack_section.
12133 * reloc.cc (Sized_relobj::relocate_sections): Call
12134 split_stack_adjust for executable sections in split_stack
12135 objects. Pass reloc_map to relocate_section.
12136 (Sized_relobj::split_stack_adjust): New function.
12137 (Sized_relobj::split_stack_adjust_reltype): New function.
12138 (Sized_relobj::find_functions): New function.
12139 * target-reloc.h: Include "object.h".
12140 (relocate_section): Add reloc_symbol_changes parameter. Change
12141 all callers.
12142 * target.h (class Target): Add calls_non_split method. Declare
12143 do_calls_non_split virtual method. Declare match_view and
12144 set_view_to_nop.
12145 * target.cc: Include "elfcpp.h".
12146 (Target::do_calls_non_split): New function.
12147 (Target::match_view): New function.
12148 (Target::set_view_to_nop): New function.
12149 * gold.cc (queue_middle_tasks): Give an error if mixing
12150 split-stack and non-split-stack objects with -r.
12151 * i386.cc (Target_i386::relocate_section): Add
12152 reloc_symbol_changes parameter.
12153 (Target_i386::do_calls_non_split): New function.
12154 * x86_64.cc (Target_x86_64::relocate_section): Add
12155 reloc_symbol_changes parameter.
12156 (Target_x86_64::do_calls_non_split): New function.
12157 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12158 parameter.
12159 * powerpc.cc (Target_powerpc::relocate_section): Add
12160 reloc_symbol_changes parameter.
12161 * sparc.cc (Target_sparc::relocate_section): Add
12162 reloc_symbol_changes parameter.
12163 * configure.ac: Call AM_CONDITIONAL for the default target.
12164 * configure: Rebuild.
12165 * testsuite/Makefile.am (TEST_AS): New variable.
12166 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12167 (check_DATA): Add split_i386 and split_x86_64 files.
12168 (SPLIT_DEFSYMS): Define.
12169 (split_i386_[1234n].o): New targets.
12170 (split_i386_[124]): New targets.
12171 (split_i386_[1234r].stdout): New targets.
12172 (split_x86_64_[1234n].o): New targets.
12173 (split_x86_64_[124]): New targets.
12174 (split_x86_64_[1234r].stdout): New targets.
12175 (MOSTLYCLEANFILES): Add new executables.
12176 * testsuite/split_i386.sh: New file.
12177 * testsuite/split_x86_64.sh: New file.
12178 * testsuite/split_i386_1.s: New file.
12179 * testsuite/split_i386_2.s: New file.
12180 * testsuite/split_i386_3.s: New file.
12181 * testsuite/split_i386_4.s: New file.
12182 * testsuite/split_i386_n.s: New file.
12183 * testsuite/split_x86_64_1.s: New file.
12184 * testsuite/split_x86_64_2.s: New file.
12185 * testsuite/split_x86_64_3.s: New file.
12186 * testsuite/split_x86_64_4.s: New file.
12187 * testsuite/split_x86_64_n.s: New file.
12188 * testsuite/testfile.cc (Target_test): Update relocation_section
12189 function.
12190 * testsuite/Makefile.in: Rebuild.
12191
e8a9fcda
ILT
121922009-10-06 Ian Lance Taylor <iant@google.com>
12193
12194 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12195 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12196 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12197 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12198 the address on ldo_addrs_.
12199 (Target_i386::Relocate::fix_up_ldo): New function.
12200
e99daf92
ILT
122012009-10-06 Rafael Espindola <espindola@google.com>
12202
12203 * plugin.cc (add_input_library): New.
12204 (Plugin::load): Add add_input_library to tv.
12205 (Plugin_manager::add_input_file): Add the is_lib argument.
12206 (add_input_file): Update call to Plugin_manager::add_input_file.
12207 (add_input_library): New.
12208 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12209
966d4097
DK
122102009-09-30 Doug Kwan <dougkwan@google.com>
12211
12212 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12213 symbol and call Symbol::may_need_copy_reloc to determine if
12214 a copy reloc is needed.
12215 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12216 nocopyreloc is given in command line.
12217 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12218 given in command line.
12219 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12220 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12221 of the removed Target_i386::may_need_copy_reloc.
12222 * options.h (copyreloc): New option with default value false.
12223 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12224 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12225 instead of the removed Target_powerpc::may_need_copy_reloc.
12226 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12227 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12228 instead of the removed Target_sparc::may_need_copy_reloc.
12229 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12230 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12231 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12232 instead of the removed Target_x86_64::may_need_copy_reloc.
12233
029ba973
ILT
122342009-09-30 Ian Lance Taylor <iant@google.com>
12235
12236 * object.h (class Object): Remove target_ field, and target,
12237 sized_target, and set_target methods.
12238 (Object::sized_target): Remove.
12239 (class Sized_relobj): Update declarations. Remove sized_target.
12240 * object.cc (Sized_relobj::setup): Remove target parameter.
12241 Change all callers.
12242 (Input_objects::add_object): Don't do anything with the target.
12243 (make_elf_sized_object): Add punconfigured parameter. Change all
12244 callers. Set or test parameter target.
12245 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12246 Change all callers.
12247 * parameters.cc (Parameters::set_target): Change parameter type to
12248 be non-const.
12249 (Parameters::default_target): Remove.
12250 (set_parameters_target): Change parameter type to be non-const.
12251 (parameters_force_valid_target): New function.
12252 (parameters_clear_target): New function.
12253 * parameters.h (class Parameters): Update declarations. Remove
12254 default_target method. Add sized_target and clear_target
12255 methods. Change target_ to be non-const.
12256 (set_parameters_target): Update declaration.
12257 (parameters_force_valid_target): Declare.
12258 (parameters_clear_target): Declare.
12259 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12260 as NULL if we aren't searching.
12261 (Add_symbols::run): Don't check for compatible target.
12262 * fileread.cc (Input_file::open_binary): Call
12263 parameters_force_valid_target.
12264 * gold.cc (queue_middle_tasks): Likewise.
12265 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12266 set_target on object.
12267 * dynobj.h (class Sized_dynobj): Update declarations.
12268 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12269 make_elf_object returns NULL.
12270 (Archive::include_member): Don't check whether object target is
12271 compatible.
12272 * output.cc (Output_section::add_input_section): Get target from
12273 parameters.
12274 (Output_section::relax_input_section): Likewise.
12275 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12276 parameters.
12277 (Sized_relobj::do_scan_relocs): Likewise.
12278 (Sized_relobj::relocate_sections): Likewise.
12279 * resolve.cc (Symbol_table::resolve): Likewise.
12280 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12281 parameter. Change all callers.
12282 (Symbol_table::add_from_object): Get target from parameters.
12283 (Symbol_table::add_from_relobj): Don't check object target.
12284 (Symbol_table::add_from_dynobj): Likewise.
12285 (Symbol_table::define_special_symbol): Get target from
12286 parameters.
12287 * symtab.h (class Symbol_table): Update declaration.
12288 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12289 parameter. Change all callers. Clear parameter target.
12290 (Binary_test): Test target here.
12291 * testsuite/object_unittest.cc (gold_testsuite): Remove
12292 target_test_pointer parameter. Change all callers.
12293 (Object_test): Test target here.
12294
a6a22b83
ILT
122952009-09-26 Ian Lance Taylor <iant@google.com>
12296
12297 * testsuite/initpri1.c: Don't try to use constructor priorities if
12298 compiling with gcc before 4.3.
12299
6a8f49fe
ILT
123002009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12301
12302 * testsuite/retain_symbols_file_test.sh (check_present): Change
12303 output file name to retain_symbols_file_test.stdout.
12304 (check_absent): Likewise.
12305
8c604651
CS
123062009-09-18 Craig Silverstein <csilvers@google.com>
12307
12308 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12309 * options.cc: Include <cerrno> and <fstream>.
12310 (General_options::finalize): Parse -retain-symbols-file tag.
12311 * options.h: New flag.
12312 (General_options): New method should_retain_symbol, new
12313 variable symbols_to_retain.
12314 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12315 should_retain_symbol map.
12316 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12317 * testsuite/Makefile.in: Regenerate.
12318 * testsuite/retain_symbols_file_test.sh: New file.
12319
ca58b19f
NC
123202009-09-18 Nick Clifton <nickc@redhat.com>
12321
12322 * po/es.po: Updated Spanish translation.
12323
20e6d0d6
DK
123242009-09-17 Doug Kwan <dougkwan@google.com>
12325
12326 * debug.h (DEBUG_RELAXATION): New constant.
12327 (DEBUG_ALL): Add DEBUG_RELAXATION.
12328 (debug_string_to_enum): Add relaxation debug option.
12329 * layout.cc
12330 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12331 Layout::Relaxation_debug_check::read_sections,
12332 Layout::Relaxation_debug_check::read_sections): New method definitions.
12333 (Layout::Layout): Initialize data members
12334 record_output_section_data_from_scrips_,
12335 script_output_section_data_list_ and relaxation_debug_check_.
12336 (Layout::save_segments, Layout::restore_segments,
12337 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12338 Layout::relaxation_loop_body): New method definitions.
12339 (Layout::finalize): Support relaxation. Move section layout code to
12340 Layout::relaxation_loop_body.
12341 (Layout::set_asection_address_from_script): Move code for orphan
12342 section placement out.
12343 (Layout::place_orphan_sections_in_script): New method definition.
12344 * layout.h (Output_segment_headers, Output_file_header):
12345 New forward class declarations.
12346 (Layout::~Layout): Define.
12347 (Layout::new_output_section_data_from_script): New method definition.
12348 (Layout::place_orphan_sections_in_script): New method declaration.
12349 (Layout::Segment_states): New type declaration.
12350 (Layout::save_segments, Layout::restore_segments,
12351 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12352 Layout::relaxation_loop_body): New method declarations.
12353 (Layout::Output_section_data_list): New type declaration.
12354 (Layout::Relaxation_debug_check): New class definition.
12355 (Layout::record_output_section_data_from_script_,
12356 Layout::script_output_section_data_list_, Layout::segment_states_,
12357 Layout::relaxation_debug_check_): New data members.
12358 * output.cc: (Output_section_headers::do_size): New method definition.
12359 (Output_section_headers::Output_section_headers): Move size
12360 computation to Output_section_headers::do_size.
12361 (Output_segment_headers::do_size): New method definition.
e1df38aa 12362 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12363 Output_file_header::do_size and call it.
12364 (Output_file_header::do_size): New method definition.
12365 (Output_data_group::Output_data_group): Adjust call to
12366 Output_section_data.
12367 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12368 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12369 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12370 RELAXED_INPUT_SECTION_CODE.
12371 (Output_section::Output_section): Initialize data member checkpoint_.
12372 (Output_section::~Output_section): Delete checkpoint object pointed
12373 by checkpoint_.
12374 (Output_section::add_input_section): Always add an Input_section if
12375 relaxing.
12376 (Output_section::add_merge_input_section): Add assert.
12377 (Output_section::relax_input_section): New method definition.
12378 (Output_section::set_final_data_size): Set load address to zero for
12379 an unallocated section.
12380 (Output_section::do_address_and_file_offset_have_reset_values):
12381 New method definition.
12382 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12383 Handle relaxed input section.
12384 (Output_section::sort_attached_input_sections): Checkpoint input
12385 section list lazily.
12386 (Output_section::get_input_sections): Change type of input_sections to
12387 list of Simple_input_section pointers. Checkpoint input section list
12388 lazily. Also handle relaxed input sections.
12389 (Output_section::add_input_section_for_script): Take a reference to
12390 a Simple_input_section object instead of Relobj pointer and section
12391 index as parameter. Handle relaxed input sections.
12392 (Output_section::save_states, Output_section::restore_states): New
12393 method definitions.
12394 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12395 (Output_data::is_data_size_fixed): New method definition.
12396 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12397 if it is fixed.
12398 (Output_data::address_and_file_offset_have_reset_values): New method
12399 definition.
12400 (Output_data::do_address_and_file_offset_have_reset_values): New method
12401 definition.
12402 (Output_data::set_data_size): Check that data size is not fixed.
12403 (Output_data::fix_data_size): New method definition.
12404 (Output_data::is_data_size_fixed_): New data member.
12405 (Output_section_headers::set_final_data_size): New method definition.
12406 (Output_section_headers::do_size): New method declaration.
12407 (Output_segment_headers::set_final_data_size): New method definition.
12408 (Output_segment_headers::do_size): New method declaration.
12409 (Output_file_header::set_final_data_size)::New method definition.
12410 (Output_file_header::do_size)::New method declaration.
12411 (Output_section_data::Output_section_data): Add new parameter
12412 is_data_size_fixed and use it to fix data size.
12413 (Output_data_const::Output_data_const): Adjust call to base class
12414 constructor and fix data size.
12415 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12416 base class constructor and fix data size.
12417 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12418 base class constructor and fix data size.
12419 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12420 class constructor and fix data size.
12421 (Output_data_group::set_final_data_size): New method definition.
12422 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12423 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12424 class constructor and fix data size.
12425 (Output_relaxed_input_section): New class definition.
12426 (Output_section::Simple_input_section): New class definition.
12427 (Output_section::get_input_sections): Adjust parameter list.
12428 (Output_section::add_input_section_for_script): Same.
12429 (Output_section::save_states, Output_section::restore_states,
12430 Output_section::do_address_and_file_offset_have_reset_values,
12431 (Output_section::Input_section::Input_section): Handle
12432 RELAXED_INPUT_SECTION_CODE. Add new overload for
12433 Output_relaxed_input_section.
12434 (Output_section::Input_section::is_input_section,
12435 Output_section::Input_section::set_output_section): Handle relaxed
12436 input section.
12437 (Output_section::Input_section::is_relaxed_input_section,
12438 Output_section::Input_section::output_section_data,
12439 Output_section::Input_section::relaxed_input_section): New method
12440 definitions.
12441 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12442 value.
12443 (Output_section::Input_section::u1_): Update comments.
12444 (Output_section::Input_section::u2_): Add new union member poris.
12445 (Output_section::Checkpoint_output_section): New classs definition.
12446 (Output_section::relax_input_section): New method declaration.
12447 (Output_section::checkpoint_): New data member.
12448 (Output_segment): Update comments.
12449 (Output_segment::Output_segment): Un-privatize copy constructor.
12450 (Output_segment::operator=): Un-privatize.
12451 * script-sections.cc (Output_section_element::Input_section_list):
12452 Change element type to Output_section::Simple_input_section.
12453 (Output_section_element_dot_assignment::set_section_addresses):
12454 Register output section data for relaxation clean up.
12455 (Output_data_exression::Output_data_expression): Adjust call to base
12456 constructor to fix data size.
12457 (Output_section_element_data::set_section_addresses): Register
12458 Output_data_expression object for relaxation clean up.
12459 (struct Input_section_info): Replace Relobj pointer and section index
12460 pair with Output_section::Simple_input_section and Convert struct to a
12461 class.
12462 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12463 Input_section_info data member to use accessors.
20e6d0d6
DK
12464 (Output_section_element_input::set_section_addresses): Use layout
12465 parameter. Adjust code to use Output_section::Simple_input_section
12466 and Input_secction_info classes. Register filler for relaxation
12467 clean up.
12468 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12469 and section index pair with Output_section::Simple_input_section
12470 class. Adjust code accordingly.
12471 (Phdrs_element::release_segment): New method definition.
12472 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12473 segment list.
12474 (Script_sections::release_segments): New method definition.
12475 * gold/script-sections.h (Script_sections::release_segments): New
12476 method declaration.
12477 * gold/target.h (Target::may_relax, Target::relax,
12478 Target::do_may_relax, Target::do_relax): New method definitions.
12479
5e445df6
ILT
124802009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12481
12482 * arm.cc (has_signed_unsigned_overflow): New function.
12483 (Arm_relocate_functions::abs8): New function.
12484 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12485 (Target_arm::Scan::global): Likewise.
12486 (Target_arm::relocate::relocate): Likewise.
12487 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12488 Likewise.
12489
8c604651 124902009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12491
12492 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12493 * testsuite/Makefile.in: Regenerate.
12494
1e9cc1c2
NC
124952009-09-11 Nick Clifton <nickc@redhat.com>
12496
12497 * po/gold.pot: Updated by the Translation project.
12498
6a89f575
CC
124992009-09-08 Cary Coutant <ccoutant@google.com>
12500
12501 * output.cc (Output_file::open): Add execute permission to empty file.
12502 * testsuite/Makefile.am (permission_test): New test.
12503 * testsuite/Makefile.in: Regenerate.
12504
fdcac5af
ILT
125052009-09-02 Ian Lance Taylor <iant@google.com>
12506
12507 * output.cc (Output_file::resize): Call map_no_anonymous rather
12508 than map.
12509
44453f85
ILT
125102009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12511
12512 * gold.cc: Include "incremental.h".
12513 (queue_initial_tasks): Call Incremental_checker methods.
12514 * incremental.cc: Include "output.h".
12515 (Incremental_checker::can_incrementally_link_output_file): New
12516 method.
12517 * incremental.h (Incremental_checker): New class.
12518
12519 * output.cc (Output_file::open_for_modification): New method.
12520 (Output_file::map_anonymous): Changed return type to bool. Record
12521 map in base_ field.
12522 (Output_file::map_no_anonymous): New method, broken out of map.
12523 (Output_file::map): Use map_no_anonymous and map_anonymous.
12524 * output.h (class Output_file): Update declarations.
12525
293c1386
CC
125262009-08-24 Cary Coutant <ccoutant@google.com>
12527
12528 * options.h (Command_line::Pre_options): New class.
12529 (Command_line::pre_options): New member.
12530 * options.cc (gold::options::ready_to_register): New variable.
12531 (One_option::register_option): Do nothing if not registering options.
12532 Assert if same short option registered twice.
12533 (General_options::General_options): Turn off option registration when
12534 done constructing.
12535 (Command_line::Pre_options::Pre_options): New constructor.
12536
f773f3d2
CC
125372009-08-24 Cary Coutant <ccoutant@google.com>
12538
06a73cfe
CC
12539 * options.h (General_options::no_keep_memory): Remove incorrect
12540 short option.
f773f3d2 12541
a15af8e2
RW
125422009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12543
12544 * Makefile.am (am__skiplex, am__skipyacc): New.
12545 * Makefile.in: Regenerate.
12546
c462b41b
RW
125472009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12548
14ec8efd
RW
12549 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12550 (INCLUDES): ... this.
12551 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12552 (AM_CPPFLAGS): Renamed from ...
12553 (INCLUDE): ... this.
12554 * Makefile.in, testsuite/Makefile.in: Regenerate.
12555
81ecdfbb
RW
12556 * Makefile.in: Regenerate.
12557 * aclocal.m4: Likewise.
12558 * config.in: Likewise.
12559 * configure: Likewise.
12560 * testsuite/Makefile.in: Likewise.
12561
c462b41b
RW
12562 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12563 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12564 * Makefile.in: Regenerate.
12565 * testsuite/Makefile.in: Regenerate.
12566
2da73f13
CC
125672009-08-19 Cary Coutant <ccoutant@google.com>
12568
12569 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12570 symbols in shared libraries overridden by hidden or internal symbols
12571 in the main program.
12572
2db70501
CD
125732009-08-19 Chris Demetriou <cgd@google.com>
12574
12575 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12576 checking source file names in error messages.
12577
f733487b
DK
125782009-08-18 Doug Kwan <dougkwan@google.com>
12579
12580 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12581 an elcpp::Ehdr as parameter. Adjust call to set_target.
12582 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12583 an elfcpp::Ehdr as parameter.
12584 * object.cc (Object::set_target): Remove the version that looks up
12585 a target and sets it.
12586 (Sized_relobj::setup): Take a Target object instead of
12587 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12588 (make_elf_sized_object): Find target and ask target to
12589 make an ELF object.
12590 * object.h: (Object::set_target): Remove the version that looks up
12591 a target and sets it.
12592 (Sized_relobj::setup): Take a Target object instead of
12593 an elfcpp:Ehdr as parameter.
12594 * target.cc: Include dynobj.h.
12595 (Target::do_make_elf_object_implementation): New.
2e702c99 12596 (Target::do_make_elf_object): New.
f733487b
DK
12597 * target.h (Target::make_elf_object): New template declaration.
12598 (Target::do_make_elf_object): New method declarations.
12599 (Target::do_make_elf_object_implementation): New template declaration.
12600
cc70f101
ILT
126012009-08-14 Ian Lance Taylor <iant@google.com>
12602
12603 * gold.h (FUNCTION_NAME): Define.
12604 (gold_unreachable): Use FUNCTION_NAME.
12605
ef5e0cb1
ST
126062009-08-12 Sriraman Tallam <tmsriram@google.com>
12607
12608 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12609 symbol in the --keep-unique list is not found.
12610
48c187ce
ST
126112009-08-12 Sriraman Tallam <tmsriram@google.com>
12612
12613 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12614 been maked as --keep-unique.
12615 (Icf::unfold_section): New function.
12616 * icf.h (Icf::unfold_section): New function.
12617 * options.h (General_options::keep_unique): New option.
12618 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12619 * testsuite/Makefile.in: Regenerate.
12620 * testsuite/icf_keep_unique_test.sh: New file.
12621 * testsuite/icf_keep_unique_test.cc: New file.
12622
645afe0c
CC
126232009-08-12 Cary Coutant <ccoutant@google.com>
12624
12625 PR 10471
12626 * resolve.cc (Symbol_table::resolve): Check for references from
12627 dynamic objects to hidden and internal symbols.
12628 * testsuite/Makefile.am (hidden_test.sh): New test.
12629 * testsuite/Makefile.in: Regenerate.
12630 * testsuite/hidden_test.sh: New script.
12631 * testsuite/hidden_test_1.c: New test source.
12632 * testsuite/hidden_test_main.c: New test source.
12633
11af873f
DK
126342009-08-11 Doug Kwan <dougkwan@google.com>
12635
12636 * arm.cc: Update comments.
12637 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12638 segment to locate the .ARM.exidx section if present.
12639
b9f7d72d
DK
126402009-08-09 Doug Kwan <dougkwan@google.com>
12641
12642 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12643 patch.
12644
ddd3c53c
ST
126452009-08-07 Sriraman Tallam <tmsriram@google.com>
12646 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12647 compiler warnings.
12648
27721062
ST
126492009-08-06 Sriraman Tallam <tmsriram@google.com>
12650
12651 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12652 valid tls_segment only for non-debug-section relocations.
12653 * testsuite/Makefile.am: Add gc_tls_test.
12654 * testsuite/Makefile.in: Regenerate.
12655 * testsuite/gc_tls_test.cc: New file.
12656 * testsuite/gc_tls_test.sh: New file.
12657
ef15dade 126582009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12659
ef15dade
ST
12660 * icf.cc: New file.
12661 * icf.h: New file.
12662 * Makefile.am (CCFILES): Add icf.cc.
12663 (HFILES): Add icf.h
12664 * Makefile.in: Regenerate.
12665 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12666 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12667 section, symbol and addend information for the relocs.
12668 * gold.cc (queue_middle_tasks): Call identical code folding.
12669 * gold.h: Add defines for multimap.
12670 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12671 to the call of finalize_local_symbols.
12672 * main.cc (main): Create object of class Icf.
12673 * object.cc (Sized_relobj::do_layout): Allow this function to be
12674 called twice during icf.
12675 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12676 to sections marked as identical by icf.
12677 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12678 when available.
12679 (Sized_relobj::do_section_entsize): New function.
12680 * object.h (Object::section_entsize): New function.
12681 (Object::do_section_entsize): New pure virtual function.
12682 (Relobj::finalize_local_symbols): Add new parameter.
12683 (Relobj::do_section_entsize): New function.
12684 * options.h (General_options::icf): New option.
12685 (General_options::icf_iterations): New option.
12686 (General_options::print_icf_sections): New option.
12687 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12688 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12689 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12690 icf.
12691 * symtab.cc (Symbol_table::is_section_folded): New function.
12692 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12693 to sections marked as identical by icf.
12694 * symtab.h (Symbol_table::set_icf): New function.
12695 (Symbol_table::icf): New function.
12696 (Symbol_table::is_section_folded): New function.
12697 (Symbol_table::icf_): New data member.
12698 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12699 * testsuite/Makefile.am: Add commands to build icf_test.
12700 * testsuite/Makefile.in: Regenerate.
12701 * testsuite/icf_test.sh: New file.
12702 * testsuite/icf_test.cc: New file.
12703
c3b65ac4
CD
127042009-07-24 Chris Demetriou <cgd@google.com>
12705
12706 * layout.cc (is_compressible_debug_section): Fix incorrect
12707 comment about compressed section names.
12708
1caf2c51
ILT
127092009-07-20 Ian Lance Taylor <ian@airs.com>
12710
12711 PR 10419
12712 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12713
1ef4d87f
ILT
127142009-07-16 Ian Lance Taylor <iant@google.com>
12715
12716 PR 10400
12717 * layout.h: #include <map>.
12718 (class Kept_section): Change from struct to class. Add accessors
12719 and setters. Add section size to Comdat_group mapping. Change
12720 Comdat_group to std::map. Add is_comdat_ field. Add
12721 linkonce_size field in union.
12722 (class Layout): Update declaration of find_or_add_kept_section.
12723 Don't declare find_kept_object.
12724 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12725 parameter. Add object, shndx, is_comdat, and is_group_name
12726 parameters. Change all callers. Adjust for new Kept_section.
12727 (Layout::find_kept_object): Remove.
12728 * object.cc (Sized_relobj::include_section_group): Update use of
12729 Kept_section. Rename secnum to shndx. Only record
12730 Kept_comdat_section if sections are the same size.
12731 (Sized_relobj::include_linkonce_section): Update use of
12732 Kept_section. Only record Kept_comdat_section if sections are the
12733 same size. Set size of linkonce section.
12734 (Sized_relobj::map_to_kept_section): Update call to
12735 get_kept_comdat_section.
12736 * object.h (class Sized_relobj): Rename fields in
12737 Kept_comdat_section to drop trailing underscores; change object
12738 field to Relobj*. Change Kept_comdat_section_table to store
12739 struct rather than pointer.
12740 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12741 Add kept_object and kept_shndx parameters. Change all callers.
12742 (Sized_relobj::get_kept_comdat_section): Change return type to
12743 bool. Add kept_object and kept_shndx parameters. Change all
12744 callers.
12745 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12746 Layout::find_or_add_kept_section.
12747
37c3b7b0
ILT
127482009-07-09 Ian Lance Taylor <iant@google.com>
12749
12750 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12751 Reserve space in the hash table.
12752
98fa85cb
ILT
127532009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12754
12755 * fileread.cc (File_read::get_mtime): New method.
12756 * fileread.h (Timespec): New structure.
12757 (File_read::get_mtime): New method.
12758 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12759 Renamed from timestamp_nsec.
12760 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12761 Elf_Xword.
e1df38aa 12762 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12763 timestamp_nsec.
e1df38aa 12764 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12765 (Incremental_inputs::report_obejct): Save mtime; style fix.
12766 (Incremental_inputs::report_script): Save mtime; style fix.
12767 (Incremental_inputs::finalize_inputs): Style fix.
12768 (Incremental_inputs::finalize): Style fix.
12769 (Incremental_inputs::create_input_section_data): Store inputs
12770 mtime.
12771 * incremental.h (Incremental_inputs::report_script): Add mtime
12772 argument.
12773 (Incremental_inputs::Input_info::Input_info): Intialize only one
12774 union member.
12775 (Incremental_inputs::Input_info::archive): Move to nameless
12776 union.
12777 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12778 (Incremental_inputs::Input_info::script): Move to nameless union.
12779 (Incremental_inputs::mtime): New field.
12780 * script.cc (read_input_script): Pass file mtime to
12781 Incremental_input.
12782 * script.h (Script_info::inputs): Style fix.
12783
c9d70757
ILT
127842009-07-01 Ian Lance Taylor <ian@airs.com>
12785
12786 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12787 instead of 32.
12788
9c547ec3
ILT
127892009-06-24 Ian Lance Taylor <iant@google.com>
12790
12791 PR 10156
12792 * layout.cc (Layout::choose_output_section): If we find an
12793 existing section, update the flags.
12794 (Layout::create_notes): New function, broken out of
12795 Layout::finalize.
12796 (Layout::finalize): Don't create note sections.
12797 (Layout::create_note): Don't crash if linker script discards
12798 section.
12799 (Layout::create_gold_note): Likewise.
12800 (Layout::create_build_id): Likewise. Don't set
12801 after_input_sections on the section.
12802 (Layout::create_executable_stack_info): Remove target parameter.
12803 Change caller.
12804 * layout.h (class Layout): Declare create_notes. Update
12805 declaration of create_executable_stack_info.
12806 * gold.cc (queue_middle_tasks): Call create_notes.
12807 * output.cc (Output_section::update_flags_for_input_section): Move
12808 here from output.h. If SHF_ALLOC flag is newly set, mark address
12809 invalid.
12810 * output.h (Output_data::mark_address_invalid): New function.
12811 (class Output_section): Only declare, not define,
12812 update_flags_for_input_section. Remove set_flags.
12813
55458500
ILT
128142009-06-24 Ian Lance Taylor <iant@google.com>
12815
12816 * script-sections.cc (Output_section_definition::
12817 set_section_addresses): Rename shadowing local load_address to
12818 laddr.
12819
1307d6cd
ILT
128202009-06-24 Ian Lance Taylor <iant@google.com>
12821
12822 PR 10244
12823 * reloc.cc (relocate_sections): Skip empty relocation sections.
12824
ec3f783e
ILT
128252009-06-23 Ian Lance Taylor <iant@google.com>
12826
12827 PR 10156
12828 * layout.cc (Layout::create_note): Use choose_output_section
12829 rather than make_output_section.
12830
459c9f1c
ILT
128312009-06-23 Ian Lance Taylor <iant@google.com>
12832
12833 PR 10237
12834 * options.cc (General_options::parse_V): Set printed_version_.
12835 (General_options::General_options): Initialize printed_version_.
12836 * options.h (class General_options): Add printed_version_ field.
12837 * gold.cc (queue_initial_tasks): If there are no input files,
12838 don't give a fatal error if we printed the version information.
12839 (queue_middle_tasks): If using -r with a shared object, give a
12840 fatal error rather than an ordinary error.
12841
1518dc8f
ILT
128422009-06-23 Ian Lance Taylor <iant@google.com>
12843
12844 PR 10219
12845 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12846 (Layout::make_output_section): Set have_stabstr_section_ if we see
12847 a .stab*str section.
12848 (Layout::finalize): Call link_stabs_sections.
12849 (Layout::link_stabs_sections): New file.
12850 * layout.h (class Layout): Add have_stabstr_section_ field.
12851 Declare link_stabs_sections.
12852
3d857b98
DK
128532009-06-23 Doug Kwan <dougkwan@google.com>
12854
12855 * Makefile.am (libgold_a_LIBADD): New.
12856 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12857 * Makefile.in: Regenerate.
3d857b98
DK
12858 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12859 * configure: Regenerate.
12860 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12861 * fileread.cc: Include sys/state.h
12862 * gold.h: Declare memmem and strndup if found missing.
12863 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12864
0639a6f6
ILT
128652009-06-23 Ian Lance Taylor <iant@google.com>
12866
12867 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12868 * configure: Rebuild.
12869
8d63875c
ILT
128702009-06-23 Ian Lance Taylor <iant@google.com>
12871
12872 PR 10147
12873 * object.cc (Object::section_contents): Don't try to get a view if
12874 the section has length zero.
12875 (Object::handle_gnu_warning_section): If the section is empty, use
12876 the name of the section as the warning.
12877
f7c8a183
ILT
128782009-06-23 Ian Lance Taylor <iant@google.com>
12879
12880 PR 10133
12881 * stringpool.h (class Stringpool_template): Add optimize_ field.
12882 (Stringpool_template::set_optimize): New function.
12883 * stringpool.cc (Stringpool_template::Stringpool_template):
12884 Initialize optimize_ field.
12885 (Stringpool_template::set_string_offsets): Test local optimize
12886 fild rather than parameter.
12887 * layout.cc (Layout::Layout): Call set_optimize on the section
12888 name stringpool.
12889
e6a307ba
ILT
128902009-06-22 Ian Lance Taylor <iant@google.com>
12891
12892 PR 10030
12893 * yyscript.y: Parse TARGET.
12894 * script.cc (script_set_target): New function.
12895 * script-c.h (script_set_target): Declare.
12896 * options.cc (General_options::string_to_object_format): Rename
12897 from string_to_object_format in anonymous namespace. Change
12898 callers.
12899 * options.h (class General_options): Declare
12900 string_to_object_format.
12901
3ee173de
ILT
129022009-06-22 Ian Lance Taylor <iant@google.com>
12903
12904 * script-sections.cc (Script_sections::create_segments): Don't put
12905 program headers in a PT_LOAD segment if -n or -N.
12906
129072009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12908
12909 PR 10141
12910 * options.h (class General_options): Add -z lazy and -z now. Sort
12911 -z options into alphabetical order.
12912 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12913
cd6739a1 129142009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12915
12916 * layout.cc (Layout::make_output_section): Call
12917 Target::new_output_section.
12918 (Layout::attach_allocated_section_to_segment): Put large section
12919 sections in a separate load segment with the large segment flag
12920 set.
12921 (Layout::segment_precedes): Sort large data segments after other
12922 load segments.
12923 (align_file_offset): New static function.
12924 (Layout::set_segment_offsets): Use align_file_offset.
12925 * output.h (class Output_section): Add is_small_section_ and
12926 is_large_section_ fields.
12927 (Output_section::is_small_section): New function.
12928 (Output_section::set_is_small_section): New function.
12929 (Output_section::is_large_section): New function.
12930 (Output_section::set_is_large_section): New function.
12931 (Output_section::is_large_data_section): New function.
12932 (class Output_segment): Add is_large_data_segment_ field.
12933 (Output_segment::is_large_data_segment): New function.
12934 (Output_segment::set_is_large_data_segment): New function.
12935 * output.cc (Output_section::Output_section): Initialize new
12936 fields.
12937 (Output_segment::Output_segment): Likewise.
12938 (Output_segment::add_output_section): Add assertion that large
12939 data sections always go in large data segments. Force small data
12940 sections to the end of the list of data sections. Force small BSS
12941 sections to the start of the list of BSS sections. For large BSS
12942 sections to the end of the list of BSS sections.
12943 * symtab.h (class Symbol): Declare is_common_shndx.
12944 (Symbol::is_defined): Check Symbol::is_common_shndx.
12945 (Symbol::is_common): Likewise.
12946 (class Symbol_table): Define enum Commons_section_type. Update
12947 declarations. Add small_commons_ and large_commons_ fields.
12948 * symtab.cc (Symbol::is_common_shndx): New function.
12949 (Symbol_table::Symbol_table): Initialize new fields.
12950 (Symbol_table::add_from_object): Put small and large common
12951 symbols in the right list.
12952 (Symbol_table::sized_finalized_symbol): Check
12953 Symbol::is_common_shndx.
12954 (Symbol_table::sized_write_globals): Likewise.
12955 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12956 common symbol lists. Don't call do_allocate_commons_list if the
12957 list is empty.
12958 (Symbol_table::do_allocate_commons_list): Remove is_tls
12959 parameter. Add comons_section_type parameter. Change all
12960 callers. Handle small and large common symbols.
12961 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12962 Symbol::is_common_shndx.
12963 * resolve.cc (symbol_to_bits): Likewise.
12964 * target.h (Target::small_common_shndx): New function.
12965 (Target::small_common_section_flags): New function.
12966 (Target::large_common_shndx): New function.
12967 (Target::large_common_section_flags): New function.
12968 (Target::new_output_section): New function.
12969 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12970 small_common_section_flags, and large_common_section_flags
12971 fields.
12972 (Target::do_new_output_section): New virtual function.
12973 * arm.cc (Target_arm::arm_info): Initialize new fields.
12974 * i386.cc (Target_i386::i386_info): Likewise.
12975 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12976 Likewise.
12977 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12978 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12979 (Target_x86_64::do_new_output_section): New function.
12980 * configure.ac: Define conditional MCMODEL_MEDIUM.
12981 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12982 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12983 (large_LDFLAGS): Define.
12984 * testsuite/large.c: New file.
12985 * testsuite/testfile.cc (Target_test::test_target_info):
12986 Initialize new fields.
12987 * configure, testsuite/Makefile.in: Rebuild.
12988
bb04269c
DK
129892009-06-05 Doug Kwan <dougkwan@google.com>
12990
12991 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12992 * Makefile.in: Regenerate.
bb04269c
DK
12993 * i386.cc (class Target_i386): Define new virtual method to
12994 override do_is_local_label_name in parent.
12995 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12996 local symbols if --discard-locals or -X is given.
12997 * options.h (class General_options): Declare new options
12998 '--discard-locals' and '-X' for discarding locals.
12999 * target.h (class Target): Define new methods is_local_label_name.
13000 Declare new virtual method do_is_local_label_name.
13001 * target.cc: New file.
13002 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
13003 (check_SCRIPTS): Add discard_locals_test.sh.
13004 (check_DATA): Add discard_local_tests.syms.
13005 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
13006 (discard_local_tests.syms, discard_locals_test.o): New make rules.
13007 * testsuite/Makefile.in: Regenerate.
13008 * testsuite/discard_locals_test.c: New file.
13009 * testsuite/discard_locals_test.sh: Same.
13010
805bb01c
DK
130112009-06-05 Doug Kwan <dougkwan@google.com>
13012
13013 * object.cc (Sized_relobj::Sized_relobj): Initialize
13014 discarded_eh_frame_shndx_ to -1U.
13015 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13016 section.
13017 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13018 a discarded .eh_frame section.
13019 (Sized_relobj::do_finalize_local_symbols): Ditto.
13020 * object.h (class Sized_relobj): Declare new member
13021 discarded_eh_frame_shndx_.
13022 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13023 (local_labels_test.o, local_labels_test): New rules.
13024 * testsuite/Makefile.in: Regenerate.
13025
1dcd334d
DK
130262009-06-04 Doug Kwan <dougkwan@google.com>
13027
13028 * layout.cc (Layout::section_name_mapping): Add mapping for
13029 special ARM sections.
13030
96d49306
DK
130312009-06-03 Doug Kwan <dougkwan@google.com>
13032
13033 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13034 (utils::has_overflow): Same.
13035
dff16297
ILT
130362009-06-03 Ian Lance Taylor <iant@google.com>
13037
13038 * layout.cc (Layout::section_name_mapping): New array, replacing
13039 Layout::linkonce_mapping.
13040 (Layout::section_name_mapping_count): New variable, replacing
13041 Layout::linkonce_mapping_count.
13042 (Layout::linkonce_output_name): Remove.
13043 (Layout::output_section_name): Rewrite.
13044 * layout.h (class Layout): Rename Linkonce_mapping to
13045 Section_name_mapping, linkonce_mapping to section_name_mapping,
13046 linkonce_mapping_count to section_name_mapping_count. Don't
13047 declare linkonce_output_name.
13048
c121c671
DK
130492009-06-03 Doug Kwan <dougkwan@google.com>
13050
13051 * gold/arm.cc (namespace utils): New.
13052 (Target_arm::reloc_is_non_pic): Define new method.
13053 (class Arm_relocate_functions): New.
13054 (Target_arm::Relocate::relocate): Handle relocation types used by
13055 Android.
13056
07800fab
ILT
130572009-06-03 Ian Lance Taylor <iant@google.com>
13058
13059 * arm.cc (Target_arm::scan::global): Use || instead of |.
13060
c121c671
DK
130612009-06-02 Doug Kwan <dougkwan@google.com>
13062
13063 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13064 issued_non_pic_error_.
13065 (class Target_arm::Scan): Declare new method check_non_pic.
13066 Define new method symbol_needs_plt_entry.
13067 Declare new data member issued_non_pic_error_.
13068 (class Target_arm::Relocate): Declare new method
13069 should_apply_static_reloc.
13070 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13071 (Target_arm::Scan::check_non_pic): Define new method.
13072 (Target_arm::Scan::local): Handle a small subset of reloc types used
13073 by Android.
13074 (Target_arm::Scan::local): Same.
13075 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13076
b19b0c6d
ILT
130772009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13078
13079 * incremental.cc (Incremental_inputs::report_command_line): Filter
13080 out --incremental-* options.
13081
94cdfcff
DK
130822009-05-29 Doug Kwan <dougkwan@google.com>
13083
13084 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13085 template class.
13086 (class Target_arm): Update comment.
13087 (Target_arm::Target_arm): Initialize new data members GOT_,
13088 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13089 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13090 and Target_arm::rel_dyn_section.
13091 Declare new_enum Target_arm::Got_type.
13092 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13093 and DYNBSS_.
13094 Update commments for member do_dynsym_value.
13095 (Target_arm::got_size, Target_arm::plt_section,
13096 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13097 new methods inside class defintion.
13098 (Target_arm::got_section): Define new method.
13099 (Target_arm::rel_dyn_section): Same.
13100 (Output_data_plt_arm): New template class.
13101 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13102 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13103 (Output_data_plt_arm::add_entry): Same.
13104 (Output_data_plt_arm::first_plt_entry): Define new
13105 static data member for PLT instruction template.
13106 (Output_data_plt_arm::plt_entry): Same.
13107 (Output_data_plt_arm::do_write): Define new method.
13108 (Target_arm::make_plt_entry): Same.
13109 (Target_arm::do_finalize_sections): Same.
13110 (Target_arm::do_dynsym_value): Same.
13111
4a657b0d
DK
131122009-05-28 Doug Kwan <dougkwan@google.com>
13113
13114 * Makefile.am (TARGETSOURCES): Add arm.cc.
13115 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13116 * Makefile.in: Regenerate.
13117 * arm.cc: New file.
13118 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13119
e7ae8c36
DK
131202009-05-26 Doug Kwan <dougkwan@google.com>
13121
13122 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13123 (General_options::check_excluded_libs): Strip off directories in
13124 archive name before matching like GNU ld does.
13125 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13126 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13127 (exclude_libs_test_LDFLAGS): Add linker option
13128 -Wl,--exclude-libs,libexclude_libs_test_3
13129 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13130 an explicit archive without using -l.
13131 (alt/libexclude_libs_test_3.a): New make rule.
13132 * testsuite/Makefile.in: Regenerate.
13133 * testsuite/exclude_libs_test.c : Declare lib3_default().
13134 (main): Call it.
13135 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13136 * exclude_libs_test_3.c: New file.
13137
f12e7348
NC
131382009-05-26 Nick Clifton <nickc@redhat.com>
13139
13140 * po/id.po: New Indonesian translation.
13141 * po/gold.pot: Updated template file.
13142
4daadc0d
ST
131432009-05-22 Sriraman Tallam <tmsriram@google.com>
13144
e1df38aa 13145 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13146 gc_comdat_test files. Add -Wl,--gc-sections to build
13147 gc_comdat_test.
13148 * testsuite/Makefile.in: Regenerate.
13149 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13150
531813ad
ST
131512009-05-21 Sriraman Tallam <tmsriram@google.com>
13152
13153 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13154 kept comdat section was garbage collected.
13155 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13156 * testsuite/Makefile.in: Regenerate.
13157 * testsuite/gc_comdat_test.sh: New file.
13158 * testsuite/gc_comdat_test_1.cc: New file.
13159 * testsuite/gc_comdat_test_2.cc: New file.
13160
65514900
CC
131612009-05-19 Doug Kwan <dougkwan@google.com>
13162
13163 * archive.cc (Archive::Archive): Move constructor from archive.h
13164 to here. Initialize no_export_.
13165 (Archive::get_elf_object_for_member): Set no_export flag of object.
13166 * archive.h (Archive::Archive): Move constructor body to
13167 archive.cc.
13168 (Archive::no_export): New method.
13169 (Archive::no_export_): New field.
13170 * object.h (Object::Object): Initialize no_export_ to false.
13171 (Object::no_export, Object::set_no_export): New methods.
13172 (Object::no_export_): New field.
13173 * options.cc (General_options::parse_exclude_libs): New method.
13174 (General_options::check_excluded_libs) Same.
13175 * options.h (exclude_libs): New option.
13176 (General_options::check_excluded_libs): New method declaration.
13177 (General_options::excluded_libs_): New field.
13178 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13179 default or protected visibility if an object has no-export flag set.
13180 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13181 (check_SCRIPTS): Add exclude_libs_test.sh.
13182 (check_DATA): Add exclude_libs_test.syms.
13183 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13184 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13185 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13186 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13187 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13188 libexclude_libs_test_2.a): New rules.
13189 * testsuite/Makefile.in: Regenerate.
13190 * testsuite/exclude_libs_test.c: New file.
13191 * testsuite/exclude_libs_test.sh: Ditto.
13192 * testsuite/exclude_libs_test_1.c: Ditto.
13193 * testsuite/exclude_libs_test_2.c: Ditto.
13194
1b77ea50
ILT
131952009-05-15 Ian Lance Taylor <iant@google.com>
13196
13197 * configure.ac: Check for declarations for cases where libiberty.h
13198 checks HAVE_DECL_xxx.
13199 * configure, config.in: Rebuild.
13200
072fe7ce
ILT
132012009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13202
13203 * gold.h (Incremental_argument_list): Remove (invalid) forward
13204 declaration.
13205 * incremental.cc (Incremental_inputs::report_achive): New method.
13206 (Incremental_inputs::report_object): New method.
13207 (Incremental_inputs::report_script): New method.
13208 (Incremental_inputs::finalize_inputs): New method.
13209 (Incremental_inputs::finalize): Call finalize_inputs().
13210 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13211 Create inputs entries.
13212 * incremental.h (Incremental_input_type): New enum.
13213 (Incremental_inputs::Incremental_input): Initialize new fields.
13214 (Incremental_inputs::report_inputs): New method.
13215 (Incremental_inputs::report_achive): New method.
13216 (Incremental_inputs::report_object): New method.
13217 (Incremental_inputs::report_script): New method.
13218 (Incremental_inputs::finalize_inputs): New method.
13219 (Incremental_inputs::Input_info): New struct.
13220 (Incremental_inputs::Input_info_map): New typedef.
13221 (Incremental_inputs::lock_): New field.
13222 (Incremental_inputs::Inputs_): New field.
13223 (Incremental_inputs::Inputs_map): New field.
13224 * main.cc (main): Call Incremental_input::report_inputs.
13225 * options.h (Input_argument_list): Typedef moved from
13226 Input_arguments.
13227 (Input_file_group::Files): Remove, use ::Input_argument_list.
13228 (Input_file_group::Input_argument_list): Remove, use
13229 ::Input_argument_list.
13230 * plugin.cc (Plugin_manager::add_input_file): Add error in
13231 incremental build.
13232 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13233 functions.
13234 * script.cc (read_input_script): Call
13235 Incremental_input::report_script.
13236 * script.h (Script_info): New class.
13237
b0481b0b
ILT
132382009-04-27 Ian Lance Taylor <iant@google.com>
13239
13240 * x86_64.cc (do_adjust_output_section): Set entsize to
13241 plt_entry_size.
13242
b22a5a41 132432009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13244
13245 * output.cc (Output_file::close): After short writes, continue
13246 writing from the correct offset in the buffer being written.
13247
40fde488
CD
132482009-04-23 Chris Demetriou <cgd@google.com>
13249
13250 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13251 * configure: Regenerate.
13252 * config.in: Regenerate.
13253 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13254 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13255
3ce2c28e
ILT
132562009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13257
13258 * incremental.cc (Incremental_inputs_header_data): Renamed from
13259 Incremental_input_header_data.
13260 (Incremental_inputs_header_data::data_size): New field.
13261 (Incremental_inputs_header_data::put_input_file_count): Renamed
13262 from input_file_count.
13263 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13264 from command_line_offset.
13265 (Incremental_inputs_header_data::put_reserved): Renamed from
13266 put_reserved.
13267 (Incremental_inputs_entry_data): Renamed from
13268 Incremental_input_entry_data.
13269 (Incremental_inputs_entry_data::data_size): New field.
13270 (Incremental_inputs::report_command_line): New method.
13271 (Incremental_inputs::finalize): New method.
13272 (Incremental_inputs::create_incremental_inputs_data): New method.
13273 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13274 * incremental.h: New file.
13275 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13276 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13277 incremental builds.
703d02da 13278 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13279 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13280 (Layout::create_incremental_info_sections): New method.
13281 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13282 * main.cc (main): Notify Incremental_input of the command line.
13283
e55bde5e
ILT
132842009-04-01 Ian Lance Taylor <iant@google.com>
13285 Mikolaj Zalewski <mikolajz@google.com>
13286
13287 * gold.h (reserve_unordered_map): Define, three versions, one for
13288 each version of Unordered_map.
13289 * layout.cc (Layout::Layout): Remove options parameter. Add
13290 number_of_input_files parameter. Don't initialize options_.
13291 Initialize number_of_input_files_ and resized_signatures_. Move
13292 sections_are_attached_.
13293 (Layout::layout_group): Reserve space for group_signatures_.
13294 (Layout::find_or_add_kept_section): Change name parameter to be a
13295 reference. Resize signatures_ map when it gets large enough.
13296 (Layout::layout_eh_frame): Use parameters->options() instead of
13297 this->options_.
13298 (Layout::make_output_section): Likewise.
13299 (Layout::attach_allocated_section_to_segment): Likewise.
13300 (Layout::finalize, Layout::create_executable_stack): Likewise.
13301 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13302 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13303 * layout.h (class Layout): Update declarations. Remove options_
13304 field. Add number_of_input_files_ and resized_signatures_
13305 fields. Move sections_are_attached_ field.
13306 * main.cc (main): Pass number of input files to Layout
13307 constructor. Don't pass options.
13308
154b857c
ILT
133092009-03-30 Ian Lance Taylor <iant@google.com>
13310
13311 * ffsll.c (ffsll): Correct implementation.
13312
2f35ab9b
ILT
133132009-03-27 Ian Lance Taylor <iant@google.com>
13314
fd03461a
ILT
13315 * ffsll.c: New file.
13316 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13317 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13318 * ftruncate.c (ftruncate): Declare before definition.
13319 * mremap.c (mremap): Likewise.
13320 * pread.c (pread): Likewise.
13321 * configure, Makefile.in, config.in: Rebuild.
13322
2f35ab9b
ILT
13323 * mremap.c: New file.
13324 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13325 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13326 (mremap): Declare if HAVE_MREMAP is not defined.
13327 * configure, Makefile.in, config.in: Rebuild.
13328
33aea2fd
CC
133292009-03-27 Cary Coutant <ccoutant@google.com>
13330
13331 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13332 position independent.
13333 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13334 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13335
6d479619
CC
133362009-03-24 Cary Coutant <ccoutant@google.com>
13337
13338 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13339 an executable.
13340 (needs_dynamic_reloc): Likewise.
13341
afc06bb8
ILT
133422009-03-24 Ian Lance Taylor <iant@google.com>
13343
13344 * yyscript.y (file_cmd): Recognize EXTERN.
13345 (extern_name_list, extern_name_list_body): New nonterminals.
13346 * script.cc (script_add_extern): Define.
13347 * script-c.h (script_add_extern): Declare.
13348
f6060a4d
ILT
133492009-03-24 Rafael Avila de Espindola <espindola@google.com>
13350
13351 * object.cc (is_elf_object): Define.
13352 * object.h (is_elf_object): Declare.
13353 * archive.cc (Archive::get_elf_object_for_member): Call
13354 is_elf_object.
33aea2fd 13355 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13356
26736d8e
ILT
133572009-03-24 Elliott Hughes <enh@google.com>
13358
13359 * output.cc (Output_file::map_anonymous): Define.
13360 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13361 try an anonymous one. Report the size if the mmap fails.
13362 * output.h (class Output_file): Declare map_anonymous.
13363
22fd9730
ILT
133642009-03-24 Ian Lance Taylor <iant@google.com>
13365
13366 * target-select.cc (instantiate_target): Don't acquire the lock if
13367 the instantiated_target_ field has already been set.
13368
cb010894
ILT
133692009-03-23 Ian Lance Taylor <iant@google.com>
13370
7f055c20
ILT
13371 * gold-threads.h (class Initialize_lock): Define.
13372 * gold-threads.cc (class Initialize_lock_once): Define.
13373 (initialize_lock_control): New static variable.
13374 (initialize_lock_pointer): New static variable.
13375 (initialize_lock_once): New static function.
13376 (Initialize_lock::Initialize_lock): Define.
13377 (Initialize_lock::initialize): Define.
13378 * target-select.h: Include "gold-threads.h".
13379 (class Target_selector): Add lock_ and initialize_lock_ fields.
13380 Don't define instantiate_target, just declare it.
13381 * target-select.cc (Target_selector::Target_selector): Initialize
13382 new fields.
13383 (Target_selector::instantiate_target): Define.
13384 * descriptors.h: Include "gold-threads.h".
13385 (class Descriptors): Add initialize_lock_ field.
13386 * descriptors.cc (Descriptors::Descriptors): Initialize new
13387 field.
13388 (Descriptors::open): Use initialize_lock_ field
13389 * errors.h (class Errors): Add initialize_lock_ field.
13390 * errors.cc (Errors::Errors): Initialize new field.
13391 (Errors::initialize_lock): Use initialize_lock_ field.
13392 * powerpc.cc (class Target_selector_powerpc): Remove
13393 instantiated_target_ field. In do_recognize call
13394 instantiate_target rather than do_instantiate_target. In
13395 do_instantiate_target just allocate a new target.
13396 * sparc.cc (class Target_selector_sparc): Likewise.
13397
36959681
ILT
13398 * freebsd.h: New file.
13399 * i386.cc: Include "freebsd.h".
13400 (Target_i386): Derive from Target_freebsd rather than
13401 Sized_target.
13402 (Target_selector_i386): Derive from Target_selector_freebsd rather
13403 than Target_selector.
13404 * x86_64.cc: Include "freebsd.h".
13405 (Target_x86_64): Derive from Target_freebsd rather than
13406 Sized_target.
13407 (Target_selector_x86_64): Derive from Target_selector_freebsd
13408 rather than Target_selector.
13409 * target.h (class Target): Add adjust_elf_header and
13410 do_adjust_elf_header.
13411 * output.cc (Output_file_header:: do_sized_write): Call target
13412 adjust_elf_header routine.
13413 * configure.tgt: Set targ_osabi.
13414 * configure.ac: Define GOLD_DEFAULT_OSABI.
13415 * parameters.cc (Parameters::default_target): Pass
13416 GOLD_DEFAULT_OSABI to select_target.
13417 * target-select.h (class Target_selector): Make instantiate_target
13418 protected rather than private.
13419 * Makefile.am (HFILES): Add freebsd.h.
13420 * configure, Makefile.in, config.in: Rebuild.
13421
cb010894
ILT
13422 * merge.cc (do_add_input_section): Correct pend value. Change
13423 message about last entry not being null terminated from error to
13424 warning.
13425
0e879927
ILT
134262009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13427
13428 * incremental.cc: New file.
13429 * Makefile.am (CCFILES): Add incremental.cc.
13430 * Makefile.in: Rebuild.
13431
41105937
PP
134322009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13433
13434 * layout.cc (Layout::output_section_name): Preserve names
13435 of '.note.' sections.
e1df38aa 13436
60439920
ILT
134372009-03-19 Ian Lance Taylor <iant@google.com>
13438
13439 * descriptors.cc (Descriptors::open): Check that the options are
13440 valid before using them.
13441
0d371ad3
ILT
134422009-03-18 Ian Lance Taylor <iant@google.com>
13443
13444 * script-sections.h: Include <list>.
13445 (class Script_sections): Change Sections_elements from std::vector
13446 to std::list. Typedef public Elements_iterator. Add
13447 orphan_section_placement_, data_segment_align_start_, and
13448 saw_data_segment_align_ fields. Remove data_segment_align_index_
13449 field.
13450 * script-sections.cc (class Orphan_section_placement): New class.
13451 (class Sections_element): Add virtual functions is_relro and
13452 orphan_section_init. Remove virtual function place_orphan_here.
13453 (class Output_section_definition): Add is_relro and
13454 orphan_section_init. Remove place_orphan_here.
13455 (class Orphan_output_section): Likewise.
13456 (Script_sections::Script_sections): Update for field changes.
13457 (Script_sections::data_segment_align): Set saw_data_segment_align_
13458 and data_segment_align_start_, not data_segment_align_index.
13459 (Script_sections::data_segment_relro_end): Check
13460 saw_data_segment_align_. Use data_segment_align_start_ rather
13461 than data_segment_align_index_.
13462 (Script_sections::place_orphan): Rewrite to use
13463 Orphan_section_placement.
13464
9201d894
ILT
134652009-03-17 Ian Lance Taylor <iant@google.com>
13466
9c5b8369
ILT
13467 * archive.cc (Archive::add_symbols): Check for a version attached
13468 to the symbol name in the archive map.
13469 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13470 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13471 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13472 (ver_test_11.a): New target.
13473 * testsuite/Makefile.in: Rebuild.
13474
9201d894
ILT
13475 * configure.ac: Check for chsize and posix_fallocate. Replace
13476 ftruncate.
13477 * ftruncate.c: New file, from gnulib.
13478 * output.cc (posix_fallocate): Define dummy version if not
13479 HAVE_POSIX_FALLOCATE.
13480 (Output_file::map): Call posix_fallocate rather than lseek and
13481 write.
13482 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13483 * configure, Makefile.in, config.in: Rebuild.
13484
ef4ab7a8 134852009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13486
ef4ab7a8
PP
13487 * layout.h (Layout::create_note): Add section_name parameter.
13488 * layout.cc (Layout::create_note): Likewise.
13489 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13490
8c500701
ILT
134912009-03-17 Ian Lance Taylor <iant@google.com>
13492
e85b18e1
ILT
13493 * descriptors.cc: Include "options.h".
13494 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13495 (Descriptors::open): Always use O_CLOEXEC when opening a new
13496 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13497 then set FD_CLOEXEC.
13498
9efe6174
ILT
13499 * sparc.cc (class Target_sparc): Add has_got_section.
13500 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13501 make sure we have a GOT section.
13502
13503 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13504 (Target_sparc::Scan::local): Likewise.
13505 (Target_sparc::Scan::global): Likewise.
13506 (Target_sparc::Relocate::relocate): Likewise.
13507 (Target_sparc::Relocate::relocate_tls): Likewise.
13508
8c500701
ILT
13509 * symtab.cc (Symbol_table::define_default_version): New function,
13510 broken out of add_from_object.
13511 (Symbol_table::add_from_object): Call define_default_version.
13512 (Symbol_table::define_special_symbol): Add resolve_oldsym
13513 parameter. Change all callers. If the version for a symbol comes
13514 from a version script, resolve it with the symbol with the same
13515 name with no version. Also add the symbol without a version if
13516 appropriate.
13517 (do_define_in_output_data): If resolving with oldsym, don't delete
13518 sym.
13519 (do_define_in_output_segment): Likewise.
13520 (do_define_as_constant): Likewise.
13521 * symtab.h (class Symbol_table): Update declarations.
13522
f1ed28fb
ILT
135232009-03-13 Ian Lance Taylor <iant@google.com>
13524
15f8229b
ILT
13525 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13526 (Read_symbols::requeue): New function.
13527 (Read_symbols::do_read_symbols): If make_elf_object fails because
13528 the target type is not configured, and the file was searched for,
13529 issue a warning and retry with the next directory.
13530 (Add_symbols::run): If the file has an incompatible format, and
13531 it was searched for, requeue the Read_symbols task. On error,
13532 release the object.
13533 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13534 dirindex parameter to constructor. Change all callers. Declare
13535 incompatible_warning and requeue.
13536 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13537 input_argument_ and input_group_ fields. Add them to
13538 constructor. Change all callers.
13539 (class Read_script): Add dirindex_ field. Add it to constructor.
13540 Change all callers.
13541 * archive.cc (Archive::setup): Remove input_objects parameter.
13542 Change all callers.
13543 (Archive::get_file_and_offset): Likewise.
13544 (Archive::read_all_symbols): Likewise.
13545 (Archive::read_symbols): Likewise.
13546 (Archive::get_elf_object_for_member): Remove input_objects
13547 parameter. Add punconfigured parameter. Change all callers.
13548 (Archive::add_symbols): Change return type to bool. Check return
13549 value of include_member.
13550 (Archive::include_all_members): Likewise.
13551 (Archive::include_member): Change return type to bool. Return
13552 false if first included object has incompatible target. Set
13553 included_member_ field.
13554 (Add_archive_symbols::run): If add_symbols returns false, requeue
13555 Read_symbols task.
13556 * archive.h (class Archive): Add included_member_ field.
13557 Initialize it in constructor. Add input_file and searched_for
13558 methods. Update declarations.
13559 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13560 input_argument_ fields. Add them to constructor. Change all
13561 callers.
13562 * script.cc: Include "target-select.h".
13563 (class Parser_closure): Add skip_on_incompatible_target_ and
13564 found_incompatible_target_ fields. Add
13565 skip_on_incompatible_target parameter to constructor. Change all
13566 callers. Add methods skip_on_incompatible_target,
13567 clear_skip_on_incompatible_target, found_incompatible_target, and
13568 set_found_incompatible_target.
13569 (read_input_script): Add dirindex parameter. Change all callers.
13570 If parser finds an incompatible target, requeue Read_symbols
13571 task.
13572 (script_set_symbol): Clear skip_on_incompatible_target in
13573 closure.
13574 (script_add_assertion, script_parse_option): Likewise.
13575 (script_start_sections, script_add_phdr): Likewise.
13576 (script_check_output_format): New function.
13577 * script.h (read_input_script): Update declaration.
13578 * script-c.h (script_check_output_format): Declare.
13579 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13580 (ignore_cmd): Remove OUTPUT_FORMAT.
13581 * fileread.cc (Input_file::Input_file): Add explicit this.
13582 (Input_file::will_search_for): New function.
13583 (Input_file::open): Add pindex parameter. Change all callers.
13584 * fileread.h (class Input_file): Add input_file_argument method.
13585 Declare will_search_for. Update declarations.
13586 * object.cc (make_elf_object): Add punconfigured parameter.
13587 Change all callers.
13588 * object.h (class Object): Make input_file public. Add
13589 searched_for method.
13590 (make_elf_object): Update declaration.
13591 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13592 restart search.
13593 * dirsearch.h (class Dirsearch): Update declaration.
13594 * options.h (class General_options): Add --warn-search-mismatch.
13595 * parameters.cc (Parameters::is_compatible_target): New function.
13596 * parameters.h (class Parameters): Declare is_compatible_target.
13597 * workqueue.cc (Workqueue::add_blocker): New function.
13598 * workqueue.h (class Workqueue): Declare add_blocker.
13599
f1ed28fb
ILT
13600 * fileread.cc (Input_file::open): Remove options parameter.
13601 Change all callers.
13602 (Input_file::open_binary): Likewise.
13603 * script.cc (read_input_script): Likewise.
13604 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13605 options parameter from constructor. Change all callers.
13606 (class Read_script): Likewise.
13607 * fileread.h (class Input_file): Update declarations.
13608 * script.h (read_input_script): Update declaration.
13609
34dd024a
NC
136102009-03-10 Nick Clifton <nickc@redhat.com>
13611
13612 * po/es.po: New Spanish translation.
13613
6d71b17c
CC
136142009-03-06 Cary Coutant <ccoutant@google.com>
13615
13616 * options.cc (parse_short_option): Keep dash_z from registering itself.
13617
031cdbed
ILT
136182009-03-03 Ian Lance Taylor <iant@google.com>
13619
13620 PR 9918
13621 * target-reloc.h (relocate_section): Pass output_section to
13622 relocate.
13623 * i386.cc (Target_i386::should_apply_static_reloc): Add
13624 output_section parameter. Change all callers.
13625 (Target_i386::Relocate::relocate): Add output_section parameter.
13626 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13627 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13628 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13629 * testsuite/two_file_shared.sh: New script.
13630 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13631 (check_DATA): Add two_file_shared.dbg.
13632 (two_file_shared.dbg): New target.
13633 * testsuite/Makefile.in: Rebuild.
13634
15d5fa16
ILT
136352009-03-01 Ian Lance Taylor <iant@google.com>
13636
13637 * configure.ac: Check for byteswap.h.
13638 * configure: Rebuild.
13639 * config.in: Rebuild.
13640
8a4c0b0d
ILT
136412009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13642
13643 * layout.cc (Layout::find_or_add_kept_section): New function.
13644 (Layout::add_comdat): Removed.
13645 * layout.h (struct Kept_section): Move out of class Layout.
13646 Remove trailing underscores from field names. Add group_sections
13647 field. Rename group_ field to is_group. Change all uses.
13648 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13649 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13650 comdat_groups_ field.
13651 (Sized_relobj::include_section_group): Use
13652 find_or_add_kept_section and Kept_section::group_sections.
13653 (Sized_relobj::include_linkonce_section): Likewise.
13654 * object.cc (class Sized_relobj): Don't define Comdat_group or
13655 Comdat_group_table. Remove find_comdat_group and
13656 add_comdat_group. Remove comdat_groups_ field.
13657 * plugin.cc (include_comdat_group): Use
13658 Layout::find_or_add_kept_section.
13659
b4ecf66b
ILT
136602009-02-28 Ian Lance Taylor <iant@google.com>
13661
14359ca0
ILT
13662 * README: --gc-sections and map files are now supported. Document
13663 some build requirements.
13664
b4ecf66b
ILT
13665 PR 6992
13666 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13667 relocatable link set the value of the section symbol to zero.
13668 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13669 relocatable link don't include the section address in the local
13670 symbol value.
13671
0602e05a
ILT
136722009-02-27 Ian Lance Taylor <iant@google.com>
13673
fd9d194f
ILT
13674 PR 6811
13675 * options.h (class Search_directory): Add is_system_directory.
13676 (class General_options): Declare is_in_system_directory.
13677 * options.cc (get_relative_sysroot): Make static.
13678 (get_default_sysroot): Make static.
13679 (General_optoins::is_in_system_directory): New function.
13680 * fileread.cc (Input_file::is_in_system_directory): New function.
13681 * fileread.h (class Input_file): Declare is_in_system_directory.
13682 * object.h (class Object): Add is_in_system_directory.
13683 (class Input_objects): Remove system_library_directory_ field.
13684 * object.cc (Input_objects::add_object): Don't set
13685 system_library_directory_.
13686 (input_objects::found_in_system_library_directory): Remove.
13687 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13688 parameter. Change all callers.
13689 (Symbol_table::sized_write_globals): Likewise.
13690 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13691 Call Object::is_in_system_directory.
13692 * symtab.h (class Symbol_table): Update declarations.
13693
61edd21f
ILT
13694 PR 5990
13695 * descriptors.h (Open_descriptor): Add is_on_stack field.
13696 * descriptors.cc (Descriptors::open): If the descriptor is on the
13697 top of the stack, remove it. Initialize is_on_stack field.
13698 (Descriptors::release): Only add pod to stack if it is not on the
13699 stack already.
13700 (Descriptors::close_some_descriptor): Clear stack_next and
13701 is_on_stack fields.
13702
e29e076a
ILT
13703 PR 7091
13704 * output.cc (Output_section::find_starting_output_address): Rename
13705 from starting_output_address; add PADDR parameter; change return
13706 type.
13707 * output.h (class Output_section): Declare
13708 find_starting_output_address instead of starting_output_address.
13709 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13710 section symbol for which we can't find a merge section.
13711
0602e05a
ILT
13712 PR 9836
13713 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13714 hidden or internal, force the symbol to be local.
13715 * resolve.cc (Symbol::override_visibility): Define.
13716 (Symbol::override_base): Use override_visibility.
13717 (Symbol_table::resolve): Likewise.
13718 (Symbol::override_base_with_special): Likewise.
13719 (Symbol_table::override_with_special): If the visibility is hidden
13720 or internal, force the symbol to be local.
13721 * symtab.h (class Symbol): Add set_visibility and
13722 override_visibility.
13723 * testsuite/ver_test_1.sh: New file.
13724 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13725 (check_DATA): Add ver_test_1.syms.
13726 (ver_test_1.syms): New target.
13727 * testsuite/Makefile.in: Rebuild.
13728
401a9a73
CC
137292009-02-25 Cary Coutant <ccoutant@google.com>
13730
13731 * layout.cc (Layout::choose_output_section): Don't rename sections
13732 when using a linker script that has a SECTIONS clause.
13733 * Makefile.in: Regenerate.
13734
13735 * testsuite/Makefile.am (script_test_5.sh): New test case.
13736 * testsuite/Makefile.in: Regenerate.
13737 * testsuite/script_test_5.cc: New file.
13738 * testsuite/script_test_5.sh: New file.
13739 * testsuite/script_test_5.t: New file.
13740
f488e4b0
CC
137412009-02-13 Rafael Avila de Espindola <espindola@google.com>
13742
13743 * archive.cc (Archive::include_member): Update calls to add_symbols.
13744 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13745 the Layout argument.
13746 * dynobj.h (do_add_symbols): Add the Layout argument.
13747 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13748 Layout argument.
13749 * object.h (Object::add_symbols): Add the Layout argument.
13750 (Object::do_add_symbols): Add the Layout argument.
13751 (Sized_relobj::do_add_symbols): Add the Layout argument.
13752 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13753 Unify the two versions.
13754 (Add_plugin_symbols): Remove.
13755 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13756 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13757 (Add_plugin_symbols): Remove.
13758 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13759 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13760 (Add_symbols::run): Make it work with Pulginobj.
13761
89dd1680
ILT
137622009-02-06 Ian Lance Taylor <iant@google.com>
13763
13764 * object.cc (Sized_relobj::do_layout): Make info message start
13765 with lower case letter.
13766
266d0a74
ILT
137672009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13768
602b464e
ILT
13769 * binary.cc: Fix file comment.
13770
266d0a74
ILT
13771 * options.h (enum Incremental_disposition): Define.
13772 (class General_options): Add new options: --incremental,
13773 --incremental_changed, --incremental_unchanged,
13774 --incremental_unknown. Add incremental_disposition_ and
13775 implicit_incremental_ fields.
13776 (General_options::incremental_disposition): New function.
13777 (class Position_dependent_options): Add incremental_disposition
13778 option.
13779 (Position_dependent_options::copy_from_options): Set incremental
13780 dispositions.
13781 * options.cc (General_options::parse_incremental_changed): New
13782 function.
2e702c99
RM
13783 (General_options::parse_incremental_unchanged): New function.
13784 (General_options::parse_incremental_unknown): New function.
13785 (General_options::General_options): Initialize new fields
266d0a74 13786 incremental_disposition_ and implicit_incremental_.
2e702c99 13787 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13788 without --incremental.
13789
f073bbf7
CD
137902009-02-06 Chris Demetriou <cgd@google.com>
13791
13792 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13793 pointer and to report location as the file name associated with
13794 the symbol.
13795 (gold_undefined_symbol_at_location): New function to replace the
13796 old gold_undefined_symbol functionality.
13797 * target-reloc.h (relocate_section): Update to use
13798 gold_undefined_symbol_at_location.
13799 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13800 Call gold_undefined_symbol function rather than gold_error.
13801 * errors.h (Errors::undefined_symbol): Take location as a
13802 string, rather than calculating it from a relocation.
13803 * errors.cc (Errors::fatal): Print "fatal error:" before the
13804 formatted message.
13805 (Errors::error, Errors::error_at_location): Print "error: "
13806 before the formatted message.
13807 (Errors::undefined_symbol): Take location as a string, rather
13808 than calculating it from a relocation.
13809 (gold_undefined_symbol_at_location): New function akin to
13810 old gold_undefined_symbol, calculates location from relocation.
13811 (gold_undefined_symbol): Change to take only a Symbol pointer
13812 and to report location as the file name associated with the symbol.
13813 * testsuite/debug_msg.sh: Update for changed error messages.
13814 * testsuite/undef_symbol.sh: Likewise.
13815
8e94a90c
ILT
138162009-02-04 Duncan Sands <baldrick@free.fr>
13817
13818 PR 9812
13819 * reduced_debug_output.h
13820 (Output_reduced_debug_abbrev_section::failed): Use format for
13821 gold_warning.
13822 (Output_reduced_debug_info_section::faild): Likewise.
13823
88a0e15b
ILT
138242009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13825
13826 * script.cc (Lazy_demangler): New class.
2e702c99 13827 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13828 symbol only once.
13829
5efc7cd2
CC
138302009-01-29 Cary Coutant <ccoutant@google.com>
13831
13832 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13833 to __tls_get_addr.
13834 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13835
e0ebcf42
ILT
138362009-01-28 Ian Lance Taylor <iant@google.com>
13837
5efc7cd2 13838 * version.cc (version_string): Bump to 1.9.
75fe7426 13839
e0ebcf42
ILT
13840 * gold.h: Include <cstring> and <stdint.h>.
13841 * version.cc: Include <cstdio>.
13842 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13843 warning.
13844 * reduced_debug_output.cc (insert_into_vector): Rename from
13845 Insert_into_vector; change all callers. Use Swap_unaligned to
13846 avoid aliasing issue; remove union since it is unnecessary.
13847
8e2813be 138482009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13849
13850 * Makefile.am (CCFILES): Add gc.cc.
13851 (HFILES): Add gc.h.
13852 * Makefile.in: Regenerate.
13853 * gold.cc (Gc_runner): New class.
13854 (queue_initial_tasks): Call garbage collection related tasks
13855 when corresponding options are invoked.
13856 (queue_middle_gc_tasks): New function.
13857 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13858 processed early before laying out sections during garbage collection.
13859 * gold.h (queue_middle_gc_tasks): New function.
13860 (is_prefix_of): Move from "layout.cc".
13861 * i386.cc (Target_i386::gc_process_relocs): New function.
13862 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13863 * main.cc (main): Create object of class "Garbage_collection".
13864 * object.cc (Relobj::copy_symbols_data): New function.
13865 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13866 (Sized_relobj::do_layout): Allow this function to be called twice
13867 during garbage collection and defer layout of section during the
6d03d481
ST
13868 first call.
13869 * object.h (Relobj::get_symbols_data): New function.
13870 (Relobj::is_section_name_included): New function.
13871 (Relobj::copy_symbols_data): New function.
13872 (Relobj::set_symbols_data): New function.
13873 (Relobj::get_relocs_data): New function.
13874 (Relobj::set_relocs_data): New function.
13875 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13876 (Relobj::gc_process_relocs): New function.
13877 (Relobj::do_gc_process_relocs): New pure virtual function.
13878 (Relobj::sd_): New data member.
13879 (Sized_relobj::is_output_section_offset_invalid): New function.
13880 (Sized_relobj::do_gc_process_relocs): New function.
13881 * options.h (General_options::gc_sections): Modify to not be a no-op.
13882 (General_options::print_gc_sections): New option.
13883 * plugin.cc (Plugin_finish::run): Remove function call to
13884 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13885 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13886 * reloc.cc (Read_relocs::run): Add task to process relocs and
13887 determine unreferenced sections when doing garbage collection.
13888 (Gc_process_relocs): New class.
13889 (Sized_relobj::do_gc_process_relocs): New function.
13890 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13891 sections that are garbage collected.
13892 * reloc.h (Gc_process_relocs): New class.
13893 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13894 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13895 symbols whose corresponding sections are garbage collected.
13896 (Symbol_table::Symbol_table): Add new parameter for the garbage
13897 collection object.
13898 (Symbol_table::gc_mark_undef_symbols): New function.
13899 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13900 (Symbol_table::gc_mark_dyn_syms): New function.
13901 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13902 as garbage.
13903 (Symbol_table::add_from_object): Likewise.
13904 (Symbol_table::add_from_relobj): When building shared objects, do not
13905 treat externally visible symbols as garbage.
13906 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13907 table information for static and relocatable links.
13908 * symtab.h (Symbol_table::set_gc): New function.
13909 (Symbol_table::gc): New function.
13910 (Symbol_table::gc_mark_undef_symbols): New function.
13911 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13912 (Symbol_table::gc_mark_dyn_syms): New function.
13913 (Symbol_table::gc_): New data member.
e1df38aa 13914 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13915 function.
13916 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13917 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13918
3b293544
CF
139192009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13920
13921 * options.h (General_options::gc_sections): Define as a no-op for now.
13922 (General_options::no_keep_memory): Ditto.
13923 (General_options::Bshareable): Define.
13924 * options.cc (General_options::finalize): Honor -Bshareable.
13925
83d22aa8
AS
139262009-01-20 Andreas Schwab <schwab@suse.de>
13927
13928 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13929 read the value in the contents, since we don't use it. Use the
13930 template endianness when writing.
13931 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13932
cd536b21
AS
139332009-01-19 Andreas Schwab <schwab@suse.de>
13934
13935 * configure.tgt (powerpc64-*): Fix targ_obj.
13936
99e9a495
ILT
139372009-01-15 Ian Lance Taylor <iant@google.com>
13938
13939 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13940 local symbols when stripping all symbols.
13941
bbbfea06
CC
139422009-01-14 Cary Coutant <ccoutant@google.com>
13943
99e9a495 13944 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13945
0f7c0701
CC
139462009-01-14 Cary Coutant <ccoutant@google.com>
13947
13948 * archive.cc (Archive::get_elf_object_for_member): Remove call
13949 to File_read::claim_for_plugin.
13950 * descriptors.cc (Descriptors::open): Remove reference to
13951 is_claimed.
13952 (Descriptors::claim_for_plugin): Remove.
13953 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13954 (Descriptors::is_claimed): Remove.
13955 (claim_descriptor_for_plugin): Remove.
13956 * fileread.cc (File_read::claim_for_plugin): Remove.
13957 * fileread.h (File_read::claim_for_plugin): Remove.
13958 (File_read::descriptor): Reopen descriptor if necessary.
13959 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13960 (Plugin_manager::all_symbols_read): Add task parameter. Change
13961 all callers.
13962 (Plugin_manager::get_input_file): New function.
13963 (Plugin_manager::release_input_file): New function.
13964 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13965 corresponding data member.
13966 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13967 and pass to base constructor. Change all callers.
13968 (get_input_file, release_input_file): New functions.
13969 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13970 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13971 (Plugin_manager::all_symbols_read): Add task parameter.
13972 (Plugin_manager::get_input_file): New function.
13973 (Plugin_manager::release_input_file): New function.
13974 (Plugin_manager::task_): New data member.
13975 (Pluginobj::Pluginobj): Add filesize parameter.
13976 (Pluginobj::filename): New function.
13977 (Pluginobj::descriptor): New function.
13978 (Pluginobj::filesize): New function.
13979 (Pluginobj::filesize_): New data member.
13980 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13981 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13982 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13983
13984 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13985 with archive libraries.
13986 * testsuite/Makefile.in: Regenerate.
13987 * testsuite/plugin_test.c (struct sym_info): New type.
13988 (get_input_file, release_input_file): New static variables.
13989 (onload): Capture new transfer vector entries.
13990 (claim_file_hook): Stop reading at end of file according to filesize.
13991 Factor out parsing of readelf output into separate function.
13992 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13993 APIs and get the source file name from the symbol table. Convert
13994 source file name to corresponding object file name. Print info
13995 message when adding new input files.
13996 (parse_readelf_line): New function.
13997 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13998 * testsuite/plugin_test_2.sh: Likewise.
13999 * testsuite/plugin_test_3.sh: Likewise.
14000 * testsuite/plugin_test_4.sh: New test case.
14001
62a6d109
ILT
140022009-01-07 Ian Lance Taylor <iant@google.com>
14003
14004 * version.cc (version_string): Bump to 1.8.
14005
483620e8
CC
140062008-12-23 Cary Coutant <ccoutant@google.com>
14007
14008 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
14009 * plugin.cc (Plugin_manager::finish): Rename as
14010 layout_deferred_objects. Move cleanup to separate function.
14011 (Plugin_manager::cleanup): New function.
14012 (Plugin_finish::run): Call layout_deferred_objects and cleanup
14013 separately.
14014 * plugin.h (Plugin_manager::finish): Rename as
14015 layout_deferred_objects.
14016 (Plugin_manager::cleanup): New function.
14017 (Plugin_manager::cleanup_done): New field.
14018
d66a9eb3
CC
140192008-12-23 Cary Coutant <ccoutant@google.com>
14020
14021 * plugin.cc (is_visible_from_outside): New function.
14022 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14023 so we don't return "IR only" status for exported symbols or -r links.
14024
14025 * testsuite/Makefile.am (plugin_test_3): New test case.
14026 * testsuite/Makefile.in: Regenerate.
14027 * testsuite/plugin_test_3.sh: New file.
14028
5995b570
CC
140292008-12-22 Cary Coutant <ccoutant@google.com>
14030
14031 * object.cc (Sized_relobj::layout_section): New function.
14032 (Sized_relobj::do_layout): Defer layout of input sections until after
14033 plugin has provided replacement files.
14034 (Sized_relobj::do_layout_deferred_sections): New function.
14035 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14036 (Relobj::layout_deferred_sections): New function.
14037 (Relobj::do_layout_deferred_sections): New function.
14038 (Sized_relobj::do_layout_deferred_sections): New function.
14039 (Sized_relobj::layout_section): New function.
14040 (Sized_relobj::Deferred_layout): New structure.
14041 (Sized_relobj::deferred_layout_): New field.
14042 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14043 Change all callers. Layout deferred sections.
14044 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14045 references.
14046 (Plugin_hook::run): Move code from do_plugin_hook inline.
14047 (Plugin_hook::do_plugin_hook): Remove.
14048 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14049 (Plugin_manager::finish): Renamed, was cleanup.
14050 (Plugin_manager::should_defer_layout): New function.
14051 (Plugin_manager::add_deferred_layout_object): New function.
14052 (Plugin_manager::Deferred_layout_list): New type.
14053 (Plugin_manager::deferred_layout_objects_): New field.
14054 (Plugin_hook::do_plugin_hook): Remove.
14055
ee769c88
ILT
140562008-12-17 Ian Lance Taylor <iant@google.com>
14057
14058 * options.h (class General_options): Add --no case for
14059 --export-dynamic.
14060
abc8dcba
CC
140612008-12-16 Cary Coutant <ccoutant@google.com>
14062
14063 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14064 vector.
14065 (Plugin_manager::claim_file): Create plugin object even if
14066 plugin did not call the add_symbols callback.
14067 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14068 asking for more symbols than were added.
14069 * testsuite/Makefile.am (plugin_test_1): Add test case with
14070 no global symbols.
14071 (empty.syms): New target.
14072 * testsuite/Makefile.in: Regenerate.
14073 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14074 message. Don't call add_symbols if no globals.
14075 (all_symbols_read_hook): Don't provide replacement for empty
14076 claimed file.
14077
b0074644
ILT
140782008-12-12 Ian Lance Taylor <iant@google.com>
14079
68943102
ILT
14080 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14081 r_type == 0 for a local symbol with r_sym == 0.
14082 (scan_relocatable_relocs): Pass r_sym to
14083 local_non_section_strategy.
14084 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14085 r_sym parameter.
14086
b0074644
ILT
14087 * configure.ac: Update test for TLS descriptors: they are
14088 supported as of glibc 2.9.
14089 * configure: Rebuild.
14090
c2508178
ILT
140912008-12-11 Ian Lance Taylor <iant@google.com>
14092
14093 PR 7091
14094 * target-reloc.h (Default_scan_relocatable_relocs): For each
14095 function, map r_type == 0 to RELOC_DISCARD.
14096
2756a258
CC
140972008-12-10 Cary Coutant <ccoutant@google.com>
14098
14099 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14100 object to override a kept COMDAT group from a plugin object.
14101
bb6f53d3
ILT
141022008-12-09 Ian Lance Taylor <iant@google.com>
14103
fbc558e1
ILT
14104 PR 7088
14105 * yyscript.y (file_cmd): Handle INPUT.
14106
bb6f53d3
ILT
14107 * testsuite/initpri1.c: Change all declarations to be full
14108 prototypes by adding void, to avoid compiler warnings.
14109
4674ecfc
CC
141102008-12-05 Rafael Avila de Espindola <espindola@google.com>
14111
14112 * options.cc (General_options::parse_plugin_opt): New.
14113 (General_options::add_plugin): The argument now is just the filename.
14114 (General_options::add_plugin_option): New.
14115 * options.h (plugin_opt): New.
14116 (add_plugin): Change argument name.
14117 (add_plugin_option): New.
14118 * plugin.cc (Plugin::load): Don't parse the plugin option.
14119 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14120 (Plugin::add_option): New.
14121 (Plugin::args_): Change type.
14122 (Plugin::filename_): New.
14123 (Plugin_manager::add_plugin_option): New.
14124 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14125 * testsuite/Makefile.in: Regenerate.
14126
fd06b4aa
CC
141272008-12-05 Cary Coutant <ccoutant@google.com>
14128
14129 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14130 Handle --strip-lto-sections option.
14131 * options.h (strip_lto_sections): New option.
14132
6c52134c
CC
141332008-12-01 Cary Coutant <ccoutant@google.com>
14134
14135 * plugin.cc (ld_plugin_message): Change format parameter to const.
14136 Fix mismatch between new[] and delete.
14137
a45248e0
CC
141382008-11-14 Cary Coutant <ccoutant@google.com>
14139
14140 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14141 instead of -1U.
14142
c82fbeee
CS
141432008-11-05 Craig Silverstein <csilvers@google.com>
14144
14145 * options.cc (General_options::parse_dynamic_list): New function.
14146 * options.h (General_options): New flags dynamic_list,
14147 dynamic_list_data, dynamic_list_cpp_new, and
14148 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14149 (General_options::in_dynamic_list): New function.
14150 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14151 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14152 (Lex::can_continue_name): Likewise.
14153 (yylex): Likewise.
14154 (read_script_file): New parameter script_options.
14155 (read_dynamic_list): New function.
14156 (Script_options::define_dynamic_list): New function.
14157 (dynamic_list_keyword_parsecodes): New variable.
14158 (dynamic_list_keywords): New variable.
14159 * script.h (Script_options::define_dynamic_list): New function
14160 prototype.
14161 (read_dynamic_list): New function prototype.
14162 * symtab.cc (strprefix): New macro.
14163 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14164 dynamic_list_data, dynamic_list_cpp_new, and
14165 dynamic_list_cpp_typeinfo.
14166 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14167 (dynamic_list_expr): New rule.
14168 (dynamic_list_nodes): Likewise.
14169 (dynamic_list_node): Likewise.
14170 * testsuite/Makefile.am (dynamic_list): New test.
14171 * testsuite/Makefile.in: Regenerated.
14172 * testsuite/dynamic_list.t: New file.
14173 * testsuite/dynamic_list.sh: New file.
14174
e0bb29a5
CS
141752008-11-05 Craig Silverstein <csilvers@google.com>
14176
14177 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14178 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14179 (t11_last): Likewise.
14180 * testsuite/ver_test_6.c (main): Likewise.
14181
4e1e25e0
CC
141822008-10-07 Cary Coutant <ccoutant@google.com>
14183
14184 * options.c (General_options::finalize): Add check for -static and
14185 -shared.
14186 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14187 is not empty.
14188
92f03fcb
CC
141892008-10-02 Cary Coutant <ccoutant@google.com>
14190
14191 * plugin.cc (make_sized_plugin_object): Fix conditional
14192 compilation to work when not all targets are enabled.
14193
fbd8a257
CC
141942008-09-29 Cary Coutant <ccoutant@google.com>
14195
14196 * archive.cc (Archive::get_file_and_offset): Use filename instead
14197 of name to get library path.
14198 (Archive::include_member): Unlock external member of a thin archive.
14199
14200 * testsuite/Makefile.am (TEST_AR): New variable.
14201 (thin_archive_test_1): New test.
14202 (thin_archive_test_2): New test.
81636b3f
CC
14203 * testsuite/Makefile.in: Regenerate.
14204 * testsuite/thin_archive_main.cc: New file.
14205 * testsuite/thin_archive_test_1.cc: New file.
14206 * testsuite/thin_archive_test_2.cc: New file.
14207 * testsuite/thin_archive_test_3.cc: New file.
14208 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14209
eff45813
CC
142102008-09-29 Cary Coutant <ccoutant@google.com>
14211
14212 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14213 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14214 instead of -1U.
14215 (Sized_relobj::do_finalize_local_symbols): Likewise.
14216 (Sized_relobj::map_to_kept_section): Likewise.
14217 * object.h (Sized_relobj::invalid_address): New constant.
14218 (Sized_relobj::do_output_section_offset): Check for invalid_address
14219 and return -1ULL.
14220 * output.cc (Output_reloc::local_section_offset): Use constant
14221 invalid_address instead of -1U.
14222 (Output_reloc::get_address): Likewise.
14223 (Output_section::output_address): Change -1U to -1ULL.
14224 * output.h (Output_reloc::invalid_address): New constant.
14225 * reloc.cc (Sized_relobj::write_sections): Use constant
14226 invalid_address instead of -1U.
14227 (Sized_relobj::relocate_sections): Likewise.
14228 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14229 values for merge sections.
14230 * target-reloc.h (relocate_for_relocatable): Use constant
14231 invalid_address instead of -1U.
14232
89fc3421
CC
142332008-09-19 Cary Coutant <ccoutant@google.com>
14234
14235 Add plugin functionality for link-time optimization (LTO).
14236 * configure.ac (plugins): Add --enable-plugins option.
14237 * configure: Regenerate.
14238 * config.in: Regenerate.
14239 * Makefile.am (LIBDL): New variable.
14240 (CCFILES): Add plugin.cc.
14241 (HFILES): Add plugin.h.
14242 (ldadd_var): Add LIBDL.
14243 * Makefile.in: Regenerate.
14244
14245 * archive.cc: Include "plugin.h".
14246 (Archive::setup): Don't preread archive symbols when using a plugin.
14247 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14248 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14249 files.
14250 (Archive::include_member): Add symbols from plugin objects.
14251 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14252 * descriptors.cc (Descriptors::open): Check for file descriptors
14253 abandoned by plugins.
14254 (Descriptors::claim_for_plugin): New function.
14255 * descriptors.h (Descriptors::claim_for_plugin): New function.
14256 (Open_descriptor::is_claimed): New field.
14257 (claim_descriptor_for_plugin): New function.
14258 * fileread.cc (File_read::claim_for_plugin): New function.
14259 * fileread.h (File_read::claim_for_plugin): New function.
14260 (File_read::descriptor): New function.
14261 * gold.cc: Include "plugin.h".
14262 (queue_initial_tasks): Add task to call plugin hooks for generating
14263 new object files.
14264 * main.cc: Include "plugin.h".
14265 (main): Load plugin libraries.
14266 * object.h (Pluginobj): Declare.
14267 (Object::pluginobj): New function.
14268 (Object::do_pluginobj): New function.
14269 (Object::set_target): New function.
14270 * options.cc: Include "plugin.h".
14271 (General_options::parse_plugin): New function.
14272 (General_options::General_options): Initialize plugins_ field.
14273 (General_options::add_plugin): New function.
14274 * options.h (Plugin_manager): Declare.
14275 (General_options): Add --plugin option.
14276 (General_options::has_plugins): New function.
14277 (General_options::plugins): New function.
14278 (General_options::add_plugin): New function.
14279 (General_options::plugins_): New field.
14280 * plugin.cc: New file.
14281 * plugin.h: New file.
14282 * readsyms.cc: Include "plugin.h".
14283 (Read_symbols::do_read_symbols): Check for archive before checking
14284 for ELF file. Call plugin hooks to claim files.
14285 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14286 from a real object file; force override when processing replacement
14287 files.
14288 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14289 (Symbol::init_base_object): Likewise.
14290 (Symbol::init_base_output_data): Likewise.
14291 (Symbol::init_base_output_segment): Likewise.
14292 (Symbol::init_base_constant): Likewise.
14293 (Symbol::init_base_undefined): Likewise.
14294 (Symbol::output_section): Assert that object is not a plugin.
14295 (Symbol_table::add_from_pluginobj): New function.
14296 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14297 undefined.
14298 (Symbol_table::sized_write_globals): Likewise.
14299 (Symbol_table::add_from_pluginobj): Instantiate template.
14300 * symtab.h (Sized_pluginobj): Declare.
14301 (Symbol::in_real_elf): New function.
14302 (Symbol::set_in_real_elf): New function.
14303 (Symbol::in_real_elf_): New field.
14304 (Symbol_table::add_from_pluginobj): New function.
14305
14306 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14307 (LIBDL): New variable.
14308 (LDADD): Add LIBDL.
14309 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14310 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14311 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14312 (MOSTLYCLEANFILES): Likewise.
14313 * testsuite/Makefile.in: Regenerate.
14314 * testsuite/plugin_test.c: New file.
14315 * testsuite/plugin_test_1.sh: New file.
14316 * testsuite/plugin_test_2.sh: New file.
14317
de31bda5
ILT
143182008-09-16 Ian Lance Taylor <iant@google.com>
14319
9c2d0ef9
ILT
14320 * target-reloc.h (relocate_section): Check whether a symbol is
14321 defined by the ABI before reporting an undefined symbol error.
14322 * target.h (Target::is_defined_by_abi): Make parameter const.
14323 (Target::do_is_defined_by_abi): Likewise.
14324 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14325 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14326 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14327 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14328 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14329 * testsuite/Makefile.in: Rebuild.
14330
de31bda5
ILT
14331 * fileread.cc (make_view): Add casts to avoid warning.
14332
9fa33bee
AO
143332008-09-16 Alexandre Oliva <aoliva@redhat.com>
14334
14335 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14336 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14337
183fd0e3
AO
143382008-09-16 Alexandre Oliva <aoliva@redhat.com>
14339
14340 * options.h (General_options::output_is_executable): New.
14341 (General_options::output_is_pie): New.
14342 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14343 for shared libraries.
14344 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14345
7be8330a
CD
143462008-09-11 Chris Demetriou <cgd@google.com>
14347
14348 * options.h (origin): New -z option.
14349 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14350 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14351 in DT_FLAGS_1.
14352
a9caad02
CC
143532008-09-05 Cary Coutant <ccoutant@google.com>
14354
14355 * fileread.cc (File_read::make_view): Add check for attempt to map
14356 beyond end of file.
14357
ae6dce4d
CC
143582008-09-05 Cary Coutant <ccoutant@google.com>
14359
14360 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14361 explicit instantiations.
14362
d7ab2a47
KVH
143632008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14364
14365 PR gold/6858
14366 * options.cc (General_options::finalize): Allow undefined symbols
14367 in shlibs if linking -shared.
14368
14369 PR gold/6859
14370 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14371 symbols as not needing a dynsym entry.
14372
1e52a9c1
CS
143732008-08-20 Craig Silverstein <csilvers@google.com>
14374
14375 * fileread.cc (File_read::open): Do not lock the file unless it
14376 was successfully opened.
14377
d85c80a3
CC
143782008-08-14 Cary Coutant <ccoutant@google.com>
14379
14380 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14381 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14382 * testsuite/tls_test.cc (struct int128): 128-bit struct
14383 for testing TLS relocs with non-zero addend.
14384 (v12): New TLS variable.
14385 (t12): New test.
14386 (t_last): Add check for v12.
14387 * testsuite/tls_test.h (t12): New function.
14388 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14389
2d924fd9
ILT
143902008-08-13 Ian Lance Taylor <iant@google.com>
14391
14392 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14393 set tls_segment_ or relro_segment_.
14394 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14395 when appropriate.
14396 * output.h (Output_section::clear_is_relro): New function.
14397 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14398 sections specially even when output_data_ is empty.
14399 (Output_segment::maximum_alignment): When first section is relro,
14400 only force alignment for PT_LOAD segments.
14401 * script.cc (script_data_segment_align): New function.
14402 (script_data_segment_relro_end): New function.
14403 * script-c.h (script_data_segment_align): Declare.
14404 (script_data_segment_relro_end): Declare.
14405 * script-sections.h (class Script_sections): Declare
14406 data_segment_align and data_segment_relro_end. Add fields
14407 segment_align_index_ and saw_relro_end_.
14408 * script-sections.cc (class Sections_element): Add set_is_relro
14409 virtual function. Add new bool* parameter to place_orphan_here.
14410 Add get_output_section virtual function.
14411 (class Output_section_definition): Add set_is_relro. Add new
14412 bool* parameter to place_orphan_here. Add get_output_section.
14413 Add is_relro_ field.
14414 (Output_section_definition::Output_section_definition): Initialize
14415 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14416 and is_relro_ fields.
14417 (Output_section_definition::place_orphan_here): Add is_relro
14418 parameter.
14419 (Output_section_definition::set_section_addresses): Set relro for
14420 output section.
14421 (Output_section_definition::alternate_constraint): Likewise.
14422 (class Orphan_output_section): Add new bool* parameter to
14423 place_orphan_here. Add get_output_section.
14424 (Orphan_output_section::place_orphan_here): Add is_relro
14425 parameter.
14426 (Script_sections::Script_sections): Initialize
14427 data_segment_align_index_ and saw_relro_end_.
14428 (Script_sections::data_segment_align): New function.
14429 (Script_sections::data_segment_relro_end): New function.
14430 (Script_sections::place_orphan): Set or clear is_relro.
14431 (Script_sections::set_section_addresses): Force alignment of first
14432 TLS section.
14433 * yyscript.y (exp): Call script_data_segment_align and
14434 script_data_segment_relro_end.
14435 * testsuite/relro_script_test.t: New file.
14436 * testsuite/relro_test.cc (using_script): Declare.
14437 (t1, t2): Test using_script.
14438 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14439 (relro_script_test_SOURCES): Define.
14440 (relro_script_test_DEPENDENCIES): Define.
14441 (relro_script_test_LDFLAGS): Define.
14442 (relro_script_test_LDADD): Define.
14443 (relro_script_test.so): New target.
14444 * testsuite/Makefile.in: Rebuild.
14445
f827c9a9
CC
144462008-08-06 Cary Coutant <ccoutant@google.com>
14447
14448 * archive.cc (Archive::total_archives, Archive::total_members)
14449 (Archive::total_members_loaded): New variables.
14450 (Archive::setup): Add parameter. Add option to preread
14451 archive symbols.
14452 (Archive::read_armap): Add counter.
14453 (Archive::get_file_and_offset): New function.
14454 (Archive::get_elf_object_for_member): New function.
14455 (Archive::read_all_symbols): New function.
14456 (Archive::read_symbols): New function.
14457 (Archive::add_symbols): Add counters.
14458 (Archive::include_all_members): Use armap to find members if it's
14459 already built.
14460 (Archive::include_member): Skip reading symbols if already read.
14461 Factored code into Archive::get_file_and_offset and
14462 Archive::get_elf_object_for_member. Changed call to
14463 Mapfile::report_include_archive_member.
14464 (Archive::print_stats): New function.
14465 * archive.h: Declare Object and Read_symbols_data classes.
14466 (Archive::Archive): Add initializers for new members.
14467 (Archive::setup): Add parameter.
14468 (Archive::print_stats): New function.
14469 (Archive::total_archives, Archive::total_members)
14470 (Archive::total_members_loaded): New variables.
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::Archive_member): New class.
14476 (Archive::members_): New member.
14477 (Archive::num_members_): New member.
14478 * main.cc: Include archive.h.
14479 (main): Call Archive::print_stats.
14480 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14481 archive parameter; member_name is now the fully-decorated name.
14482 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14483 * options.h: (General_options): Add --preread-archive-symbols option.
14484 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14485 Archive::setup.
14486
de4c45bd
ILT
144872008-08-04 Ian Lance Taylor <iant@google.com>
14488
14489 * symtab.h (Symbol::use_plt_offset): New function.
14490 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14491 * powerpc.cc (Relocate::relocate): Likewise.
14492 * sparc.cc (Relocate::relocate): Likewise.
14493 * x86_64.cc (Relocate::relocate): Likewise.
14494 * testsuite/weak_plt.sh: New test.
14495 * testsuite/weak_plt_main.cc: New test.
14496 * testsuite/weak_plt_shared.cc: New test.
14497 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14498 (check_PROGRAMS): Add weak_plt.
14499 (check_DATA): Add weak_plt_shared.so.
14500 (weak_plt_main_pic.o, weak_plt): New targets.
14501 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14502 * testsuite/Makefile.in: Rebuild.
14503
14504 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14505 gcctestdir/ld.
14506 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14507 * testsuite/Makefile.in: Rebuild.
14508
323ee3f4
AM
145092008-08-04 Alan Modra <amodra@bigpond.net.au>
14510
14511 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14512 * Makefile.in: Regenerate.
14513 * po/POTFILES.in: Regenerate.
14514
7c07ecec
ILT
145152008-07-29 Ian Lance Taylor <iant@google.com>
14516
14517 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14518 symbols before other symbols.
14519 * testsuite/script_test_2.cc (test_addr): Declare.
14520 (test_addr_alias): Declare.
14521 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14522 values.
7c07ecec
ILT
14523 * testsuite/script_test_2.t: Define test_addr_alias and
14524 test_addr.
14525
5778530e
ILT
145262008-07-24 Ian Lance Taylor <iant@google.com>
14527
2a00e4fb
ILT
14528 PR 5990
14529 * descriptors.cc: New file.
14530 * descriptors.h: New file.
14531 * gold-threads.h (class Hold_optional_lock): New class.
14532 * fileread.cc: Include "descriptors.h".
14533 (File_read::~File_read): Release descriptor rather than closing
14534 it.
14535 (File_read::open) [file]: Call open_descriptor rather than open.
14536 Set is_descriptor_opened_.
14537 (File_read::open) [memory]: Assert that descriptor is not open.
14538 (File_read::reopen_descriptor): New function.
14539 (File_read::release): Release descriptor.
14540 (File_read::do_read): Make non-const. Reopen descriptor.
14541 (File_read::read): Make non-const.
14542 (File_read::make_view): Reopen descriptor.
14543 (File_read::do_readv): Likewise.
14544 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14545 Update declarations.
14546 * layout.cc: Include "descriptors.h".
14547 (Layout::create_build_id): Use open_descriptor rather than open.
14548 * output.cc: Include "descriptors.h".
14549 (Output_file::open): Use open_descriptor rather than open.
14550 * archive.cc (Archive::const_iterator): Change Archive to be
14551 non-const.
14552 (Archive::begin, Archive::end): Make non-const.
14553 (Archive::count_members): Likewise.
14554 * archive.h (class Archive): Update declarations.
14555 * object.h (Object::read): Make non-const.
14556 * Makefile.am (CCFILES): Add descriptors.cc.
14557 (HFILES): Add descriptors.h.
14558 * Makefile.in: Rebuild.
14559
801647d1
ILT
14560 PR 6716
14561 * gold.h: Always include <clocale>. Add Solaris workarounds
14562 following code in binutils/sysdep.h.
14563
5edd166e
ILT
14564 PR 6048
14565 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14566 this->eh_frame_hdr_ is NULL before using it.
14567
c89ad728
ILT
14568 * dynobj.cc (Versions::Versions): Update comment.
14569
aa86f06b
ILT
14570 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14571 the base version name.
14572
5778530e
ILT
14573 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14574 array size plus one.
14575 (Stringpool_template::set_string_offsets): Subtract one from key
14576 before using it as an array index.
14577 (Stringpool_template::get_offset_with_length): Likewise.
14578 (Stringpool_template::write_to_buffer): Likewise.
14579 * stringpool.h (Stringpool_template::get_offset_from_key):
14580 Likewise.
14581
057ead22
ILT
145822008-07-23 Ian Lance Taylor <iant@google.com>
14583
7f649c59
ILT
14584 PR 6658
14585 * object.h (Merged_symbol_value::value): Do our best to handle a
14586 negative addend.
14587
057ead22
ILT
14588 PR 6647
14589 * script.cc (Version_script_info::get_versions): Don't add empty
14590 version tag to return value.
14591 (Version_script_info::get_symbol_version_helper): Change return
14592 type to bool. Add pversion parameter. Change all callers.
14593 (script_register_vers_node): Don't require a non-NULL tag.
14594 * script.h (class Version_script_info): Update declarations.
14595 (Version_script_info::get_symbol_version): Change return type to
14596 bool. Add version parameter. Change all callers.
14597 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14598 handling. Handle an empty version from a version script.
14599 (Symbol_table::define_special_symbol): Likewise.
14600 * testsuite/ver_test_10.script: New file.
14601 * testsuite/ver_test_10.sh: New file.
14602 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14603 (check_DATA): Add ver_test_10.syms.
14604 (ver_test_10.syms, ver_test_10.so): New target.
14605 * testsuite/Makefile.in: Rebuild.
14606
58e54ac2
CD
146072008-07-23 Simon Baldwin <simonb@google.com>
14608
14609 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14610 to zero for undefined symbols from dynamic libraries.
14611
95d14cd3
ILT
146122008-07-23 Ian Lance Taylor <iant@google.com>
14613
14614 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14615 Change all callers.
14616 * symtab.h (class Symbol_table): Update declaration.
14617 * testsuite/ver_test_9.cc: New file.
14618 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14619 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14620 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14621 (ver_test_9.so, ver_test_9.o): New targets.
14622 * testsuite/Makefile.in: Rebuild.
14623
92de84a6
ILT
146242008-07-22 Ian Lance Taylor <iant@google.com>
14625
34810851
ILT
14626 * options.h (class General_options): Define --check-sections.
14627 * layout.cc (Layout::set_segment_offsets): Handle
14628 --check-sections.
14629
af6156ef
ILT
14630 * options.h (class General_options): Define -n/--nmagic and
14631 -N/--omagic.
14632 * options.cc (General_options::finalize): For -n/--nmagic or
14633 -N/--omagic, set -static.
14634 * layout.cc (Layout::attach_allocated_section_to_segment): If
14635 -N/--omagic, don't put read-only and read-write sections in
14636 different segments.
14637 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14638 finding a read-only segment.
14639 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14640 don't set the minimum segment alignment to the common page size,
14641 and don't set the file offset to the address modulo the page size.
14642 * script-sections.cc (Script_sections::create_segments): If
14643 -n/--omagic, don't put read-only and read-write sections in
14644 different segments.
14645
92de84a6
ILT
14646 * cref.cc: New file.
14647 * cref.h: New file.
14648 * options.h (class General_options): Add --print-symbol-counts.
14649 * main.cc (main): Issue defined symbol report if requested.
14650 * archive.cc (Archive::interpret_header): Make into a const member
14651 function.
14652 (Archive::add_symbols): Call Input_objects::archive_start and
14653 archive_stop.
14654 (Archive::const_iterator): Define new class.
14655 (Archive::begin, Archive::end): New functions.
14656 (Archive::include_all_members): Rewrite to use iterator.
14657 (Archive::count_members): New function.
14658 * archive.h (class Archive): Update declarations.
14659 (Archive::filename): New function.
14660 * object.cc: Include "cref.h".
14661 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14662 (Sized_relobj::do_get_global_symbol_counts): New function.
14663 (Input_objects::add_object): Add object to cross-referencer.
14664 (Input_objects::archive_start): New function.
14665 (Input_objects::archive_stop): New function.
14666 (Input_objects::print_symbol_counts): New function.
14667 * object.h: Declare Cref and Archive.
14668 (Object::get_global_symbol_counts): New function.
14669 (Object::do_get_global_symbol_counts): New pure virtual function.
14670 (class Sized_relobj): Add defined_count_ field. Update
14671 declarations.
14672 (class Input_objects): Add cref_ field. Update constructor.
14673 Update declarations.
14674 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14675 defined_count_.
14676 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14677 symbol counts.
14678 (Sized_dynobj::do_get_global_symbol_counts): New function.
14679 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14680 defined_count_. Update declarations. Define Symbols typedef.
14681 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14682 parameter. Change all callers.
14683 (Symbol_table::add_from_dynobj): Add sympointers and defined
14684 parameters. Change all callers.
14685 * symtab.h (class Symbol_table): Update declarations.
14686 * Makefile.am (CCFILES): Add cref.cc.
14687 (HFILES): Add cref.h.
14688 * Makefile.in: Rebuild.
14689
3f7c5e1d
CD
146902008-07-22 Simon Baldwin <simonb@google.com>
14691
14692 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14693 to zero when writing undefined symbols.
14694
e0b64032
ILT
146952008-07-22 Ian Lance Taylor <iant@google.com>
14696
14697 * output.cc (Output_section::add_input_section): Don't try to
14698 merge empty merge sections.
14699
096b02cf
CS
147002008-07-21 Craig Silverstein <csilvers@google.com>
14701
14702 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14703 Include symbol version in error message.
cd536b21 14704
1d1f116d
CD
147052008-07-20 Chris Demetriou <cgd@google.com>
14706
cd536b21 14707 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14708 (RANDOM_SEED_CFLAGS): New substituted variable.
14709 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14710 * configure: Rebuild.
14711 * Makefile.in: Likewise.
14712 * testsuite/Makefile.in: Likewise.
14713
a18f591e
ILT
147142008-07-18 Ian Lance Taylor <iant@google.com>
14715
14716 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14717 where we see NAME/NULL and NAME/VERSION as separate symbols.
14718 * testsuite/ver_test_main.cc (main): Call t4.
14719 (t4, t4_2a): Define.
14720 * testsuite/ver_test_2.cc (t4_2): Define.
14721 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14722 * testsuite/ver_test_4.cc (t4_2a): Define.
14723 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14724 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14725
c6e3f6ed
ILT
147262008-07-17 Ian Lance Taylor <iant@google.com>
14727
14728 * dynobj.cc (Versions::add_def): If we give an error about a
14729 missing version, go ahead and create the version anyhow.
14730
ef9beddf
ILT
147312008-07-10 Ian Lance Taylor <iant@google.com>
14732
14733 Handle output sections with more than 0x7fffffff bytes.
14734 * object.h (class Relobj): Change map_to_output_ to
14735 output_sections_, and just keep a section pointer. Change all
14736 uses. Move comdat group support to Sized_relobj.
14737 (Relobj::is_section_specially_mapped): Remove.
14738 (Relobj::output_section): Remove poff parameter. Change all
14739 callers.
14740 (Relobj::output_section_offset): New function.
14741 (Relobj::set_section_offset): Rewrite.
14742 (Relobj::map_to_output): Remove.
14743 (Relobj::output_sections): New function.
14744 (Relobj::do_output_section_offset): New pure virtual function.
14745 (Relobj::do_set_section_offset): Likewise.
14746 (class Sized_relobj): Add section_offsets_ field. Add comdat
14747 group support from Relobj. Update declarations.
14748 (Sized_relobj::get_output_section_offset): New function.
14749 (Sized_relobj::do_output_section_offset): New function.
14750 (Sized_relobj::do_set_section_offset): New function.
14751 * object.cc (Relobj::output_section_address): Remove.
14752 (Sized_relobj::Sized_relobj): Initialize new fields.
14753 (Sized_relobj::include_section_group): Cast find_kept_object to
14754 Sized_relobj.
14755 (Sized_relobj::include_linkonce_section): Likewise.
14756 (Sized_relobj::do_layout): Use separate arrays for output section
14757 and output offset.
14758 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14759 output_sections.
14760 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14761 output_sections and section_offsets.
14762 (Sized_relobj::write_local_symbols): Likewise.
14763 (map_to_kept_section): Compute output address directly.
14764 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14765 output_sections and section_offsets.
14766 (Sized_relobj::write_sections): Likewise.
14767 (Sized_relobj::relocate_sections): Likewise.
14768 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14769 * output.h (class Output_reloc): Update declarations. Change
14770 u2_.relobj to Sized_relobj*.
14771 (class Output_data_reloc): Change add functions to use
14772 Sized_relobj*.
14773 * output.cc (Output_reloc::Output_reloc): Change relobj to
14774 Sized_relobj*.
14775 (Output_reloc::local_section_offset): Change return type to
14776 Elf_Addr. Use get_output_section_offset.
14777 (Output_reloc::get_address): Likewise.
14778 (Output_section::is_input_address_mapped): Don't call
14779 is_section_specially_mapped.
14780 (Output_section::output_offset): Likewise.
14781 (Output_section::output_address): Likewise.
14782 (Output_section::starting_output_address): Likewise.
14783 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14784 parameter to Sized_relobj*.
14785 (Copy_relocs::need_copy_reloc): Likewise.
14786 (Copy_relocs::save): Likewise.
14787 * copy-relocs.h (class Copy_relocs): Update declarations.
14788 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14789 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14790 * target-reloc.h (relocate_for_relocatable): Change
14791 offset_in_output_section type to Elf_Addr. Change code that uses
14792 it as well.
14793 * layout.cc (Layout::layout): Always set *off.
14794 * mapfile.cc (Mapfile::print_input_section): Use
14795 output_section_offset.
14796 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14797 Sized_relobj*.
14798 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14799 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14800 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14801
5cb66f97
ILT
148022008-07-03 Ian Lance Taylor <iant@google.com>
14803
14804 * layout.cc (Layout::include_section): Do not discard unrecognized
14805 SHT_STRTAB sections.
14806
afe47622
CS
148072008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14808
14809 * script.cc (Lex::can_continue_name): Make '?' allowable in
14810 version-script names.
14811 * testsuite/version_script.map: Change glob pattern to use '?'
14812
5adf9721
ILT
148132008-06-30 Manish Singh <yosh@gimp.org>
14814
14815 PR 6585
14816 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14817 Correct typo.
14818
e6fde208
ILT
148192008-06-30 Ian Lance Taylor <iant@google.com>
14820
14821 PR 6660
14822 PR 6682
14823 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14824 versions]: Don't try to read the value in the contents, since we
14825 don't use it. Use the template endianness when writing.
14826
3f2e6a2d
CC
148272008-06-25 Cary Coutant <ccoutant@google.com>
14828
14829 * fileread.cc (File_read::make_view): Assert on zero-length view.
14830 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14831 symbol table when there are no symbols to read.
14832
c43d3a48
CS
148332008-06-23 Craig Silverstein <csilvers@google.com>
14834
14835 * version.cc (version_string): Bump to 1.7
14836
5f494ea0
CS
148372008-06-18 Craig Silverstein <csilvers@google.com>
14838
14839 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14840 constant 0xFFFF to type Valtype.
14841 (Powerpc_relocate_functions::rel16_ha): Likewise.
14842
c42e122e
ILT
148432008-06-17 Ian Lance Taylor <iant@google.com>
14844
f34787f8
ILT
14845 * output.h (Output_section::Input_section): Initialize p2align_ to
14846 zero for Output_section_data constructors.
14847 (Output_section::Input_section::addralign): If not an input
14848 section, return the alignment of the Output_section_data.
14849 * testsuite/copy_test.cc: New file.
14850 * testsuite/copy_test_1.cc: New file.
14851 * testsuite/copy_test_2.cc: New file.
14852 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14853 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14854 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14855 (copy_test_1_pic.o, copy_test_1.so): New targets.
14856 (copy_test_2_pic.o, copy_test_2.so): New targets.
14857 * testsuite/Makefile.in: Rebuild.
14858
c42e122e
ILT
14859 * script-sections.cc (Script_sections::place_orphan): Initialize
14860 local variable exact.
14861
ce3ac18a
DE
148622008-06-13 David Edelsohn <edelsohn@gnu.org>
14863
14864 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14865
42cacb20
DE
148662008-06-12 David Edelsohn <edelsohn@gnu.org>
14867 David S. Miller <davem@davemloft.net>
14868
14869 * powerpc.cc: New file.
14870 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14871 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14872 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14873 * Makefile.in: Rebuild.
14874
7b308235
ILT
148752008-06-09 Ian Lance Taylor <iant@google.com>
14876
14877 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14878 <exception>.
14879 (throwing, orig_terminate): New static variables.
14880 (terminate_handler): New static function.
14881 (t2): Set terminate handler.
14882
f0b886e3
ILT
148832008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14884
14885 PR 6584
cd536b21 14886 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14887 alignment.
14888
3e90f135
CC
148892008-05-30 Cary Coutant <ccoutant@google.com>
14890
14891 * archive.cc (Archive::include_all_members) Correct to step
14892 over symbol table and extended name table in thin archives.
14893
e09ad04a
ILT
148942008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14895
14896 PR 6407
14897 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14898 calculation.
14899
62b01cb5
ILT
149002008-05-28 Caleb Howe <cshowe@google.com>
14901
14902 * reduced_debug_output.cc: New file.
14903 * reduced_debug_output.h: New file.
92de84a6 14904 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14905 * options.cc (General_options::finalize): Add strip_debug_non_line
14906 to the strip heirarchy.
14907 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14908 fields.
14909 * layout.cc: Include "reduced_debug_output.h".
14910 (Layout::Layout): Initialize new fields.
14911 (line_only_debug_sections): New static array.
14912 (is_lines_only_debug_sections): New static inline function.
14913 (Layout::include_section): Handle --strip-debug-non-line.
14914 (Layout::make_output_section): If --strip-debug-non-line, build
14915 new output sections for .debug_abbrev and .debug_info.
14916 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14917 gold. Warn about possible overflow.
14918 (read_signed_LEB_128): Likewise.
14919 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14920 (read_signed_LEB_128): Declare.
14921 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14922 (HFILES): Add reduced_debug_output.h.
14923 * Makefile.in: Rebuild.
14924
7d9e3d98
ILT
149252008-05-21 Ian Lance Taylor <iant@google.com>
14926
14927 * mapfile.cc: New file.
14928 * mapfile.h: New file.
14929 * options.h (class General_options): Add -M/--print-map and -Map.
14930 * options.cc (General_options::finalize): Make -M equivalent to
14931 -Map -.
14932 * main.cc: Include <cstdio> and "mapfile.h".
14933 (main): Open mapfile if requested.
14934 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14935 constructor. Change caller.
14936 (queue_initial_tasks): Add mapfile parameter. Change caller.
14937 (queue_middle_tasks): Likewise.
14938 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14939 declarations.
14940 * archive.cc: Include "mapfile.h".
14941 (Archive::add_symbols): Add mapfile parameter. Change all
14942 callers. Pass mapfile, symbol, and reason to include_member.
14943 (Archive::include_all_members): Add mapfile parameter. Change all
14944 callers.
14945 (Archive::include_member): Add mapfile, sym, and why parameters.
14946 Change all callers. Report inclusion to map file.
14947 * archive.h: Include "fileread.h".
14948 (class Archive): Update declarations.
14949 (Archive::file): New const method.
14950 (class Add_archive_symbols): Add mapfile_ field. Update
14951 constructor. Change all callers.
14952 * readsyms.h (class Read_symbols): Likewise.
14953 (class Finish_group): Likewise.
14954 (class Read_script): Likewise.
14955 * common.cc: Include "mapfile.h".
14956 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14957 all callers.
14958 (Symbol_table::do_allocate_commons): Likewise.
14959 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14960 symbol allocation to mapfile.
14961 * common.h (class Allocate_commons_task): Add mapfile_ field.
14962 Update constructor. Change all callers.
14963 * symtab.h (class Symbol_table): Update declarations.
14964 * layout.cc: Include "mapfile.h".
14965 (Layout_task_runner::run): Print information to mapfile.
14966 (Layout::create_gold_note): Change Output_data_fixed_space to
14967 Output_data_zero_fill.
14968 (Layout::create_build_id): Likewise.
14969 (Layout::print_to_mapfile): New function.
14970 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14971 constructor. Change caller.
14972 (class Layout): Declare print_to_mapfile.
14973 * output.cc (Output_section::Input_section::print_to_mapfile): New
14974 function.
14975 (Output_section::add_input_section): If producing a map, always
14976 add to input_sections_ list.
14977 (Output_section::do_print_to_mapfile): New function.
14978 (Output_segment::print_sections_to_mapfile): New function.
14979 (Output_segment::print_section_list_to_mapfile): New function.
14980 * output.h: Include "mapfile.h".
14981 (Output_data::print_to_mapfile): New function.
14982 (Output_data::do_print_to_mapfile): New virtual function.
14983 (Output_segment_headers::do_print_to_mapfile): New function.
14984 (Output_file_header::do_print_to_mapfile): New function.
14985 (Output_data_const::do_print_to_mapfile): New function.
14986 (class Output_data_const_buffer): Add map_name_ field. Update
14987 constructor. Change all callers. Add do_print_to_mapfile
14988 function.
14989 (class Output_data_fixed_space): Likewise.
14990 (class Output_data_space): Likewise.
14991 (class Output_data_zero_fill): New class.
14992 (Output_data_strtab::do_print_to_mapfile): New function.
14993 (Output_data_reloc_base::do_print_to_mapfile): New function.
14994 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14995 (Output_data_group::do_print_to_mapfile): New function.
14996 (Output_data_got::do_print_to_mapfile): New function.
14997 (Output_data_dynamic::do_print_to_mapfile): New function.
14998 (Output_symtab_xindex::do_print_to_mapfile): New function.
14999 (class Output_section): Declare do_print_to_mapflie. Declare
15000 print_to_mapfile in Input_section.
15001 (class Output_segment): Declare new functions.
15002 * object.h (Sized_relobj::symbol_count): New function.
15003 * script-sections.cc
15004 (Output_section_element_dot_assignment::set_section_addresses):
15005 Change Output_data_fixed_space to Output_data_zero_fill.
15006 (Output_data_expression::do_print_to_mapfile): New function.
15007 * script.cc (read_input_script): Add mapfile parameter. Change
15008 all callers.
15009 * script.h (read_input_script): Update declaration.
15010 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
15011 (Eh_frame::do_print_to_mapfile): New function.
15012 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
15013 (Output_merge_string::do_print_to_mapfile): New function.
15014 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15015 function.
15016 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15017 function.
15018 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15019 function.
15020 * Makefile.am (CCFILES): Add mapfile.cc.
15021 (HFILES): Add mapfile.h.
15022 * Makefile.in: Rebuild.
15023
9f1d377b
ILT
150242008-05-19 Ian Lance Taylor <iant@google.com>
15025
15026 * options.h (class General_options): Add -z relro.
15027 * layout.cc (Layout::Layout): Initialize relro_segment_.
15028 (Layout::add_output_section_data): Return the output section.
15029 (Layout::make_output_section): Rcognize relro sections and mark
15030 them appropriately.
15031 (Layout::attach_allocated_section_to_segment): Put relro sections
15032 in a PT_GNU_RELRO segment.
15033 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15034 section as relro.
15035 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15036 PT_TLS segments.
15037 (Layout::linkonce_mapping): Map d.rel.ro.local to
15038 .data.rel.ro.local.
15039 (Layout::output_section_name): Us .data.rel.ro.local for any
15040 section which begins with that.
15041 * layout.h (class Layout): Update add_output_section_data
15042 declaration. Add relro_segment_ field.
15043 * output.cc (Output_section::Output_section): Initialize is_relro_
15044 and is_relro_local_ fields.
15045 (Output_segment::add_output_section): Group relro sections.
15046 (Output_segment::is_first_section_relro): New function.
15047 (Output_segment::maximum_alignment): If there is a relro section,
15048 align the segment to the common page size.
15049 (Output_segment::set_section_addresses): Track whether we are
15050 looking at relro sections. If the last section is a relro
15051 section, align to the common page size.
15052 (Output_segment::set_section_list_addresses): Add in_relro
15053 parameter. Change all callers. Align to the page size when
15054 moving from relro to non-relro section.
15055 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15056 segment.
15057 * output.h (class Output_section): Add is_relro_ and
15058 is_relro_local_ fields.
15059 (Output_section::is_relro): New function.
15060 (Output_section::set_is_relro): New function.
15061 (Output_section::is_relro_local): New function.
15062 (Output_section::set_is_relro_local): New function.
15063 (class Output_segment): Update declarations.
15064 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15065 * sparc.cc (Target_sparc::got_section): Likewise.
15066 * x86_64.cc (Target_x86_64::got_section): Likewise.
15067 * testsuite/relro_test_main.cc: New file.
15068 * testsuite/relro_test.cc: New file.
15069 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15070 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15071 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15072 (relro_test.so, relro_test_pic.o): New targets.
15073 * testsuite/Makefile.in: Rebuild.
15074
a984ee1d
ILT
150752008-05-16 Ian Lance Taylor <iant@google.com>
15076
01676dcd
ILT
15077 * output.cc (Output_segment::add_output_section): Remove front
15078 parameter.
15079 * output.h (class Output_segment): Remove
15080 add_initial_output_section and overloaded add_output_section.
15081 Update declaration of remaining add_output_section.
15082 * layout.cc (Layout::create_interp): Call add_output_section
15083 rather than add_initial_output_section.
15084 (Layout::finish_dynamic_section): Likewise.
15085
497897f9
ILT
15086 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15087 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15088 know the dynamic type.
15089 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15090 field. Initialize it in constructor.
15091 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15092 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15093 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15094 reloc.
15095
a984ee1d
ILT
15096 * output.cc (Output_reloc::get_address): Change return type to
15097 Elf_Addr.
15098 * output.h (class Output_reloc): Update get_address declaration.
15099 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15100 for section addresses.
15101
55ba0940
ILT
151022008-05-09 Ian Lance Taylor <iant@google.com>
15103
15104 PR 6493
15105 * gold.cc (gold_nomem): Use return value of write.
15106
75517b77
ILT
151072008-05-08 Ian Lance Taylor <iant@google.com>
15108
15109 * symtab.c (Symbol::init_base_output_data): Add version
15110 parameter. Change all callers.
15111 (Symbol::init_base_output_segment): Likewise.
15112 (Symbol::init_base_constant): Likewise.
15113 (Symbol::init_base_undefined): Likewise.
15114 (Sized_symbol::init_output_data): Likewise.
15115 (Sized_symbol::init_output_segment): Likewise.
15116 (Sized_symbol::init_constant): Likewise.
15117 (Sized_symbol::init_undefined): Likewise.
15118 (Symbol_table::do_define_in_output_data): If the new symbol has a
15119 version, mark it as the default.
15120 (Symbol_table::do_define_in_output_segment): Likewise.
15121 (Symbol_table::do_define_as_constant): Likewise.
15122 * symtab.h (class Symbol): Update declarations.
15123 (class Sized_symbol): Likewise.
15124 * resolve.cc (Symbol::override_version): New function.
c42e122e 15125 (Symbol::override_base): Call override_version.
75517b77
ILT
15126 (Symbol::override_base_with_special): Likewise.
15127 * testsuite/ver_script_8.script: New file.
15128 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15129 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15130 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15131 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15132
f1f70eae
ILT
151332008-05-06 Ian Lance Taylor <iant@google.com>
15134
f3e9c5c5
ILT
15135 PR 6049
15136 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15137 functions.
15138 (class General_options): Remove existing --undefined, and add
15139 --no-undefined instead. Add new --undefined as synonym for -u.
15140 * archive.cc (Archive::add_symbols): Check whether symbol was
15141 named with -u.
15142 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15143 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15144 all uses. Add IS_UNDEFINED. Update declarations to split
15145 different versions of init_base. Declare init_base_undefined.
15146 (Symbol::is_defined): Handle IS_UNDEFINED.
15147 (Symbol::is_undefined): Likewise.
15148 (Symbol::is_weak_undefined): Call is_undefined.
15149 (Symbol::is_absolute): Handle IS_CONSTANT.
15150 (class Sized_symbol): Update declarations to split different
15151 versions of init. Declare init_undefined.
15152 (class Symbol_table): Declare new functions.
15153 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15154 Change all callers.
15155 (Symbol::init_base_output_data): Likewise.
15156 (Symbol::init_base_output_segment): Likewise.
15157 (Symbol::init_base_constant): Likewise.
15158 (Symbol::init_base_undefined): New function.
15159 (Sized_symbol::init_object): Rename from init. Change all
15160 callers.
15161 (Sized_symbol::init_output_data): Likewise.
15162 (Sized_symbol::init_output_segment): Likewise.
15163 (Sized_symbol::init_constant): Likewise.
15164 (Sized_symbol::init_undefined): New function.
15165 (Symbol_table::add_undefined_symbols_from_command_line): New
15166 function.
15167 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15168 function.
15169 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15170 (Symbol::output_section): Likewise.
15171 (Symbol::set_output_section): Likewise.
15172 (Symbol_table::sized_finalize_symbol): Likewise.
15173 (Symbol_table::sized_write_globals): Likewise.
15174 * resolve.cc (Symbol_table::should_override): Likewise.
15175 (Symbol::override_base_with_special): Likewise.
15176
8bdcdf2c
ILT
15177 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15178 symbol, change it to have default visibility.
15179 * testsuite/protected_1.cc: New file.
15180 * testsuite/protected_2.cc: New file.
15181 * testsuite/protected_3.cc: New file.
15182 * testsuite/protected_main_1.cc: New file.
15183 * testsuite/protected_main_2.cc: New file.
15184 * testsuite/protected_main_3.cc: New file.
15185 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15186 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15187 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15188 (protected_1.so): New target.
15189 (protected_1_pic.o, protected_2_pic.o): New targets.
15190 (protected_3_pic.o): New target.
15191 (check_PROGRAMS): Add protected_2.
15192 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15193 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15194 * testsuite/Makefile.in: Rebuild.
15195
2b706932
ILT
15196 * options.h (DEFINE_var): Add set_user_set_##varname__.
15197 (DEFINE_bool_alias): New macro.
15198 (class General_options): Define -Bstatic using DEFINE_bool_alias
15199 rather than DEFINE_special. Add --undefined as an alias for -z
15200 defs.
15201 * options.cc (General_options::parse_Bstatic): Remove.
15202
d82a5bcc
ILT
15203 * options.h (class General_options): Add --fatal-warnings.
15204 * main.cc (main): Implement --fatal-warnings.
15205 * errors.h (Errors::warning_count): New function.
15206
f1f70eae
ILT
15207 * options.h (class General_options): Add -Bsymbolic-functions.
15208 * symtab.h (Symbol::is_preemptible): Check for
15209 -Bsymbolic-functions.
15210
8825ac63
ILT
152112008-05-05 Ian Lance Taylor <iant@google.com>
15212
d98bc257
ILT
15213 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15214 as noVARNAME rather than no-VARNAME.
15215 (class General_options): Add option -z combreloc.
15216 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15217 get_address.
15218 (Output_reloc::sort_before) [SHT_REL]: New function.
15219 (Output_reloc::sort_before) [SHT_RELA]: New function.
15220 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15221 Sort_relocs_comparison.
15222 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15223 parameter. Change all callers.
15224 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15225 sort_relocs parameter. Change all callers.
15226 * output.cc (Output_reloc::get_address): New function, broken out
15227 of write_rel.
15228 (Output_reloc::write_rel): Call it.
15229 (Output_reloc::compare): New function.
15230 (Output_data_reloc_base::do_write): Optionally sort relocs.
15231
60b2b4e7
ILT
15232 * configure.ac: If targ_extra_obj is set, link it in.
15233 * configure.tgt: Initialize all variables.
15234 (x86_64*): Set targ_extra_obj and targ_extra_size.
15235 * configure: Rebuild.
15236
8825ac63
ILT
15237 * object.cc (Sized_relobj::include_section_group): Adjust section
15238 indexes read from group data. Build vector to pass to
15239 layout_group.
15240 * layout.cc (Layout::layout_group): Add flags and shndxes
15241 parameters. Remove contents parameter. Change caller. Update
15242 explicit instantiations.
15243 * layout.h (class Layout): Update layout_group declaration.
15244 * output.cc (Output_data_group::Output_data_group): Add flags and
15245 input_shndxes parameters. Remove contents parameter. Change
15246 caller.
15247 (Output_data_group::do_write): Change input_sections_ to
15248 input_shndxes_.
15249 * output.h (class Output_data_group): Update constructor
15250 declaration. Rename input_sections_ to input_shndxes_.
15251 * testsuite/many_sections_test.cc: Add template.
15252
e94cf127
CC
152532008-04-30 Cary Coutant <ccoutant@google.com>
15254
4418b2d5
CC
15255 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15256
e94cf127
CC
15257 * layout.cc (Layout::include_section): Refactored check for debug
15258 info section.
15259 (Layout::add_comdat): Add new parameters. Change type
15260 of signature parameter. Add object and shndx to signatures table.
15261 (Layout::find_kept_object): New function.
15262 * layout.h: Include <cstring>.
15263 (Layout::is_debug_info_section): New function.
15264 (Layout::add_comdat): Add new parameters.
15265 (Layout::find_kept_object): New function.
15266 (Layout::Kept_section): New struct.
15267 (Layout::Signatures): Change type of map range.
15268 * object.cc (Relobj::output_section_address): New function.
15269 (Sized_relobj::include_section_group): Add new parameters. Change
15270 calls to Layout::add_comdat. Change to build table of kept comdat
15271 groups and table mapping discarded sections to kept sections.
15272 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15273 (Sized_relobj::do_layout): Change calls to include_section_group and
15274 include_linkonce_section.
15275 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15276 value to zero when section is discarded.
15277 (Sized_relobj::map_to_kept_section): New function.
15278 * object.h (Relobj::output_section_address): New function.
15279 (Relobj::Comdat_group): New type.
15280 (Relobj::find_comdat_group): New function.
15281 (Relobj::Comdat_group_table): New type.
15282 (Relobj::Kept_comdat_section): New type.
15283 (Relobj::Kept_comdat_section_table): New type.
15284 (Relobj::add_comdat_group): New function.
15285 (Relobj::set_kept_comdat_section): New function.
15286 (Relobj::get_kept_comdat_section): New function.
15287 (Relobj::comdat_groups_): New field.
15288 (Relobj::kept_comdat_sections_): New field.
15289 (Symbol_value::input_value): Update comment.
15290 (Sized_relobj::map_to_kept_section) New function.
15291 (Sized_relobj::include_linkonce_section): Add new parameter.
15292 * target-reloc.h (Comdat_behavior): New type.
15293 (get_comdat_behavior): New function.
15294 (relocate_section): Add code to map a discarded section to the
15295 corresponding kept section when applying a relocation.
15296
e4e5049b
CS
152972008-04-30 Craig Silverstein <csilvers@google.com>
15298
15299 * dwarf_reader.cc (next_generation_count): New static var.
15300 (Addr2line_cache_entry): New struct.
15301 (addr2line_cache): New static var.
15302 (Dwarf_line_info::one_addr2line): Added caching.
15303 (Dwarf_line_info::clear_addr2line_cache): New function.
15304 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15305 cache-size parameter.
15306 (Dwarf_line_info::one_addr2line_cache): New function.
15307 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15308 new cache-size argument to one_addr2line(), and clear cache.
15309
d09e9154
CC
153102008-04-28 Cary Coutant <ccoutant@google.com>
15311
15312 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15313 R_386_PC8 relocations.
15314
7ef73768
ILT
153152008-04-23 Ian Lance Taylor <iant@google.com>
15316
55438702
ILT
15317 * object.cc (Sized_relobj::include_section_group): Check for
15318 invalid section group.
15319
c165fb93
ILT
15320 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15321 header size.
15322
7ef73768
ILT
15323 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15324 than read for file header.
15325 * archive.cc (Archive::include_member): Likewise.
15326
6194aaab
L
153272008-04-23 Paolo Bonzini <bonzini@gnu.org>
15328
15329 * aclocal.m4: Regenerate.
15330 * configure: Regenerate.
15331
d491d34e
ILT
153322008-04-19 Ian Lance Taylor <iant@google.com>
15333
5ea2bac6
ILT
15334 * version.cc (version_string): Bump to 1.6.
15335
7bc3e21a
ILT
15336 * testsuite/Makefile.am (many_sections_r_test): New target.
15337 (many_sections_r_test_SOURCES): Remove.
15338 (many_sections_r_test_DEPENDENCIES): Remove.
15339 (many_sections_r_test_LDFLAGS): Remove.
15340 (many_sections_r_test_LDADD): Remove.
15341
7fcd3aa9
ILT
15342 * object.cc (Sized_relobj::do_add_symbols): Always pass
15343 local_symbol_count_ to add_from_relobj.
15344
4c94d6ae
ILT
15345 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15346 every thousand variables.
15347 * testsuite/Makefile.in: Rebuild.
15348
d491d34e
ILT
15349 * object.cc (Xindex::initialize_symtab_xindex): New function.
15350 (Xindex::read_symtab_xindex): New function.
15351 (Xindex::sym_xindex_to_shndx): New function.
15352 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15353 available.
15354 (Sized_relobj::do_initialize_xindex): New function.
15355 (Sized_relobj::do_read_symbols): Adjust section links.
15356 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15357 parameter. Change all callers.
15358 (Sized_relobj::include_section_group): Adjust section links and
15359 symbol section indexes.
15360 (Sized_relobj::do_layout): Adjust section links.
15361 (Sized_relobj::do_count_local_symbols): Adjust section links and
15362 symbol section indexes.
15363 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15364 ordinary and special symbols.
15365 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15366 dynsym_xindex parameters. Change all callers. Adjust section
15367 links. Use SHN_XINDEX when needed.
15368 (Sized_relobj::get_symbol_location_info): Adjust section links.
15369 Don't get fooled by special symbols.
15370 * object.h (class Xindex): Define.
15371 (class Object): Add xindex_ parameter. Declare virtual functoin
15372 do_initialize_xindex.
15373 (Object::adjust_sym_shndx): New function.
15374 (Object::set_xindex): New protected function.
15375 (class Symbol_value): Add is_ordinary_shndx_ field.
15376 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15377 (Symbol_value::value): Assert ordinary section.
15378 (Symbol_value::initialize_input_to_output_map): Likewise.
15379 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15380 Change all callers.
15381 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15382 all callers.
15383 (class Sized_relobj): Update declarations.
15384 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15385 parameter. Change all callers.
15386 (Sized_relobj::adjust_shndx): New function.
15387 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15388 field.
15389 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15390 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15391 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15392 (Sized_dynobj::read_dynsym_section): Adjust section links.
15393 (Sized_dynobj::read_dynamic): Likewise.
15394 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15395 section links.
15396 (Sized_dynobj::do_initialize_xindex): New function.
15397 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15398 do_initialize_xindex.
15399 (Sized_dynobj::adjust_shndx): New function.
15400 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15401 dynsym_xindex_ fields.
15402 (Layout::finalize): Add a call to set_section_indexes before
15403 creating the symtab sections.
15404 (Layout::set_section_indexes): Don't do anything if the section
15405 already has a section index.
15406 (Layout::create_symtab_sections): Add shnum parameter. Change
15407 caller. Create .symtab_shndx section if needed.
15408 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15409 caller.
15410 (Layout::allocated_output_section_count): New function.
15411 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15412 needed.
15413 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15414 fields. Update declarations.
15415 (Layout::symtab_xindex): New function.
15416 (Layout::dynsym_xindex): New function.
15417 (class Write_symbols_task): Add layout_ field.
15418 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15419 Change caller.
15420 * output.cc (Output_section_headers::Output_section_headers): Add
15421 shstrtab_section parameter. Change all callers.
15422 (Output_section_headers::do_sized_write): Store overflow values
15423 for section count and section string table section index in
15424 section header zero.
15425 (Output_file_header::do_sized_write): Check for overflow of
15426 section count and section string table section index.
15427 (Output_symtab_xindex::do_write): New function.
15428 (Output_symtab_xindex::endian_do_write): New function.
15429 * output.h (class Output_section_headers): Add shstrtab_section_.
15430 Update declarations.
15431 (class Output_symtab_xindex): Define.
15432 (Output_section::has_out_shndx): New function.
15433 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15434 field.
15435 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15436 Change all callers.
15437 (Sized_symbol::init): Likewise.
15438 (Symbol::output_section): Check for ordinary symbol.
15439 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15440 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15441 callers.
15442 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15443 Change all callers. Simplify handling of symbols from sections
15444 not included in the link.
15445 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15446 distinction.
15447 (Weak_alias_sorter::operator()): Assert that symbols are
15448 ordinary.
15449 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15450 distinction.
15451 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15452 parameters. Change all callers.
15453 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15454 symbol distinction. Use SHN_XINDEX when needed.
15455 (Symbol_table::write_section_symbol): Add symtab_xindex
15456 parameter. Change all callers.
15457 (Symbol_table::sized_write_section_symbol): Likewise. Use
15458 SHN_XINDEX when needed.
15459 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15460 declarations.
15461 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15462 (Symbol::is_defined): Check is_ordinary.
15463 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15464 (Symbol::is_absolute, Symbol::is_common): Likewise.
15465 (class Sized_symbol): Update declarations.
15466 (class Symbol_table): Update declarations.
15467 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15468 parameters. Change all callers.
15469 (Sized_symbol::override): Likewise.
15470 (Symbol_table::override): Likewise.
15471 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15472 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15473 is_ordinary, and orig_st_shndx parameters. Change all callers.
15474 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15475 to be in an ordinary section.
15476 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15477 object and is_ordinary parameters. Change all callers.
15478 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15479 Change all callers. Don't add undefined or non-ordinary symbols
15480 to reloc_map_.
15481 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15482 Change all callers.
15483 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15484 declarations.
15485 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15486 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15487 (Sized_relobj::relocate_sections): Likewise.
15488 * target-reloc.h (scan_relocs): Adjust section symbol index.
15489 (scan_relocatable_relocs): Likewise.
15490 * i386.cc (Scan::local): Check for ordinary symbols.
15491 * sparc.cc (Scan::local): Likewise.
15492 * x86_64.cc (Scan::local): Likewise.
15493 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15494 to symbol_section_and_value.
15495 * testsuite/many_sections_test.cc: New file.
15496 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15497 (check_PROGRAMS): Add many_sections_test.
15498 (many_sections_test_SOURCES): Define.
15499 (many_sections_test_DEPENDENCIES): Define.
15500 (many_sections_test_LDFLAGS): Define.
15501 (BUILT_SOURCES): Add many_sections_define.h.
15502 (many_sections_define.h): New target.
15503 (BUILT_SOURCES): Add many_sections_check.h.
15504 (many_sections_check.h): New target.
15505 (check_PROGRAMS): Add many_sections_r_test.
15506 (many_sections_r_test_SOURCES): Define.
15507 (many_sections_r_test_DEPENDENCIES): Define.
15508 (many_sections_r_test_LDFLAGS): Define.
15509 (many_sections_r_test_LDADD): Define.
15510 (many_sections_r_test.o): New target.
15511 * testsuite/Makefile.in: Rebuild.
15512
c5818ff1
CC
155132008-04-17 Cary Coutant <ccoutant@google.com>
15514
15515 * errors.cc (Errors::info): New function.
15516 (gold_info): New function.
15517 * errors.h (Errors::info): New function.
15518 * gold.h (gold_info): New function.
15519 * object.cc (Input_objects::add_object): Print trace output.
15520 * options.cc (options::parse_set): New function.
15521 (General_options::parse_wrap): Deleted.
15522 (General_options::General_options): Deleted initializer.
15523 * options.h (options::String_set): New typedef.
15524 (options::parse_set): New function.
15525 (DEFINE_set): New macro.
15526 (General_options::wrap): Changed to use DEFINE_set. Changed
15527 callers of any_wrap_symbols and is_wrap_symbol.
15528 (General_options::trace, General_options::trace_symbol):
15529 New options.
15530 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15531 (General_options::wrap_symbols_): Deleted.
15532 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15533
b5be4a7c
DM
155342008-04-17 David S. Miller <davem@davemloft.net>
15535
15536 * options.cc (General_options::parse_V): New function.
15537 * options.h: Add entries for -V and -Qy.
15538
155a0dd7
ILT
155392008-04-17 Ian Lance Taylor <iant@google.com>
15540
15541 * common.cc (Symbol_table::allocate_commons): Remove options
15542 parameter. Change caller.
15543 (Symbol_table::do_allocate_commons): Remove options parameter.
15544 Change caller. Just call do_allocate_commons_list twice.
15545 (Symbol_table::do_allocate_commons_list): New function, broken out
15546 of do_allocate_commons.
15547 * common.h (class Allocate_commons_task): Remove options_ field.
15548 Update constructor.
15549 * symtab.cc (Symbol_table::Symbol_table): Initialize
15550 tls_commons_.
15551 (Symbol_table::add_from_object): Put TLS common symbols on
15552 tls_commons_ list.
15553 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15554 which are IN_OUTPUT_DATA.
15555 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15556 allocate_commons and do_allocate_commons declarations. Declare
15557 do_allocate_commons_list.
15558 * gold.cc (queue_middle_tasks): Update creation of
15559 Allocate_commons_task to not pass options.
15560 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15561 (TLS_TEST_C_FLAGS): New variable.
15562 (tls_test_c_pic.o): New target.
15563 (tls_test_shared.so): Link in tls_test_c_pic.o.
15564 (tls_test_c_pic_ie.o): New target.
15565 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15566 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15567 (tls_test_c.o): New target.
15568 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15569 (tls_pic_test_LDADD): Likewise.
15570 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15571 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15572 (tls_test_c_gnu2.o): New target.
15573 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15574 tls_test_c_gnu2.o.
15575 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15576 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15577 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15578 * testsuite/tls_test.cc: Include "config.h".
15579 (t_last): Call t11_last.
15580 * testsuite/tls_test.h (t11, t11_last): Declare.
15581 * testsuite/tls_test_c.c: New file.
15582 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15583 * configure.ac: Check for OpenMP support.
15584 * configure, config.in, Makefile.in: Rebuild.
15585 * testsuite/Makefile.in: Rebuild.
15586
edfbb029
CC
155872008-04-16 Cary Coutant <ccoutant@google.com>
15588
15589 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15590 (Target_i386::tls_base_symbol_defined_): New field.
15591 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15592 (Target_i386::Scan::global): Likewise.
15593 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15594 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15595 (Target_x86_64::tls_base_symbol_defined_): New field.
15596 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15597 (Target_x86_64::Scan::global): Likewise.
15598
f3c69fca
CC
155992008-04-16 Cary Coutant <ccoutant@google.com>
15600
15601 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15602 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15603 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15604 building shared libraries.
15605 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15606 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15607 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15608 * testsuite/Makefile.in: Rebuild.
15609 * testsuite/weak_undef.h: New file.
15610 * testsuite/weak_undef_file1.cc: Add extra test cases.
15611 * testsuite/weak_undef_file2.cc: Likewise.
15612 * testsuite/weak_undef_test.cc: Likewise.
15613
7c414435
DM
156142008-04-16 David S. Miller <davem@davemloft.net>
15615
32b769e1
DM
15616 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15617 Add issued_non_pic_error_ field. Declare check_non_pic.
15618 (Target_sparc::Scan::check_non_pic): New function.
15619 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15620 (Target_sparc::Scan::global): Likewise.
15621
11936fb1
DM
15622 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15623 * configure: Rebuild.
15624
7c414435
DM
15625 * options.h (DEFINE_enable): New macro.
15626 (new_dtags): New enable option.
15627 (initfirst, interpose, loadfltr, nodefaultlib,
15628 nodelete, nodlopen, nodump): New -z options.
15629 * layout.cc (Layout:finish_dynamic_section): If new
15630 dtags enabled, emit DT_RUNPATH. Also, emit a
15631 DT_FLAGS_1 containing any specified -z flags.
15632
85c7bf8b
ILT
156332008-04-16 Ian Lance Taylor <iant@google.com>
15634
12c0daef
ILT
15635 * copy-relocs.cc: New file.
15636 * copy-relocs.h: New file.
15637 * reloc.cc: Remove Copy_relocs code.
15638 * reloc.h: Likewise.
15639 * reloc-types.h (struct Reloc_types) [both versions]: Add
15640 get_reloc_addend_noerror.
15641 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15642 variants of add_global which take an addend which must be zero.
15643 * i386.cc: Include "copy-relocs.h".
15644 (class Target_i386): Change type of copy_relocs_ to variable,
15645 update initializer.
15646 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15647 Change all callers.
15648 (Target_i386::do_finalize_sections): Change handling of
15649 copy_relocs_.
15650 * sparc.cc: Include "copy-relocs.h".
15651 (class Target_sparc): Change type of copy_relocs_ to variable,
15652 update initializer.
15653 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15654 Change all callers.
15655 (Target_sparc::do_finalize_sections): Change handling of
15656 copy_relocs_.
15657 * x86_64.cc: Include "copy-relocs.h".
15658 (class Target_x86_64): Change type of copy_relocs_ to variable,
15659 update initializer.
15660 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15661 class. Change all callers.
15662 (Target_x86_64::do_finalize_sections): Change handling of
15663 copy_relocs_.
15664 * Makefile.am (CCFILES): Add copy-relocs.cc.
15665 (HFILES): Add copy-relocs.h.
15666
4f4995b6
ILT
15667 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15668
85c7bf8b
ILT
15669 * testsuite/script_test_4.sh: Permit leading zeroes.
15670
4f2a9edd
ILT
156712008-04-15 Ian Lance Taylor <iant@google.com>
15672
e6188289
ILT
15673 * script-sections.cc (Script_sections::create_segments): Use
15674 header_size_adjustment even when there is enough room for the
15675 headers.
15676 * testsuite/script_test_4.sh: New file.
15677 * testsuite/script_test_4.t: New file.
15678 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15679 (check_DATA): Add script_test_4.stdout.
15680 (MOSTLYCLEANFILES): Likewise.
15681 (script_test_4): New target.
15682 (script_test_4.stdout): New target.
15683 * testsuite/Makefile.in: Rebuild.
15684
4f2a9edd
ILT
15685 * sparc.cc: Add definitions for Output_data_plt_sparc class
15686 constants.
15687
f5314dd5
DM
156882008-04-14 David S. Miller <davem@davemloft.net>
15689
15690 * sparc.cc: New file.
15691 * Makefile.am (TARGETSOURCES): Add sparc.cc
15692 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15693 * configure.tgt: Document targ_extra_size and
15694 targ_extra_big_endian. Add entries for sparc-* and
15695 sparc64-*.
15696 * configure.ac: Handle targ_extra_size and
15697 targ_extra_big_endian.
15698 * Makefile.in: Rebuild.
15699 * configure: Likewise.
15700 * po/POTFILES.in: Likewise.
15701 * po/gold.pot: Likewise.
15702
154e0e9a
ILT
157032008-04-14 Ian Lance Taylor <iant@google.com>
15704
15705 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15706 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15707 in the name/type/flags to section mapping. Don't call
15708 allocate_output_section.
15709 (Layout::choose_output_section): Change parameter from adjust_name
15710 to is_input_section. Don't permit input sections after sections
15711 are attached to segments. Don't call allocate_output_section.
15712 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15713 not write_enable_output_section.
15714 (Layout::make_output_section): Don't push to
15715 unattached_section_list_ nor call attach_to_segment. Call
15716 attach_section_to_segment if sections are attached.
15717 (Layout::attach_sections_to_segments): New function.
15718 (Layout::attach_section_to_segment): New function.
15719 (Layout::attach_allocated_section_to_segment): Rename from
15720 attach_to_segment. Remove flags parameter.
15721 (Layout::allocate_output_section): Remove function.
15722 (Layout::write_enable_output_section): Remove function.
15723 * layout.h (class Layout): Update for above changes. Add new
15724 field sections_are_attached_.
15725 * output.h (Output_section::update_flags_for_input_section): New
15726 function.
15727 * output.cc (Output_section::add_input_section): Call
15728 update_flags_for_input_section.
15729 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15730
009a67a2
CC
157312008-04-11 Cary Coutant <ccoutant@google.com>
15732
15733 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15734 thought unnecessary.
15735 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15736
759b1a24
ILT
157372008-04-11 Ian Lance Taylor <iant@google.com>
15738
15739 * output.h (class Output_section_data): Remove inline definition
15740 of set_addralign.
15741 * output.cc (Output_section_data::set_addralign): New function.
15742
c2b45e22
CC
157432008-04-11 Cary Coutant <ccoutant@google.com>
15744
15745 Add support for TLS descriptors for i386 and x86_64.
15746 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15747 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15748 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15749 GOT_TYPE_TLS_DESC.
15750 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15751 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15752 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15753 relocations.
15754 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15755 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15756 Fix problem with initial-exec relocations.
15757 (Target_i386::Relocate::relocate_tls): Likewise.
15758 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15759 relaxation.
15760 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15761 support for section-plus-offset dynamic table entries.
15762 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15763 (Output_data_dynamic::Dynamic_entry): Add support for
15764 section-plus-offset dynamic table entries.
15765 (Output_data_dynamic::Classification): Likewise.
15766 (Output_data_dynamic::classification_): Renamed offset_.
15767 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15768 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15769 (Target_x86_64::make_plt_section): New function.
15770 (Target_x86_64::reserve_tlsdesc_entries): New function.
15771 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15772 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15773 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15774 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15775 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15776 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15777 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15778 add extra PLT entry for TLS descriptors.
15779 (Output_data_plt_x86_64::got_): New field.
15780 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15781 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15782 fields.
15783 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15784 descriptors.
15785 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15786 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15787 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15788 R_386_TLS_DESC_CALL relocations.
15789 (Target_x86_64::Scan::global): Likewise.
15790 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15791 for TLS descriptors.
15792 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15793 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15794 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15795 GD-to-IE relaxation.
15796 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15797 and TLS_DESCRIPTORS.
15798 * Makefile.in: Rebuild.
15799 * configure: Rebuild.
15800 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15801 (tls_test_shared2.so): New target.
15802 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15803 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15804 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15805 (tls_shared_gd_to_ie_test_LDADD): New variable.
15806 (tls_shared_gnu2_gd_to_ie_test): New target.
15807 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15808 New targets.
15809 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15810 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15811 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15812 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15813 (tls_shared_gnu2_test): New target.
15814 (tls_test_gnu2_shared.so): New target.
15815 (tls_shared_gnu2_test_SOURCES): New variable.
15816 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15817 (tls_shared_gnu2_test_LDFLAGS): New variable.
15818 (tls_shared_gnu2_test_LDADD): New variable.
15819 * testsuite/Makefile.in: Rebuild.
15820 * testsuite/Makefile.
15821
83bfb6b7
ILT
158222008-04-11 Ian Lance Taylor <iant@google.com>
15823
15824 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15825 justsyms.t.
15826 * testsuite/Makefile.in: Rebuild.
15827
15828 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15829 long.
15830 * testsuite/script_test_2.cc (main): Adjust test.
15831
706e1f5e
ILT
158322008-04-11 David S. Miller <davem@davemloft.net>
15833 Ian Lance Taylor <iant@google.com>
15834
15835 * options.h (General_options): Add entries for '-Y' and
15836 '-relax'.
15837 * options.cc (General_options:finalize): If -Y was used, add those
15838 entries to the library path instead of the default "/lib" and
15839 "/usr/lib".
15840
7c98e6bb
DM
158412008-04-11 David S. Miller <davem@davemloft.net>
15842
15843 * testsuite/justsyms.t: Start at 0x100.
15844 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15845 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15846 long.
15847 * testsuite/script_test_2.cc: Adjust string and section length
15848 checks.
7c98e6bb 15849
99a37bfd
ILT
158502008-04-09 Ian Lance Taylor <iant@google.com>
15851
2cefc357
ILT
15852 PR gold/5996
15853 * script-sections.cc (Sections_element::allocate_to_segment): Add
15854 orphan parameter.
15855 (Output_section_definition::allocate_to_segment): Likewise.
15856 (Orphan_output_section::allocate_to_segment): Likewise.
15857 (Script_sections::attach_sections_using_phdrs_clause): Don't
15858 propagate non-PT_LOAD segments to orphan sections.
15859 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15860 readelf rather than objdump.
15861 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15862 .interp section and PT_INTERP segment are the same size.
15863 * testsuite/Makefile.in: Rebuild.
15864
99a37bfd
ILT
15865 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15866 aliases for symbols defined in the same object.
15867 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15868 (weak_alias_test_SOURCES): New variable.
15869 (weak_alias_test_DEPENDENCIES): New variable.
15870 (weak_alias_test_LDFLAGS): New variable.
15871 (weak_alias_test_LDADD): New variable.
15872 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15873 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15874 (weak_alias_test_3.o): New target.
15875 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15876 * testsuite/weak_alias_test_main.cc: New file.
15877 * testsuite/weak_alias_test_1.cc: New file.
15878 * testsuite/weak_alias_test_2.cc: New file.
15879 * testsuite/weak_alias_test_3.cc: New file.
15880
780e49c5
ILT
158812008-04-08 Ian Lance Taylor <iant@google.com>
15882
cdb0b8f5
ILT
15883 * options.h (class General_options): Add --noinhibit-exec option.
15884 * main.cc (main): Check --noinhibit-exec.
15885
0864d551
ILT
15886 * options.h (class General_options): Define --wrap as a special
15887 option. Add wrap_symbols_ field.
15888 (General_options::any_wrap_symbols): New function.
15889 (General_options::is_wrap_symbol): New function.
15890 * options.cc (General_options::parse_wrap): New function.
15891 (General_options::General_options): Initialize wrap_symbols_.
15892 * symtab.cc (Symbol_table::wrap_symbol): New function.
15893 (Symbol_table::add_from_object): Handle --wrap.
15894 * symtab.h (class Symbol_table): Declare wrap_symbol.
15895 * target.h (Target::wrap_char): New function.
15896 (Target::Target_info): Add wrap_char field.
15897 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15898 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15899 * testsuite/testfile.cc (Target_test::test_target_info):
15900 Likewise.
15901
789aa6de
ILT
15902 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15903 there is one.
15904
2c38906f
ILT
15905 * layout.h (class Layout): Add added_eh_frame_data_ field.
15906 * layout.cc (Layout::Layout): Initialize new field.
15907 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15908 output section until we find a section we merged successfully.
15909 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15910 that the size be non-zero.
15911
780e49c5
ILT
15912 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15913 qualifier.
15914
7fcd0256
ILT
159152008-04-08 Craig Silverstein <csilvers@google.com>
15916
15917 * configure.ac: Export new conditional variable HAVE_ZLIB.
15918 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15919 on HAVE_ZLIB.
15920 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15921 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15922
6835af53
ILT
159232008-04-07 Ian Lance Taylor <iant@google.com>
15924
e24f324c
ILT
15925 * version.cc (version_string): Set to "1.5".
15926
a036edd8
ILT
15927 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15928 Add issued_non_pic_error_ field. Declare check_non_pic.
15929 (Target_x86_64::Scan::check_non_pic): New function.
15930 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15931 (Target_x86_64::Scan::global): Likewise.
15932
624f8810
ILT
15933 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15934 addend parameter. Change caller. Handle merge sections.
15935 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15936 Address to Addend. Don't add in the result of
15937 local_section_offset, pass down the addend and use the returned
15938 value.
15939 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15940 Update declarations of local_section_offset and symbol_value.
15941 * testsuite/two_file_test_1.cc (t18): New function.
15942 * testsuite/two_file_test_2.cc (f18): New function.
15943 * testsuite/two_file_test_main.cc (main): Call t18.
15944 * testsuite/two_file_test.h (t18, f18): Declare.
15945
6835af53
ILT
15946 * configure.ac: Don't test for objdump, c++filt, or readelf.
15947 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15948 conditionals.
15949 (TEST_READELF): New variable.
15950 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15951 (check_PROGRAMS): Add two_file_strip_test.
15952 (two_file_strip_test): New target.
15953 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15954 (two_file_same_shared_strip_test_SOURCES): New variable.
15955 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15956 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15957 (two_file_same_shared_strip_test_LDADD): New variable.
15958 (two_file_shared_strip.so): New target.
15959 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15960 (ver_test_5.syms, ver_test_7.syms): Likewise.
15961 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15962 (strip_test_3.stdout): Use TEST_OBJDUMP.
15963 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15964
86925eef
CC
159652008-04-04 Cary Coutant <ccoutant@google.com>
15966
15967 * symtab.h (Symbol::is_weak_undefined): New function.
15968 (Symbol::is_strong_undefined): New function.
15969 (Symbol::is_absolute): New function.
15970 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15971 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15972 absolute symbols.
15973 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15974 (weak_undef_test): New target.
15975 * testsuite/Makefile.in: Rebuild.
15976 * testsuite/weak_undef_file1.cc: New file.
15977 * testsuite/weak_undef_file2.cc: New file.
15978 * testsuite/weak_undef_test.cc: New file.
15979
126f3ece
ILT
159802008-04-03 Craig Silverstein <csilvers@google.com>
15981
15982 * compressed_output.h (class Output_compressed_section): Use
15983 unsigned buffer.
15984 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15985 add zlib header.
15986 (zlib_compressed_suffix): Removed.
15987 (Output_compressed_section::set_final_data_size): Use unsigned
15988 buffers.
15989 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15990 Fix linker invocation.
15991 (flagstest_o_specialfile_and_compress_debug_sections):
15992 Likewise.
15993 * testsuite/Makefile.in: Regenerated.
15994
deae2a14
DM
159952008-04-02 David S. Miller <davem@davemloft.net>
15996
15997 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15998 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15999
70752818
ILT
160002008-04-02 Craig Silverstein <csilvers@google.com>
16001
16002 * TODO: New file.
16003
39d0cb0e
ILT
160042008-04-02 Ian Lance Taylor <iant@google.com>
16005
16006 * fileread.cc (File_read::find_view): Add byteshift and vshifted
16007 parameters. Update for new key type to views_. Change all
16008 callers.
16009 (File_read::read): Adjust for byteshift in returned view.
16010 (File_read::add_view): New function, broken out of
16011 find_and_make_view.
16012 (File_read::make_view): New function, broken out of
16013 find_and_make_view.
16014 (File_read::find_or_make_view): Add offset and aligned
16015 parameters. Rewrite accordingly. Change all callers.
16016 (File_read::get_view): Add offset and aligned parameters. Adjust
16017 for byteshift in return value.
16018 (File_read::get_lasting_view): Likewise.
16019 * fileread.h (class File_read): Update declarations.
16020 (class File_read::View): Add byteshift_ field. Add byteshift to
16021 constructor. Add byteshift method.
16022 * archive.h (Archive::clear_uncached_views): New function.
16023 (Archive::get_view): Add aligned parameter. Change all callers.
16024 * object.h (Object::get_view): Add aligned parameter. Change all
16025 callers.
16026 (Object::get_lasting_view): Likewise.
16027
16028 * fileread.cc (File_read::release): Don't call clear_views if
16029 there are multiple objects.
16030 * fileread.h (File_read::clear_uncached_views): New function.
16031 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16032 on the archive.
16033
a1207466
CC
160342008-03-31 Cary Coutant <ccoutant@google.com>
16035
16036 Add thin archive support.
16037 * archive.cc (Archive::armagt): New const.
16038 (Archive::setup): Remove task parameter and calls to unlock.
16039 (Archive::unlock_nested_archives): New function.
16040 (Archive::read_header): Add nested_off parameter. Change
16041 all callers.
16042 (Archive::interpret_header): Likewise.
16043 (Archive::include_all_members): Change to handle thin
16044 archives.
16045 (Archive::include_member): Likewise.
16046 * archive.h (Archive::Archive): Add new parameters and
16047 initializers.
16048 (Archive::armagt): New const.
16049 (Archive::setup): Remove task parameter.
16050 (Archive::unlock_nested_archives): New function.
16051 (Archive::read_header): Add nested_off parameter.
16052 (Archive::interpret_header): Likewise.
16053 (Archive::Nested_archive_table): New typedef.
16054 (Archive::is_thin_archive_): New field.
16055 (Archive::nested_archives_): New field.
16056 (Archive::options_): New field.
16057 (Archive::dirpath_): New field.
16058 (Archive::task_): New field.
16059 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16060 for thin archives. Pass additional parameters to
16061 Archive::Archive. Unlock the archive file after calling
16062 Archive::setup.
cd536b21 16063
479f6503
ILT
160642008-03-29 Ian Lance Taylor <iant@google.com>
16065
686c8caf
ILT
16066 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16067 version symbol to be local.
16068 * testsuite/ver_test_4.sh: New file.
16069 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16070 (check_DATA): Add ver_test_4.syms.
16071 (ver_test_4.syms): New target.
16072 * testsuite/Makefile.in: Rebuild.
16073
ab794b6b
ILT
16074 * output.cc
16075 (Output_section::Input_section_sort_entry::has_priority): New
16076 function.
16077 (Output_section::Input_section_sort_entry::match_file_name): New
16078 function.
16079 (Output_section::Input_section_sort_entry::match_section_name):
16080 Remove.
16081 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16082 Remove.
16083 (Output_section::Input_section_sort_entry::match_section_file):
16084 Remove.
16085 (Output_section::Input_section_sort_compare::operator()): Rewrite
16086 using new Input_section_sort_entry functions. Sort crtbegin and
16087 crtend first. Sort sections with no priority before sections with
16088 a priority.
16089 * testsuite/initpri1.c (d3): Check j != 4.
16090 (cd5): New constructor/destructor function.
16091 (main): Check j != 2.
16092
479f6503
ILT
16093 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16094 new symbol when resolving, don't call set_is_default.
16095 * testsuite/ver_test_7.cc: New file.
16096 * testsuite/ver_test_7.sh: New file.
16097 * testsuite/Makefile.am (ver_test_7.so): New target.
16098 (ver_test_7.o): New target.
16099 (check_SCRIPTS): Add ver_test_7.sh.
16100 (check_DATA): Add ver_test_7.syms.
16101 (ver_test_7.syms): New target.
16102
2fd32231
ILT
161032008-03-28 Ian Lance Taylor <iant@google.com>
16104
16105 * layout.cc (Layout::layout): If we see an input section with a
16106 name that needs sorting, set the must_sort flag for the output
16107 section.
16108 (Layout::make_output_section): If the name of the output section
16109 indicates that it might require sorting, set the may_sort flag.
16110 * output.h (Output_section::may_sort_attached_input_sections): New
16111 function.
16112 (Output_section::set_may_sort_attached_input_sections): New
16113 function.
16114 (Output_section::must_sort_attached_input_sections): New
16115 function.
16116 (Output_section::set_must_sort_attached_input_sections): New
16117 function.
16118 (class Output_section): Declare Input_section_sort_entry. Define
16119 Input_section_sort_compare. Declare
16120 sort_attached_input_sections. Add new fields:
16121 may_sort_attached_input_sections_,
16122 must_sort_attached_input_sections_,
16123 attached_input_sections_are_sorted_.
16124 * output.cc (Output_section::Output_section): Initialize new
16125 fields.
16126 (Output_section::add_input_section): Add an entry to
16127 input_sections_ if may_sort or must_sort are true.
16128 (Output_section::set_final_data_size): Call
16129 sort_attached_input_sections if necessary.
16130 (Output_section::Input_section_sort_entry): Define new class.
16131 (Output_section::Input_section_sort_compare::operator()): New
16132 function.
16133 (Output_section::sort_attached_input_sections): New function.
16134 * configure.ac: Check whether the compiler supports constructor
16135 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16136 * testsuite/initpri1.c: New file.
16137 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16138 CONSTRUCTOR_PRIORITY.
16139 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16140 (initpri1_LDFLAGS): New variable.
16141 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16142
18e6b24e
ILT
161432008-03-27 Ian Lance Taylor <iant@google.com>
16144
49bdd526
ILT
16145 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16146 * testsuite/common_test_1.c: New file.
16147 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16148 (common_test_1_SOURCES): New variable.
16149 (common_test_1_DEPENDENCIES): New variable.
16150 (common_test_1_LDFLAGS): New variable.
16151
18e6b24e
ILT
16152 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16153 and commons_ correctly when NAME/VERSION does not override
16154 NAME/NULL.
16155 * testsuite/ver_test_6.c: New file.
16156 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16157 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16158 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16159
04bf7072
ILT
161602008-03-26 Ian Lance Taylor <iant@google.com>
16161
5871526f
ILT
16162 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16163 of an undefined symbol from a version script.
16164 * testsuite/Makefile.am (ver_test_5.so): New target.
16165 (ver_test_5.o): New target.
16166 (check_SCRIPTS): Add ver_test_5.sh.
16167 (check_DATA): Add ver_test_5.syms.
16168 (ver_test_5.syms): New target.
16169 * testsuite/ver_test_5.cc: New file.
16170 * testsuite/ver_test_5.script: New file.
16171 * testsuite/ver_test_5.sh: New file.
16172 * Makefile.in, testsuite/Makefile.in: Rebuild.
16173
04bf7072
ILT
16174 PR gold/5986
16175 Fix problems building gold with gcc 4.3.0.
16176 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16177 (gold_error_at_location, gold_warning_at_location): Use it.
16178 * configure.ac: Check whether we can compile and use a template
16179 function with a printf attribute.
16180 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16181 when jumping over bytes.
16182 * object.cc: Instantiate Object::read_section_data.
16183 * debug.h: Include <cstring>
16184 * dwarf_reader.cc: Include <algorithm>
16185 * main.cc: Include <cstring>.
16186 * options.cc: Include <cstring>.
16187 * output.cc: Include <cstring>.
16188 * script.cc: Include <cstring>.
16189 * script.h: Include <string>.
16190 * symtab.cc: Include <cstring> and <algorithm>.
16191 * target-select.cc: Include <cstring>.
16192 * version.cc: Include <string>.
16193 * testsuite/testmain.cc: Include <cstdlib>.
16194 * configure, config.in: Rebuild.
16195
874c5b28
ILT
161962008-03-25 Ian Lance Taylor <iant@google.com>
16197
819d6c3a
ILT
16198 * options.cc: Include "../bfd/bfdver.h".
16199 (options::help): Print bug reporting address.
16200
f4b2c6f5
ILT
16201 * version.cc (print_version): Adjust output for current value of
16202 BFD_VERSION_STRING.
16203
16204 * NEWS: New file.
16205
e96caa79
ILT
16206 * options.cc (options::help): Print list of supported targets.
16207 * target-select.h: Include <vector>.
16208 (class Target_selector): Make machine_, size_, and is_big_endian_
16209 fields const. Add bfd_name_ and instantiated_target_ fields.
16210 (Target_selector::Target_selector): Add bfd_name parameter.
16211 (Target_selector::recognize): Make non-virtual, call
16212 do_recognize.
16213 (Target_selector::recognize_by_name): Make non-virtual, call
16214 do_recognize_by_name.
16215 (Target_selector::supported_names): New function.
16216 (Target_selector::bfd_name): New function.
16217 (Target_selector::do_instantiate_target): New pure virtual
16218 function.
16219 (Target_selector::do_recognize): New virtual function.
16220 (Target_selector::do_recognize_by_name): New virtual function.
16221 (Target_selector::instantiate_target): New private function.
16222 (supported_target_names): Declare.
16223 * target-select.cc (Target_selector::Target_selector): Update for
16224 new parameter and fields.
16225 (select_target_by_name): Check that the name matches before
16226 calling recognize_by_name.
16227 (supported_target_names): New function.
16228 * i386.cc (class Target_selector_i386): Update Target_selector
16229 constructor call. Remove recognize and recognize_by_name. Add
16230 do_instantiate_target.
16231 * x86_64.cc (class Target_selector_x86_64): Likewise.
16232 * testsuite/testfile.cc (class Target_selector_test): Update for
16233 changes to Target_selector.
16234
874c5b28
ILT
16235 * README: Rewrite, with some notes on unsupported features.
16236
0a65a3a7
CC
162372008-03-24 Cary Coutant <ccoutant@google.com>
16238
16239 * i386.cc (Target_i386::Got_type): New enum declaration.
16240 (Target_i386::Scan::local): Updated callers of Output_data_got
16241 member functions.
16242 (Target_i386::Scan::global): Likewise.
16243 (Target_i386::Relocate::relocate): Likewise.
16244 (Target_i386::Relocate::relocate_tls): Likewise.
16245 * object.h (Got_offset_list): New class.
16246 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16247 (Sized_relobj::local_got_offset): Likewise.
16248 (Sized_relobj::set_local_got_offset): Likewise.
16249 (Sized_relobj::local_has_tls_got_offset): Removed.
16250 (Sized_relobj::local_tls_got_offset): Removed.
16251 (Sized_relobj::set_local_tls_got_offset): Removed.
16252 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16253 * output.cc (Output_data_got::add_global): Added got_type parameter.
16254 (Output_data_got::add_global_with_rel): Likewise.
16255 (Output_data_got::add_global_with_rela): Likewise.
16256 (Output_data_got::add_global_pair_with_rel): New function.
16257 (Output_data_got::add_global_pair_with_rela): New function.
16258 (Output_data_got::add_local): Added got_type parameter.
16259 (Output_data_got::add_local_with_rel): Likewise.
16260 (Output_data_got::add_local_with_rela): Likewise.
16261 (Output_data_got::add_local_pair_with_rel): New function.
16262 (Output_data_got::add_local_pair_with_rela): New function.
16263 (Output_data_got::add_global_tls): Removed.
16264 (Output_data_got::add_global_tls_with_rel): Removed.
16265 (Output_data_got::add_global_tls_with_rela): Removed.
16266 (Output_data_got::add_local_tls): Removed.
16267 (Output_data_got::add_local_tls_with_rel): Removed.
16268 (Output_data_got::add_local_tls_with_rela): Removed.
16269 * output.h (Output_data_got::add_global): Added got_type parameter.
16270 (Output_data_got::add_global_with_rel): Likewise.
16271 (Output_data_got::add_global_with_rela): Likewise.
16272 (Output_data_got::add_global_pair_with_rel): New function.
16273 (Output_data_got::add_global_pair_with_rela): New function.
16274 (Output_data_got::add_local): Added got_type parameter.
16275 (Output_data_got::add_local_with_rel): Likewise.
16276 (Output_data_got::add_local_with_rela): Likewise.
16277 (Output_data_got::add_local_pair_with_rel): New function.
16278 (Output_data_got::add_local_pair_with_rela): New function.
16279 (Output_data_got::add_global_tls): Removed.
16280 (Output_data_got::add_global_tls_with_rel): Removed.
16281 (Output_data_got::add_global_tls_with_rela): Removed.
16282 (Output_data_got::add_local_tls): Removed.
16283 (Output_data_got::add_local_tls_with_rel): Removed.
16284 (Output_data_got::add_local_tls_with_rela): Removed.
16285 * resolve.cc (Symbol::override_base_with_special): Removed
16286 reference to has_got_offset_ field.
16287 * symtab.cc (Symbol::init_fields): Replaced initialization
16288 of got_offset_ with got_offsets_. Removed initialization
16289 of has_got_offset_
53fcba31 16290 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16291 (Symbol::got_offset): Likewise.
16292 (Symbol::set_got_offset): Likewise.
16293 (Symbol::has_tls_got_offset): Removed.
16294 (Symbol::tls_got_offset): Removed.
16295 (Symbol::set_tls_got_offset): Removed.
16296 (Symbol::got_offset_): Removed.
16297 (Symbol::tls_mod_got_offset_): Removed.
16298 (Symbol::tls_pair_got_offset_): Removed.
16299 (Symbol::got_offsets_): New field.
16300 (Symbol::has_got_offset): Removed.
16301 (Symbol::has_tls_mod_got_offset): Removed.
16302 (Symbol::has_tls_pair_got_offset): Removed.
16303 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16304 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16305 member functions.
16306 (Target_x86_64::Scan::global): Likewise.
16307 (Target_x86_64::Relocate::relocate): Likewise.
16308 (Target_x86_64::Relocate::relocate_tls): Likewise.
16309
bd52eafb
BE
163102008-03-25 Ben Elliston <bje@au.ibm.com>
16311
16312 * yyscript.y: Fix spelling error in comment.
16313
8b105e34
ILT
163142008-03-24 Ian Lance Taylor <iant@google.com>
16315
8ed814a9
ILT
16316 * options.h (class General_options): Define build_id option.
16317 * layout.h (class Layout): Declare write_build_id, create_note,
16318 create_build_id. Add build_id_note_ member.
16319 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16320 "libiberty.h", "md5.h", "sha1.h".
16321 (Layout::Layout): Initialize eh_frame_data_,
16322 eh_frame_hdr_section_, and build_id_note_.
16323 (Layout::finalize): Call create_build_id.
16324 (Layout::create_note): New function, broken out of
16325 Layout::create_gold_note.
16326 (Layout::create_gold_note): Call create_note.
16327 (Layout::create_build_id): New function.
16328 (Layout::write_build_id): New function.
16329 (Close_task_runner::run): Call write_build_id.
16330
8b105e34
ILT
16331 * x86_64.cc: Correct license to GPLv3.
16332
086a1841
ILT
163332008-03-23 Ian Lance Taylor <iant@google.com>
16334
16335 * options.cc: Include "demangle.h".
16336 (parse_optional_string): New function.
16337 (parse_long_option): Handle takes_optional_argument.
16338 (parse_short_option): Update dash_z initializer. Handle
16339 takes_optional_argument.
16340 (General_options::General_options): Initialize do_demangle_.
16341 (General_options::finalize): Set do_demangle_. Handle demangling
16342 style.
16343 * options.h (parse_optional_string): Declare.
16344 (struct One_option): Add optional_arg field. Update constructor.
16345 Update call constructor calls. Add takes_optional_argument
16346 function.
16347 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16348 (DEFINE_optional_string): Define.
16349 (General_options::demangle): Change from DEFINE_bool to
16350 DEFINE_optional_string.
16351 (General_options::no_demangle): New function.
16352 (General_options::do_demangle): New function.
16353 (General_options::set_do_demangle): New function.
16354 (General_options::execstack_status_): Move definition to end of
16355 class definition.
16356 (General_options::static_): Likewise.
16357 (General_options::do_demangle_): New field.
16358 * object.cc (big_endian>::get_symbol_location_info): Call
16359 Options::do_demangle, not Options::demangle.
16360 * symtab.cc (demangle): Likewise.
16361
cbb93e63
ILT
163622008-03-22 Ian Lance Taylor <iant@google.com>
16363
16364 * gold.h: Include <cstddef> and <sys/types.h>
16365 * options.h: Include <cstring>.
16366
ec531623
ILT
163672008-03-21 Ian Lance Taylor <iant@google.com>
16368
16369 * Added source code to GNU binutils.
752937aa 16370\f
4b95cf5c 16371Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16372
16373Copying and distribution of this file, with or without modification,
16374are permitted in any medium without royalty provided the copyright
16375notice and this notice are preserved.
16376
16377Local Variables:
16378mode: change-log
16379left-margin: 8
16380fill-column: 74
16381version-control: never
16382End:
This page took 1.129306 seconds and 4 git commands to generate.