gdb/testsuite/
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c9824451
AM
12012-10-05 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
4 do_plt_address_for_global): New functions.
5 (Output_data_got_powerpc::do_write): Don't segfault when linking
6 statically.
7 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
8 add_local_ifunc_entry): Return true on adding entry..
9 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
10 glink->add_entry call. Remove unused symtab param. Adjust calls.
11 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
12 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
13 set up symbols here.
14 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
15 syms here. Do so even when no .iplt. Don't segfault when linking
16 statically.
17 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
18 new variants without reloc param.
19 (Glink_sym_ent::Glink_sym_ent): Likewise.
20 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
21 reloc when refs will resolve to plt call stub.
22 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
23 R_PPC_PLTREL24 to resolve locally.
24 (Target_powerpc::Scan::global): Correct ifunc handling.
25 (Target_powerpc::Relocate::relocate): Correct local sym glink
26 lookup. Don't destroy "value" when we have a plt call stub,
27 and when checking plt call validity.
28 (Target_powerpc::do_dynsym_value): Simplify.
29
19fec8c1
AM
302012-10-05 Alan Modra <amodra@gmail.com>
31
32 * i386.cc (Output_data_plt_i386::address_for_global,
33 address_for_local): Add plt offset to returned value. Adjust uses.
34 * sparc.cc (Output_data_plt_sparc::address_for_global,
35 address_for_local): Likewise.
36 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
37 address_for_local): Likewise.
38 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
39 address_for_local): Likewise.
40 * target.h (Target::plt_address_for_global, plt_address_for_local):
41 Update comment.
42 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
43 (Output_data_got::Got_entry::write): Nor here.
44 * output.h: Comment fix.
45
e867b647
WL
462012-10-02 Jiong Wang <jiwang@tilera.com>
47
48 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
49 global_offset_table_ value for larget got.
50 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
51
e5d5f5ed
AM
522012-09-29 Alan Modra <amodra@gmail.com>
53
54 * powerpc.cc (Target_powerpc::iplt_): New output section.
55 (Target_powerpc::iplt_section, make_iplt_section,
56 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
57 (Target_powerpc::make_plt_entry): Handle ifunc syms.
58 Target_powerpc::plt_entry_count): Count iplt entries too.
59 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
60 reloc section in constructor. New params.
61 (Target_powerpc::make_plt_section): Create reloc section here instead.
62 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
63 functions.
64 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
65 (Output_data_glink::add_entry, find_entry): New functions to
66 deal with local syms.
67 (Glink_sym_ent): Add support for local syms.
68 (Output_data_glink::do_write): Handle ifunc plt entries.
69 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
70 (Target_powerpc::Scan::local, global): Handle ifunc syms.
71 (Target_powerpc::Relocate::relocate): Likewise.
72 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
73
ec4dbad3
AM
742012-09-25 Alan Modra <amodra@gmail.com>
75
76 * object.h (Sized_relobj_file::adjust_local_symbol,
77 do_adjust_local_symbol): New functions.
78 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
79 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
80 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
81 and irregular opd entry spacing.
82 (Powerpc_relobj::do_read_relocs): Add opd size checks.
83 (Global_symbol_visitor_opd): New functor.
84 (Target_powerpc::do_finalize_sections): Omit global symbols defined
85 on deleted opd entries.
86
5c0b3823
WL
872012-09-15 Jiong Wang <jiwang@tilera.com>
88
89 * tilegx.cc: New file.
90 * Makefile.am (TARGETSOURCES): Add tilegx.cc
91 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
92 * configure.tgt: Add entries for tilegx*.
93 * configure.ac: Likewise.
94 * Makefile.in: Rebuild.
95 * configure: Likewise.
96 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
97 tilegx.
98
bfdfa4cd
AM
992012-09-13 Alan Modra <amodra@gmail.com>
100
101 * target-reloc.h (scan_relocs): Call scan.local for relocs
102 against symbols in discarded sections. Pass is_discarded
103 param.
104 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
105 Add is_discarded param.
106 * powerpc (Target_powerpc::Scan::local): Likewise. Use
107 is_discarded to flag opd entry as discarded. Don't emit dyn
108 relocs on such entries.
109 (Target_powerpc::Scan::global): Similarly detect and handle
110 such opd entries.
111 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
112 opd_ent_. Update all uses.
113 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
114 (Target_powerpc::relocate_section): Zero out discarded opd
115 entry relocs.
116
d77a0555
ILT
1172012-09-12 Ian Lance Taylor <iant@google.com>
118
119 PR gold/14570
120 * output.cc: Rename Output_data_got template parameter from size
121 to got_size for all functions. Compile all variants of
122 Output_data_got.
123 (Output_data_got::Got_entry::write): Correct use of size for
124 symbol value. Use local_is_tls rather than casting to
125 Sized_relobj_file.
126 * object.h (class Object): Add local_is_tls and do_local_is_tls.
127 (class Sized_relobj_file): Add do_local_is_tls.
128 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
129
815a1205
AM
1302012-09-11 Alan Modra <amodra@gmail.com>
131
132 PR gold/14566
133 * layout.cc (Layout::set_segment_offsets): When using
134 common-page-size alignment, ensure we are on a new max-page-size
135 page.
136 * output.cc (Output_segment::set_section_addresses): Use
137 abi_pagesize, not common_pagesize for relro boundary.
138 (Output_segment::set_offset): Likewise.
139
bd73a62d
AM
1402012-09-11 Alan Modra <amodra@gmail.com>
141
142 * output.h (Output_data_got::add_global_tls, add_local_tls,
143 add_local_tls_pair): New functions.
144 (Output_data_got::add_local_pair_with_rel): Remove second
145 reloc param. Expand comment.
146 (Output_data_got::Got_entry): Rename use_plt_offset_ to
147 use_plt_or_tls_offset_, similarly for constructor param.
148 (Output_data_got::Got_entry::write): Add got_index param.
149 * output.cc (Output_data_got::add_global_tls, add_local_tls,
150 add_local_tls_pair): New functions.
151 (Output_data_got::Got_entry::write): Handle tls symbols
152 with use_plt_or_tls_offset_ set specially.
153 (Output_data_got::add_local_pair_with_rel): Only one reloc.
154 (Output_data_got::do_write): Replace iterator with index, pass
155 index to entry write function.
156 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
157 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
158 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
159 call.
160 * i386.cc (Target_i386::Scan::local): Likewise.
161 * sparc.cc (Target_sparc::Scan::local): Likewise.
162 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
163 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
164 do_tls_offset_for_global): New functions.
165 (Target_powerpc::Scan::local): Correct TLS relocations and got
166 entry values.
167 (Target_powerpc::Scan::global): Don't emit unnecessary
168 dynamic relocations on TLS GOT entries.
169
00716ab1
AM
1702012-09-10 Matthias Klose <doko@ubuntu.com>
171
172 * config.in: Disable sanity check for kfreebsd.
173
c891b3f9
SA
1742012-09-10 Sterling Augustine <saugustine@google.com>
175
176 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
177 (Gdb_index::pubtypes_read): New parameter.
178 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
179 to calls.
180 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
181 pubtypes_object_.
182
e81fea4d
AM
1832012-09-09 Alan Modra <amodra@gmail.com>
184
185 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
186 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
187 * gc.h (gc_process_relocs): Call target gc_add_reference.
188 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
189 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
190 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
191 unnecessary cast.
192 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
193 to cater for when we don't need code offset. Update use.
194 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
195 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
196 set_opd_valid): New functions.
197 (Target_powerpc::do_gc_add_reference): New function.
198 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
199 stashed refs.
200 (Target_powerpc::do_gc_mark_symbol): New function.
201
d2d60eef
CC
2022012-09-06 Cary Coutant <ccoutant@google.com>
203
204 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
205 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
206 (Dwarf_die::skip_attributes): Likewise.
207 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
208 * testsuite/gdb_index_test.cc (inline_func_1): New function.
209 (main): Call it.
210 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
211
32ed4573
L
2122012-09-05 H.J. Lu <hongjiu.lu@intel.com>
213
214 * testsuite/script_test_3.t: Add .got.plt output section
215 statement.
216 * testsuite/script_test_4.t: Likewise.
217
f4baf0d4
AM
2182012-09-05 Alan Modra <amodra@gmail.com>
219
220 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
221 update all uses and lose "enum" when using type.
222
864a1b56
AM
2232012-09-05 Alan Modra <amodra@gmail.com>
224
225 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
226 * configure: Regenerate.
227 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
228 (plugin_final_layout.stdout): Likewise.
229 (memory_test): Set page sizes to 0x1000.
230 * testsuite/Makefile.in: Regenerate.
231 * testsuite/discard_locals_test.sh: Add FIXME comment.
232 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
233 * testsuite/pr14265.t: Add .got output section statement.
234 * testsuite/script_test_2.t: Likewise.
235 * testsuite/script_test_3.t: Likewise.
236 * testsuite/script_test_4.t: Likewise.
237 * testsuite/script_test_5.t: Likewise.
238 * testsuite/script_test_6.t: Likewise.
239 * testsuite/script_test_7.t: Likewise.
240 * testsuite/script_test_9.t: Likewise.
241
3ea0a085
AM
2422012-09-05 Alan Modra <amodra@gmail.com>
243
244 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
245 (Powerpc_relocate_functions::Status): New typedef.
246 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
247 (Target_powerpc::Scan::local): Handle REL64.
248 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
249 for REL32 and REL64.
250 (Target_powerpc::symval_for_branch): New function, extracted from..
251 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
252 checks. Report overflow errors.
253
7404fe1b
AM
2542012-09-05 Alan Modra <amodra@gmail.com>
255
256 * object.h (Sized_relobj_file::emit_relocs): Delete.
257 (Sized_relobj_file::emit_relocs_reltype): Delete.
258 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
259 relocate_relocs for --emit-relocs.
260 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
261 * output.h: Update comment.
262 (Output_segment::first_section): New function.
263 (Output_segment::first_section_load_address): Use first_section.
264 * output.cc (Output_segment::first_section): New function extracted..
265 (Output_segment::first_section_load_address): ..from here. Delete.
266 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
267 * target.h (Sized_target::relocate_for_relocatable): Likewise.
268 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
269 adjust call to target.h function.
270 * i386.cc (Target_i386): Likewise.
271 * sparc.cc (Target_sparc): Likewise.
272 * x86_64.cc (Target_x86_64): Likewise.
273 * powerpc.cc (Target_powerpc): Likewise.
274 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
275 first tls section has section symbol for optimised local dynamic
276 output relocs.
277 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
278 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
279 optimised tls code.
280 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
281 Rename to relocate_relocs. Update error message.
282
957564c9
AS
2832012-09-04 Andreas Schwab <schwab@linux-m68k.org>
284
285 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
286 --just-symbols.
287
dd93cd0a
AM
2882012-08-31 Alan Modra <amodra@gmail.com>
289
290 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
291 (Powerpc_relobj::toc_base_offset): New stub function.
292 (Target_powerpc): Add tp_offset, dtp_offset. Rename
293 got_mod_index_offset to tlsld_got_offset. Update all refs.
294 (Target_powerpc::Relocate::enum skip_tls): New.
295 (Target_powerpc::call_tls_get_addr_): New var.
296 (Target_powerpc::is_branch_reloc): Move to file scope.
297 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
298 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
299 New functions.
300 (Target_powerpc::enum Got_type): Delete old values, add new ones.
301 (powerpc_info): Correct common_pagesize for ppc64.
302 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
303 (Powerpc_relocate_functions): Add overflow check enums and functions.
304 Add non-shift version of rela, rela_ua. Delete all rel public
305 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
306 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
307 addr16_ha3, addr14 functions.
308 (Output_data_got_powerpc::add_constant_pair): New function.
309 (Output_data_got_powerpc::got_base_offset): Likewise.
310 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
311 (instruction constants): Sort, add some more.
312 (Output_data_glink::do_write): Add and use Address typedef. Use
313 object->toc_base_offset() stub for 64-bit.
314 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
315 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
316 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
317 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
318 Always treat .opd relocs as against locally defined symbol.
319 Correct condition for RELATIVE relocs.
320 (Target_powerpc::do_finalize_sections): Test for NULL sections.
321 (Target_powerpc::Relocate::relocate): Use plt call stub as value
322 for 32-bit syms with a plt entry. Correct ppc64 toc base
323 calculations. Handle TLS relocs, and more. Add overflow
324 checking and adjust for Powerpc_relocate_functions changes.
325 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
326 Reinstate --emit-relocs code with FIXME.
327
a1373b60
AM
3282012-08-30 Alan Modra <amodra@gmail.com>
329
330 * layout.cc (Layout::set_segment_offsets): Set p_align to
331 abi_pagesize, not common_pagesize.
332 (Layout::relaxation_loop_body): Similarly use abi_pagesize
333 to determine whether file header can go in segment.
334
703d02da
AM
3352012-08-30 Alan Modra <amodra@gmail.com>
336
337 * output.h (Output_reloc::Output_reloc <output section>): Add
338 is_relative param. Adjust calls.
339 (Output_reloc::add_output_section_relative): New functions.
340 * output.cc (Output_reloc::Output_reloc <output section>): Handle
341 is_relative.
342 (Output_reloc::symbol_value): Handle SECTION_CODE.
343
16164a6b
ST
3442012-08-24 Sriraman Tallam <tmsriram@google.com>
345
346 * gold.cc (queue_middle_tasks): Call layout again when unique
347 segments for sections is desired.
348 * layout.cc (Layout::Layout): Initialize new members.
349 (Layout::get_output_section_flags): New function.
350 (Layout::choose_output_section): Call get_output_section_flags.
351 (Layout::layout): Make output section for mapping to a unique segment.
352 (Layout::insert_section_segment_map): New function.
353 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 354 output sections marked so.
16164a6b
ST
355 (Layout::segment_precedes): Check for unique segments when sorting.
356 * layout.h (Layout::Unique_segment_info): New struct.
357 (Layout::Section_segment_map): New typedef.
358 (Layout::insert_section_segment_map): New function.
359 (Layout::get_output_section_flags): New function.
360 (Layout::is_unique_segment_for_sections_specified): New function.
361 (Layout::set_unique_segment_for_sections_specified): New function.
362 (Layout::unique_segment_for_sections_specified_): New member.
363 (Layout::section_segment_map_): New member.
364 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
365 Rename is_gc_pass_one to is_pass_one.
366 Rename is_gc_pass_two to is_pass_two.
367 Rename is_gc_or_icf to is_two_pass.
368 Check for which pass based on whether symbols data is present.
369 Make it two pass when unique segments for sections is desired.
370 * output.cc (Output_section::Output_section): Initialize new
371 members.
372 * output.h (Output_section::is_unique_segment): New function.
373 (Output_section::set_is_unique_segment): New function.
374 (Output_section::is_unique_segment_): New member.
375 (Output_section::extra_segment_flags): New function.
376 (Output_section::set_extra_segment_flags): New function.
377 (Output_section::extra_segment_flags_): New member.
378 (Output_section::segment_alignment): New function.
379 (Output_section::set_segment_alignment): New function.
380 (Output_section::segment_alignment_): New member.
381 (Output_segment::Output_segment): Initialize is_unique_segment_.
382 (Output_segment::is_unique_segment): New function.
383 (Output_segment::set_is_unique_segment): New function.
384 (Output_segment::is_unique_segment_): New member.
385 * plugin.cc (allow_unique_segment_for_sections): New function.
386 (unique_segment_for_sections): New function.
387 (Plugin::load): Add new functions to transfer vector.
388 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
389 * Makefile.in: Regenerate.
390 * testsuite/plugin_final_layout.sh: Check if unique segment
391 functionality works.
392 * testsuite/plugin_section_order.c (onload): Check if new interfaces
393 are available.
394 (allow_unique_segment_for_sections): New global.
395 (unique_segment_for_sections): New global.
396 (claim_file_hook): Call allow_unique_segment_for_sections.
397 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 398
1e2bee4f
CC
3992012-08-22 Cary Coutant <ccoutant@google.com>
400
401 * layout.cc (Layout::include_section): Don't assert on GROUP
402 sections with --emit-relocs.
403
1d5dfe78
CC
4042012-08-21 Cary Coutant <ccoutant@google.com>
405
406 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
407 if --export-dynamic-symbol names an undef symbol.
408
c9269dff
AM
4092012-08-18 Alan Modra <amodra@gmail.com>
410
411 * powerpc.cc: Formatting and white space.
412 (Powerpc_relobj): Rename got2_section_ to special_.
413 Add opd_ent_shndx_ and opd_ent_off_ vectors.
414 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
415 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
416 (Target_powerpc): Add Address typedef and invalid_address. Use
417 throughout.
418 (Target_powerpc::is_branch_reloc): New function.
419 (Powerpc_relocate_functions): Add Address typedef, use throughout.
420 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
421 for dst_mask, value and addend.
422 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
423 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
424 (Output_data_glink::do_write): Correct toc base. Don't try to use
425 uint16_t for 24-bit offset. Use get_output_section_offset and
426 check return.
427 (Target_powerpc::Scan::local): Handle more relocs.
428 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
429 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
430 Plug in toc restoring insn after plt calls. Translate branches
431 to function descriptor symbols to corresponding entry point.
432 (Target_powerpc::relocate_for_relocatable): Check return from
433 get_output_section_offset.
434 * symtab.h: Comment typo.
435
b1759dce
ILT
4362012-08-14 Ian Lance Taylor <iant@google.com>
437
438 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
439 unsupported_relocal_local to call unsupported_reloc_global.
440
b9b2ae8b
NC
4412012-08-14 Nick Clifton <nickc@redhat.com>
442
443 PR ld/14265
444 * script-sections.cc (Sections_element::output_section_name): Add
445 keep return parameter.
446 (Output_section_element::match_name): Add keep return parameter.
447 Return the value of the keep_ member.
448 * script-sections.h (class Output_section): Update
449 output_section_name prototype.
450 * layout.cc (Layout::keep_input_section): New public member
451 function.
452 (Layout::choose_output_section): Pass keep parameter to
453 output_section_name.
454 * layout.h (class Layout): Add keep_input_section.
455 * object.cc (Sized_relobj_file::do_layout): Check for kept input
456 sections.
457 * testsuite/Makefile.am: Add a test.
458 * testsuite/Makefile.in: Regenerate.
459 * testsuite/pr14265.c: Source file for the test.
460 * testsuite/pr14265.t: Linker script for the test.
461 * testsuite/pr14265.sh: Shell script for the test.
462
921b5322
AM
4632012-08-14 Alan Modra <amodra@gmail.com>
464
465 * target.h (Target::output_section_name): New function.
466 (Target::do_output_section_name): New function.
467 * layout.cc (Layout::choose_output_section): Call the above.
468 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
469
6ce78956
AM
4702012-08-14 Alan Modra <amodra@gmail.com>
471
472 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
473 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
474 for replace_constant call.
475 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
476 (Output_data_glink::do_print_to_mapfile): New function.
477 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
478 (Target_powerpc::Relocate::relocate): Likewise.
479
d1a8cabd
AM
4802012-08-14 Alan Modra <amodra@gmail.com>
481
482 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
483 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
484 (Output_data_glink::add_entry,find_entry): Remove shndx param.
485 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
486 all references to shndx_. Handle special case for R_PPC_PLTREL24
487 here.
488 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
489 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
490 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
491 here.
492 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
493 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
494
d83ce4e3
AM
4952012-08-12 Alan Modra <amodra@gmail.com>
496
497 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
498 (glink insn constants): Use uint32_t.
499 (Output_data_glink::add_entry): Use insert, not [] operator.
500
cf43a2fe
AM
5012012-08-11 Alan Modra <amodra@gmail.com>
502
503 * object.h (Sized_relobj_file::find_shdr): New function.
504 (Sized_relobj_file::find_special_sections): New function.
505 * object.cc (Sized_relobj_file::find_shdr): New function.
506 (Sized_relobj_file::find_eh_frame): Use find_shdr.
507 (Sized_relobj_file::find_special_sections): New function, split out..
508 (Sized_relobj_file::do_read_symbols): ..from here.
509 * output.h (Output_data_got::replace_constant): New function.
510 (Output_data_got::num_entries): New function.
511 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
512 (Output_data_got::got_offset): Protected rather than private.
513 (Output_data_got::replace_got_entry): New function.
514 * output.cc (Output_data_got::replace_got_entry): New function.
515 * powerpc.cc (class Powerpc_relobj): New.
516 (class Powerpc_relocate_functions): Delete all psymval variants or
517 convert to value,addend type. Delete pcrela, pcrela_unaligned.
518 Implement _ha functions using corresponding _hi function.
519 (Powerpc_relobj::find_special_sections): New function.
520 (Target_powerpc::do_make_elf_object): New function.
521 (class Output_data_got_powerpc): New.
522 (class Output_data_glink): New.
523 (class Powerpc_scan_relocatable_reloc): New.
524 Many more changes througout file.
525
3c892704
NC
5262012-08-09 Nick Clifton <nickc@redhat.com>
527
528 * po/vi.po: Updated Vietnamese translation.
529
82435b3b
ILT
5302012-08-07 Ian Lance Taylor <iant@google.com>
531
532 * layout.cc (Layout::add_target_dynamic_tags): If
533 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
534 plt_rel.
535
a6dc81d2
NC
5362012-07-30 Nick Clifton <nickc@redhat.com>
537
538 * po/gold.pot: Updated template.
539 * po/es.po: Updated Spanish translation.
540
f1415016
CC
5412012-07-18 Cary Coutant <ccoutant@google.com>
542
543 PR gold/14344
544 * configure.ac: Add check for -gpubnames support.
545 * configure: Regenerate.
546 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
547 support; force -gno-pubnames.
548 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
549 support.
550 (gdb_index_test_4): New test.
551 * testsuite/Makefile.in: Regenerate.
552 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
553 * testsuite/gdb_index_test_2.sh: Likewise.
554 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
555 * testsuite/gdb_index_test_4.sh: New script.
556 * testsuite/gdb_index_test_comm.sh: New script with common code;
557 don't look for space after colon.
558
b7fd7c37
ST
5592012-07-16 Sriraman Tallam <tmsriram@google.com>
560
561 * gold.cc (queue_middle_tasks): Update function order only after
562 deferred objects due to plugins are processed.
563
1f3212db
ILT
5642012-07-11 Ian Lance Taylor <iant@google.com>
565
566 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
567 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
568 (Target_arm::scan_reloc_for_stub): Likewise.
569 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
570 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
571 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
572 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
573 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
574
81c82a68
ILT
5752012-07-10 Dodji Seketeli <dodji@redhat.com>
576 Ian Lance Taylor <iant@google.com>
577
578 PR gold/14309
579 * configure.ac: Test whether std::tr1::hash<off_t> works.
580 * gold.h: Add a specialization for std::tr1::hash<off_t> if
581 needed.
582 * output.h (class Output_fill): Add virtual destructor.
583 * configure, config.in: Rebuild.
584
eabc84f4
RM
5852012-06-22 Roland McGrath <mcgrathr@google.com>
586
587 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
588
370e30b6
RÁE
5892012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
590
591 * plugin.cc (Plugin::load): Handle position independent executables.
592
fb1b895d
CC
5932012-06-06 Cary Coutant <ccoutant@google.com>
594
595 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
596 add .debug_macro.
597 (lines_only_debug_sections): Likewise.
598 (gdb_fast_lookup_sections): New static array.
599 (is_gdb_debug_section): Rename formal parameter.
600 (is_lines_only_debug_section): Likewise.
601 (is_gdb_fast_lookup_section): New function.
602 (Layout::include_section): Check for ".zdebug_" prefix; pass
603 section name suffix to is_gdb_debug_section, et al.; check for
604 fast-lookup sections when building .gdb_index.
605 * options.h (--strip-debug-gdb): Update GDB version number.
606
7c0640fa
CC
6072012-06-06 Cary Coutant <ccoutant@google.com>
608
609 * configure.ac: Add check for fallocate.
610 * configure: Regenerate.
611 * config.in: Regenerate.
612
613 * options.h (class General_options): Add --mmap-output-file and
614 --posix-fallocate options.
615 * output.cc: (posix_fallocate): Remove; replace with...
616 (gold_fallocate): New function.
617 (Output_file::map_no_anonymous): Call gold_fallocate.
618 (Output_file::map): Check --mmap-output-file option.
619
2a49eb69
DK
6202012-06-05 Jing Yu <jingyu@google.com>
621
622 * gold.h (textdomain): Add do {} to empty while(0).
623 (bindtextdomain): Likewise.
624
fad072ac
CC
6252012-06-04 Cary Coutant <ccoutant@google.com>
626
627 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
628 has_dynsym_index.
629
8cc69fb6
ST
6302012-05-25 Sriraman Tallam <tmsriram@google.com>
631
632 * symtab.cc (Symbol_table::define_special_symbol):
633 Initialize *poldsym to prevent uninitialized variable errors.
634
1be75daa
CC
6352012-05-23 Cary Coutant <ccoutant@google.com>
636
637 * layout.cc (Layout::section_name_mapping): Add rules to handle
638 exact match on .data.rel.ro.local or .data.rel.ro.
639 (Layout::output_section_name): Check for exact matches.
640
9b689de0
CC
6412012-05-23 Cary Coutant <ccoutant@google.com>
642
643 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
644 more carefully.
645
b24fdbf5
CC
6462012-05-22 Cary Coutant <ccoutant@google.com>
647
648 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
649 object before exporting symbol.
650
e550e1a2
L
6512012-05-21 H.J. Lu <hongjiu.lu@intel.com>
652
653 * testsuite/tls_test.cc: Include "config.h" first.
654 * testsuite/tls_test_c.c: Likewise.
655
df7b86aa
NC
6562012-05-17 Daniel Richard G. <skunk@iskunk.org>
657 Nick Clifton <nickc@redhat.com>
658
659 PR 14072
660 * configure.in: Add check that sysdep.h has been included before
661 any system header files.
662 * configure: Regenerate.
663 * config.in: Regenerate.
664
1007b503
CC
6652012-05-14 Cary Coutant <ccoutant@google.com>
666
667 * layout.cc (Layout::make_output_section): Mark .tdata section
668 as RELRO.
669 * testsuite/relro_test.cc: Add a TLS variable.
670
fd885f3a
L
6712012-05-10 H.J. Lu <hongjiu.lu@intel.com>
672
673 PR gold/14091
674 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
675 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
676 R_X86_64_64.
677
80f5885c
CC
6782012-05-08 Cary Coutant <ccoutant@google.com>
679
680 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
681 (lines_only_debug_sections): Likewise.
682
2e702c99
RM
6832012-05-02 Roland McGrath <mcgrathr@google.com>
684
685 * nacl.cc: New file.
686 * nacl.h: New file.
687 * Makefile.am (CCFILES, HFILES): Add them.
688 * Makefile.in: Regenerate.
689 * i386.cc (Output_data_plt_i386_nacl): New class.
690 (Output_data_plt_i386_nacl_exec): New class.
691 (Output_data_plt_i386_nacl_dyn): New class.
692 (Target_i386_nacl): New class.
693 (Target_selector_i386_nacl): New class.
694 (target_selector_i386): Use it instead of Target_selector_i386.
695 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
696 (Target_x86_64_nacl): New class.
697 (Target_selector_x86_64_nacl): New class.
698 (target_selector_x86_64, target_selector_x32): Use it instead of
699 Target_selector_x86_64.
700 * arm.cc (Output_data_plt_arm_nacl): New class.
701 (Target_arm_nacl): New class.
702 (Target_selector_arm_nacl): New class.
703 (target_selector_arm, target_selector_armbe): Use it instead of
704 Target_selector_arm.
705
706 * target-select.cc (select_target): Take new Input_file* and off_t
707 arguments, pass them on to recognize method of selector.
708 * object.cc (make_elf_sized_object): Update caller.
709 * parameters.cc (parameters_force_valid_target): Likewise.
710 * incremental.cc (make_sized_incremental_binary): Likewise.
711 * target-select.h: Update decl.
712 (Target_selector::recognize): Take new Input_file* argument,
713 pass it on to do_recognize.
714 (Target_selector::do_recognize): Take new Input_file* argument.
715 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
716 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
717 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
718 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
719
720 * target.h (Target::Target_info): New members isolate_execinstr
721 and rosegment_gap.
722 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
723 * arm.cc (Target_arm::arm_info): Update initializer.
724 * i386.cc (Target_i386::i386_info): Likewise.
725 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
726 * sparc.cc (Target_sparc::sparc_info): Likewise.
727 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
728 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
729 * layout.cc (Layout::attach_allocated_section_to_segment):
730 Take new const Target* argument. If target->isolate_execinstr(), act
731 like --rosegment.
732 (Layout::find_first_load_seg): Take new const Target* argument;
733 if target->isolate_execinstr(), reject PF_X segments.
734 (Layout::relaxation_loop_body): Update caller.
735 (Layout::set_segment_offsets): If target->isolate_execinstr(),
736 reset file offset to zero when we hit LOAD_SEG, and then do a second
737 loop over the segments before LOAD_SEG to reassign offsets after
738 addresses have been determined. Handle target->rosegment_gap().
739 (Layout::attach_section_to_segment): Take new const Target* argument;
740 pass it to attach_allocated_section_to_segment.
741 (Layout::make_output_section): Update caller.
742 (Layout::attach_sections_to_segments): Take new const Target* argument;
743 pass it to attach_section_to_segment.
744 * gold.cc (queue_middle_tasks): Update caller.
745 * layout.h (Layout): Update method decls with new arguments.
746
747 * arm.cc (Target_arm::Target_arm): Take optional argument for the
748 Target_info pointer to use.
749 (Target_arm::do_make_data_plt): New virtual method.
750 (Target_arm::make_data_plt): New method that calls it.
751 (Target_arm::make_plt_entry): Use it.
752 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
753 for the section alignment.
754 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
755 method.
756 (Output_data_plt_arm::first_plt_entry_offset): Call it.
757 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
758 method.
759 (Output_data_plt_arm::get_plt_entry_size): Call it.
760 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
761 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
762 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
763 method.
764 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
765 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
766 method instead of sizeof(plt_entry).
767 (Output_data_plt_arm::add_entry): Likewise.
768 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
769 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
770 than static method.
771 (Target_arm::plt_entry_size): Likewise.
772 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
773 Move to ...
774 (Output_data_plt_arm_standard): ... here, new class.
775 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
776 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
777 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
778
779 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
780 Take additional argument for the PLT entry size.
781 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
782 Use get_plt_entry_size method rather than plt_entry_size variable.
783 (Output_data_plt_x86_64::reserve_slot): Likewise.
784 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
785 (Output_data_plt_x86_64::add_entry): Likewise.
786 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
787 (Output_data_plt_x86_64::address_for_global): Likewise.
788 (Output_data_plt_x86_64::address_for_local): Likewise.
789 (Output_data_plt_x86_64::set_final_data_size): Likewise.
790 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
791 Make method non-static.
792 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
793 method.
794 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
795 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
796 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
797 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
798 virtual method.
799 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
800 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
801 virtual method.
802 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
803 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
804 virtual method.
805 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
806 (Output_data_plt_x86_64::plt_entry_size)
807 (Output_data_plt_x86_64::first_plt_entry)
808 (Output_data_plt_x86_64::plt_entry)
809 (Output_data_plt_x86_64::tlsdesc_plt_entry)
810 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
811 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
812 (Output_data_plt_x86_64_standard): ... here, new class.
813 (Target_x86_64::Target_x86_64): Take optional argument for the
814 Target_info pointer to use.
815 (Target_x86_64::do_make_data_plt): New virtual method.
816 (Target_x86_64::make_data_plt): New method to call it.
817 (Target_x86_64::init_got_plt_for_update): Use that.
818 Call this->plt_->add_eh_frame method here.
819 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
820 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
821 rather than static method.
822 (Target_x86_64::plt_entry_size): Likewise.
823 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
824 rather than plt_entry_size variable. Move guts of PLT filling to...
825 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
826 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
827 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
828
829 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
830 additional argument for the section alignment.
831 Don't do add_eh_frame_for_plt here.
832 (Output_data_plt_i386::first_plt_entry_offset): Make the method
833 non-static. Use get_plt_entry_size method rather than plt_entry_size
834 variable.
835 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
836 method.
837 (Output_data_plt_i386::get_plt_entry_size): Call it.
838 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
839 (Output_data_plt_i386::add_eh_frame): New method to call it.
840 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
841 method.
842 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
843 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
844 method.
845 (Output_data_plt_i386::fill_plt_entry): New method to call it.
846 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
847 method instead of plt_entry_size.
848 (Output_data_plt_i386::plt_entry_size)
849 (Output_data_plt_i386::plt_eh_frame_fde_size)
850 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
851 (Output_data_plt_i386_standard): ... here, new class.
852 (Output_data_plt_i386_exec): New class.
853 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
854 (Output_data_plt_i386_exec::first_plt_entry): ... here.
855 (Output_data_plt_i386::exec_plt_entry): Move to ...
856 (Output_data_plt_i386_exec::plt_entry): ... here.
857 (Output_data_plt_i386_dyn): New class.
858 (Output_data_plt_i386::first_plt_entry): Move to ...
859 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
860 (Output_data_plt_i386::dyn_plt_entry): Move to ...
861 (Output_data_plt_i386_dyn::plt_entry): ... here.
862 (Target_i386::Target_i386): Take optional argument for the Target_info
863 pointer to use.
864 (Target_i386::do_make_data_plt): New virtual method.
865 (Target_i386::make_data_plt): New method to call it.
866 (Target_i386::make_plt_section): Use that.
867 Call this->plt_->add_eh_frame method here.
868 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
869 rather than plt_entry_size variable.
870 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
871 (Output_data_plt_i386::address_for_local): Likewise.
872 (Output_data_plt_i386::do_write): Likewise.
873 Move guts of PLT filling to...
874 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
875 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
876 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
877 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
878
b9b9f2ee
CC
8792012-05-01 Cary Coutant <ccoutant@google.com>
880
881 * dwarf_reader.cc (Dwarf_die::read_attributes)
882 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
883 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
884 * reduced_debug_output.cc
885 (Output_reduced_debug_info_section::get_die_end): Remove
886 DW_FORM_GNU_ref_index. Add default case.
887
57923f48
MW
8882012-04-26 Mark Wielaard <mjw@redhat.com>
889
890 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
891 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
892 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
893 DW_AT_high_pc as offset from DW_AT_low_pc.
894
895 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
896 * testsuite/Makefile.in: Regenerate.
897 * testsuite/gdb_index_test_3.c: New test source file.
898 * testsuite/gdb_index_test_3.sh: New test source file.
899
2c54b4f4
ILT
9002012-04-25 Ian Lance Taylor <iant@google.com>
901
902 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
903 pointer.
904 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
905 as a class, not a struct.
906 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
907 (Target_arm::apply_cortex_a8_workaround): Likewise.
908 * gc.h: Declare Reloc_types as a struct, not a class.
909 * object.h: Declare Symbols_data as a struct.
910 * reloc.h: Declare Read_relocs_data as a struct.
911 * target.h: Declare Relocate_info as a struct.
912
a5a5f7a3
DM
9132012-04-24 David S. Miller <davem@davemloft.net>
914
915 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
916 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
917 and R_SPARC_WPLT30.
918
f038d496
CC
9192012-04-24 Cary Coutant <ccoutant@google.com>
920
921 * incremental-dump.cc (find_input_containing_global): Replace
922 magic number with symbolic constant.
923 (dump_incremental_inputs): Update version number.
924 * incremental.cc (Output_section_incremental_inputs): Update version
925 number; import symbolic constants from Incremental_inputs_reader.
926 (Incremental_inputs::create_data_sections): Align relocations
927 section correctly for 64-bit targets.
928 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
929 constants; add padding.
930 (Output_section_incremental_inputs::write_header): Add assert for
931 header_size.
932 (Output_section_incremental_inputs::write_input_files): Add assert
933 for input_entry_size.
934 (Output_section_incremental_inputs::write_info_blocks): Add padding;
935 add assert for object_info_size, input_section_entry_size,
936 global_sym_entry_size.
937 * incremental.h (Incremental_inputs_reader): Add symbolic constants
938 for data structure sizes; use them.
939 (Incremental_input_entry_reader): Import symbolic constants from
940 Incremental_inputs_reader; use them.
941
a4d85145
DM
9422012-04-23 David S. Miller <davem@davemloft.net>
943
944 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
945 and elf_flags_set_.
946 (Target_sparc::Target_sparc): Initialize new fields.
947 (Target_sparc::do_make_elf_object): New function.
948 (Target_sparc::do_adjust_elf_header): New function.
949
1d509098
CC
9502012-04-23 Cary Coutant <ccoutant@google.com>
951
952 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
953 CU range table of gdb index.
954
7ebeff7f
DM
9552012-04-20 David S. Miller <davem@davemloft.net>
956
957 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
958 instead of false.
959
13cf9988
DM
9602012-04-16 David S. Miller <davem@davemloft.net>
961
2a1079e8
DM
962 * sparc.cc (Target_sparc::got_address): New function.
963 (Sparc_relocate_functions::gdop_hix22): New function.
964 (Sparc_relocate_functions::gdop_lox10): New function.
965 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
966 relocs.
967 (Target_sparc::Scan::local): Likewise if the global symbol is not
968 preemptible and is not IFUNC.
969 (Target_sparc::Relocate::relocate): Perform GOTDATA code
970 transformations for local and non-preemptible non-IFUNC global
971 symbols.
972
0bc964fc
DM
973 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
974 writing out 64-bit part of ranges.
975
661d7a80
DM
976 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
977 -fpic and -fpie respectively.
978 * Makefile.in: Regenerate.
979
8c2bf391
DM
980 * sparc.cc (class Target_sparc): Add rela_ifunc_.
981 (Target_sparc::Target_sparc): Initialize new field.
982 (Target_sparc::do_plt_section_for_global): New function.
983 (Target_sparc::do_plt_section_for_local): New function.
984 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
985 (Target_sparc::make_plt_section): New function, broken out of
986 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
987 (Target_sparc::make_plt_entry): Call make_plt_section.
988 (Target_sparc::make_local_ifunc_plt_entry): New function.
989 (Target_sparc::rela_ifunc_section): New function.
990 (Target_sparc::plt_section): Remove const.
991 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
992 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
993 and ifunc_count_ fields.
994 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
995 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
996 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
997 (Output_data_plt_sparc::rela_ifunc): New function.
998 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
999 (Output_data_plt_sparc::has_ifunc_section): New function.
1000 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1001 (Output_data_plt_sparc::address_for_global): New function.
1002 (Output_data_plt_sparc::address_for_local): New function.
1003 (Output_data_plt_sparc::plt_index_to_offset): New function.
1004 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1005 and entry_count.
1006 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1007 entry_count.
1008 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1009 R_SPARC_JMP_IREL to switch.
1010 (Target_sparc::Scan::check_non_pic): Likewise.
1011 (Target_sparc::Scan::local): Handle IFUNC symbols.
1012 (Target_sparc::Scan::local): Likewise.
1013 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1014 and plt_address_for_local.
1015 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1016 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1017
13cf9988
DM
1018 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1019 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1020 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1021 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1022 global relocs too.
1023 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1024 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1025 calls.
1026 * sparc.cc (Target_sparc::Scan::global): Likewise.
1027 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1028
31821be0
CC
10292012-04-16 Cary Coutant <ccoutant@google.com>
1030
1031 * archive.cc (Library_base::should_include_member): Check for
1032 --export-dynamic-symbol.
1033 * options.h (class General_options): Add --export-dynamic-symbol.
1034 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1035 --export-dynamic-symbol.
1036 (Symbol_table::gc_mark_undef_symbols): Likewise.
1037 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1038
2615994e
DM
10392012-04-12 David S. Miller <davem@davemloft.net>
1040
1041 * sparc.cc (Reloc::wdisp10): New relocation method.
1042 (Reloc::h34): Likewise.
1043 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1044 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1045 R_SPARC_WDISP10.
1046 (Target_sparc::Scan::local): Likewise.
1047 (Target_sparc::Scan::global): Likewise.
1048 (Target_sparc::Relocate::relocate): Likewise.
1049
6782735d
CC
10502012-04-09 Cary Coutant <ccoutant@google.com>
1051
1052 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1053 low_pc == 0.
1054
8c7a0b00
ILT
10552012-04-06 Ian Lance Taylor <iant@google.com>
1056
1057 * timer.cc: #include <unistd.h>.
1058
58797674
RM
10592012-04-06 Roland McGrath <mcgrathr@google.com>
1060
1061 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1062 * config.in: Regenerate.
1063 * configure: Regenerate.
1064
44350750
NC
10652012-04-05 Nick Clifton <nickc@redhat.com>
1066
1067 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1068 (AM_LC_MESSAGES): Add.
1069 * aclocal.m4: Regenerate.
1070 * config.in: Regenerate.
1071 * configure: Regenerate.
1072
c1027032
CC
10732012-03-21 Cary Coutant <ccoutant@google.com>
1074
1075 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1076 * Makefile.in: Regenerate.
1077 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1078 (Sized_elf_reloc_mapper::symbol_section): New function.
1079 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1080 (make_elf_reloc_mapper): New function.
1081 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1082 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1083 (Dwarf_abbrev_table::do_get_abbrev): New function.
1084 (Dwarf_ranges_table::read_ranges_table): New function.
1085 (Dwarf_ranges_table::read_range_list): New function.
1086 (Dwarf_pubnames_table::read_section): New function.
1087 (Dwarf_pubnames_table::read_header): New function.
1088 (Dwarf_pubnames_table::next_name): New function.
1089 (Dwarf_die::Dwarf_die): New function.
1090 (Dwarf_die::read_attributes): New function.
1091 (Dwarf_die::skip_attributes): New function.
1092 (Dwarf_die::set_name): New function.
1093 (Dwarf_die::set_linkage_name): New function.
1094 (Dwarf_die::attribute): New function.
1095 (Dwarf_die::string_attribute): New function.
1096 (Dwarf_die::int_attribute): New function.
1097 (Dwarf_die::uint_attribute): New function.
1098 (Dwarf_die::ref_attribute): New function.
1099 (Dwarf_die::child_offset): New function.
1100 (Dwarf_die::sibling_offset): New function.
1101 (Dwarf_info_reader::check_buffer): New function.
1102 (Dwarf_info_reader::parse): New function.
1103 (Dwarf_info_reader::do_parse): New function.
1104 (Dwarf_info_reader::do_read_string_table): New function.
1105 (Dwarf_info_reader::lookup_reloc): New function.
1106 (Dwarf_info_reader::get_string): New function.
1107 (Dwarf_info_reader::visit_compilation_unit): New function.
1108 (Dwarf_info_reader::visit_type_unit): New function.
1109 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1110 Sized_elf_reloc_mapper.
1111 (Sized_dwarf_line_info::symbol_section): Remove function.
1112 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1113 (Sized_dwarf_line_info::read_line_mappings): Remove object
1114 parameter, adjust callers.
1115 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1116 * dwarf_reader.h: Include <sys/types.h>.
1117 (class Track_relocs): Remove forward declaration.
1118 (class Elf_reloc_mapper): New class.
1119 (class Sized_elf_reloc_mapper): New class.
1120 (class Dwarf_abbrev_table): New class.
1121 (class Dwarf_range_list): New class.
1122 (class Dwarf_ranges_table): New class.
1123 (class Dwarf_pubnames_table): New class.
1124 (class Dwarf_die): New class.
1125 (class Dwarf_info_reader): New class.
1126 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1127 (Sized_dwarf_line_info::symbol_section): Remove member function.
1128 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1129 base class.
1130 * gdb-index.cc: New source file.
1131 * gdb-index.h: New source file.
1132 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1133 and .debug_types sections, call Layout::add_to_gdb_index.
1134 (Sized_relobj_incr::do_section_name): Implement.
1135 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1136 return type; Implement.
1137 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1138 return type.
1139 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1140 parameter list and return type.
1141 (Sized_incr_dynobj::do_section_contents): Likewise.
1142 * layout.cc: Include gdb-index.h.
1143 (Layout::Layout): Initialize gdb_index_data_.
1144 (Layout::init_fixed_output_section): Check for .gdb_index section.
1145 (Layout::add_to_gdb_index): New function. Instantiate.
1146 * layout.h: Add forward declaration for class Gdb_index.
1147 (Layout::add_to_gdb_index): New member function.
1148 (Layout::gdb_index_data_): New data member.
1149 * main.cc: Include gdb-index.h.
1150 (main): Print statistics for gdb index.
1151 * object.cc (Object::section_contents): Move code into
1152 do_section_contents.
1153 (need_decompressed_section): Check for sections needed when building
1154 gdb index.
1155 (build_compressed_section_map): Likewise.
1156 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1157 gdb index.
1158 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1159 sections; call Layout::add_to_gdb_index.
1160 (Sized_relobj_file::do_decompressed_section_contents): Call
1161 do_section_contents directly.
1162 * object.h (Object::do_section_contents): Adjust parameter list and
1163 return type.
1164 (Object::do_decompressed_section_contents): Call do_section_contents
1165 directly.
1166 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1167 return type.
1168 * options.h (class General_options): Add --gdb-index option.
1169 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1170 list and return type.
1171 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1172 * reloc.h (Track_relocs::checkpoint): New function.
1173 (Track_relocs::reset): New function.
1174
1175 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1176 New test cases.
1177 * testsuite/Makefile.in: Regenerate.
1178 * testsuite/gdb_index_test.cc: New test source file.
1179 * testsuite/gdb_index_test_1.sh: New test source file.
1180 * testsuite/gdb_index_test_2.sh: New test source file.
1181
647f1574
DK
11822012-03-19 Doug Kwan <dougkwan@google.com>
1183
1184 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1185 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1186 __exidx_start and __exidx_end. Make symbol table parameter
1187 anonymous as it is not used.
1188 * gold.cc (queue_middle_tasks): Call target hook to define any
1189 target-specific symbols.
1190 * target.h (Target::define_standard_symbols): New method.
1191 (Target::do_define_standard_symbols): Same.
1192 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1193 * testsuite/Makefile.in: Regenerate.
1194 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1195 and __exidx_end.
1196 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1197 relocations are generated for __exidx_start and __exidx_end.
1198
7c6109da
DK
11992012-03-16 Doug Kwan <dougkwan@google.com>
1200
1201 * testsuite/Makefile.am: Disable test initpri3b.
1202 * testsuite/Makefile.in: Regenerate.
1203
7b8957f8
DK
12042012-03-15 Doug Kwan <dougkwan@google.com>
1205
1206 * arm.cc (Target_arm::got_section): Make .got section read-only
1207 if -z now is given.
1208
14dc9ef7
ILT
12092012-03-15 Ian Lance Taylor <iant@google.com>
1210
1211 PR gold/13850
1212 * layout.cc (Layout::make_output_section): Correctly mark
1213 SHT_INIT_ARRAY, et. al., as relro.
1214
fa40b62a
DK
12152012-03-14 Doug Kwan <dougkwan@google.com>
1216
1217 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1218 dynamic relocations for protected symbols in shared objects.
1219
fd325007
ILT
12202012-03-13 Ian Lance Taylor <iant@google.com>
1221
1222 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1223 keep the larger alignment.
1224
e8dd54e1
CC
12252012-03-12 Cary Coutant <ccoutant@google.com>
1226
1227 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1228 handling of DW_LNE_define_file.
1229
feb5f3b0
CC
12302012-03-12 Cary Coutant <ccoutant@google.com>
1231
1232 * reduced_debug_output.cc
1233 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1234 codes to switch.
1235
a1fb4256
CC
12362012-02-29 Cary Coutant <ccoutant@google.com>
1237
1238 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1239
5dd8762a
CC
12402012-02-29 Cary Coutant <ccoutant@google.com>
1241
1242 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1243 Call Object::decompressed_section_contents.
1244 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1245 New dtor.
1246 (Sized_dwarf_line_info::buffer_start_): New data member.
1247 * merge.cc (Output_merge_data::do_add_input_section): Call
1248 Object::decompressed_section_contents.
1249 (Output_merge_string::do_add_input_section): Likewise.
1250 * object.cc (need_decompressed_section): New function.
1251 (build_compressed_section_map): Decompress sections needed later.
1252 (Sized_relobj_file::do_decompressed_section_contents): New function.
1253 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1254 * object.h (Object::decompressed_section_contents): New function.
1255 (Object::discard_decompressed_sections): New function.
1256 (Object::do_decompressed_section_contents): New function.
1257 (Object::do_discard_decompressed_sections): New function.
1258 (Compressed_section_info): New type.
1259 (Compressed_section_map): Include decompressed section contents.
1260 (Sized_relobj_file::do_decompressed_section_contents): New function.
1261 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1262
7b5de7ee
CC
12632012-02-16 Cary Coutant <ccoutant@google.com>
1264
1265 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1266 * testsuite/Makefile.in: Regenerate.
1267
f9fa4a63
CC
12682012-02-14 Cary Coutant <ccoutant@google.com>
1269
1270 * options.cc (General_options::finalize): Disallow -pie and -static.
1271
2c175ebc
DK
12722012-02-03 Doug Kwan <dougkwan@google.com>
1273
1274 * arm.cc (Arm_relocate_functions::abs8,
1275 Arm_relocate_functions::abs16): Use
1276 Bits::has_signed_unsigned_overflow32.
1277 (Arm_relocate_functions::thm_abs8): Correct range of
1278 overflow check.
1279 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1280 in assertions.
1281
90cff06f
DK
12822012-02-02 Doug Kwan <dougkwan@google.com>
1283
1284 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1285 position independent outputs, not just shared objects.
1286
63887f3d
L
12872012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1288
1289 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1290 * configure: Regenerated.
1291
bef2b434
ILT
12922012-01-27 Ian Lance Taylor <iant@google.com>
1293
1294 * reloc.h (Bits): New class with static functions, copied from
1295 namespace utils in arm.cc.
1296 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1297 instead.
1298
c335b55d
L
12992012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1300
1301 * incremental.cc (write_info_blocks): Correct relocation offset.
1302
41194d9f
L
13032012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1304
1305 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1306 (Relocate::tls_gd_to_le): Likewise.
1307
1bae613c
L
13082012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1309
1310 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1311
24482ca0
L
13122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1313
1314 * configure.ac: Check if -mcmodel=medium works.
1315 * configure: Regenerated.
1316
c2c7840a
CC
13172012-01-24 Cary Coutant <ccoutant@google.com>
1318
1319 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1320 definition and ...
1321 (read_unsigned_LEB_128_x): ... this new function.
1322 (read_signed_LEB_128): Replaced with inline definition and ...
1323 (read_signed_LEB_128_x): ... this new function.
1324 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1325 (read_unsigned_LEB_128): Add inline definition.
1326 (read_signed_LEB_128_x): New function.
1327 (read_signed_LEB_128): Add inline definition.
1328 * testsuite/Makefile.am (leb128_unittest): New unit test.
1329 * testsuite/Makefile.in: Regenerate.
1330 * testsuite/leb128_unittest.cc: New unit test.
1331
833de760 13322012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1333
1334 PR gold/13617
1335 * i386.cc (Target_i386::do_code_fill): When using a jmp
1336 instruction, pad with nop instructions.
1337 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1338
618d6666
L
13392012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1340
1341 * x86_64.cc (gc_process_relocs): Add typename on types used in
1342 template.
1343 (scan_relocs): Likewise.
1344 (relocate_section): Likewise.
1345 (apply_relocation): Likewise.
1346
3660ff06
L
13472012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1348
1349 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1350 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1351 under x32.
1352
fc51264f
L
13532012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1354
1355 * x86_64.cc: Initial support for x32.
1356
dd74ae06
CC
13572012-01-03 Cary Coutant <ccoutant@google.com>
1358
1359 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1360 Use abstract base class for GOT.
1361 * gold/output.h (class Output_data_got_base): New abstract base class.
1362 (class Output_data_got): Derive from new base class, adjust ctors.
1363 (Output_data_got::reserve_slot): Make virtual; rename to
1364 do_reserve_slot; Adjust callers.
1365 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1366 pointer to abstract base class.
1367 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1368
83896202
ILT
13692011-12-18 Ian Lance Taylor <iant@google.com>
1370
1371 * object.h (Relobj::local_symbol_value): New function.
1372 (Relobj::local_plt_offset): New function.
1373 (Relobj::local_has_got_offset): New function.
1374 (Relobj::local_got_offset): New function.
1375 (Relobj::set_local_got_offset): New function.
1376 (Relobj::do_local_symbol_value): New pure virtual function.
1377 (Relobj::do_local_plt_offset): Likewise.
1378 (Relobj::do_local_has_got_offset): Likewise.
1379 (Relobj::do_local_got_offset): Likewise.
1380 (Relobj::do_set_local_got_offset): Likewise.
1381 (Sized_relobj::do_local_has_got_offset): Rename from
1382 local_has_got_offset.
1383 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1384 (Sized_relobj::do_set_local_got_offset): Rename from
1385 set_local_got_offset.
1386 (Sized_relobj_file::do_local_plt_offset): Rename from
1387 local_plt_offset.
1388 (Sized_relobj_file::do_local_symbol_value): New function.
1389 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1390 local_plt_offset.
1391 * output.cc (Output_data_got::Got_entry::write): Change object to
1392 Relobj. Use local_symbol_value.
1393 (Output_data_got::add_global_with_rel): Change rel_dyn to
1394 Output_data_reloc_generic*. Use add_global_generic.
1395 (Output_data_got::add_global_with_rela): Remove. Change all
1396 callers to use add_global_with_rel.
1397 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1398 Output_data_reloc_generic*. Use add_global_generic.
1399 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1400 callers to use add_global_pair_with_rel.
1401 (Output_data_got::add_local): Change object to Relobj*.
1402 (Output_data_got::add_local_plt): Likewise.
1403 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1404 change rel_dyn to Output_data_reloc_generic*. Use
1405 add_local_generic.
1406 (Output_data_got::add_local_with_rela): Remove. Change all
1407 callers to use all_local_with_rel.
1408 (Output_data_got::add_local_pair_with_rel): Change object to
1409 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1410 add_output_section_generic.
1411 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1412 callers to use add_local_pair_with_rel.
1413 (Output_data_got::reserve_local): Change object to Relobj*.
1414 * output.h: (class Output_data_reloc_generic): Add pure virtual
1415 declarations for add_global_generic, add_local_generic,
1416 add_output_section_generic.
1417 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1418 functions for Output_data_reloc_generic. Update declarations for
1419 changes listed in output.cc.
1420 (class Output_data_got): Change template parameter to got_size.
1421 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1422 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1423 function.
1424 (Sized_relobj_incr::do_local_plt_offset): New function.
1425 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1426 add_global_generic.
1427
76677ad0
CC
14282011-12-17 Cary Coutant <ccoutant@google.com>
1429
1430 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1431 * resolve.cc (Symbol_table::resolve): Likewise.
1432 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1433 arrays.
1434 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1435
8b8dd8d5
ILT
14362011-12-16 Ian Lance Taylor <iant@google.com>
1437
1438 * output.h (Output_data_reloc_generic::add): Only call
1439 add_dynamic_reloc if this is a dynamic reloc section.
1440
d55525b9
L
14412011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1442
1443 PR gold/13505
1444 * target-reloc.h (apply_relocation): Replace <64, false> with
1445 <size, big_endian>.
1446
ff81c7c1
NC
14472011-11-25 Nick Clifton <nickc@redhat.com>
1448
1449 * po/it.po: New Italian translation.
1450
628f39be
SA
14512011-11-17 Sterling Augustine <saugustine@google.com>
1452
1453 * script.cc (script_include_directive): Implement.
1454 (read_script_file): New local variables name and search_path. Update
1455 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1456 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1457 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1458
98ef3ea4
SA
14592011-11-11 Sterling Augustine <saugustine@google.com>
1460
1461 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1462 (file_or_sections_cmd): Likewise.
1463
f4a8b6d7
DK
14642011-11-11 Doug Kwan <dougkwan@google.com>
1465
1466 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1467 if --just-symbols is given.
1468
29ab395d
DK
14692011-11-10 Doug Kwan <dougkwan@google.com>
1470
1471 PR gold/13362
1472 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1473 when processing data relocs.
1474 * reloc.h (Relocate_functions::rel_unaligned): New method.
1475 (Relocate_functions::pcrel_unaligned): Ditto.
1476 (Relocate_functions::rel32_unaligned): Ditto.
1477 (Relocate_functions::pcrel32_unaligned): Ditto.
1478
2c339f71
DK
14792011-11-09 Doug Kwan <dougkwan@google.com>
1480
1481 PR gold/13362
1482 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1483 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1484 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1485 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1486 (Relocate_functions::rel_unaligned): New.
1487 (Relocate_functions::rel32_unaligned): New.
1488 * target-reloc.h (relocate_for_relocatable): Add code to handle
1489 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1490 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1491 arm_unaligned_reloc_r): New targets.
1492 * testsuite/Makefile.in: Regenerate.
1493 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1494 linking.
1495
3f3cddf1
ILT
14962011-11-02 Ian Lance Taylor <iant@google.com>
1497
1498 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1499 NATIVE_LINKER.
1500 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1501 * options.cc (General_options::finalize): Use library search path
1502 from configure script if specified. If not native and no sysroot,
1503 only search TOOLLIBDIR.
1504 * options.h (Search_directory::Search_directory): Change name to
1505 const std::string&.
1506 (General_options::add_to_library_path_with_sysroot): Change arg to
1507 const std::string&.
1508 * configure, Makefile.in, config.in: Rebuild.
1509
a8e2273b
ILT
15102011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1511
1512 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1513 we are working around the ARM1176 Erratum.
1514 * options.h (General_options::fix_arm1176): Add option.
1515 * testsuite/Makefile.am: Add testcases, and keep current ones
1516 working.
1517 * testsuite/Makefile.in: Regenerate.
1518 * testsuite/arm_fix_1176.s: New file.
1519 * testsuite/arm_fix_1176.sh: Likewise.
1520
cd6eab1c
ILT
15212011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1522
1523 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1524 may_use_blx_.
1525 (Target_arm::may_use_blx): Remove method.
1526 (Target_arm::set_may_use_blx): Likewise.
1527 (Target_arm::may_use_v4t_interworking): New method.
1528 (Target_arm::may_use_v5t_interworking): Likewise.
1529 (Target_arm::may_use_blx_): Remove member variable.
1530 (Arm_relocate_functions::arm_branch_common): Check for v5T
1531 interworking.
1532 (Arm_relocate_functions::thumb_branch_common): Likewise.
1533 (Reloc_stub::stub_type_for_reloc): Likewise.
1534 (Target_arm::do_finalize_sections): Correct interworking checks.
1535 * testsuite/Makefile.am: Add new tests.
1536 * testsuite/Makefile.in: Regenerate.
1537 * testsuite/arm_farcall_arm_arm.s: New test.
1538 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1539 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1540 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1541 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1542 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1543 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1544 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1545
286adcf4
CC
15462011-10-31 Cary Coutant <ccoutant@google.com>
1547
1548 PR gold/13023
1549 * expression.cc (Expression::eval_with_dot): Add
1550 is_section_dot_assignment parameter.
1551 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1552 absolute and assigning to dot within a section.
1553 * script-sections.cc
1554 (Output_section_element_assignment::set_section_addresses): Pass
1555 dot_section to set_if_absolute.
1556 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1557 as is_section_dot_assignment flag to eval_with_dot.
1558 (Output_section_element_dot_assignment::set_section_addresses):
1559 Likewise.
1560 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1561 parameter. Also set value if relative to dot_section; set the
1562 symbol's output_section.
1563 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1564 parameter. Adjust all callers.
1565 (Expression::eval_maybe_dot): Likewise.
1566 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1567 Adjust all callers.
1568 * testsuite/script_test_2.t: Test assignment of an absolute value
1569 to dot within an output section element.
1570
9634ed06
CC
15712011-10-31 Cary Coutant <ccoutant@google.com>
1572
1573 * options.h (class General_options): Add --[no-]gnu-unique options.
1574 * symtab.cc (Symbol_table::sized_write_globals): Convert
1575 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1576
de4101c7
CC
15772011-10-31 Cary Coutant <ccoutant@google.com>
1578
1579 PR gold/13359
1580 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1581 unnecessary assertion.
1582 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1583
7257cc92
ST
15842011-10-31 Sriraman Tallam <tmsriram@google.com>
1585
1586 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1587 gc_mark_symbol.
1588 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1589 gc_mark_symbol.
1590 Change to just keep the section associated with symbol.
1591 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1592 they are externally visible and --export-dynamic is turned on.
1593 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1594
bfc34b3f
ILT
15952011-10-19 Ian Lance Taylor <iant@google.com>
1596
1597 PR gold/13163
1598 * script-sections.cc
1599 (Output_section_element_dot_assignment::needs_output_section): New
1600 function.
1601
ea0d8c47
ILT
16022011-10-19 Ian Lance Taylor <iant@google.com>
1603
1604 PR gold/13204
1605 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1606 --section-start option was seen.
1607 * options.h (General_options::any_section_start): New function.
1608
abd242a9
DM
16092011-10-18 David S. Miller <davem@davemloft.net>
1610
1611 PR binutils/13301
1612 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1613 member to track relocation locations that have moved during TLS
1614 reloc optimizations.
1615 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1616 (Target_sparc::Relocate::relocate): Adjust view down by 4
1617 bytes if it matches reloc_adjust_addr_.
1618 (Target_sparc::Relocate::relocate_tls): Always move the
1619 __tls_get_addr call delay slot instruction forward 4 bytes when
1620 performing relaxation.
1621
bab9090f
CC
16222011-10-18 Cary Coutant <ccoutant@google.com>
1623
1624 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1625 (Output_file::map_no_anonymous): Check for non-zero
1626 return code from posix_fallocate.
1627
f7c5b166
CC
16282011-10-17 Cary Coutant <ccoutant@google.com>
1629
1630 PR gold/13245
1631 * plugin.cc (is_visible_from_outside): Check for symbols
1632 referenced from dynamic objects.
1633 * resolve.cc (Symbol_table::resolve): Don't count references
1634 from dynamic objects as references from real ELF files.
1635 * testsuite/plugin_test_2.sh: Adjust expected result.
1636
b490c0bb
CC
16372011-10-17 Cary Coutant <ccoutant@google.com>
1638
1639 * gold.cc: Include timer.h.
1640 (queue_middle_tasks): Stamp time.
1641 (queue_final_tasks): Likewise.
1642 * main.cc (main): Store timer in parameters. Print timers
1643 for each pass.
1644 * parameters.cc (Parameters::Parameters): Initialize timer_.
1645 (Parameters::set_timer): New function.
1646 (set_parameters_timer): New function.
1647 * parameters.h (Parameters::set_timer): New function.
1648 (Parameters::timer): New function.
1649 (Parameters::timer_): New data member.
1650 (set_parameters_timer): New function.
1651 * timer.cc (Timer::stamp): New function.
1652 (Timer::get_pass_time): New function.
1653 * timer.h (Timer::stamp): New function.
1654 (Timer::get_pass_time): New function.
1655 (Timer::pass_times_): New data member.
1656
f475cf7b
CC
16572011-10-17 Cary Coutant <ccoutant@google.com>
1658
1659 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1660 task for members of lib groups.
1661
cdd7e244
CC
16622011-10-17 Cary Coutant <ccoutant@google.com>
1663
1664 PR gold/13288
4f95c8b4 1665 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1666 (File_read::make_view): Move bounds check (replace with assert)...
1667 (File_read::find_or_make_view): ... to here.
1668
dfb45471
CC
16692011-10-12 Cary Coutant <ccoutant@google.com>
1670
4f95c8b4 1671 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1672 ::read returns less than requested size.
1673
53bbcc1b
CC
16742011-10-10 Cary Coutant <ccoutant@google.com>
1675
4f95c8b4 1676 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1677 Initialize defined_count_.
1678 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1679 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1680 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1681 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1682 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1683 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1684 member.
1685 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1686 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1687 Return zeroes instead of internal error.
1688
397b129b
CC
16892011-10-10 Cary Coutant <ccoutant@google.com>
1690
1691 PR gold/13249
4f95c8b4 1692 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1693 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1694 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1695 (Output_reloc::type_): Adjust size of bit field.
1696 (Output_reloc::use_plt_offset_): New bit field.
1697 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1698 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1699 flag. Adjust all callers.
4f95c8b4 1700 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1701 creating RELATIVE relocations.
1702
d5698657
NC
17032011-10-10 Nick Clifton <nickc@redhat.com>
1704
1705 * po/es.po: Updated Spanish translation.
1706 * po/fi.po: Updated Finnish translation.
1707
6a59a5c2
DN
17082011-10-03 Diego Novillo <dnovillo@google.com>
1709
1710 * options.cc (parse_uint): Fix dereference of RETVAL.
1711
f0558624
ST
17122011-09-29 Sriraman Tallam <tmsriram@google.com>
1713
1714 * layout.h (section_order_map_): New member.
1715 (get_section_order_map): New member function.
1716 * output.cc (Output_section::add_input_section): Check for patterns
1717 only when --section-ordering-file is specified.
1718 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1719 output_sections have been formed.
1720 * layout.cc (Layout_Layout): Initialize section_order_map_.
1721 * plugin.cc (update_section_order): Store order in order_map. Do not
1722 update the order.
1723 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1724 * testsuite/Makefile.in: Regenerate.
1725 * testsuite/plugin_section_order.c: New file.
1726 * testsuite/plugin_final_layout.cc: New file.
1727 * testsuite/plugin_final_layout.sh: New file.
1728
a7dac153
CC
17292011-09-29 Cary Coutant <ccoutant@google.com>
1730
4f95c8b4 1731 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1732 Check for NULL.
4f95c8b4 1733 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1734 symbols during incremental update.
1735 (Symbol_table::add_from_dynobj): Likewise.
1736
eebd87a5
ILT
17372011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1738 Ian Lance Taylor <iant@google.com>
1739
1740 * symtab.cc (Symbol_table::define_special_symbol): Always
1741 canonicalize version string.
1742
403a3331
CC
17432011-09-26 Cary Coutant <ccoutant@google.com>
1744
4f95c8b4
CC
1745 * gold.cc (queue_initial_tasks): Move option checks ...
1746 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1747 some options; make others fatal.
1748
235061c2
CC
17492011-09-26 Cary Coutant <ccoutant@google.com>
1750
1751 gcc PR lto/47247
1752 * plugin.cc (get_symbols_v2): New function.
1753 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1754 (is_referenced_from_outside): New function.
1755 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1756 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1757 (get_symbols): Pass version parameter.
1758 (get_symbols_v2): New function.
1759 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1760 parameter.
1761 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1762 (onload): Add LDPT_GET_SYMBOLS_V2.
1763 (all_symbols_read_hook): Use get_symbols_v2; check for
1764 LDPR_PREVAILING_DEF_IRONLY_EXP.
1765 * testsuite/plugin_test_3.sh: Update expected results.
1766
dc87f620
ILT
17672011-09-23 Simon Baldwin <simonb@google.com>
1768
1769 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1770 configuration options.
1771 * configure: Regenerate.
1772 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1773 * Makefile.in: Regenerate.
1774 * testsuite/Makefile.in: Regenerate.
1775
a8279f82
ST
17762011-09-19 Sriraman Tallam <tmsriram@google.com>
1777
1778 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1779
0c9350c8
CC
17802011-09-19 Cary Coutant <ccoutant@google.com>
1781
1782 * incremental.cc (can_incremental_update): Fix typo in comment.
1783 * incremental.h (can_incremental_update): Likewise.
1784
aa06ae28
CC
17852011-09-18 Cary Coutant <ccoutant@google.com>
1786
1787 * incremental.cc (can_incremental_update): New function.
1788 * incremental.h (can_incremental_update): New function.
1789 * layout.cc (Layout::init_fixed_output_section): Call it.
1790 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1791 * object.cc (Sized_relobj_file::do_layout): Call
1792 can_incremental_update.
1793
ebb300b2
CC
17942011-09-13 Cary Coutant <ccoutant@google.com>
1795
1796 * configure.ac: Check for glibc support for gnu_indirect_function
1797 support with static linking, setting automake conditional
1798 IFUNC_STATIC.
1799 * Makefile.in: Regenerate.
1800 * configure: Regenerate.
1801
1802 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1803 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1804 for IFUNC_STATIC.
1805 * testsuite/Makefile.in: Regenerate.
1806
1206d0d5
CC
18072011-09-13 Cary Coutant <ccoutant@google.com>
1808
1809 * incremental.cc (Sized_relobj_incr::do_layout): Call
1810 report_comdat_group for kept comdat sections.
1811 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1812 * testsuite/Makefile.in: Regenerate.
1813 * testsuite/incr_comdat_test_1.cc: New source file.
1814 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1815 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1816 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1817
40b29874
ILT
18182011-09-13 Ian Lance Taylor <iant@google.com>
1819
1820 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1821 variable external_symbols_offset.
1822
1b045aac
ILT
18232011-09-12 Ian Lance Taylor <iant@google.com>
1824
1825 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1826 triggered if object has no symbols.
1827
24c6c55a
DM
18282011-09-09 David S. Miller <davem@davemloft.net>
1829
1830 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1831 (Output_fill_debug_line::do_write): Likewise.
1832
66570254
CC
18332011-08-29 Cary Coutant <ccoutant@google.com>
1834
1835 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1836 casts to match formatting specs.
1837 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1838
8ea8cd50
CC
18392011-08-26 Cary Coutant <ccoutant@google.com>
1840
1841 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1842 remaining hole size when allocating.
1843 (Layout::make_output_section): Set fill methods for debug sections.
1844 * layout.h (Free_list::Free_list_node): Move from private to
1845 public.
1846 (Free_list::set_min_hole_size): New function.
1847 (Free_list::begin, Free_list::end): New functions.
1848 (Free_list::min_hole_): New data member.
1849 * output.cc: Include dwarf.h.
1850 (Output_fill_debug_info::do_minimum_hole_size): New function.
1851 (Output_fill_debug_info::do_write): New function.
1852 (Output_fill_debug_line::do_minimum_hole_size): New function.
1853 (Output_fill_debug_line::do_write): New function.
1854 (Output_section::Output_section): Initialize new data member.
1855 (Output_section::set_final_data_size): Ensure patch space is larger
1856 than minimum hole size.
1857 (Output_section::do_write): Fill holes in debug sections.
1858 * output.h (Output_fill): New class.
1859 (Output_fill_debug_info): New class.
1860 (Output_fill_debug_line): New class.
1861 (Output_section::set_free_space_fill): New function.
1862 (Output_section::free_space_fill_): New data member.
1863 * testsuite/Makefile.am (incremental_test_3): Add
1864 --incremental-patch option.
1865 (incremental_test_4): Likewise.
1866 (incremental_test_5): Likewise.
1867 (incremental_test_6): Likewise.
1868 (incremental_copy_test): Likewise.
1869 (incremental_common_test_1): Likewise.
1870 * testsuite/Makefile.in: Regenerate.
1871
7cf80422
NC
18722011-08-26 Nick Clifton <nickc@redhat.com>
1873
1874 * po/es.po: Updated Spanish translation.
1875
c3f7b0e5
CC
18762011-08-01 Cary Coutant <ccoutant@google.com>
1877
1878 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1879 * gold/testsuite/Makefile.in: Regenerate.
1880 * gold/testsuite/justsyms_exec.c: New source file.
1881 * gold/testsuite/justsyms_lib.c: New source file.
1882
9590bf25
CC
18832011-08-01 Cary Coutant <ccoutant@google.com>
1884
1885 * layout.cc (Layout::set_segment_offsets): Don't realign text
1886 segment if -Ttext was specified.
1887 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1888 file type.
1889 * object.h (Sized_relobj_file::e_type): New function.
1890 (Sized_relobj_file::e_type_): New data member.
1891 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1892 base address for ET_EXEC files.
1893 * target.cc (Target::do_make_elf_object_implementation): Allow
1894 ET_EXEC files with --just-symbols option.
1895
dcd8d12e
CC
18962011-07-28 Cary Coutant <ccoutant@google.com>
1897
1898 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1899 Add thread_number parameter.
1900 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1901 * workqueue-threads.cc
1902 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1903 current thread if its thread number is greater than desired thread
1904 count.
1905 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1906 Add thread_number parameter.
1907 (Workqueue::should_cancel_thread): Likewise.
1908 (Workqueue::find_runnable_or_wait): Pass thread_number to
1909 should_cancel_thread.
1910 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1911 parameter.
1912
804eb480
ST
19132011-07-22 Sriraman Tallam <tmsriram@google.com>
1914
1915 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1916 only after checking if it cannot be forced local.
1917 * symtab.h (is_externally_visible): Check if the symbol is not forced
1918 local.
1919
f1ddb600
ILT
19202011-07-15 Ian Lance Taylor <iant@google.com>
1921
1922 * options.h (class General_options): Add --print-output-format.
1923 Move -EL next to -EB, for better --help output.
1924 * target-select.cc: Include <cstdio>, "options.h", and
1925 "parameters.h".
1926 (Target_selector::do_target_bfd_name): New function.
1927 (print_output_format): New function.
1928 * target-select.h (class Target_selector): Update declarations.
1929 (Target_selector::target_bfd_name): New function.
1930 (print_output_format): Declare.
1931 * main.cc: Include "target-select.h".
1932 (main): Handle --print-output-format.
1933 * gold.cc: Include "target-select.h".
1934 (queue_initial_tasks): Handle --print-output-format when there are
1935 no input files.
1936 * parameters.cc (parameters_force_valid_target): Give a better
1937 error message if -EB/-EL does not match target.
1938 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1939 function.
1940
7d172687
ILT
19412011-07-15 Ian Lance Taylor <iant@google.com>
1942
1943 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1944 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1945 (Output_data_plt_i386::do_write): Write address of .dynamic
1946 section to first entry in .got.plt section.
1947 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1948 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1949 Initialize layout_.
1950 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1951 section to first entry in .got.plt section.
1952 * layout.h (Layout::dynamic_section): New function.
1953
e9552f7e
ST
19542011-07-13 Sriraman Tallam <tmsriram@google.com>
1955
1956 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1957 to claim_file call.
1958 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1959 input_section_position_, and input_section_glob_.
1960 (read_layout_from_file): Call function section_ordering_specified.
1961 * layout.h (is_section_ordering_specified): New function.
1962 (section_ordering_specified): New function.
1963 (section_ordering_specified_): New boolean member.
1964 * main.cc(main): Call load_plugins after layout object is defined.
1965 * output.cc (Output_section::add_input_section): Use
1966 function section_ordering_specified to check if section ordering is
1967 needed.
1968 * output.cc (Output_section::add_relaxed_input_section): Use
1969 function section_ordering_specified to check if section ordering is
1970 needed.
1971 (Output_section::update_section_layout): New function.
1972 (Output_section::sort_attached_input_sections): Check if input section
1973 must be reordered.
1974 * output.h (Output_section::update_section_layout): New function.
1975 * plugin.cc (get_section_count): New function.
1976 (get_section_type): New function.
1977 (get_section_name): New function.
1978 (get_section_contents): New function.
1979 (update_section_order): New function.
58797674 1980 (allow_section_ordering): New function.
e9552f7e
ST
1981 (Plugin::load): Add the new interfaces to the transfer vector.
1982 (Plugin_manager::load_plugins): New parameter.
1983 (Plugin_manager::all_symbols_read): New parameter.
1984 (Plugin_manager::claim_file): New parameter. Save the elf object for
1985 unclaimed objects.
1986 (Plugin_manager::get_elf_object): New function.
1987 (Plugin_manager::get_view): Change to directly use the bool to check
1988 if get_view is called from claim_file_hook.
1989 * plugin.h (input_objects): New function
1990 (Plugin__manager::load_plugins): New parameter.
1991 (Plugin_manager::claim_file): New parameter.
1992 (Plugin_manager::get_elf_object): New function.
1993 (Plugin_manager::in_claim_file_handler): New function.
1994 (Plugin_manager::in_claim_file_handler_): New member.
1995 (layout): New function.
1996 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1997 handler with an extra parameter. Make the elf object before calling
1998 claim_file handler.
1999 * testsuite/plugin_test.c (get_section_count): New function pointer.
2000 (get_section_type): New function pointer.
2001 (get_section_name): New function pointer.
2002 (get_section_contents): New function pointer.
2003 (update_section_order): New function pointer.
2004 (allow_section_ordering): New function pointer.
2005 (onload): Check if the new interfaces exist.
2006
9446efde
ILT
20072011-07-13 Ian Lance Taylor <iant@google.com>
2008
2009 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2010 relro section.
2011 * x86_64.cc (Target_x86_64::got_section): Likewise.
2012 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2013 (relro_now_test_SOURCES): New variable.
2014 (relro_now_test_DEPENDENCIES): New variable.
2015 (relro_now_test_LDFLAGS): New variable.
2016 (relro_now_test_LDADD): New variable.
2017 (relro_now_test.so): New target.
2018 * testsuite/Makefile.in: Rebuild.
2019
07aa62f2
ILT
20202011-07-12 Ian Lance Taylor <iant@google.com>
2021
2022 PR gold/12980
2023 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2024 GLOB_DAT relocation rather than a RELATIVE relocation for a
2025 protected symbol when creating a shared library.
2026 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2027 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2028 * testsuite/protected_main_1.cc (main): Test that protected
2029 function has same address.
2030
e2153196
ILT
20312011-07-11 Ian Lance Taylor <iant@google.com>
2032
2033 PR gold/12979
2034 * options.h (class General_options): Add -Bgroup.
2035 * options.cc (General_options::finalize): If -Bgroup is set,
2036 default to --unresolved-symbols=report-all.
2037 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2038 * target-reloc.h (issue_undefined_symbol_error): Handle
2039 --unresolved-symbols=report-all.
2040
6daf5215
ILT
20412011-07-08 Ian Lance Taylor <iant@google.com>
2042
2043 PR gold/11985
2044 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2045 if linker script discards key sections.
2046 (Layout::create_dynamic_symtab): Likewise.
2047 (Layout::assign_local_dynsym_offsets): Likewise.
2048 (Layout::sized_create_version_sections): Likewise.
2049 (Layout::create_interp): Likewise.
2050 (Layout::finish_dynamic_section): Likewise.
2051 (Layout::set_dynamic_symbol_size): Likewise.
2052
beabb2c6
ILT
20532011-07-08 Ian Lance Taylor <iant@google.com>
2054
2055 PR gold/12386
2056 * options.h (class General_options): Add --unresolved-symbols.
2057 * target-reloc.h (issue_undefined_symbol_error): Check
2058 --unresolved-symbols. Add comments.
2059
9c16daf1
ILT
20602011-07-08 Ian Lance Taylor <iant@google.com>
2061
2062 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2063 expression more complex.
2064
191f1a2d
ILT
20652011-07-08 Ian Lance Taylor <iant@google.com>
2066
2067 PR gold/11317
2068 * target-reloc.h (issue_undefined_symbol_error): New inline
2069 function, broken out of relocate_section.
2070 (relocate_section): Call issue_undefined_symbol_error.
2071 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2072 there is no TLS segment if we are about to issue an undefined
2073 symbol error.
2074 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2075
62855347
ILT
20762011-07-08 Ian Lance Taylor <iant@google.com>
2077
2078 PR gold/12279
2079 * resolve.cc (Symbol_table::should_override): Add fromtype
2080 parameter. Change all callers. Give error when linking together
2081 TLS and non-TLS symbol.
2082 (Symbol_table::should_override_with_special): Add fromtype
2083 parameter. Change all callers.
2084 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2085 there is no TLS segment if we have reported some errors.
2086 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2087
67181c72
ILT
20882011-07-08 Ian Lance Taylor <iant@google.com>
2089
2090 PR gold/12372
2091 * target.h (Target::plt_address_for_global): New function.
2092 (Target::plt_address_for_local): New function.
2093 (Target::plt_section_for_global): Remove.
2094 (Target::plt_section_for_local): Remove.
2095 (Target::do_plt_address_for_global): New virtual function.
2096 (Target::do_plt_address_for_local): New virtual function.
2097 (Target::do_plt_section_for_global): Remove.
2098 (Target::do_plt_section_for_local): Remove.
2099 (Target::register_global_plt_entry): Add Symbol_table and Layout
2100 parameters.
2101 * output.cc (Output_data_got::Got_entry::write): Use
2102 plt_address_for_global and plt_address_for_local.
2103 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2104 address of output section.
2105 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2106 got_irelative_, and irelative_count_ fields. Update
2107 declarations.
2108 (Output_data_plt_i386::has_irelative_section): New function.
2109 (Output_data_plt_i386::entry_count): Add irelative_count_.
2110 (Output_data_plt_i386::set_final_data_size): Likewise.
2111 (class Target_i386): Add got_irelative_ and rel_irelative_
2112 fields. Update declarations.
2113 (Target_i386::Target_i386): Initialize new fields.
2114 (Target_i386::do_plt_address_for_global): New function replacing
2115 do_plt_section_for_global.
2116 (Target_i386::do_plt_address_for_local): New function replacing
2117 do_plt_section_for_local.
2118 (Target_i386::got_section): Create got_irelative_.
2119 (Target_i386::rel_irelative_section): New function.
2120 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2121 fields. Don't define __rel_iplt_{start,end}.
2122 (Output_data_plt_i386::add_entry): Add symtab and layout
2123 parameters. Change all callers. Use different PLT and GOT for
2124 IFUNC symbols.
2125 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2126 layout parameters. Change all callers. Use different PLT and
2127 GOT.
2128 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2129 (Output_data_plt_i386::rel_irelative): New function.
2130 (Output_data_plt_i386::address_for_global): New function.
2131 (Output_data_plt_i386::address_for_local): New function.
2132 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2133 IRELATIVE GOT when changing IFUNC GOT entries.
2134 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2135 reloc.
2136 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2137 if we didn't create an IRELATIVE GOT.
2138 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2139 plt_address_for_local.
2140 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2141 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2142 got_irelative_, and irelative_count_ fields. Update
2143 declarations.
2144 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2145 Initialize new fields. Remove symtab parameter. Change all
2146 callers.
2147 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2148 irelative_count_.
2149 (Output_data_plt_x86_64::has_irelative_section): New function.
2150 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2151 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2152 fields. Update declarations.
2153 (Target_x86_64::Target_x86_64): Initialize new fields.
2154 (Target_x86_64::do_plt_address_for_global): New function replacing
2155 do_plt_section_for_global.
2156 (Target_x86_64::do_plt_address_for_local): New function replacing
2157 do_plt_section_for_local.
2158 (Target_x86_64::got_section): Create got_irelative_.
2159 (Target_x86_64::rela_irelative_section): New function.
2160 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2161 all callers. Don't create __rel_iplt_{start,end}.
2162 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2163 parameters. Change all callers. Use different PLT and GOT for
2164 IFUNC symbols.
2165 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2166 layout parameters. Change all callers. Use different PLT and
2167 GOT.
2168 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2169 parameters. Change all callers. Use different PLT and GOT for
2170 IFUNC symbols.
2171 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2172 (Output_data_plt_x86_64::rela_irelative): New function.
2173 (Output_data_plt_x86_64::address_for_global): New function.
2174 (Output_data_plt_x86_64::address_for_local): New function.
2175 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2176 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2177 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2178 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2179 parameters.
2180 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2181 reloc.
2182 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2183 symbols if we didn't create an IRELATIVE GOT.
2184 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2185 plt_address_for_local.
2186 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2187 * testsuite/ifuncvar1.c: New test file.
2188 * testsuite/ifuncvar2.c: New test file.
2189 * testsuite/ifuncvar3.c: New test file.
2190 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2191 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2192 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2193 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2194 * testsuite/Makefile.in: Rebuild.
2195
33c15b45
CC
21962011-07-07 Cary Coutant <ccoutant@google.com>
2197
2198 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2199 (two_file_test_1_ndebug.o): Likewise.
2200 (two_file_test_1b_ndebug.o): Likewise.
2201 (two_file_test_2_ndebug.o): Likewise.
2202 (two_file_test_main_ndebug.o): Likewise.
2203 (incremental_test_2): Link with no-debug versions.
2204
f48b5fb7
CC
22052011-07-06 Cary Coutant <ccoutant@google.com>
2206
2207 * gold/incremental.cc
2208 (Output_section_incremental_inputs::write_info_blocks): Check for
2209 hidden and internal symbols.
2210
221597a5
CC
22112011-07-06 Cary Coutant <ccoutant@google.com>
2212
2213 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2214 Check disposition for startup file.
2215 (Incremental_inputs::report_command_line): Ignore
2216 --incremental-startup-unchanged option.
2217 * options.cc (General_options::parse_incremental_startup_unchanged):
2218 New function.
2219 (General_options::General_options): Initialize new data member.
2220 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2221 (General_options): Add --incremental-startup-unchanged option.
2222 (General_options::incremental_startup_disposition): New function.
2223 (General_options::incremental_startup_disposition_): New data member.
2224
e24719f6
CC
22252011-07-06 Cary Coutant <ccoutant@google.com>
2226
2227 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2228 input file index to Script_info ctor.
2229 (Sized_incremental_binary::do_file_has_changed): Find the
2230 command-line argument for files named in scripts.
2231 * incremental.h (Script_info::Script_info): New ctor
2232 with input file index.
2233 (Script_info::input_file_index): New function.
2234 (Script_info::input_file_index_): New data member.
2235 (Incremental_binary::get_library): Add const.
2236 (Incremental_binary::get_script_info): Add const.
2237 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2238 * testsuite/Makefile.am (incremental_test_5): New test case.
2239 (incremental_test_6): New test case.
2240 * testsuite/Makefile.in: Regenerate.
2241
8f7c81e8
CC
22422011-07-06 Cary Coutant <ccoutant@google.com>
2243
2244 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2245 debug output when command lines differ.
2246
9fbd3822
CC
22472011-07-06 Cary Coutant <ccoutant@google.com>
2248
2249 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2250 --incremental-patch option.
2251 * layout.cc (Free_list::allocate): Extend allocation beyond original
2252 end if enabled.
2253 (Layout::make_output_section): Mark sections that should get
2254 patch space.
2255 * options.cc (parse_percent): New function.
2256 * options.h (parse_percent): New function.
2257 (DEFINE_percent): New macro.
2258 (General_options): Add --incremental-patch option.
2259 * output.cc (Output_section::Output_section): Initialize new data
2260 members.
2261 (Output_section::add_input_section): Print section name when out
2262 of patch space.
2263 (Output_section::add_output_section_data): Likewise.
2264 (Output_section::set_final_data_size): Add patch space when
2265 doing --incremental-full.
2266 (Output_section::do_reset_address_and_file_offset): Remove patch
2267 space.
2268 (Output_segment::set_section_list_addresses): Print debug output
2269 only if --incremental-update.
2270 * output.h (Output_section::set_is_patch_space_allowed): New function.
2271 (Output_section::is_patch_space_allowed_): New data member.
2272 (Output_section::patch_space_): New data member.
2273 * parameters.cc (Parameters::incremental_full): New function.
2274 * parameters.h (Parameters::incremental_full): New function
2275 * testsuite/Makefile.am (incremental_test_2): Add test for
2276 --incremental-patch option.
2277 * testsuite/Makefile.in: Regenerate.
2278 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2279 (t18): Remove function body.
2280
f6cccc2c
DK
22812011-07-05 Doug Kwan <dougkwan@google.com>
2282
2283 PR gold/12771
2284 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2285 Arm_Address type for relocation result.
2286 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2287 overflow check.
2288 (Arm_relocate_functions::abs32): Use unaligned access.
2289 (Arm_relocate_functions::rel32): Ditto.
2290 (Arm_relocate_functions::prel31): Ditto.
2291 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2292 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2293 static data relocations.
2294 * testsuite/Makefile.in: Regnerate.
2295 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2296
28a13fec
ILT
22972011-07-05 Ian Lance Taylor <iant@google.com>
2298
2299 PR gold/12392
2300 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2301 symbols if necessary.
2302 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2303
24d47b34
ILT
23042011-07-05 Ian Lance Taylor <iant@google.com>
2305
2306 PR gold/12952
2307 * resolve.cc (Symbol::override_base_with_special): Simply override
2308 version with special symbol version, ignoring previous version.
2309
41f9cbbe
ILT
23102011-07-05 Ian Lance Taylor <iant@google.com>
2311
2312 * object.cc (Sized_relobj_file::include_section_group): Add
2313 information to comment about signature location.
2314
886288f1
ILT
23152011-07-02 Ian Lance Taylor <iant@google.com>
2316
2317 PR gold/12957
2318 * options.h (class General_options): Add -f and -F.
2319 * options.cc (General_options::finalize): Fatal error if -f/-F
2320 are used without -shared.
2321 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2322
ae3a6d4f
ILT
23232011-07-02 Ian Lance Taylor <iant@google.com>
2324
2325 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2326
21131061
ILT
23272011-07-01 Ian Lance Taylor <iant@google.com>
2328
2329 PR gold/12525
2330 PR gold/12952
2331 * resolve.cc (Symbol::override_base_with_special): Don't override
2332 the version if the overriding symbol has a different name.
2333 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2334 all callers. If we give an error about an undefined version,
2335 define the base version if necessary.
2336 * dynobj.h (class Versions): Update declaration.
2337 * testsuite/weak_alias_test_5.cc: New file.
2338 * testsuite/weak_alias_test.script: New file.
2339 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2340 and versioned_alias have the right value, and call t2.
2341 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2342 weak_alias_test_5.so.
2343 (weak_alias_test_LDADD): Likewise.
2344 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2345 * testsuite/Makefile.in: Rebuild.
2346
611062c0
ILT
23472011-07-01 Ian Lance Taylor <iant@google.com>
2348
2349 PR gold/12525
2350 * options.h (class General_options): Support -z notext.
2351 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2352 -Wl,-z,notext.
2353 (two_file_shared_nonpic.so): Likewise.
2354 (two_file_shared_mixed.so): Likewise.
2355 (two_file_shared_mixed_1.so): Likewise.
2356 (weak_undef_lib_nonpic.so): Likewise.
2357 (alt/weak_undef_lib_nonpic.so): Likewise.
2358 (tls_test_shared_nonpic.so): Likewise.
2359 * testsuite/Makefile.in: Rebuild.
2360
328c7c2f
ILT
23612011-07-01 Ian Lance Taylor <iant@google.com>
2362
2363 PR gold/12525
2364 * configure.ac: Test whether static linking works, setting
2365 the automake conditional HAVE_STATIC.
2366 * testsuite/Makefile.am: Disable tests using -static if
2367 HAVE_STATIC is not true.
2368 * configure, testsuite/Makefile.in: Rebuild.
2369
02d7cd44
ILT
23702011-07-01 Ian Lance Taylor <iant@google.com>
2371
2372 PR gold/12525
2373 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2374 Assert if we see DW_EH_PE_indirect.
2375 * target.h (Target::ehframe_datarel_base): New function.
2376 (Target::do_ehframe_datarel_base): New target function.
2377 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2378 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2379 function.
2380
07a60597
ILT
23812011-07-01 Ian Lance Taylor <iant@google.com>
2382
2383 PR gold/12571
2384 * options.h (class General_options): Add
2385 --ld-generated-unwind-info.
2386 * ehframe.cc (Fde::write): Add address parameter. Change all
2387 callers. If associated with PLT, fill in address and size.
2388 (Cie::set_output_offset): Only add merge mapping if there is an
2389 object.
2390 (Cie::write): Add address parameter. Change all callers.
2391 (Eh_frame::add_ehframe_for_plt): New function.
2392 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2393 input_offset_ fields into union u_, with new plt field.
2394 (Fde::Fde): Adjust for new union field.
2395 (Fde::Fde) [Output_data version]: New constructor.
2396 (Fde::add_mapping): Only add merge mapping if there is an object.
2397 (class Cie): Update declarations.
2398 (class Eh_frame): Declare add_ehframe_for_plt.
2399 * layout.cc (Layout::layout_eh_frame): Break out code into
2400 make_eh_frame_section, and call it.
2401 (Layout::make_eh_frame_section): New function.
2402 (Layout::add_eh_frame_for_plt): New function.
2403 * layout.h (class Layout): Update declarations.
2404 * merge.cc (Merge_map::add_mapping): Add assertion.
2405 * i386.cc: Include "dwarf.h".
2406 (class Output_data_plt_i386): Make first_plt_entry,
2407 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2408 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2409 and plt_eh_frame_fde.
2410 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2411 boundary. Call add_eh_frame_for_plt if appropriate.
2412 * x86_64.cc: Include "dwarf.h".
2413 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2414 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2415 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2416 and plt_eh_frame_fde.
2417 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2418 appropriate.
2419
14788a3f
ILT
24202011-06-29 Ian Lance Taylor <iant@google.com>
2421
2422 PR gold/12629
2423 * object.cc (Sized_relobj_file::layout_section): Change shdr
2424 parameter to be const.
2425 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2426 out of do_layout.
2427 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2428 appropriate. Call layout_eh_frame_section.
2429 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2430 sections.
2431 * object.h (class Sized_relobj_file): Update declarations.
2432
6c21fce1
ILT
24332011-06-29 Ian Lance Taylor <iant@google.com>
2434
37e41b03 2435 PR gold/12652
6c21fce1
ILT
2436 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2437 modifier.
2438 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2439
4d5e4e62
ILT
24402011-06-29 Ian Lance Taylor <iant@google.com>
2441
2442 PR gold/12675
2443 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2444 SHT_X86_64_UNWIND.
2445 * layout.cc (Layout::layout_eh_frame): Likewise.
2446
886f533a
ILT
24472011-06-29 Ian Lance Taylor <iant@google.com>
2448
2449 PR gold/12695
2450 * layout.cc (Layout::symtab_section_shndx): New function.
2451 * layout.h (class Layout): Declare symtab_section_shndx.
2452 * output.cc (Output_section::write_header): Call it.
2453
f3ae1b28
ILT
24542011-06-29 Ian Lance Taylor <iant@google.com>
2455
2456 PR gold/12818
2457 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2458 symbols which are not used in a relocation.
2459
aecf301f
ILT
24602011-06-28 Ian Lance Taylor <iant@google.com>
2461
2462 PR gold/12898
2463 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2464 script create indistinguishable segments.
2465 (Layout::set_segment_offsets): Use stable_sort when sorting
2466 segments. Pass this to Compare_segments constructor.
2467 * layout.h (class Layout): Make segment_precedes non-static.
2468 (class Compare_segments): Change from struct to class. Add
2469 layout_ field. Add constructor.
2470 * script-sections.cc
2471 (Script_sections::attach_sections_using_phdrs_clause): Rename
2472 local orphan to is_orphan. Don't report failure to put empty
2473 section in segment. On attachment failure, report name of
2474 section, and attach to first PT_LOAD segment.
2475
03ef7571
ILT
24762011-06-28 Ian Lance Taylor <iant@google.com>
2477
2478 PR gold/12934
2479 * target-select.cc (Target_selector::Target_selector): Add
2480 emulation parameter. Change all callers.
2481 (select_target_by_bfd_name): Rename from select_target_by_name.
2482 Change all callers.
2483 (select_target_by_emulation): New function.
2484 (supported_emulation_names): New function.
2485 * target-select.h (class Target_selector): Add emulation_ field.
2486 Update declarations.
2487 (Target_selector::recognize_by_bfd_name): Rename from
2488 recognize_by_name. Change all callers.
2489 (Target_selector::supported_bfd_names): Rename from
2490 supported_names. Change all callers.
2491 (Target_selector::recognize_by_emulation): New function.
2492 (Target_selector::supported_emulations): New function.
2493 (Target_selector::emulation): New function.
2494 (Target_selector::do_recognize_by_bfd_name): Rename from
2495 do_recognize_by_name. Change all callers.
2496 (Target_selector::do_supported_bfd_names): Rename from
2497 do_supported_names. Change all callers.
2498 (Target_selector::do_recognize_by_emulation): New function.
2499 (Target_selector::do_supported_emulations): New function.
2500 (select_target_by_bfd_name): Change name in declaration.
2501 (select_target_by_emulation): Declare.
2502 (supported_emulation_names): Declare.
2503 * parameters.cc (parameters_force_valid_target): Try to find
2504 target based on emulation from -m option.
2505 * options.h (class General_options): Change doc string for -m.
2506 * options.cc (help): Print emulations.
2507 (General_options::parse_V): Likewise.
2508 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2509 Add emulation parameter. Change all callers.
2510
200b2bb9
ILT
25112011-06-28 Ian Lance Taylor <iant@google.com>
2512
2513 * target.h (class Target): Add osabi_ field.
2514 (Target::osabi): New function.
2515 (Target::set_osabi): New function.
2516 (Target::Target): Initialize osabi_.
2517 (Target::do_adjust_elf_header): Make pure virtual.
2518 (Sized_target::do_adjust_elf_header): Declare.
2519 * target.cc (Sized_target::do_adjust_elf_header): New function.
2520 (class Sized_target): Instantiate all versions.
2521 * freebsd.h (class Target_freebsd): Remove.
2522 (Target_selector_freebsd::do_recognize): Call set_osabi on
2523 Target.
2524 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2525 (Target_selector_freebsd::set_osabi): Remove.
2526 * i386.cc (class Target_i386): Inherit from Sized_target rather
2527 than Target_freebsd.
2528 * x86_64.cc (class Target_x86_64): Likewise.
2529
b3ce541e
ILT
25302011-06-28 Ian Lance Taylor <iant@google.com>
2531
2532 * target.h (Target::can_check_for_function_pointers): Rewrite.
2533 Make non-virtual.
2534 (Target::can_icf_inline_merge_sections): Likewise.
2535 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2536 (Target::Target_info): Add can_icf_inline_merge_sections field.
2537 (Target::do_can_check_for_function_pointers): New virtual
2538 function.
2539 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2540 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2541 from can_check_for_function_pointers, move in file.
2542 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2543 section_may_have_icf_unsafe_poineters, move in file.
2544 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2545 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2546 Rename from can_check_for_function_pointers, move in file.
2547 (Target_i386::can_icf_inline_merge_sections): Remove.
2548 (Target_i386::i386_info): Initialize
2549 can_icf_inline_merge_sections.
2550 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2551 Initialize can_icf_inline_merge_sections.
2552 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2553 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2554 Rename from can_check_for_function_pointers, move in file.
2555 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2556 (Target_x86_64::x86_64_info): Initialize
2557 can_icf_inline_merge_sections.
2558 * testsuite/testfile.cc (Target_test::test_target_info):
2559 Likewise.
2560 * icf.cc (get_section_contents): Correct formatting.
2561
6d1c4efb
ILT
25622011-06-27 Ian Lance Taylor <iant@google.com>
2563
2564 * symtab.cc (Symbol::versioned_name): New function.
2565 (Symbol_table::add_to_final_symtab): Use versioned_name when
2566 appropriate.
2567 (Symbol_table::sized_write_symbol): Likewise.
2568 * symtab.h (class Symbol): Declare versioned_name.
2569 * stringpool.h (class Stringpool_template): Add variant of add
2570 which takes a std::basic_string.
2571 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2572 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2573 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2574 (ver_test_12.o): New target.
2575 * testsuite/Makefile.in: Rebuild.
2576
57eb9b50
DK
25772011-06-27 Doug Kwan <dougkwan@google.com>
2578
2579 * arm.cc (Arm_relocate_functions::thm_jump8,
2580 Arm_relocate_functions::thm_jump11): Use a wider signed
2581 type to compute offset.
2582 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2583 arm_thm_jump8.
2584 * testsuite/Makefile.in: Regenerate.
2585 * testsuite/arm_branch_in_range.sh: Check test results of
2586 arm_thm_jump11 and arm_thm_jump8.
2587 * testsuite/arm_thm_jump11.s: New test source file.
2588 * testsuite/arm_thm_jump11.t: New linker script.
2589 * testsuite/arm_thm_jump8.s: New test source file.
2590 * testsuite/arm_thm_jump8.t: New linker script.
2591
487b39df
ILT
25922011-06-24 Ian Lance Taylor <iant@google.com>
2593
2594 * layout.cc: Include "object.h".
2595 (ctors_sections_in_init_array): New static variable.
2596 (Layout::is_ctors_in_init_array): New function.
2597 (Layout::layout): Add entry to ctors_sections_in_init_array if
2598 appropriate.
2599 * layout.h (class Layout): Declare is_ctors_in_init_array.
2600 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2601 is_ctors_reverse_view is set.
2602 (Sized_relobj_file::write_sections): Add layout parameter. Change
2603 all callers. Set is_ctors_reverse_view field of View_size.
2604 (Sized_relobj_file::reverse_words): New function.
2605 * object.h (Sized_relobj_file::View_size): Add
2606 is_ctors_reverse_view field.
2607 (class Sized_relobj_file): Update declarations.
2608 * testsuite/initpri3.c: New test.
2609 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2610 initpri3b.
2611 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2612 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2613 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2614 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2615 * testsuite/Makefile.in: Rebuild.
2616
472076e4
CC
26172011-06-24 Cary Coutant <ccoutant@google.com>
2618
2619 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2620 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2621 (debug_msg_cdebug.err): New targets.
2622 * testsuite/Makefile.in: Regenerate.
2623 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2624 Fix checks for link with shared library.
2625
a60af0db
DK
26262011-06-24 Doug Kwan <dougkwan@google.com>
2627
2628 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2629 skip empty text sections.
2630 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2631
5393d741
ILT
26322011-06-22 Ian Lance Taylor <iant@google.com>
2633
2634 PR gold/12910
2635 * options.h (class General_options): Add --ctors-in-init-array.
2636 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2637 friends as SHT_PROGBITS for merging sections.
2638 (Layout::layout): Remove special handling of .init_array and
2639 friends. Don't sort if doing relocatable link. Sort for .ctors
2640 and .dtors if ctors_in_init_array.
2641 (Layout::make_output_section): Force correct section types for
2642 .init_array and friends. Don't sort if doing relocatable link,
2643 Don't sort .ctors and .dtors if ctors_in_init_array.
2644 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2645 (Layout::output_section_name): Add relobj parameter. Change all
2646 callers. Handle .ctors. and .dtors. in code rather than table.
2647 Handle .ctors and .dtors if ctors_in_init_array.
2648 (Layout::match_file_name): New function, moved from output.cc.
2649 * layout.h (class Layout): Update declarations.
2650 * output.cc: Include "layout.h".
2651 (Input_section_sort_entry::get_priority): New function.
2652 (Input_section_sort_entry::match_file_name): Just call
2653 Layout::match_file_name.
2654 (Output_section::Input_section_sort_init_fini_compare::operator()):
2655 Handle .ctors and .dtors. Sort by explicit priority rather than
2656 by name.
2657 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2658 * testsuite/initpri2.c: New test.
2659 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2660 (check_PROGRAMS): Add initpri2.
2661 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2662 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2663 * configure, testsuite/Makefile.in: Rebuild.
2664
e1f74f98
ILT
26652011-06-19 Ian Lance Taylor <iant@google.com>
2666
2667 PR gold/12880
2668 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2669 .interp section to a PT_INTERP segment even if we have seen a
2670 --dynamic-linker option. Don't do it if we have seen a PHDRS
2671 clause in a linker script.
2672 (Layout::finalize): Don't create a .interp section if we've
2673 already create a PT_INTERP segment.
2674 (Layout::create_interp): Always call choose_output_section (revert
2675 patch of 2011-06-17). Don't create PT_INTERP segment.
2676 * script-sections.cc
2677 (Script_sections::create_note_and_tls_segments): Add a .interp
2678 section to a PT_INTERP segment even if we have seen a
2679 --dynamic-linker option.
2680
766f91bb
ILT
26812011-06-18 Ian Lance Taylor <iant@google.com>
2682
2683 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2684 merely because a non-PT_LOAD segment has a dynamic reloc.
2685
0d212c3a
ILT
26862011-06-18 Ian Lance Taylor <iant@google.com>
2687
2688 * layout.cc (Layout::finish_dynamic_section): Don't create
2689 DT_FLAGS entry if not needed.
2690
911a5072
ILT
26912011-06-18 Ian Lance Taylor <iant@google.com>
2692
2693 PR gold/12745
2694 * layout.cc (Layout::layout_eh_frame): Correct handling of
2695 writable .eh_frame section.
2696
534b4e5f
ILT
26972011-06-17 Ian Lance Taylor <iant@google.com>
2698
2699 PR gold/12893
2700 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2701 symbol is redefined with the exact same object and value.
2702
10b4f102
ILT
27032011-06-17 Ian Lance Taylor <iant@google.com>
2704
2705 PR gold/12880
2706 * layout.h (class Layout): Add interp_segment_ field.
2707 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2708 (Layout::attach_allocated_section_to_segment): If making shared
2709 library, put .interp section in PT_INTERP segment.
2710 (Layout::finalize): Also call create_interp if -dynamic-linker
2711 option was used.
2712 (Layout::create_interp): Assert that there is no PT_INTERP
2713 segment. If not using a SECTIONS clause, use make_output_section.
2714 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2715 * script-sections.cc
2716 (Script_sections::create_note_and_tls_segments): If making shared
2717 library, put .interp section in PT_INTERP segment.
2718
a29b0dad
ILT
27192011-06-17 Ian Lance Taylor <iant@google.com>
2720
e588ea8d
ILT
2721 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2722 when making a shared library.
2723
27242011-06-17 Ian Lance Taylor <iant@google.com>
2725
2726 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2727 parameter. Change all callers. Don't issue warning about PC32
2728 against locally defined symbol.
a29b0dad 2729
9d3b0698
ILT
27302011-06-16 Ian Lance Taylor <iant@google.com>
2731
2732 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2733 occurs in same object.
2734
85b0f90c
AM
27352011-06-14 Alan Modra <amodra@gmail.com>
2736
2737 * po/POTFILES.in: Regenerate.
2738
a94907d9
ILT
27392011-06-09 Ian Lance Taylor <iant@google.com>
2740
2741 * script-sections.cc
2742 (Orphan_output_section::set_section_addresses): For a relocatable
2743 link set address to 0.
2744
4fb3a1c3
CC
27452011-06-09 Cary Coutant <ccoutant@google.com>
2746
2747 PR gold/12804
2748 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2749 used with --compress-debug-sections.
2750 * gold/object.cc (Sized_relobj_file::do_layout): Report
2751 uncompressed size of compressed input sections.
2752
61220854
CC
27532011-06-08 Cary Coutant <ccoutant@google.com>
2754
2755 PR gold/12804
2756 * testsuite/two_file_test_2_v1.cc: Change initialization of
2757 v2 to keep it in .data.
2758
e6455dfb
CC
27592011-06-07 Cary Coutant <ccoutant@google.com>
2760
2761 * common.cc (Symbol_table::do_allocate_commons_list): Call
2762 gold_fallback.
2763 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2764 (Errors::fallback): New function.
2765 (gold_fallback): New function.
2766 * errors.h (Errors::fallback): New function.
2767 * gold.cc (gold_exit): Change status parameter to enum; adjust
2768 all callers.
2769 (queue_initial_tasks): Call gold_fallback.
2770 * gold.h: Include cstdlib.
2771 (Exit_status): New enum type.
2772 (gold_exit): Change status parameter to enum.
2773 (gold_fallback): New function.
2774 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2775 (Layout::create_symtab_sections): Likewise.
2776 (Layout::create_shdrs): Likewise.
2777 * main.cc (main): Adjust call to gold_exit.
2778 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2779 (Output_data_got::add_got_entry_pair): Likewise.
2780 (Output_section::add_input_section): Likewise.
2781 (Output_section::add_output_section_data): Likewise.
2782 (Output_segment::set_section_list_addresses): Likewise.
2783 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2784
fb0e076f
CC
27852011-06-07 Cary Coutant <ccoutant@google.com>
2786
2787 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2788 for incremental links.
2789 * output.cc (Output_segment::set_section_list_addresses): Remove
2790 FIXME and test for TLS or BSS.
2791
a5ee4d5d
CC
27922011-06-07 Cary Coutant <ccoutant@google.com>
2793
2794 * testsuite/Makefile.am: Add incremental_copy_test,
2795 incremental_common_test_1.
2796 * testsuite/Makefile.in: Regenerate.
2797 * testsuite/common_test_1_v1.c: New source file.
2798 * testsuite/common_test_1_v2.c: New source file.
2799 * testsuite/copy_test_v1.cc: New source file.
2800
5146f448
CC
28012011-06-07 Cary Coutant <ccoutant@google.com>
2802
2803 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2804 update, allocate common from bss section's free list.
2805 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2806 linker-defined symbols.
2807 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2808 Skip GOT and PLT entries that are no longer referenced.
2809 (Output_section_incremental_inputs::write_info_blocks): Mark
2810 linker-defined symbols.
2811 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2812 * output.cc (Output_section::allocate): New function.
2813 * output.h (Output_section::allocate): New function.
2814 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2815 linker-defined symbols.
2816 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2817 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2818 (Symbol::init_base_output_data): Likewise.
2819 (Symbol::init_base_output_segment): Likewise.
2820 (Symbol::init_base_constant): Likewise.
2821 (Sized_symbol::init_output_data): Likewise.
2822 (Sized_symbol::init_output_segment): Likewise.
2823 (Sized_symbol::init_constant): Likewise.
2824 (Symbol_table::do_define_in_output_data): Likewise.
2825 (Symbol_table::do_define_in_output_segment): Likewise.
2826 (Symbol_table::do_define_as_constant): Likewise.
2827 * symtab.h (Symbol::is_predefined): New function.
2828 (Symbol::init_base_output_data): Add is_predefined parameter.
2829 (Symbol::init_base_output_segment): Likewise.
2830 (Symbol::init_base_constant): Likewise.
2831 (Symbol::is_predefined_): New data member.
2832 (Sized_symbol::init_output_data): Add is_predefined parameter.
2833 (Sized_symbol::init_output_segment): Likewise.
2834 (Sized_symbol::init_constant): Likewise.
2835 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2836
26d3c67d
CC
28372011-06-07 Cary Coutant <ccoutant@google.com>
2838
2839 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2840 instead of emit_copy_reloc.
2841 (Copy_relocs::emit_copy_reloc): Refactor.
2842 (Copy_relocs::make_copy_reloc): New function.
2843 (Copy_relocs::add_copy_reloc): Remove.
2844 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2845 section.
2846 (Copy_relocs::make_copy_reloc): New function.
2847 (Copy_relocs::add_copy_reloc): Remove.
2848 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2849 unchanged input files.
2850 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2851 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2852 Reserve BSS space for COPY relocations.
2853 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2854 (Output_section_incremental_inputs::write_info_blocks): Record
2855 whether a symbol is copied from a shared object.
2856 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2857 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2858 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2859 (Incremental_input_entry_reader::get_output_symbol_index): Add
2860 is_copy parameter.
2861 (Incremental_binary::emit_copy_relocs): New function.
2862 (Incremental_binary::do_emit_copy_relocs): New function.
2863 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2864 new data member.
2865 (Sized_incremental_binary::add_copy_reloc): New function.
2866 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2867 (Sized_incremental_binary::Copy_reloc): New struct.
2868 (Sized_incremental_binary::Copy_relocs): New typedef.
2869 (Sized_incremental_binary::copy_relocs_): New data member.
2870 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2871 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2872 * target.h (Sized_target::emit_copy_reloc): New function.
2873 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2874
7cdb37d9
CC
28752011-06-02 Cary Coutant <ccoutant@google.com>
2876
2877 PR gold/12163
2878 * gold/archive.cc (Archive::Archive): Initialize new data member.
2879 (Archive::include_all_members): Return if archive has already been
2880 included.
2881 * gold/archive.h (Archive::include_all_members_): New data member.
2882
cc643b88
NC
28832011-06-02 Nick Clifton <nickc@redhat.com>
2884
2885 * dynobj.h: Fix spelling mistake in comment.
2886 * output.cc: Likewise.
2887
f62a3ca7 28882011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2889 Asier Llano
f62a3ca7
DK
2890
2891 PR gold/12826
cc643b88 2892 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2893 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2894 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2895 redundant arm_exidx_test.so.
2896 * testsuite/Makefile.in: Regenerate.
2897 (check_SCRIPTS): Add pr12826.sh
2898 (check_DATA): Add pr12826.stdout
2899 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2900 * testsuite/pr12826.sh: New file.
2901 * testsuite/pr12826_1.s: Ditto.
2902 * testsuite/pr12826_1.s: Ditto.
2903
8dbe1edc
ILT
29042011-05-30 Ian Lance Taylor <iant@google.com>
2905
2906 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2907 sections.
2908
c49875be
ILT
29092011-05-29 Ian Lance Taylor <iant@google.com>
2910
2911 PR gold/12804
2912 * testsuite/Makefile.am: Use different file name for two_file_test
2913 temporary file for each incremental test.
2914 * testsuite/Makefile.in: Rebuild.
2915
69d53f7a
ILT
29162011-05-29 Ian Lance Taylor <iant@google.com>
2917
2918 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2919 binary input file is empty.
2920
41d0ab5f
ILT
29212011-05-27 Ian Lance Taylor <iant@google.com>
2922
2923 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2924 (ver_test_9.so): Likewise.
2925 * testsuite/Makefile.in: Rebuild.
2926
89d8a36b
CC
29272011-05-26 Cary Coutant <ccoutant@google.com>
2928
2929 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2930 * incremental.cc (Incremental_inputs::report_input_section): Fix
2931 comment, indentation.
2932 (Incremental_inputs::report_comdat_group): New function.
2933 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2934 of data for incremental input file entry.
2935 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2936 group count, COMDAT group signatures.
2937 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2938 an unchanged input file.
2939 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2940 Initialize new data member.
2941 (Incremental_object_entry::add_comdat_group): New function.
2942 (Incremental_object_entry::get_comdat_group_count): New function.
2943 (Incremental_object_entry::get_comdat_signature_key): New function.
2944 (Incremental_object_entry::groups_): New data member.
2945 (Incremental_inputs::report_comdat_group): New function.
2946 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2947 data for incremental input file entry.
2948 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2949 (Incremental_input_entry_reader::get_input_section): Adjust size of
2950 data for incremental input file entry.
2951 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2952 (Incremental_input_entry_reader::get_comdat_group_signature): New
2953 function.
2954 * object.cc (Sized_relobj::include_section_group): Report kept
2955 COMDAT groups for incremental links.
2956
1706a06f
ILT
29572011-05-24 David Meyer <pdox@google.com>
2958
2959 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2960 with name parameter. Add found_name parameter.
2961 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2962 * dirsearch.h (class Dirsearch): Update declaration.
2963
a10ae760
ILT
29642011-05-24 Ian Lance Taylor <iant@google.com>
2965
2966 * archive.cc (Library_base::should_include_member): Pull in object
2967 from archive if it defines the entry symbol.
2968 * parameters.cc (Parameters::entry): New function.
2969 * parameters.h (class Parameters): Declare entry.
2970 * output.h (class Output_file_header): Remove entry_ field.
2971 * output.cc (Output_file_header::Output_file_header): Remove entry
2972 parameter. Change all callers.
2973 (Output_file_header::entry): Use parameters->entry.
2974 * gold.cc (queue_middle_tasks): Likewise.
2975 * plugin.cc (Plugin_hook::run): Likewise.
2976
aa92d6ed
CC
29772011-05-24 Cary Coutant <ccoutant@google.com>
2978
2979 * gold.cc (queue_initial_tasks): Pass incremental base filename
2980 to Output_file::open_base_file; don't print error message.
2981 * incremental-dump.cc (main): Adjust call to
2982 Output_file::open_for_modification.
2983 * incremental-dump.cc (main): Likewise.
2984 * incremental.cc (Incremental_inputs::report_command_line):
2985 Ignore --incremental-base option when comparing command lines.
2986 Ignore parameter when given as separate argument.
2987 * options.h (class General_options): Add --incremental-base.
2988 * output.cc (Output_file::Output_file):
2989 (Output_file::open_base_file): Add base_name and writable parameters;
2990 read base file into new file; print error message here.
2991 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2992 callers.
2993 * output.h (Output_file::open_for_modification): Rename to...
2994 (Output_file::open_base_file): ...this; add base_name and
2995 writable parameters; adjust all callers.
2996 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2997 callers.
2998 * testsuite/Makefile.am (incremental_test_4): Test
2999 --incremental-base.
3000 * testsuite/Makefile.in: Regenerate.
3001
2eedd706
CC
30022011-05-24 Cary Coutant <ccoutant@google.com>
3003
3004 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3005 incremental_test_4.
3006 * testsuite/Makefile.in: Regenerate.
3007 * testsuite/two_file_test_1_v1.cc: New test source file.
3008 * testsuite/two_file_test_1b_v1.cc: New test source file.
3009 * testsuite/two_file_test_2_v1.cc: New test source file.
3010
0f1c85a6
CC
30112011-05-24 Cary Coutant <ccoutant@google.com>
3012
3013 * dynobj.h (Dynobj::do_dynobj): New function.
3014 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3015 flag and soname for shared objects.
3016 * incremental.cc (Incremental_inputs::report_object): Make
3017 either Incremental_object_entry or Incremental_dynobj_entry; add
3018 soname to string table.
3019 (Incremental_inputs::report_input_section): Add assertion.
3020 (Output_section_incremental_inputs::set_final_data_size): Adjust
3021 type of input file entry for shared libraries; adjust size of
3022 shared library info entry.
3023 (Output_section_incremental_inputs::write_input_files): Write
3024 as_needed flag for shared libraries.
3025 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3026 of input file entry for shared libraries; write soname.
3027 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3028 soname from incremental info.
3029 * incremental.h (enum Incremental_input_flags): Add
3030 INCREMENTAL_INPUT_AS_NEEDED.
3031 (Incremental_input_entry::Incremental_input_entry): Initialize new
3032 data member.
3033 (Incremental_input_entry::set_as_needed): New function.
3034 (Incremental_input_entry::as_needed): New function.
3035 (Incremental_input_entry::do_dynobj_entry): New function.
3036 (Incremental_input_entry::as_needed_): New data member.
3037 (Incremental_object_entry::Incremental_object_entry): Don't check
3038 for shared library.
3039 (Incremental_object_entry::do_type): Likewise.
3040 (class Incremental_dynobj_entry): New class.
3041 (Incremental_input_entry_reader::as_needed): New function.
3042 (Incremental_input_entry_reader::get_soname): New function.
3043 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3044 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3045 size of shared library info entry.
58797674 3046 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3047 incremental link when adding DT_NEEDED entries.
3048 * object.h (Object::Object): Initialize new data member.
3049 (Object::dynobj): New function.
3050 (Object::set_as_needed): New function.
3051 (Object::as_needed): New function.
3052 (Object::do_dynobj): New function.
3053 (Object::as_needed_): New data member.
3054
6fa2a40b
CC
30552011-05-24 Cary Coutant <ccoutant@google.com>
3056
3057 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3058 info; adjust display of GOT entries.
3059 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3060 vector of input objects; remove file_status_.
3061 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3062 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3063 got_plt reader; call target hooks to reserve GOT entries.
3064 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3065 of input file info header and GOT info entry.
3066 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3067 relocation info.
3068 (Got_plt_view_info::got_descriptor): Remove.
3069 (Got_plt_view_info::sym_index): New data member.
3070 (Got_plt_view_info::input_index): New data member.
3071 (Local_got_offset_visitor::visit): Write input file index.
3072 (Global_got_offset_visitor::visit): Write 0 for input file index.
3073 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3074 with sym_index and input_index.
3075 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3076 incremental info GOT entry; replace got_descriptor with input_index.
3077 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3078 map from input file index to object.
3079 (Sized_relobj_incr::do_layout): Replace direct data member reference
3080 with accessor function.
3081 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3082 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3083 Adjust size of input file info header.
3084 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3085 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3086 (Incremental_input_entry_reader::get_input_section): Adjust size of
3087 input file info header.
3088 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3089 of incremental info GOT entry.
3090 (Incremental_got_plt_reader::get_got_desc): Remove.
3091 (Incremental_got_plt_reader::get_got_symndx): New function.
3092 (Incremental_got_plt_reader::get_got_input_index): New function.
3093 (Sized_incremental_binary::Sized_incremental_binary): Remove
3094 file_status_; add input_objects_.
3095 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3096 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3097 (Sized_incremental_binary::file_is_unchanged): Remove.
3098 (Sized_incremental_binary::set_input_object): New function.
3099 (Sized_incremental_binary::input_object): New function.
3100 (Sized_incremental_binary::file_status_): Remove.
3101 (Sized_incremental_binary::input_objects_): New data member.
3102 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3103 references.
3104 (Sized_relobj_incr::invalid_address): Move to base class.
3105 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3106 class.
3107 (Sized_relobj_incr::do_output_section_offset): Likewise.
3108 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3109 (Sized_relobj_incr::section_offsets_): Likewise.
3110 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3111 function.
3112 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3113 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3114 with accessor function.
3115 (Sized_relobj_file::do_layout): Likewise.
3116 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3117 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3118 (Sized_relobj_file::compute_final_local_value): Replace refs to
3119 section_offsets_ with accessor function.
3120 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3121 * object.h (Relobj::Relobj): Initialize new data members.
3122 (Relobj::add_dyn_reloc): New function.
3123 (Relobj::first_dyn_reloc): New function.
3124 (Relobj::dyn_reloc_count): New function.
3125 (Relobj::first_dyn_reloc_): New data member.
3126 (Relobj::dyn_reloc_count_): New data member.
3127 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3128 references.
3129 (Sized_relobj::Address): New typedef.
3130 (Sized_relobj::invalid_address): Move here from child class.
3131 (Sized_relobj::Sized_relobj): Initialize new data members.
3132 (Sized_relobj::sized_relobj): New function.
3133 (Sized_relobj::is_output_section_offset_invalid): Move here from
3134 child class.
3135 (Sized_relobj::get_output_section_offset): Likewise.
3136 (Sized_relobj::local_has_got_offset): Likewise.
3137 (Sized_relobj::local_got_offset): Likewise.
3138 (Sized_relobj::set_local_got_offset): Likewise.
3139 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3140 (Sized_relobj::clear_got_offsets): New function.
3141 (Sized_relobj::section_offsets): Move here from child class.
3142 (Sized_relobj::do_output_section_offset): Likewise.
3143 (Sized_relobj::do_set_section_offset): Likewise.
3144 (Sized_relobj::Local_got_offsets): Likewise.
3145 (Sized_relobj::local_got_offsets_): Likewise.
3146 (Sized_relobj::section_offsets_): Likewise.
3147 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3148 references.
3149 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3150 class.
3151 (Sized_relobj_file::sized_relobj): New function
3152 (Sized_relobj_file::local_has_got_offset): Move to base class.
3153 (Sized_relobj_file::local_got_offset): Likewise.
3154 (Sized_relobj_file::set_local_got_offset): Likewise.
3155 (Sized_relobj_file::get_output_section_offset): Likewise.
3156 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3157 (Sized_relobj_file::do_output_section_offset): Likewise.
3158 (Sized_relobj_file::do_set_section_offset): Likewise.
3159 (Sized_relobj_file::Local_got_offsets): Likewise.
3160 (Sized_relobj_file::local_got_offsets_): Likewise.
3161 (Sized_relobj_file::section_offsets_): Likewise.
3162 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3163 (all constructors).
3164 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3165 (Output_reloc::get_symbol_index): Likewise.
3166 (Output_reloc::local_section_offset): Likewise.
3167 (Output_reloc::get_address): Likewise.
3168 (Output_reloc::symbol_value): Likewise.
3169 (Output_data_got::reserve_slot): Move to class definition.
3170 (Output_data_got::reserve_local): New function.
3171 (Output_data_got::reserve_slot_for_global): Remove.
3172 (Output_data_got::reserve_global): New function.
3173 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3174 (all constructors, two instantiations).
3175 (Output_reloc::get_relobj): New function (two instantiations).
3176 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3177 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3178 (Output_data_reloc::add_global): Adjust type of relobj.
3179 (Output_data_reloc::add_global_relative): Likewise.
3180 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3181 (Output_data_reloc::add_local): Likewise.
3182 (Output_data_reloc::add_local_relative): Likewise.
3183 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3184 (Output_data_reloc::add_local_section): Likewise.
3185 (Output_data_reloc::add_output_section): Likewise.
3186 (Output_data_reloc::add_absolute): Likewise.
3187 (Output_data_reloc::add_target_specific): Likewise.
3188 (Output_data_got::reserve_slot): Move definition here.
3189 (Output_data_got::reserve_local): New function.
3190 (Output_data_got::reserve_global): New function.
3191 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3192 section_offsets_ with accessor function.
3193 (Sized_relobj_file::write_sections): Likewise.
3194 (Sized_relobj_file::do_relocate_sections): Likewise.
3195 * target.h (Sized_target::reserve_local_got_entry): New function.
3196 (Sized_target::reserve_global_got_entry): New function.
3197 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3198 (Target_x86_64::reserve_global_got_entry): New function.
3199 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3200
4829d394
CC
32012011-05-23 Cary Coutant <ccoutant@google.com>
3202
3203 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3204 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3205 bit when checking got_type.
3206 * incremental.cc (Sized_incremental_binary::setup_readers):
3207 Store symbol table and string table locations; initialize bit vector
3208 of file status flags.
3209 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3210 unchanged files.
3211 (Sized_incremental_binary::do_process_got_plt): New function.
3212 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3213 (Output_section_incremental_inputs::set_final_data_size): Record
3214 file index for each input file.
3215 (Output_section_incremental_inputs::write_got_plt): Store file index
3216 instead of input entry offset for each GOT entry.
3217 * incremental.h
3218 (Incremental_input_entry::Incremental_input_entry): Initialize new
3219 data member.
3220 (Incremental_input_entry::set_offset): Store file index.
3221 (Incremental_input_entry::get_file_index): New function.
3222 (Incremental_input_entry::file_index_): New data member.
3223 (Incremental_binary::process_got_plt): New function.
3224 (Incremental_binary::do_process_got_plt): New function.
3225 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3226 data members.
3227 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3228 (Sized_incremental_binary::set_file_is_unchanged): New function.
3229 (Sized_incremental_binary::file_is_unchanged): New function.
3230 (Sized_incremental_binary::do_process_got_plt): New function.
3231 (Sized_incremental_binary::file_status_): New data member.
3232 (Sized_incremental_binary::main_symtab_loc_): New data member.
3233 (Sized_incremental_binary::main_strtab_loc_): New data member.
3234 * output.cc (Output_data_got::Got_entry::write): Add case
3235 RESERVED_CODE.
3236 (Output_data_got::add_global): Call add_got_entry.
3237 (Output_data_got::add_global_plt): Likewise.
3238 (Output_data_got::add_global_with_rel): Likewise.
3239 (Output_data_got::add_global_with_rela): Likewise.
3240 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3241 (Output_data_got::add_global_pair_with_rela): Likewise.
3242 (Output_data_got::add_local): Call add_got_entry.
3243 (Output_data_got::add_local_plt): Likewise.
3244 (Output_data_got::add_local_with_rel): Likewise.
3245 (Output_data_got::add_local_with_rela): Likewise.
3246 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3247 (Output_data_got::add_local_pair_with_rela): Likewise.
3248 (Output_data_got::reserve_slot): New function.
3249 (Output_data_got::reserve_slot_for_global): New function.
3250 (Output_data_got::add_got_entry): New function.
3251 (Output_data_got::add_got_entry_pair): New function.
3252 (Output_section::add_output_section_data): Edit FIXME.
3253 * output.h
3254 (Output_section_data_build::Output_section_data_build): New
3255 constructor with size parameter.
3256 (Output_data_space::Output_data_space): Likewise.
3257 (Output_data_got::Output_data_got): Initialize new data member; new
3258 constructor with size parameter.
3259 (Output_data_got::add_constant): Call add_got_entry.
3260 (Output_data_got::reserve_slot): New function.
3261 (Output_data_got::reserve_slot_for_global): New function.
3262 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3263 (Output_data_got::add_got_entry): New function.
3264 (Output_data_got::add_got_entry_pair): New function.
3265 (Output_data_got::free_list_): New data member.
3266 * target.h (Sized_target::init_got_plt_for_update): New function.
3267 (Sized_target::register_global_plt_entry): New function.
3268 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3269 Initialize new data member; call init; add constructor with PLT count.
3270 (Output_data_plt_x86_64::init): New function.
3271 (Output_data_plt_x86_64::add_relocation): New function.
3272 (Output_data_plt_x86_64::reserve_slot): New function.
3273 (Output_data_plt_x86_64::free_list_): New data member.
3274 (Target_x86_64::init_got_plt_for_update): New function.
3275 (Target_x86_64::register_global_plt_entry): New function.
3276 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3277 incremental updates.
3278 (Output_data_plt_x86_64::add_relocation): New function.
3279 * testsuite/object_unittest.cc (Object_test): Set default options.
3280
ec69d6da
ILT
32812011-05-16 Ian Lance Taylor <iant@google.com>
3282
3283 * options.h (class General_options): Make -i a synonym for -r.
3284
732e31de
ILT
32852011-05-16 Ian Lance Taylor <iant@google.com>
3286
3287 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3288
403676b5
CC
32892011-05-10 Cary Coutant <ccoutant@google.com>
3290
3291 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3292 strip_all (-s).
3293
5b7b7d6e
ILT
32942011-05-06 Ian Lance Taylor <iant@google.com>
3295
3296 * layout.cc (Layout::layout): If the output section flags change,
3297 update the ordering.
3298
f0f9babf
CC
32992011-04-25 Cary Coutant <ccoutant@google.com>
3300
3301 * incremental-dump.cc (dump_incremental_inputs): Print local
3302 symbol info for each input file.
3303 * incremental.cc
3304 (Output_section_incremental_inputs::set_final_data_size): Add local
3305 symbol info to input file entries in incremental info.
3306 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3307 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3308 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3309 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3310 implementation.
3311 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3312 (Sized_incr_relobj::do_relocate): Write the local symbols.
3313 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3314 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3315 Adjust size of input file header.
3316 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3317 (Incremental_inputs_reader::get_local_symbol_count): New function.
3318 (Incremental_inputs_reader::get_input_section): Adjust size of input
3319 file header.
3320 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3321 (Sized_incr_relobj::This): New typedef.
3322 (Sized_incr_relobj::sym_size): New const data member.
3323 (Sized_incr_relobj::Local_symbol): New struct.
3324 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3325 (Sized_incr_relobj::do_local_symbol_offset): New function.
3326 (Sized_incr_relobj::local_symbol_count_): New data member.
3327 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3328 (Sized_incr_relobj::local_symbol_index_): New data member.
3329 (Sized_incr_relobj::local_symbol_offset_): New data member.
3330 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3331 (Sized_incr_relobj::local_symbols_): New data member.
3332 * object.h (Relobj::output_local_symbol_count): New function.
3333 (Relobj::local_symbol_offset): New function.
3334 (Relobj::do_output_local_symbol_count): New function.
3335 (Relobj::do_local_symbol_offset): New function.
3336 (Sized_relobj::do_output_local_symbol_count): New function.
3337 (Sized_relobj::do_local_symbol_offset): New function.
3338
d0a9ace3
ILT
33392011-04-22 Vladimir Simonov <sv@sw.ru>
3340
3341 * descriptors.cc (set_close_on_exec): New function.
3342 (Descriptors::open): Use set_close_on_exec.
3343 * output.cc (S_ISLNK): Define if not defined.
3344
94a3fc8b
CC
33452011-04-22 Cary Coutant <ccoutant@google.com>
3346
3347 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3348 global symbol map.
3349 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3350 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3351 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3352 relocations.
3353 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3354 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3355 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3356 * incremental.h
3357 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3358 function.
3359 (Incremental_binary::apply_incremental_relocs): New function.
3360 (Incremental_binary::do_apply_incremental_relocs): New function.
3361 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3362 data member.
3363 (Sized_incremental_binary::add_global_symbol): New function.
3364 (Sized_incremental_binary::global_symbol): New function.
3365 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3366 (Sized_incremental_binary::symbol_map_): New data member.
3367 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3368 * target.h (Sized_target::apply_relocation): New function.
3369 * target-reloc.h (apply_relocation): New function.
3370 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3371
c87e4302
DK
33722011-04-22 Doug Kwan <dougkwan@google.com>
3373
3374 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3375 flag of a SHT_ARM_EXIDX section.
2e702c99 3376 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3377 * testsuite/Makefile.in: Regenerate.
3378 * testsuite/arm_exidx_test.s: New file.
3379 * testsuite/arm_exidx_test.sh: Same.
3380
e7782cf6
CC
33812011-04-20 Cary Coutant <ccoutant@google.com>
3382
3383 PR gold/12689
3384 * archive.h (Incremental_archive_entry::Archive_member):
3385 Initialize arg_serial_ (second constructor).
3386
308ecdc7
ILT
33872011-04-17 Ian Lance Taylor <iant@google.com>
3388
3389 * object.cc (Relocate_info::location): Simplify location string.
3390 * errors.cc (Errors::error_at_location): Don't print program
3391 name.
3392 (Errors::warning_at_location): Likewise.
3393 (Errors::undefined_symbol): Likewise.
3394 * testsuite/debug_msg.sh: Update accordingly.
3395
bec5b579
CC
33962011-04-14 Cary Coutant <ccoutant@google.com>
3397
3398 * gold/layout.cc (Layout::symtab_section_offset): New function.
3399 * gold/layout.h (Layout::symtab_section_offset): New function.
3400 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3401
88597d34
ILT
34022011-04-12 Ian Lance Taylor <iant@google.com>
3403
3404 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3405 with MREMAP_MAYMOVE.
3406 * output.h (class Output_file): Add map_is_allocated_ field.
3407 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3408 not available, provide stubs. If mremap is not available, #define
3409 it to gold_mremap.
3410 (MREMAP_MAYMOVE): Define if not defined.
3411 (Output_file::Output_file): Initialize map_is_allocated_.
3412 (Output_file::resize): Check map_is_allocated_.
3413 (Output_file::map_anonymous): If mmap fails, use malloc.
3414 (Output_file::unmap): Don't do anything for an anonymous map.
3415 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3416 is not available, provide stubs.
3417 (File_read::View::~View): Use free rather than delete[].
3418 (File_read::make_view): Use malloc rather than new[]. If mmap
3419 fails, use malloc.
3420 (File_read::find_or_make_view): Use malloc rather than new[].
3421 * gold.h: Remove HAVE_REMAP code.
3422 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3423 exists. Rename mremap to gold_mremap. If mmap is not available
3424 don't do anything.
3425 * configure, config.in: Rebuild.
3426
11e361bc
ILT
34272011-04-11 Ian Lance Taylor <iant@google.com>
3428
3429 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3430 initialize local variable v.
3431
cdc29364
CC
34322011-04-11 Cary Coutant <ccoutant@google.com>
3433
3434 * archive.cc (Archive::include_member): Adjust call to
3435 report_object.
3436 (Add_archive_symbols::run): Track argument serial numbers.
3437 (Lib_group::include_member): Likewise.
3438 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3439 * archive.h (Incremental_archive_entry::Archive_member):
3440 Initialize arg_serial_.
3441 (Archive_member::arg_serial_): New data member.
3442 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3443 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3444 incremental link.
3445 (Sized_dynobj::do_for_all_local_got_entries): New function.
3446 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3447 function.
3448 * fileread.cc (get_mtime): New function.
3449 * fileread.h (get_mtime): New function.
3450 * gold.cc (queue_initial_tasks): Check for incremental update.
3451 (process_incremental_input): New function.
3452 (queue_middle_tasks): Don't force valid target for incremental
3453 update.
3454 * incremental-dump.cc (find_input_containing_global): Adjust
3455 size of symbol info entry.
3456 (dump_incremental_inputs): Dump argument serial number and
3457 in_system_directory flag; bias shndx by 1; print symbol names
3458 when dumping per-file symbol lists; use new symbol info readers.
3459 * incremental.cc
3460 (Output_section_incremental_inputs:update_data_size): New function.
3461 (Sized_incremental_binary::setup_readers): Setup input readers
3462 for each input file; build maps for files added from libraries
3463 and scripts.
3464 (Sized_incremental_binary::check_input_args): New function.
3465 (Sized_incremental_binary::do_check_inputs): Build map of argument
3466 serial numbers to input arguments.
3467 (Sized_incremental_binary::do_file_has_changed): Rename
3468 do_file_is_unchanged to this; compare file modification times.
3469 (Sized_incremental_binary::do_init_layout): New function.
3470 (Sized_incremental_binary::do_reserve_layout): New function.
3471 (Sized_incremental_binary::do_get_input_reader): Remove.
3472 (Sized_incremental_binary::get_symtab_view): New function.
3473 (Incremental_checker::can_incrementally_link_output_file): Remove.
3474 (Incremental_inputs::report_command_line): Exclude --debug options.
3475 (Incremental_inputs::report_archive_begin): Add parameter; track
3476 argument serial numbers; don't put input file entry for archive
3477 before archive members.
3478 (Incremental_inputs::report_archive_end): Put input file entry
3479 for archive after archive members.
3480 (Incremental_inputs::report_object): Add parameter; track argument
3481 serial numbers and in_system_directory flag.
3482 (Incremental_inputs::report_script): Add parameter; track argument
3483 serial numbers.
3484 (Output_section_incremental_inputs::set_final_data_size): Adjust
3485 size of symbol info entry; check for forwarding symbols.
3486 (Output_section_incremental_inputs::write_input_files): Write
3487 in_system_directory flag and argument serial number.
3488 (Output_section_incremental_inputs::write_info_blocks): Map section
3489 indices between incremental info and original input file; store
3490 input section index for each symbol.
3491 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3492 change operator() to visit().
3493 (class Global_got_offset_visitor): Likewise.
3494 (class Global_symbol_visitor_got_plt):
3495 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3496 classes.
3497 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3498 (Sized_incr_relobj::do_read_symbols): New function.
3499 (Sized_incr_relobj::do_layout): New function.
3500 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3501 (Sized_incr_relobj::do_add_symbols): New function.
3502 (Sized_incr_relobj::do_should_include_member): New function.
3503 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3504 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3505 (Sized_incr_relobj::do_section_size): New function.
3506 (Sized_incr_relobj::do_section_name): New function.
3507 (Sized_incr_relobj::do_section_contents): New function.
3508 (Sized_incr_relobj::do_section_flags): New function.
3509 (Sized_incr_relobj::do_section_entsize): New function.
3510 (Sized_incr_relobj::do_section_address): New function.
3511 (Sized_incr_relobj::do_section_type): New function.
3512 (Sized_incr_relobj::do_section_link): New function.
3513 (Sized_incr_relobj::do_section_info): New function.
3514 (Sized_incr_relobj::do_section_addralign): New function.
3515 (Sized_incr_relobj::do_initialize_xindex): New function.
3516 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3517 (Sized_incr_relobj::do_read_relocs): New function.
3518 (Sized_incr_relobj::do_gc_process_relocs): New function.
3519 (Sized_incr_relobj::do_scan_relocs): New function.
3520 (Sized_incr_relobj::do_count_local_symbols): New function.
3521 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3522 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3523 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3524 (Sized_incr_relobj::do_relocate): New function.
3525 (Sized_incr_relobj::do_set_section_offset): New function.
3526 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3527 (Sized_incr_dynobj::do_read_symbols): New function.
3528 (Sized_incr_dynobj::do_layout): New function.
3529 (Sized_incr_dynobj::do_add_symbols): New function.
3530 (Sized_incr_dynobj::do_should_include_member): New function.
3531 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3532 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3533 (Sized_incr_dynobj::do_section_size): New function.
3534 (Sized_incr_dynobj::do_section_name): New function.
3535 (Sized_incr_dynobj::do_section_contents): New function.
3536 (Sized_incr_dynobj::do_section_flags): New function.
3537 (Sized_incr_dynobj::do_section_entsize): New function.
3538 (Sized_incr_dynobj::do_section_address): New function.
3539 (Sized_incr_dynobj::do_section_type): New function.
3540 (Sized_incr_dynobj::do_section_link): New function.
3541 (Sized_incr_dynobj::do_section_info): New function.
3542 (Sized_incr_dynobj::do_section_addralign): New function.
3543 (Sized_incr_dynobj::do_initialize_xindex): New function.
3544 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3545 (make_sized_incremental_object): New function.
3546 (Incremental_library::copy_unused_symbols): New function.
3547 (Incremental_library::do_for_all_unused_symbols): New function.
3548 * incremental.h (enum Incremental_input_flags): New type.
3549 (class Incremental_checker): Remove.
3550 (Incremental_input_entry::Incremental_input_entry): Add argument
3551 serial number.
3552 (Incremental_input_entry::arg_serial): New function.
3553 (Incremental_input_entry::set_is_in_system_directory): New function.
3554 (Incremental_input_entry::is_in_system_directory): New function.
3555 (Incremental_input_entry::arg_serial_): New data member.
3556 (Incremental_input_entry::is_in_system_directory_): New data member.
3557 (class Script_info): Move here from script.h.
3558 (Script_info::Script_info): Add filename parameter.
3559 (Script_info::filename): New function.
3560 (Script_info::filename_): New data member.
3561 (Incremental_script_entry::Incremental_script_entry): Add argument
3562 serial number.
3563 (Incremental_object_entry::Incremental_object_entry): Likewise.
3564 (Incremental_object_entry::add_input_section): Build list of input
3565 sections with map to original shndx.
3566 (Incremental_object_entry::get_input_section_index): New function.
3567 (Incremental_object_entry::shndx_): New data member.
3568 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3569 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3570 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3571 serial number.
3572 (Incremental_inputs::report_archive_begin): Likewise.
3573 (Incremental_inputs::report_object): Likewise.
3574 (Incremental_inputs::report_script): Likewise.
3575 (class Incremental_global_symbol_reader): New class.
3576 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3577 and store flags and input file type.
3578 (Incremental_input_entry_reader::arg_serial): New function.
3579 (Incremental_input_entry_reader::type): Extract type from flags.
3580 (Incremental_input_entry_reader::is_in_system_directory): New function.
3581 (Incremental_input_entry_reader::get_input_section_count): Call
3582 accessor function for type.
3583 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3584 function for type; adjust size of global symbol entry.
3585 (Incremental_input_entry_reader::get_global_symbol_count): Call
3586 accessor function for type.
3587 (Incremental_input_entry_reader::get_object_count): Likewise.
3588 (Incremental_input_entry_reader::get_object_offset): Likewise.
3589 (Incremental_input_entry_reader::get_member_count): Likewise.
3590 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3591 (Incremental_input_entry_reader::get_member_offset): Likewise.
3592 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3593 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3594 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3595 (Incremental_input_entry_reader::get_global_symbol_reader): New
3596 function.
3597 (Incremental_input_entry_reader::get_output_symbol_index): New
3598 function.
3599 (Incremental_input_entry_reader::type_): Remove.
3600 (Incremental_input_entry_reader::flags_): New data member.
3601 (Incremental_inputs_reader::input_file_offset): New function.
3602 (Incremental_inputs_reader::input_file_index): New function.
3603 (Incremental_inputs_reader::input_file): Call input_file_offset.
3604 (Incremental_inputs_reader::input_file_at_offset): New function.
3605 (Incremental_relocs_reader::get_r_type): Reformat.
3606 (Incremental_relocs_reader::get_r_shndx): Reformat.
3607 (Incremental_relocs_reader::get_r_offset): Reformat.
3608 (Incremental_relocs_reader::data): New function.
3609 (Incremental_binary::Incremental_binary): Initialize new data members.
3610 (Incremental_binary::check_inputs): Add cmdline parameter.
3611 (Incremental_binary::file_is_unchanged): Remove.
3612 (Input_reader::arg_serial): New function.
3613 (Input_reader::get_unused_symbol_count): New function.
3614 (Input_reader::get_unused_symbol): New function.
3615 (Input_reader::do_arg_serial): New function.
3616 (Input_reader::do_get_unused_symbol_count): New function.
3617 (Input_reader::do_get_unused_symbol): New function.
3618 (Incremental_binary::input_file_count): New function.
3619 (Incremental_binary::get_input_reader): Change signature to use
3620 index instead of filename.
3621 (Incremental_binary::file_has_changed): New function.
3622 (Incremental_binary::get_input_argument): New function.
3623 (Incremental_binary::get_library): New function.
3624 (Incremental_binary::get_script_info): New function.
3625 (Incremental_binary::init_layout): New function.
3626 (Incremental_binary::reserve_layout): New function.
3627 (Incremental_binary::output_file): New function.
3628 (Incremental_binary::do_check_inputs): New function.
3629 (Incremental_binary::do_file_is_unchanged): Remove.
3630 (Incremental_binary::do_file_has_changed): New function.
3631 (Incremental_binary::do_init_layout): New function.
3632 (Incremental_binary::do_reserve_layout): New function.
3633 (Incremental_binary::do_input_file_count): New function.
3634 (Incremental_binary::do_get_input_reader): Change signature.
3635 (Incremental_binary::input_args_map_): New data member.
3636 (Incremental_binary::library_map_): New data member.
3637 (Incremental_binary::script_map_): New data member.
3638 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3639 new data members.
3640 (Sized_incremental_binary::output_section): New function.
3641 (Sized_incremental_binary::inputs_reader): Add const.
3642 (Sized_incremental_binary::symtab_reader): Add const.
3643 (Sized_incremental_binary::relocs_reader): Add const.
3644 (Sized_incremental_binary::got_plt_reader): Add const.
3645 (Sized_incremental_binary::get_symtab_view): New function.
3646 (Sized_incremental_binary::Inputs_reader): New typedef.
3647 (Sized_incremental_binary::Input_entry_reader): New typedef.
3648 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3649 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3650 (Sized_incremental_binary::do_file_has_changed): New function.
3651 (Sized_incremental_binary::do_init_layout): New function.
3652 (Sized_incremental_binary::do_reserve_layout): New function.
3653 (Sized_input_reader::Inputs_reader): Remove.
3654 (Sized_input_reader::Input_entry_reader): Remove.
3655 (Sized_input_reader::do_arg_serial): New function.
3656 (Sized_input_reader::do_get_unused_symbol_count): New function.
3657 (Sized_input_reader::do_get_unused_symbol): New function.
3658 (Sized_incremental_binary::do_input_file_count): New function.
3659 (Sized_incremental_binary::do_get_input_reader): Change signature;
3660 use index instead of filename.
3661 (Sized_incremental_binary::section_map_): New data member.
3662 (Sized_incremental_binary::input_entry_readers_): New data member.
3663 (class Sized_incr_relobj): New class.
3664 (class Sized_incr_dynobj): New class.
3665 (make_sized_incremental_object): New function.
3666 (class Incremental_library): New class.
3667 * layout.cc (Free_list::num_lists): New static data member.
3668 (Free_list::num_nodes): New static data member.
3669 (Free_list::num_removes): New static data member.
3670 (Free_list::num_remove_visits): New static data member.
3671 (Free_list::num_allocates): New static data member.
3672 (Free_list::num_allocate_visits): New static data member.
3673 (Free_list::init): New function.
3674 (Free_list::remove): New function.
3675 (Free_list::allocate): New function.
3676 (Free_list::dump): New function.
3677 (Free_list::print_stats): New function.
3678 (Layout_task_runner::run): Resize output file for incremental updates.
3679 (Layout::Layout): Initialize new data members.
3680 (Layout::set_incremental_base): New function.
3681 (Layout::init_fixed_output_section): New function.
3682 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3683 incremental updates.
3684 (Layout::create_gold_note): Do not create gold note section for
3685 incremental updates.
3686 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3687 for incremental updates.
3688 (Layout::set_section_offsets): For incremental updates, allocate space
3689 from free list.
3690 (Layout::create_symtab_sections): Layout with offsets relative to
3691 start of section; for incremental updates, allocate space from free
3692 list.
3693 (Layout::create_shdrs): For incremental updates, allocate space from
3694 free list.
3695 (Layout::finish_dynamic_section): For incremental updates, do not
3696 check --as-needed (fixed in subsequent patch).
3697 * layout.h (class Free_list): New class.
3698 (Layout::set_incremental_base): New function.
3699 (Layout::incremental_base): New function.
3700 (Layout::init_fixed_output_section): New function.
3701 (Layout::allocate): New function.
3702 (Layout::incremental_base_): New data member.
3703 (Layout::free_list_): New data member.
3704 * main.cc (main): Print Free_list statistics.
3705 * object.cc (Relobj::finalize_incremental_relocs): Add
3706 clear_counts parameter; clear counts only when clear_counts is set.
3707 (Sized_relobj::Sized_relobj): Initialize new base class.
3708 (Sized_relobj::do_layout): Don't report special sections.
3709 (Sized_relobj::do_for_all_local_got_entries): New function.
3710 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3711 symtab_off to all symbol table offsets.
3712 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3713 * object.h (class Got_offset_list): Move to top of file.
3714 (Object::Object): Allow case where input_file == NULL.
3715 (Object::~Object): Likewise.
3716 (Object::input_file): Assert that input_file != NULL.
3717 (Object::lock): Allow case where input_file == NULL.
3718 (Object::unlock): Likewise.
3719 (Object::is_locked): Likewise.
3720 (Object::token): Likewise.
3721 (Object::release): Likewise.
3722 (Object::is_incremental): New function.
3723 (Object::get_mtime): New function.
3724 (Object::for_all_local_got_entries): New function.
3725 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3726 (Object::set_is_in_system_directory): New function.
3727 (Object::is_in_system_directory): New function.
3728 (Object::do_is_incremental): New function.
3729 (Object::do_get_mtime): New function.
3730 (Object::do_for_all_local_got_entries): New function.
3731 (Object::is_in_system_directory_): New data member.
3732 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3733 (class Sized_relobj_base): New class.
3734 (class Sized_relobj): Derive from Sized_relobj_base.
3735 (class Sized_relobj::Symbols): Redeclare from base class.
3736 (class Sized_relobj::local_got_offset_list): Remove.
3737 (class Sized_relobj::Output_sections): Redeclare from base class.
3738 (class Sized_relobj::do_for_all_local_got_entries): New function.
3739 (class Sized_relobj::write_local_symbols): Add offset parameter.
3740 (class Sized_relobj::local_symbol_offset_): Update comment.
3741 (class Sized_relobj::local_dynsym_offset_): Update comment.
3742 * options.cc (Input_arguments::add_file): Remove const.
3743 * options.h (Input_file_argument::Input_file_argument):
3744 Initialize arg_serial_ (all constructors).
3745 (Input_file_argument::set_arg_serial): New function.
3746 (Input_file_argument::arg_serial): New function.
3747 (Input_file_argument::arg_serial_): New data member.
3748 (Input_arguments::Input_arguments): Initialize file_count_.
3749 (Input_arguments::add_file): Remove const.
3750 (Input_arguments::number_of_input_files): New function.
3751 (Input_arguments::file_count_): New data member.
3752 (Command_line::number_of_input_files): Call
3753 Input_arguments::number_of_input_files.
3754 * output.cc (Output_segment_headers::Output_segment_headers):
3755 Set current size.
3756 (Output_section::Input_section::current_data_size): New function.
3757 (Output_section::Output_section): Initialize new data members.
3758 (Output_section::add_input_section): Don't do merge sections for
3759 an incremental link; allocate space from free list for an
3760 incremental update.
3761 (Output_section::add_output_section_data): Allocate space from
3762 free list for an incremental update.
3763 (Output_section::update_data_size): New function.
3764 (Output_section::set_fixed_layout): New function.
3765 (Output_section::reserve): New function.
3766 (Output_segment::set_section_addresses): Remove const.
3767 (Output_segment::set_section_list_addresses): Remove const; allocate
3768 space from free list for an incremental update.
3769 (Output_segment::set_offset): Adjust size of RELRO segment for an
3770 incremental update.
3771 * output.h (Output_data::current_data_size): Move here from
3772 child classes.
3773 (Output_data::pre_finalize_data_size): New function.
3774 (Output_data::update_data_size): New function.
3775 (Output_section_headers::update_data_size): new function.
3776 (Output_section_data_build::current_data_size): Move to Output_data.
3777 (Output_data_strtab::update_data_size): New function.
3778 (Output_section::current_data_size): Move to Output_data.
3779 (Output_section::set_fixed_layout): New function.
3780 (Output_section::has_fixed_layout): New function.
3781 (Output_section::reserve): New function.
3782 (Output_section::update_data_size): New function.
3783 (Output_section::has_fixed_layout_): New data member.
3784 (Output_section::free_list_): New data member.
3785 (Output_segment::set_section_addresses): Remove const.
3786 (Output_segment::set_section_list_addresses): Remove const.
3787 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3788 New function.
3789 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3790 New function.
3791 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3792 parameter when calling Add_symbols constructor; store argument
3793 serial number for members of a lib group.
3794 (Add_symbols::locks): Allow case where token == NULL.
3795 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3796 (Read_member::~Read_member): New function.
3797 (Read_member::is_runnable): New function.
3798 (Read_member::locks): New function.
3799 (Read_member::run): New function.
3800 (Check_script::~Check_script): New function.
3801 (Check_script::is_runnable): New function.
3802 (Check_script::locks): New function.
3803 (Check_script::run): New function.
3804 (Check_library::~Check_library): New function.
3805 (Check_library::is_runnable): New function.
3806 (Check_library::locks): New function.
3807 (Check_library::run): New function.
3808 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3809 (Add_symbols::library_): New data member.
3810 (class Read_member): New class.
3811 (class Check_script): New class.
3812 (class Check_library): New class.
3813 * reloc.cc (Read_relocs::is_runnable): Allow case where
3814 token == NULL.
3815 (Read_relocs::locks): Likewise.
3816 (Scan_relocs::locks): Likewise.
3817 (Relocate_task::locks): Likewise.
3818 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3819 to clear counters.
3820 (Sized_relobj::incremental_relocs_scan): Fix comment.
3821 (Sized_relobj::do_relocate): Pass output file offset to
3822 write_local_symbols.
3823 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3824 from class declaration.
3825 * script.cc (read_input_script): Allocate Script_info; pass
3826 argument serial number to report_script.
3827 * script.h (class Script_info): Move to incremental.h.
3828 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3829 * symtab.h (Symbol_table::add_from_incrobj): New function.
3830 (Symbol_table::set_file_offset): New function.
3831
b961d0d7
CC
38322011-04-05 Cary Coutant <ccoutant@google.com>
3833
3834 * incremental-dump.cc (dump_incremental_inputs): Change signature
3835 to take a Sized_incremental_binary; change caller. Use readers
3836 in Sized_incremental_binary.
3837 * incremental.cc
3838 (Sized_incremental_binary::find_incremental_inputs_sections):
3839 Rename do_find_incremental_inputs_sections to this.
3840 (Sized_incremental_binary::setup_readers): New function.
3841 (Sized_incremental_binary::do_check_inputs): Check
3842 has_incremental_info_ flag; move setup code to setup_readers;
3843 use input readers.
3844 (Sized_incremental_binary::do_file_is_unchanged): New function.
3845 (Sized_incremental_binary::do_get_input_reader): New function.
3846 * incremental.h (class Incremental_binary): Move to end of file.
3847 (Incremental_binary::file_is_unchanged): New function.
3848 (Incremental_binary::do_file_is_unchanged): New function.
3849 (Incremental_binary::Input_reader): New class.
3850 (Incremental_binary::get_input_reader): New function.
3851 (class Sized_incremental_binary): Move to end of file.
3852 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3853 input section reader classes.
3854 (Sized_incremental_binary::has_incremental_info): New function.
3855 (Sized_incremental_binary::inputs_reader): New function.
3856 (Sized_incremental_binary::symtab_reader): New function.
3857 (Sized_incremental_binary::relocs_reader): New function.
3858 (Sized_incremental_binary::got_plt_reader): New function.
3859 (Sized_incremental_binary::do_file_is_unchanged): New function.
3860 (Sized_incremental_binary::Sized_input_reader): New class.
3861 (Sized_incremental_binary::get_input_reader): New function.
3862 (Sized_incremental_binary::find_incremental_inputs_sections):
3863 Rename do_find_incremental_inputs_sections to this.
3864 (Sized_incremental_binary::setup_readers): New function.
3865 (Sized_incremental_binary::has_incremental_info_): New data member.
3866 (Sized_incremental_binary::inputs_reader_): New data member.
3867 (Sized_incremental_binary::symtab_reader_): New data member.
3868 (Sized_incremental_binary::relocs_reader_): New data member.
3869 (Sized_incremental_binary::got_plt_reader_): New data member.
3870 (Sized_incremental_binary::current_input_file_): New data member.
3871
a869183f
PP
38722011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3873
3874 PR gold/12640
3875 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3876 violation.
3877
38782011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3879
3880 * archive.cc (Archive::include_member): Adjust call to report_object.
3881 (Add_archive_symbols::run): Add script_info to call to
3882 report_archive_begin.
3883 (Lib_group::include_member): Adjust call to report_object.
3884 (Add_lib_group_symbols::run): Adjust call to report_object.
3885 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3886 blocks. Add object count for script input files.
3887 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3888 script_info parameter; change all callers.
3889 (Incremental_inputs::report_object): Add script_info parameter;
3890 change all callers.
3891 (Incremental_inputs::report_script): Store backpointer to
3892 incremental info entry.
3893 (Output_section_incremental_inputs::set_final_data_size): Record
3894 additional information for scripts.
3895 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3896 * incremental.h (Incremental_script_entry::add_object): New function.
3897 (Incremental_script_entry::get_object_count): New function.
3898 (Incremental_script_entry::get_object): New function.
3899 (Incremental_script_entry::objects_): New data member; adjust
3900 constructor.
3901 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3902 (Incremental_inputs::report_object): Add script_info parameter.
3903 (Incremental_inputs_reader::get_object_count): New function.
3904 (Incremental_inputs_reader::get_object_offset): New function.
3905 * options.cc (Input_arguments::add_file): Return reference to
3906 new input argument.
3907 * options.h (Input_argument::set_script_info): New function.
3908 (Input_argument::script_info): New function.
3909 (Input_argument::script_info_): New data member; adjust all
3910 constructors.
3911 (Input_file_group::add_file): Return reference to new input argument.
3912 (Input_file_lib::add_file): Likewise.
3913 (Input_arguments::add_file): Likewise.
3914 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3915 * script.cc (Parser_closure::Parser_closure): Add script_info
3916 parameter; adjust all callers.
3917 (Parser_closure::script_info): New function.
3918 (Parser_closure::script_info_): New data member.
3919 (read_input_script): Report scripts earlier to incremental info.
3920 (script_add_file): Set script_info in Input_argument.
3921 (script_add_library): Likewise.
3922 * script.h (Script_options::Script_info): Rewrite class.
3923
a869183f 39242011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3925
3926 * archive.cc (Library_base::should_include_member): Move
3927 method here from class Archive.
3928 (Archive::Archive): Initialize base class.
3929 (Archive::should_include_member): Move to base class.
3930 (Archive::do_for_all_unused_symbols): New function.
3931 (Add_archive_symbols::run): Remove redundant access to
3932 incremental_inputs.
3933 (Lib_group::Lib_group): Initialize base class.
3934 (Lib_group::do_filename): New function.
3935 (Lib_group::include_member): Pass pointer to Lib_group to
3936 report_object.
3937 (Lib_group::do_for_all_unused_symbols): New function.
3938 (Add_lib_group_symbols::run): Report archive information for
3939 incremental links.
3940 * archive.h (class Library_base): New base class.
3941 (class Archive): Derive from Library_base.
3942 (Archive::filename): Move to base class.
3943 (Archive::set_incremental_info): Likewise.
3944 (Archive::incremental_info): Likewise.
3945 (Archive::Should_include): Likewise.
3946 (Archive::should_include_member): Likewise.
3947 (Archive::Armap_entry): Remove.
3948 (Archive::Unused_symbol_iterator): Remove.
3949 (Archive::unused_symbols_begin): Remove.
3950 (Archive::unused_symbols_end): Remove.
3951 (Archive::do_filename): New function.
3952 (Archive::do_get_mtime): New function.
3953 (Archive::do_for_all_unused_symbols): New function.
3954 (Archive::task_): Move to base class.
3955 (Archive::incremental_info_): Likewise.
3956 (class Lib_group): Derive from Library_base.
3957 (Lib_group::do_filename): New function.
3958 (Lib_group::do_get_mtime): New function.
3959 (Lib_group::do_for_all_unused_symbols): New function.
3960 (Lib_group::task_): Move to base class.
3961 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3962 function.
3963 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3964 function.
3965 * incremental.cc (Incremental_inputs::report_archive_begin):
3966 Use Library_base; call library's get_mtime; add incremental inputs
3967 entry before members.
3968 (class Unused_symbol_visitor): New class.
3969 (Incremental_inputs::report_archive_end): Use Library_base; use
3970 visitor class to record unused symbols; don't add incremental inputs
3971 entry after members.
3972 (Incremental_inputs::report_object): Use Library_base.
3973 * incremental.h
3974 (Incremental_archive_entry::Incremental_archive_entry): Remove
3975 unused Archive parameter.
3976 (Incremental_inputs::report_archive_begin): Use Library_base.
3977 (Incremental_inputs::report_archive_end): Likewise.
3978 (Incremental_inputs::report_object): Likewise.
3979 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3980 function.
3981 * object.h (Object::for_all_global_symbols): New function.
3982 (Object::do_for_all_global_symbols): New function.
3983 (Sized_relobj::do_for_all_global_symbols): New function.
3984 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3985 function.
3986 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3987 function.
3988
61ab3e40
ILT
39892011-03-27 Ian Lance Taylor <iant@google.com>
3990
3991 * archive.cc (Archive::interpret_header): Return -1 if something
3992 goes wrong. Change callers accordingly.
3993
30e1f9e6
CC
39942011-03-25 Cary Coutant <ccoutant@google.com>
3995
3996 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3997 * testsuite/Makefile.in: Regenerate.
3998
9370ce59 39992011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4000
4001 * plugin.cc (get_view): New.
4002 (Plugin::load): Pass get_view to the plugin.
4003 (Plugin_manager::get_view): New.
4004
9312bb0a
ILT
40052011-03-21 Ian Lance Taylor <iant@google.com>
4006
4007 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4008 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4009
7e12ba9e
ST
40102011-03-21 Sriraman Tallam <tmsriram@google.com>
4011
4012 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4013 Change == to -eq.
4014 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4015 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4016 Change == to -eq.
4017 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4018 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4019
fd7a005d
ILT
40202011-03-14 Ian Lance Taylor <iant@google.com>
4021
4022 * script-sections.cc (Sort_output_sections::script_compare):
4023 Rename from is_before, change return type.
4024 (Sort_output_sections::operator()): Adjust accordingly.
4025
ed16fd1b
ILT
40262011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4027
4028 PR gold/12572
4029 * testsuite/odr_violation2.cc: Add comment to make all error line
4030 numbers double digits.
4031 * testsuite/debug_msg.sh: Adjust expected errors.
4032
71ff8986
ILT
40332011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4034
4035 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4036 but mark earlier ones as non-canonical
4037 (offset_to_iterator): Update search target and example
4038 (do_addr2line): Return extra lines in a vector*
4039 (format_file_lineno): Extract from do_addr2line
4040 (one_addr2line): Add vector* out-param
4041 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4042 when a lineno entry appeared last for its instruction
4043 (Dwarf_line_info): Add vector* out-param
4044 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4045 * symtab.cc (Odr_violation_compare): Include the lineno in the
4046 comparison again.
4047 (linenos_from_loc): New. Combine the canonical line for an
4048 address with its other lines.
4049 (True_if_intersect): New. Helper functor to make
4050 std::set_intersection a query.
4051 (detect_odr_violations): Compare sets of lines instead of just
4052 one line for each function. This became less deterministic, but
4053 has fewer false positives.
4054 * symtab.h: Declarations.
4055 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4056 mix an optimized and non-optimized object in the same binary
4057 (odr_violation2.so): Same.
4058 * testsuite/Makefile.in: Regenerate from Makefile.am.
4059 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4060 * testsuite/debug_msg.sh: Update line numbers and add
4061 assertions.
4062 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4063 non-optimized context.
4064 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4065 isn't inlined, and use OdrDerived in an optimized context.
4066 * testsuite/odr_header1.h: Defines OdrDerived, where
4067 optimization will change the
4068 first-instruction-in-the-destructor's file and line number.
4069 * testsuite/odr_header2.h: Defines OdrBase.
4070
a19fefdc
ILT
40712011-03-09 Ian Lance Taylor <iant@google.com>
4072
4073 * fileread.cc (File_read::clear_views): Don't delete the whole
4074 file view.
4075
ecb351e9
ILT
40762011-03-08 Ian Lance Taylor <iant@google.com>
4077
4078 PR gold/12525
4079 * fileread.cc: #include <climits>.
4080 (GOLD_IOV_MAX): Define.
4081 (File_read::read_multiple): Limit number of entries by iov_max.
4082 * fileread.h (class File_read): Always set max_readv_entries to
4083 128.
4084
b821d13c
ILT
40852011-03-07 Ian Lance Taylor <iant@google.com>
4086
4087 PR gold/12525
4088 * options.h (class General_options): Add -dy and -dn.
4089
89243142
CC
40902011-03-02 Cary Coutant <ccoutant@google.com>
4091
4092 * testsuite/script_test_9.t: Add TLS segment.
4093
d0773f31
ILT
40942011-03-02 Simon Baldwin <simonb@google.com>
4095
4096 * configure.ac: Add check for gnu_indirect_function support in
4097 the toolchain building binutils.
4098 * configure: Rebuild.
4099
9370ce59 41002011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4101
4102 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4103 plugin only symbols.
4104 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4105 in plugin files as not needed in the symbol table.
4106
4cf7a849
ST
41072011-02-11 Sriraman Tallam <tmsriram@google.com>
4108
4109 * output.cc (Output_section::add_input_section): Delay fill
4110 generation for section ordering.
4111
b578bd7d
ILT
41122011-02-09 Ian Lance Taylor <iant@google.com>
4113
4114 PR gold/12316
4115 * object.h (class Sized_relobj): Remove clear_local_symbols.
4116 * reloc.cc (Sized_relobj::do_relocate): Don't call
4117 clear_local_symbols.
4118
9370ce59 41192011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4120
4121 * plugin.cc (is_visible_from_outside): Return true for symbols
4122 in the -u option.
4123
55382fb7
ILT
41242011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4125
4126 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4127 filename.
4128
4e271fff
ST
41292011-02-02 Sriraman Tallam <tmsriram@google.com>
4130
4131 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4132 to std::string.
4e271fff 4133 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4134 section_name to be std::string.
4e271fff
ST
4135 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4136
d433c3ac
ILT
41372011-01-25 Ian Lance Taylor <iant@google.com>
4138
4139 * script.cc (script_add_extern): Rewrite to use
4140 add_symbol_reference.
4141
880473a6
DK
41422011-01-25 Doug Kwan <dougkwan@google.com>
4143
d433c3ac 4144 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4145
f30f86fa
ILT
41462011-01-24 Ian Lance Taylor <iant@google.com>
4147
4148 * options.h (class General_options): Accept
4149 --no-detect-odr-violations.
4150
8e51a0b9
ILT
41512011-01-24 Ian Lance Taylor <iant@google.com>
4152
4153 * version.cc (version_string): Bump to 1.11.
4154
0f3b89d8
ILT
41552011-01-24 Ian Lance Taylor <iant@google.com>
4156
4157 * plugin.cc (class Plugin_rescan): Define new class.
4158 (Plugin_manager::claim_file): Set any_claimed_.
4159 (Plugin_manager::save_archive): New function.
4160 (Plugin_manager::save_input_group): New function.
4161 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4162 necessary.
4163 (Plugin_manager::new_undefined_symbol): New function.
4164 (Plugin_manager::rescan): New function.
4165 (Plugin_manager::rescannable_defines): New function.
4166 (Plugin_manager::add_input_file): Set any_added_.
4167 * plugin.h (class Plugin_manager): define new fields rescannable_,
4168 undefined_symbols_, any_claimed_, and any_added_. Declare
4169 Plugin_rescan as friend. Declare new functions.
4170 (Plugin_manager::Rescannable): Define type.
4171 (Plugin_manager::Rescannable_list): Define type.
4172 (Plugin_manager::Undefined_symbol_list): Define type.
4173 (Plugin_manager::Plugin_manager): Initialize new fields.
4174 * archive.cc (Archive::defines_symbol): New function.
4175 (Add_archive_symbols::run): Pass archive to plugins if any.
4176 * archive.h (class Archive): Declare defines_symbol.
4177 * readsyms.cc (Input_group::~Input_group): New function.
4178 (Finish_group::run): Pass input_group to plugins if any.
4179 * readsyms.h (class Input_group): Declare destructor.
4180 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4181 any.
4182
3bb951e5
ILT
41832011-01-10 Ian Lance Taylor <iant@google.com>
4184
4185 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4186 section as relro.
4187 (Layout::set_segment_offsets): Reset increase_relro before calling
4188 set_section_addresses a second time.
4189
0aa45fac
CC
41902011-01-04 Cary Coutant <ccoutant@google.com>
4191
4192 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4193 sections before NOBITS sections.
4194
0db46eb4
L
41952011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4196
4197 * version.cc (print_version): Update copyright to 2011.
4198
829c9745
CC
41992010-12-23 Cary Coutant <ccoutant@google.com>
4200
4201 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4202 of OS to this->add. Add OD parameter to second form of the function.
4203
7500420b
ILT
42042010-12-20 Ian Lance Taylor <iant@google.com>
4205
4206 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4207 second of two consecutive entries with same offset.
4208
f8e9a930
RW
42092010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4210
4211 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4212 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4213 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4214 to avoid unneeded links against $(LDADD).
4215 * testsuite/Makefile.in: Regenerate.
4216
2fbb4320
ILT
42172010-12-15 Ian Lance Taylor <iant@google.com>
4218
4219 PR gold/12324
4220 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4221 for R_X86_64_32 and R_X86_64_PC32.
4222 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4223 ver_matching_def_pic.o.
4224 (ver_matching_def_pic.o): New target.
4225
fedb228d
RW
42262010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4227
4228 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4229 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4230 Move definition before File_read::View member definitions.
4231 (File_read::View::~View): Initialize and hold lock before
4232 updating current_mapped_bytes.
4233
9b547ce6
RW
42342010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4235
4236 * dwarf_reader.cc: Remove outdated comment.
4237 * gold-threads.cc: Fix typo in error message.
4238 * archive.cc: Fix typos in comments.
4239 * archive.h: Likewise.
4240 * arm-reloc-property.cc: Likewise.
4241 * arm-reloc-property.h: Likewise.
4242 * arm-reloc.def: Likewise.
4243 * arm.cc: Likewise.
4244 * attributes.h: Likewise.
4245 * cref.cc: Likewise.
4246 * ehframe.cc: Likewise.
4247 * fileread.h: Likewise.
4248 * gold.h: Likewise.
4249 * i386.cc: Likewise.
4250 * icf.cc: Likewise.
4251 * incremental.h: Likewise.
4252 * int_encoding.cc: Likewise.
4253 * layout.h: Likewise.
4254 * main.cc: Likewise.
4255 * merge.h: Likewise.
4256 * object.cc: Likewise.
4257 * object.h: Likewise.
4258 * options.cc: Likewise.
4259 * readsyms.cc: Likewise.
4260 * reduced_debug_output.cc: Likewise.
4261 * reloc.cc: Likewise.
4262 * script-sections.cc: Likewise.
4263 * sparc.cc: Likewise.
4264 * symtab.h: Likewise.
4265 * target-reloc.h: Likewise.
4266 * target.cc: Likewise.
4267 * target.h: Likewise.
4268 * timer.cc: Likewise.
4269 * timer.h: Likewise.
4270 * x86_64.cc: Likewise.
4271
83e17bd5
CC
42722010-12-09 Cary Coutant <ccoutant@google.com>
4273
4274 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4275 stack.
4276 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4277 parameter; change all callers.
4278 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4279 * options.h (warn_execstack): New option.
4280
017257f8
DK
42812010-12-07 Doug Kwan <dougkwan@google.com>
4282
4283 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4284 like function call relocations.
4285
c20cbc06
ILT
42862010-12-07 Ian Lance Taylor <iant@google.com>
4287
4288 * archive.cc (Archive::get_elf_object_for_member): Permit
4289 punconfigured to be NULL.
4290 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4291 (Archive::include_member): Pass NULL to get_elf_object_for_member
4292 if we searched for the archive and this is the first included
4293 object.
4294
4dbfafcc
ILT
42952010-12-01 Ian Lance Taylor <iant@google.com>
4296
4297 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4298 track_relocs_type_ field.
4299 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4300 Set track_relocs_type_.
4301 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4302 contents when using RELA relocs.
4303 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4304 reloc_map_.
4305 * reloc.cc (Track_relocs::next_addend): New function.
4306 * reloc.h (class Track_relocs): Declare next_addend.
4307
e5e19edd
ILT
43082010-12-01 Ian Lance Taylor <iant@google.com>
4309
4310 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4311 virtual destructor.
4312
9a5ce24c
ILT
43132010-12-01 Ian Lance Taylor <iant@google.com>
4314
4315 * README: Update compilers known to work and fail.
4316
c7791212
NC
43172010-11-23 Matthias Klose <doko@ubuntu.com>
4318
4319 * configure.in: For --enable-gold, handle value `default' instead of
4320 `both*'. Always install ld as ld.bfd, install as ld if gold is
4321 not the default.
4322 * configure: Regenerate.
4323
0ad220c9
DK
43242010-11-18 Doug Kwan <dougkwan@google.com>
4325
4326 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4327 and right_alignment to be zero. Store result alignment only if it is
4328 greater than existing alignment.
4329
ab8056e0
CC
43302010-11-16 Cary Coutant <ccoutant@google.com>
4331
4332 PR gold/12220
4333 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4334 Check for ".zdebug_line".
4335
fd064a5b
CC
43362010-11-16 Doug Kwan <dougkwan@google.com>
4337 Cary Coutant <ccoutant@google.com>
4338
4339 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4340 by reference; adjust all callers.
4341 * output.cc (Output_segment::set_section_addresses): Adjust references
4342 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4343 list is empty.
4344 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4345 end at page boundary.
4346
6fc6ea19
CC
43472010-11-16 Cary Coutant <ccoutant@google.com>
4348
4349 PR gold/12220
4350 * layout.cc (Layout::choose_output_section): Transform names of
4351 compressed sections even when using a script with a SECTIONS clause.
4352 (Layout::output_section_name): Remove code to transform
4353 compressed debug section names.
4354 * output.cc (Output_section::add_input_section): Use uncompressed
4355 section size when tracking input sections.
4356
95a2c8d6
RS
43572010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4358
4359 * symtab.h (Symbol::NON_PIC_REF): Remove.
4360 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4361 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4362 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4363 (Symbol::use_plt_offset): Take a flags argument and pass it
4364 directly to needs_dynamic_reloc. Restrict check for undefined
4365 weak symbols to function calls.
4366 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4367 (Target_arm::Scan::global): Use it.
4368 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4369 (Target_arm::Relocate::relocate): Likewise.
4370 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4371 parameter with an r_type parameter. Use get_reference_flags
4372 to get the flags.
4373 (Target_arm::Relocate::relocate): Update accordingly.
4374 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4375 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4376 (Target_i386::Scan::global): Likewise.
4377 (Target_i386::Relocate::relocate): Likewise.
4378 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4379 parameter with an r_type parameter. Use get_reference_flags
4380 to get the flags.
4381 (Target_i386::Relocate::relocate): Update accordingly.
4382 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4383 (Target_powerpc::Scan::global): Use it.
4384 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4385 (Target_powerpc::Relocate::relocate): Likewise.
4386 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4387 (Target_sparc::Scan::global): Use it.
4388 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4389 (Target_sparc::Relocate::relocate): Likewise.
4390 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4391 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4392 (Target_x86_64::Scan::global): Likewise.
4393 (Target_x86_64::Relocate::relocate): Likewise.
4394
f625ae50
DK
43952010-11-08 Doug Kwan <dougkwan@google.com>
4396 Cary Coutant <ccoutant@google.com>
4397
4398 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4399 (Arm_exidx_merge_section::section_contents_): New data member.
4400 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4401 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4402 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4403 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4404 in parameters instead of calling Object::section_contents without
4405 locking.
4406 (Arm_output_section::group_section): New parameter TASK. Pass it
4407 to callees that need locking objects.
4408 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4409 to lock EXIDX input sections. Fix a formatting issue. Call
4410 Arm_exidx_merged_section::build_contents to create merged section
4411 contents.
4412 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4413 to lock object of stub table owner.
4414 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4415 TEXT_SIZE to initialize data member TEXT_SIZE_.
4416 (Arm_exidx_input_section::addralign): Fix typo in comment.
4417 (Arm_exidx_input_section::text_size): New method.
4418 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4419 that require locking objects. Lock objects before scanning for stubs
4420 and updating local symbols.
4421 (Arm_input_section<big_endian>::init): Copy contents of original
4422 input section.
2e702c99 4423 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4424 original input section instead of calling Object::section_contents
4425 without locking.
4426 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4427 size without calling Object::section_size().
4428 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4429 for size. Allocate a buffer for merged EXIDX entries.
4430 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4431 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4432 building code to Arm_exidx_merged_section::build_contetns. Write
4433 out contetns in buffer instead of building it on the fly.
4434 (Arm_relobj::make_exidx_input_section): Also pass text section size
4435 to Arm_exidx_input_section constructor.
4436 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4437 (Arm_dynobj::do_read_symbols): Fix memory leak.
4438 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4439 * target.h: (class Task): Add forward declaration.
4440 (Target::relax): Add new parameter TASK and pass it to
4441 Target::do_relax().
4442 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4443
5f9bcf58
CC
44442010-11-05 Cary Coutant <ccoutant@google.com>
4445
4446 PR gold/10708
4447 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4448 object when reading from the file.
4449 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4450 second layout pass.
4451 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4452 when reading section contents.
4453 (get_section_contents): Likewise.
4454 (icf::find_identical_sections): Likewise.
4455 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4456 object when reading from the file.
4457 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4458 the object when doing deferred section layout.
4459
e597fa08
NC
44602010-11-03 Nick Clifton <nickc@redhat.com>
4461
4462 PR gold/12001
4463 * script.h (class Symbol_assignment: name): New member. Returns
4464 the name of the symbol.
4465 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4466 Returns true if the given symbol name is on the list of
4467 assignments wating to be processed.
4468 * archive.cc (should_incldue_member): If the symbol is undefined,
4469 check to see if it is on the list of symbols pending assignment.
4470
3f9a3278
ILT
44712010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4472
4473 * script-sections.cc (Script_sections::find_memory_region): Check
4474 for a NULL output section pointer.
4475
d06fb4d1
DK
44762010-10-29 Doug Kwan <dougkwan@google.com>
4477
4478 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4479 Output_section::add_relaxed_input_section.
4480 * output.cc (Output_section::add_relaxed_input_section): Add new
4481 arguments LAYOUT and NAME. Set section order index.
4482 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4483 Copy section order index.
4484 * output.h (Output_section::add_relaxed_input_section): Add new
4485 arguments LAYOUT and NAME.
4486
90e24de5
ILT
44872010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4488
4489 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4490 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4491 * testsuite/Makefile.in: Regenerate.
4492
c9484ea5
DK
44932010-10-20 Doug Kwan <dougkwan@google.com>
4494
4495 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4496 without SHF_LINK_ORDER flags.
4497 * layout.cc (Layout::choose_output_section): Do not filter
4498 SHF_LINK_ORDER flag in a relocatable link.
4499
5bc2f5be
CC
45002010-10-17 Cary Coutant <ccoutant@google.com>
4501
4502 * output.h (Output_segment::set_section_addresses): Change function
4503 signature. Update all callers.
4504 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4505 sections.
4506 (Output_segment::set_section_addresses): Align after last TLS
4507 section. Add padding before last relro section instead of after.
4508
0c91cf04
DK
45092010-10-17 Doug Kwan <dougkwan@google.com>
4510
4511 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4512 GOT output section to be writable.
4513
8c21d9d3
CC
45142010-10-14 Cary Coutant <ccoutant@google.com>
4515
4516 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4517 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4518 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4519 mode.
4520 * incremental.cc (report_command_line): Ignore all forms of
4521 --incremental.
4522 * layout.cc (Layout::Layout): Check parameters for incremental link
4523 mode.
4524 * options.cc (General_options::parse_incremental): New function.
4525 (General_options::parse_no_incremental): New function.
4526 (General_options::parse_incremental_full): New function.
4527 (General_options::parse_incremental_update): New function.
4528 (General_options::incremental_mode_): New data member.
4529 (General_options::finalize): Check incremental_mode_.
4530 * options.h (General_options): Update help text for --incremental.
4531 Add --no-incremental, --incremental-full, --incremental-update.
4532 (General_options::Incremental_mode): New enum type.
4533 (General_options::incremental_mode): New function.
4534 (General_options::incremental_mode_): New data member.
4535 * parameters.cc (Parameters::incremental_mode_): New data member.
4536 (Parameters::set_options): Set incremental_mode_.
4537 (Parameters::set_incremental_full): New function.
4538 (Parameters::incremental): New function.
4539 (Parameters::incremental_update): New function.
4540 (set_parameters_incremental_full): New function.
4541 * parameters.h (Parameters::set_incremental_full): New function.
4542 (Parameters::incremental): New function.
4543 (Parameters::incremental_update): New function.
4544 (Parameters::incremental_mode_): New data member.
4545 (set_parameters_incremental_full): New function.
4546 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4547 incremental link mode.
4548 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4549 (Sized_relobj::do_relocate_sections): Likewise.
4550 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4551 option.
4552 * testsuite/Makefile.in: Regenerate.
4553 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4554
bb32aa18 45552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4556
4557 * script-sections.h (class Script_sections): Make
4558 Sections_elements typedef public.
4559 * script-sections.cc (class Sort_output_sections): Add elements_
4560 field. Add constructor which sets it; change all callers.
4561 (Sort_output_sections::is_before): New function.
4562 (Sort_output_sections::operator()): Call is_before.
4563 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4564 conditional.
4565 * testsuite/script_test_10.sh: New test. Test script section
4566 order.
4567 * testsuite/script_test_10.t: Likewise.
4568 * testsuite/script_test_10.s: Likewise.
4569 * testsuite/Makefile.am: Wrap the cross linker tests and the
4570 common tests into NATIVE_OR_CROSS_LINKER.
4571 (check_SCRIPTS): Add script_test_10.sh.
4572 (check_DATA): Add script_test_10.stdout.
4573 (script_test_10.o, script_test_10): New targets.
4574 (script_test_10.stdout): New target.
4575 * configure, testsuite/Makefile.in: Regenerate.
4576
3cef7179
ILT
45772010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4578
4579 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4580 error for the deprecated relocations.
4581 (Target_arm::Scan::global): Likewise.
4582 (Target_arm::Relocate::relocate): Likewise.
4583
7411e9a8
RS
45842010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4585
4586 * fileread.cc (Input_file::find_file): Initialize *found_name
4587 and *namep when using the fallback search for case 4.
4588
6a9da32a
CC
45892010-10-11 Cary Coutant <ccoutant@google.com>
4590
4591 * options.h (class General_options): Redefine -z lazy as an alias for
4592 the negation of -z now.
4593
ac897c20
ILT
45942010-10-11 Ian Lance Taylor <iant@google.com>
4595
4596 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4597 binding.
4598
ea5cae92
NC
45992010-10-06 Nick Clifton <nickc@redhat.com>
4600
4601 * script-sections.cc(class Memory_region): Remove
4602 current_lma_offset_ field. Rename current_vma_offset_ to
4603 current_offset_. Add last_section_ field.
4604 (Memory_region::get_current_vma_address): Rename to
4605 get_current_address.
4606 (Memory_region::get_current_lma_address): Delete.
4607 (Memory_region::increment_vma_offset): Rename to
4608 increment_offset.
4609 (Memory_region::increment_lma_offset): Delete.
4610 (Memory_region::attributes_compatible): New method. Returns
4611 true if the provided section is compatible with the region.
4612 (Memory_region::get_last_section): New method. Returns the last
4613 section to use the region.
4614 (Memory_region::set_last_section): New method. Stores the last
4615 section to use the region.
4616 (Script_sections::block_in_region): New method. Returns true if
4617 a block of memory is contained within a region.
4618 (Script_sections::find_memory_region): New method. Locates a
4619 memory region to be used to set a VMA or LMA address.
4620 (Output_section_definition::set_section_addresses): Add code to
4621 check for addresses set by memory regions.
4622 (Output_segment::set_section_addresses): Remove memory region
4623 walking code.
4624 (Script_sections::create_segment): Add a warning if a header
4625 segment is created outside of any region.
4626 * script-sections.h (class Script_sections): Add prototypes for
4627 find_memory_region and block_in_region methods.
4628 * testsuite/memory_test.s: Use .long instead of .word.
4629 * testsuite/memory_test.t: Add some more output sections.
4630 * testsuite/memory_test.sh: Update expected output.
4631
a9bfd952
DK
46322010-10-02 Doug Kwan <dougkwan@google.com>
4633
4634 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4635 defintion to symtab.h
4636 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4637 declaration to defintion.
4638
bacff3ab
NC
46392010-10-01 Nick Clifton <nickc@redhat.com>
4640
4641 * expression.cc (eval): Replace dummy argument with NULL.
4642 (eval_maybe_dot): Check for a NULL result section pointer.
4643 (Symbol_expression::value): Likewise.
4644 (Dot_expression::value): Likewise.
4645 (BINARY_EXPRESSION): Likewise.
4646 (Max_expression::value): Likewise.
4647 (Min_expression::value): Likewise.
4648 (Absolute_expression::value): Likewise.
4649 (Addr_expression::value_from_output_section): Likewise.
4650 (Loaddddr_expression::value_from_output_section): Likewise.
4651 (Segment_start_expression::value): Likewise.
4652 * script-sections.cc
4653 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4654 argument with NULL.
4655 (Sections_elememt_dot_assignment::set_section_addresses):
4656 Likewise.
4657 (Output_data_expression::do_write_to_buffer): Likewise.
4658 (Output_section_definition::finalize_symbols): Likewise.
4659 (Output_section_definition::set_section_addresses): Likewise.
4660
f81bc8b5
DK
46612010-09-30 Doug Kwan <dougkwan@google.com>
4662
4663 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4664
c95e9f27
ST
46652010-09-28 Sriraman Tallam <tmsriram@google.com>
4666
4667 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4668 function.
c95e9f27
ST
4669 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4670 virtual function.
4671 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4672 virtual function.
4673 * icf.cc (get_section_contents): Inline merge sections only when
4674 target allows it.
4675
3cac54d2
RW
46762010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4677
4678 * configure: Regenerate.
4679
2904037a
ILT
46802010-09-17 Ian Lance Taylor <iant@google.com>
4681
4682 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4683 * testsuite/Makefile.am (memory_test.o): New target.
4684 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4685 memory_test.t.
4686 * testsuite/Makefile.in: Rebuild.
2904037a 4687
bca7fb63
DK
46882010-09-17 Doug Kwan <dougkwan@google.com>
4689
4690 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4691 defintion if relocation uses GOT entries of the symbol.
4692 * testsuite/icf_safe_test.sh: Fix test.
4693 * testsuite/icf_safe_so_test.sh: Fix test.
4694
4ef28648
CC
46952010-09-16 Cary Coutant <ccoutant@google.com>
4696
4697 * script_sections.cc (class Memory_region): Remove "NULL" from
4698 vector initializations.
4699
793990de
CC
47002010-09-15 Cary Coutant <ccoutant@google.com>
4701
4702 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4703 Resolve forwarding symbols.
4704
81e015e2
DK
47052010-09-15 Doug Kwan <dougkwan@google.com>
4706
4707 * gold/testsuite/script_test_3.t: Add ARM special sections.
4708 * gold/testsuite/script_test_4.t: Same.
4709 * gold/testsuite/script_test_5.t: Same.
4710 * gold/testsuite/script_test_6.t: Same.
4711 * gold/testsuite/script_test_7.t: Same.
4712 * gold/testsuite/script_test_7.t: Same.
4713 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4714
36171d64
CC
47152010-09-14 Cary Coutant <ccoutant@google.com>
4716
4717 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4718 (Target_x86_64::Relocate::relocate_tls): Replace check for
4719 saw_tls_block_reloc_ with test for executable section.
4720
d89051bd
CC
47212010-09-12 Cary Coutant <ccoutant@google.com>
4722
4723 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4724 position-independent executables to shared libraries need dynamic
4725 relocations.
4726 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4727 position-independent executables.
4728 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4729 * testsuite/Makefile.in: Regenerate.
4730
fca41f0f
NC
47312010-09-10 Nick Clifton <nickc@redhat.com>
4732
4733 PR gold/11997
4734 * testsuite/memory_test.t: Discard any sections that are not
4735 needed.
4736
6695e4b3
L
47372010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4738
4739 PR gold/11996
4740 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4741 "This::" to work around a bug in gcc 4.2.
4742
4743 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4744
0f72bf6f
RÁE
47452010-09-09 Rafael Espindola <espindola@google.com>
4746
4747 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4748 sections with different PF_X flags in the same segment.
4749 (Layout::find_first_load_seg): Search all segments to find the first
4750 one.
4751 * options.h (rosegment): New.
4752
47532010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4754
05a79166 4755 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4756
aa98ff75
DK
47572010-09-08 Doug Kwan <dougkwan@google.com>
4758
4759 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4760 (Arm_relobj::do_relocate_sections): Add new parameter for output
4761 file to match the parent.
4762 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4763 of local symbols instead of input values. Update code to track
4764 changes in gold::relocate_section.
4765 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4766 (Sized_relobj::compute_final_local_value_internal): New methods.
4767 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4768 body into private version of Sized_relobj::compute_final_local_value.
4769 Call the inline method.
4770 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4771 merged symbol value if there is one.
4772 (Symbol_value::has_output_value): New method defintiion.
4773 (Sized_relobj::Compute_final_local_value_status): New enum type.
4774 (Sized_relobj::compute_final_local_value): New methods.
4775 (Sized_relobj::compute_final_local_value_internal): New methods.
4776 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4777 and arm_cortex_a8.sh.
4778 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4779 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4780 New tests.
4781 * Makefile.in: Regenerate.
4782 * testsuite/arm_bl_out_of_range.s: Update test.
4783 * testsuite/thumb_bl_out_of_range.s: Ditto.
4784 * testsuite/thumb_blx_out_of_range.s: Ditto.
4785 * testsuite/arm_branch_out_of_range.sh: New file.
4786 * testsuite/arm_cortex_a8.sh: Ditto.
4787 * testsuite/arm_cortex_a8_b.s: Ditto.
4788 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4789 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4790 * testsuite/arm_cortex_a8_bl.s: Ditto.
4791 * testsuite/arm_cortex_a8_blx.s: Ditto.
4792 * testsuite/arm_cortex_a8_local.s: Ditto.
4793 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4794 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4795
05a79166
L
47962010-09-08 Rafael Espindola <espindola@google.com>
4797
4798 * Makefile.am (memory_test.stdout): Run readelf with -W.
4799 * Makefile.in: Regenerate.
4800 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4801 64 bit output.
4802
33dbc701
RÁE
48032010-09-08 Rafael Espindola <espindola@google.com>
4804
4805 * script-sections.cc (Script_sections::add_memory_region): Convert
4806 field precision to int.
4807 * script.cc (script_set_section_region, script_set_section_region):
4808 Convert field precision to int.
4809
731ca54a
RÁE
48102010-09-08 Rafael Espindola <espindola@google.com>
4811
4812 * arm.cc (do_finalize_sections): Create the __exidx_start and
4813 __exdix_end symbols even when the section is missing.
4814
7f8cd844
NC
48152010-09-08 Nick Clifton <nickc@redhat.com>
4816
4817 * README: Remove claim that MEMORY is not supported.
4818 * expression.cc (script_exp_function_origin)
4819 (script_exp_function_length): Move from here to ...
4820 * script.cc: ... here.
4821 (script_set_section_region, script_add_memory)
4822 (script_parse_memory_attr, script_include_directive): New
4823 functions.
4824 * script-sections.cc
4825 (class Memory_region): New class.
4826 (class Output_section_definition): Add set_memory_region,
4827 set_section_vma, set_section_lma and get_section_name methods.
4828 (class Script_Sections): Add add_memory_region,
4829 find_memory_region, find_memory_region_origin,
4830 find_memory_region_length and set_memory_region methods.
4831 Have set_section_addresses method walk the list of set memory
4832 regions.
4833 Extend the print methos to display memory regions.
4834 * script-sections.h: Add prototypes for new methods.
4835 Add enum for MEMORY region attributes.
4836 * yyscript.y: Add support for parsing MEMORY regions.
4837 * script-c.h: Add prototypes for new functions.
4838 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4839 * testsuite/Makefile.in: Regenerate.
4840 * testsuite/memory_test.sh: New script.
4841 * testsuite/memory_test.s: New assembler source file.
4842 * testsuite/memory_test.t: New linker script.
4843
a4649286
DK
48442010-08-27 Doug Kwan <dougkwan@google.com>
4845
4846 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4847 reference override an existing dynamic weak reference.
4848 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4849 * testsuite/Makefile.in: Regenerate.
4850 * testsuite/dyn_weak_ref.sh: New file.
4851 * testsuite/dyn_weak_ref_1.c: Ditto.
4852 * testsuite/dyn_weak_ref_2.c: Ditto.
4853
b56648ad
ILT
48542010-08-27 Ian Lance Taylor <iant@google.com>
4855
4856 * incremental.h (class Incremental_input_entry): Add virtual
4857 destructor.
4858
809313cb
ILT
48592010-08-27 Ian Lance Taylor <iant@google.com>
4860
4861 * testsuite/start_lib_test_3.c: Mark t3 as used.
4862
11e32464
NC
48632010-08-27 Nick Clifton <nickc@redhat.com>
4864
4865 * options.cc (version_script): Fix small typo in previous
4866 whitespace tidyup.
4867
ca09d69a
NC
48682010-08-25 Nick Clifton <nickc@redhat.com>
4869
4870 * archive.cc: Formatting fixes: Remove whitespace between
4871 typename and following asterisk. Remove whitespace between
4872 function name and opening parenthesis.
4873 * archive.h: Likewise.
4874 * arm.cc: Likewise.
4875 * attributes.cc: Likewise.
4876 * attributes.h: Likewise.
4877 * common.cc: Likewise.
4878 * copy-relocs.cc: Likewise.
4879 * dirsearch.h: Likewise.
4880 * dynobj.cc: Likewise.
4881 * ehframe.cc: Likewise.
4882 * ehframe.h: Likewise.
4883 * expression.cc: Likewise.
4884 * fileread.cc: Likewise.
4885 * fileread.h: Likewise.
4886 * gc.h: Likewise.
4887 * gold-threads.cc: Likewise.
4888 * gold.cc: Likewise.
4889 * i386.cc: Likewise.
4890 * icf.h: Likewise.
4891 * incremental-dump.cc: Likewise.
4892 * incremental.cc: Likewise.
4893 * layout.cc: Likewise.
4894 * layout.h: Likewise.
4895 * main.cc: Likewise.
4896 * merge.cc: Likewise.
4897 * merge.h: Likewise.
4898 * object.cc: Likewise.
4899 * object.h: Likewise.
4900 * options.cc: Likewise.
4901 * options.h: Likewise.
4902 * output.cc: Likewise.
4903 * output.h: Likewise.
4904 * plugin.cc: Likewise.
4905 * plugin.h: Likewise.
4906 * powerpc.cc: Likewise.
4907 * reloc.cc: Likewise.
4908 * script-c.h: Likewise.
4909 * script-sections.cc: Likewise.
4910 * script.cc: Likewise.
4911 * stringpool.cc: Likewise.
4912 * symtab.cc: Likewise.
4913 * symtab.h: Likewise.
4914 * target.cc: Likewise.
4915 * timer.cc: Likewise.
4916 * timer.h: Likewise.
4917 * version.cc: Likewise.
4918 * x86_64.cc: Likewise.
4919
b8fa8750
NC
49202010-08-24 Nick Clifton <nickc@redhat.com>
4921
4922 PR 11899
4923 * layout.cc (segment_precedes): Sort segments by their physical
4924 addresses, if they have been set.
4925
9919d93b
CC
49262010-08-23 Cary Coutant <ccoutant@google.com>
4927
4928 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4929 symbols data.
4930 (Lib_group::include_member): Unlock object after deleting its
4931 symbols data.
4932 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4933 the bug fixed here.
4934
97b4be1c
CC
49352010-08-19 Neil Vachharajani <nvachhar@google.com>
4936 Cary Coutant <ccoutant@google.com>
4937
4938 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4939 constructor, and set_blocker.
4940 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4941 readsyms_blocker_.
4942 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4943 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4944 * testsuite/Makefile.am (start_lib_test): New test case.
4945 * testsuite/Makefile.in: Regenerate.
4946 * testsuite/start_lib_test_main.c: New file.
4947 * testsuite/start_lib_test_1.c: New file.
4948 * testsuite/start_lib_test_2.c: New file.
4949 * testsuite/start_lib_test_3.c: New file.
4950
dd0b1884
ILT
49512010-08-19 Ian Lance Taylor <iant@google.com>
4952
4953 * Makefile.in: Rebuild with automake 1.11.1.
4954 * aclocal.m4: Likewise.
4955 * testsuite/Makefile.in: Likewise.
4956
7223e9ca
ILT
49572010-08-19 Ian Lance Taylor <iant@google.com>
4958
4959 PR 10893
4960 * i386.cc (class Output_data_plt_i386): Update declarations.
4961 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4962 local_ifuncs_ fields.
4963 (Target_i386::do_plt_section_for_global): New function.
4964 (Target_i386::do_plt_section_for_local): New function.
4965 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4966 parameter; change all callers. Initialize global_ifuncs_ and
4967 local_ifuncs_. If doing a static link define __rel_iplt_start and
4968 __rel_iplt_end.
4969 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4970 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4971 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4972 symbols.
4973 (Target_i386::make_plt_section): New function, broken out of
4974 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4975 (Target_i386::make_plt_entry): Call make_plt_section.
4976 (Target_i386::make_local_ifunc_plt_entry): New function.
4977 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4978 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4979 R_386_IRELATIVE to switch.
4980 (Target_i386::Scan::global): Likewise.
4981 (Target_i386::Relocate::relocate): Likewise.
4982 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4983 switch.
4984 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4985 (Target_x86_64::do_plt_section_for_global): New function.
4986 (Target_x86_64::do_plt_section_for_local): New function.
4987 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4988 parameter; change all callers. If doing a static link define
4989 __rela_iplt_start and __rela_iplt_end.
4990 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4991 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4992 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4993 to point to .plt.
4994 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4995 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4996 switch.
4997 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4998 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4999 R_X86_64_IRELATIVE to switch.
5000 (Target_x86_64::Scan::global): Likewise.
5001 (Target_x86_64::Relocate::relocate): Likewise.
5002 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5003 switch.
5004 * target.h (class Target): Add plt_section_for_global and
5005 plt_section_for_local functions. Add do_plt_section_for_global
5006 and do_plt_section_for_local virtual functions.
5007 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5008 clarifying comments.
5009 (Symbol::use_plt_offset): Handle IFUNC symbol.
5010 * object.cc (Sized_relobj::Sized_relobj): Initialize
5011 local_plt_offsets_.
5012 (Sized_relobj::local_has_plt_offset): New function.
5013 (Sized_relobj::local_plt_offset): New function.
5014 (Sized_relobj::set_local_plt_offset): New function.
5015 (Sized_relobj::do_count): Handle IFUNC symbol.
5016 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5017 a bit away from input_shndx_ field. Add set_is_func_symbol and
5018 is_ifunc_symbol functions.
5019 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5020 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5021 local_plt_offsets_ field.
5022 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5023 * output.h (class Output_section_data): Add non-const
5024 output_section function.
5025 (class Output_data_got): Update declarations.
5026 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5027 Add use_plt_offset parameter to global and local constructors.
5028 Change all callers. Change local_sym_index_ field to 31 bits.
5029 Change GSYM_CODE and CONSTANT_CODE accordingly.
5030 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5031 doing a static link don't set sh_link field.
5032 (Output_data_got::Got_entry::write): Use PLT offset if
5033 appropriate.
5034 (Output_data_got::add_global_plt): New function.
5035 (Output_data_got::add_local_plt): New function.
5036 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5037 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5038 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5039 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5040 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5041 IFUNC conditional.
5042 * testsuite/ifunc-sel.h: New file.
5043 * testsuite/ifuncmain1.c: New file.
5044 * testsuite/ifuncmain1vis.c: New file.
5045 * testsuite/ifuncmod1.c: New file.
5046 * testsuite/ifuncdep2.c: New file.
5047 * testsuite/ifuncmain2.c: New file.
5048 * testsuite/ifuncmain3.c: New file.
5049 * testsuite/ifuncmod3.c: New file.
5050 * testsuite/ifuncmain4.c: New file.
5051 * testsuite/ifuncmain5.c: New file.
5052 * testsuite/ifuncmod5.c: New file.
5053 * testsuite/ifuncmain6pie.c: New file.
5054 * testsuite/ifuncmod6.c: New file.
5055 * testsuite/ifuncmain7.c: New file.
5056 * configure, testsuite/Makefile.in: Rebuild.
5057
56f75c03
ILT
50582010-08-18 Ian Lance Taylor <iant@google.com>
5059
5060 * incremental.cc
5061 (Output_section_incremental_inputs::write_input_files): Add cast
5062 to avoid signed/unsigned comparison warning.
5063 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5064
55455f89
CC
50652010-08-12 Cary Coutant <ccoutant@google.com>
5066
5067 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5068
e2054bcb
ILT
50692010-08-13 Ian Lance Taylor <iant@google.com>
5070
5071 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5072
74f67560
DK
50732010-08-12 Cary Coutant <ccoutant@google.com>
5074 Doug Kwan <dougkwan@google.com>
5075
5076 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5077 defintion overrides non-weak undef, remember that the original undef
5078 is not weak.
5079 * symtab.cc (Symbol_table::sized_write_global): For undef without
5080 an original weak binding, set binding to global in output.
5081 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5082 * testsuite/Makefile.in: Regenerate.
5083 * testsuite/strong_ref_weak_def.sh: New file.
5084 * testsuite/strong_ref_weak_def_1.c: Ditto.
5085 * testsuite/strong_ref_weak_def_2.c: Ditto.
5086
d1238d12
CC
50872010-08-12 Cary Coutant <ccoutant@google.com>
5088
5089 * testsuite/incremental_test.sh: Rewrite.
5090 * testsuite/incremental_test_1.c: Rewrite.
5091 * testsuite/incremental_test_2.c: Rewrite.
5092
0e70b911
CC
50932010-08-12 Cary Coutant <ccoutant@google.com>
5094
5095 * arm.cc (Target_arm::got_size): Add const.
5096 (Target_arm::got_entry_count): New function.
5097 (Target_arm::plt_entry_count): New function.
5098 (Target_arm::first_plt_entry_offset): New function.
5099 (Target_arm::plt_entry_size): New function.
5100 (Output_data_plt_arm::entry_count): New function.
5101 (Output_data_plt_arm::first_plt_entry_offset): New function.
5102 (Output_data_plt_arm::get_plt_entry_size): New function.
5103 * i386.cc (Target_i386::got_size): Add const.
5104 (Target_i386::got_entry_count): New function.
5105 (Target_i386::plt_entry_count): New function.
5106 (Target_i386::first_plt_entry_offset): New function.
5107 (Target_i386::plt_entry_size): New function.
5108 (Output_data_plt_i386::entry_count): New function.
5109 (Output_data_plt_i386::first_plt_entry_offset): New function.
5110 (Output_data_plt_i386::get_plt_entry_size): New function.
5111 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5112 find_incremental_inputs_sections. Dump incremental_got_plt section.
5113 * incremental.cc: Include target.h.
5114 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5115 parameter. Adjust all callers. Find incremental_got_plt section.
5116 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5117 section.
5118 (Output_section_incremental_inputs::set_final_data_size): Calculate
5119 size of incremental_got_plt section.
5120 (Output_section_incremental_inputs::do_write): Write the
5121 incremental_got_plt section.
5122 (Got_plt_view_info): New struct.
5123 (Local_got_offset_visitor): New class.
5124 (Global_got_offset_visitor): New class.
5125 (Global_symbol_visitor_got_plt): New class.
5126 (Output_section_incremental_inputs::write_got_plt): New function.
5127 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5128 Add parameter. Adjust all callers.
5129 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5130 (Incremental_inputs::got_plt_section): New function.
5131 (Incremental_inputs::got_plt_section_): New data member.
5132 (Incremental_got_plt_reader): New class.
5133 * layout.cc (Layout::create_incremental_info_sections): Add the
5134 incremental_got_plt section.
5135 * object.h (Got_offset_list::get_list): New function.
5136 (Got offset_list::for_all_got_offsets): New function.
5137 (Sized_relobj::local_got_offset_list): New function.
5138 * powerpc.cc (Target_powerpc::got_size): Add const.
5139 (Target_powerpc::got_entry_count): New function.
5140 (Target_powerpc::plt_entry_count): New function.
5141 (Target_powerpc::first_plt_entry_offset): New function.
5142 (Target_powerpc::plt_entry_size): New function.
5143 (Output_data_plt_powerpc::entry_count): New function.
5144 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5145 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5146 * sparc.cc (Target_sparc::got_size): Add const.
5147 (Target_sparc::got_entry_count): New function.
5148 (Target_sparc::plt_entry_count): New function.
5149 (Target_sparc::first_plt_entry_offset): New function.
5150 (Target_sparc::plt_entry_size): New function.
5151 (Output_data_plt_sparc::entry_count): New function.
5152 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5153 (Output_data_plt_sparc::get_plt_entry_size): New function.
5154 * symtab.h (Symbol::got_offset_list): New function.
5155 (Symbol_table::for_all_symbols): New function.
5156 * target.h (Sized_target::got_entry_count): New function.
5157 (Sized_target::plt_entry_count): New function.
5158 (Sized_target::plt_entry_size): New function.
5159 * x86_64.cc (Target_x86_64::got_size): Add const.
5160 (Target_x86_64::got_entry_count): New function.
5161 (Target_x86_64::plt_entry_count): New function.
5162 (Target_x86_64::first_plt_entry_offset): New function.
5163 (Target_x86_64::plt_entry_size): New function.
5164 (Output_data_plt_x86_64::entry_count): New function.
5165 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5166 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5167
09ec0418
CC
51682010-08-12 Cary Coutant <ccoutant@google.com>
5169
5170 * archive.cc: Include incremental.h.
5171 (Archive::Archive): Initialize incremental_info_.
5172 (Archive::include_member): Record archive members in incremental info.
5173 (Add_archive_symbols::run): Record begin and end of an archive in
5174 incremental info.
5175 (Lib_group::include_member): Record objects in incremental info.
5176 * archive.h (Incremental_archive_entry): Forward declaration.
5177 (Archive::set_incremental_info): New member function.
5178 (Archive::incremental_info): New member function.
5179 (Archive::Unused_symbol_iterator): New class.
5180 (Archive::unused_symbols_begin): New member function.
5181 (Archive::unused_symbols_end): New member function.
5182 (Archive::incremental_info_): New data member.
5183 * incremental-dump.cc (find_input_containing_global): New function.
5184 (dump_incremental_inputs): Dump new incremental info sections.
5185 * incremental.cc: Include symtab.h.
5186 (Output_section_incremental_inputs): New class.
5187 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5188 new incremental info sections.
5189 (Sized_incremental_binary::do_check_inputs): Likewise.
5190 (Incremental_inputs::report_archive): Remove.
5191 (Incremental_inputs::report_archive_begin): New function.
5192 (Incremental_inputs::report_archive_end): New function.
5193 (Incremental_inputs::report_object): New function.
5194 (Incremental_inputs::finalize_inputs): Remove.
5195 (Incremental_inputs::report_input_section): New function.
5196 (Incremental_inputs::report_script): Rewrite.
5197 (Incremental_inputs::finalize): Do nothing but finalize string table.
5198 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5199 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5200 (Incremental_inputs::create_data_sections): New function.
5201 (Incremental_inputs::relocs_entsize): New function.
5202 (Output_section_incremental_inputs::set_final_data_size): New function.
5203 (Output_section_incremental_inputs::do_write): New function.
5204 (Output_section_incremental_inputs::write_header): New function.
5205 (Output_section_incremental_inputs::write_input_files): New function.
5206 (Output_section_incremental_inputs::write_info_blocks): New function.
5207 (Output_section_incremental_inputs::write_symtab): New function.
5208 * incremental.h (Incremental_script_entry): Forward declaration.
5209 (Incremental_object_entry): Forward declaration.
5210 (Incremental_archive_entry): Forward declaration.
5211 (Incremental_inputs): Forward declaration.
5212 (Incremental_inputs_header_data): Remove.
5213 (Incremental_inputs_header): Remove.
5214 (Incremental_inputs_header_write): Remove.
5215 (Incremental_inputs_entry_data): Remove.
5216 (Incremental_inputs_entry): Remove.
5217 (Incremental_inputs_entry_write): Remove.
5218 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5219 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5220 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5221 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5222 Likewise.
5223 (Incremental_input_entry): New class.
5224 (Incremental_script_entry): New class.
5225 (Incremental_object_entry): New class.
5226 (Incremental_archive_entry): New class.
5227 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5228 (Incremental_inputs::report_inputs): Remove.
5229 (Incremental_inputs::report_archive): Remove.
5230 (Incremental_inputs::report_archive_begin): New function.
5231 (Incremental_inputs::report_archive_end): New function.
5232 (Incremental_inputs::report_object): Change prototype.
5233 (Incremental_inputs::report_input_section): New function.
5234 (Incremental_inputs::report_script): Change prototype.
5235 (Incremental_inputs::get_reloc_count): New function.
5236 (Incremental_inputs::set_reloc_count): New function.
5237 (Incremental_inputs::create_data_sections): New function.
5238 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5239 (Incremental_inputs::inputs_section): New function.
5240 (Incremental_inputs::symtab_section): New function.
5241 (Incremental_inputs::relocs_section): New function.
5242 (Incremental_inputs::get_stringpool): Add const.
5243 (Incremental_inputs::command_line): Add const.
5244 (Incremental_inputs::inputs): Remove.
5245 (Incremental_inputs::command_line_key): New function.
5246 (Incremental_inputs::input_file_count): New function.
5247 (Incremental_inputs::input_files): New function.
5248 (Incremental_inputs::relocs_entsize): New function.
5249 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5250 (Incremental_inputs::finalize_inputs): Remove.
5251 (Incremental_inputs::Input_info): Remove.
5252 (Incremental_inputs::lock_): Remove.
5253 (Incremental_inputs::inputs_): Change type.
5254 (Incremental_inputs::inputs_map_): Remove.
5255 (Incremental_inputs::current_object_entry_): New data member.
5256 (Incremental_inputs::inputs_section_): New data member.
5257 (Incremental_inputs::symtab_section_): New data member.
5258 (Incremental_inputs::relocs_section_): New data member.
5259 (Incremental_inputs::reloc_count_): New data member.
5260 (Incremental_inputs_reader): New class.
5261 (Incremental_symtab_reader): New class.
5262 (Incremental_relocs_reader): New class.
5263 * layout.cc (Layout::finalize): Move finalization of incremental info
5264 and creation of incremental info sections to follow finalization of
5265 symbol table. Set offsets for postprocessing sections.
5266 (Layout::create_incremental_info_sections): Call
5267 Incremental_inputs::create_data_sections. Add incremental symtab
5268 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5269 sections to layout after input sections.
5270 * layout.h (struct Timespec): Forward declaration.
5271 (Layout::incremental_inputs): Add const.
5272 (Layout::create_incremental_info_sections): Add parameter.
5273 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5274 * object.cc: Include incremental.h.
5275 (Relobj::finalize_incremental_relocs): New function.
5276 (Sized_relobj::do_layout): Record input sections in incremental info.
5277 * object.h (Object::output_section): New function.
5278 (Object::output_section_offset): Moved from Relobj.
5279 (Object::get_incremental_reloc_base): New function.
5280 (Object::get_incremental_reloc_count): New function.
5281 (Object::do_output_section): New function.
5282 (Object::do_output_section_offset): Moved from Relobj.
5283 (Object::do_get_incremental_reloc_base): New function.
5284 (Object::do_get_incremental_reloc_count): New function.
5285 (Object::Object): Initialize new data members.
5286 (Relobj::output_section): Renamed do_output_section and moved to
5287 protected.
5288 (Relobj::output_section_offset): Moved to Object.
5289 (Relobj::do_get_incremental_reloc_base): New function.
5290 (Relobj::do_get_incremental_reloc_count): New function.
5291 (Relobj::allocate_incremental_reloc_counts): New function.
5292 (Relobj::count_incremental_reloc): New function.
5293 (Relobj::finalize_incremental_relocs): New function.
5294 (Relobj::next_incremental_reloc_index): New function.
5295 (Relobj::reloc_counts_): New data member.
5296 (Relobj::reloc_bases_): New data member.
5297 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5298 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5299 (Sized_relobj::incremental_relocs_scan): New function.
5300 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5301 (Sized_relobj::incremental_relocs_write): New function.
5302 (Sized_relobj::incremental_relocs_write_reltype): New function.
5303 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5304 incremental link.
5305 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5306 archives and object files elsewhere.
5307 (Add_symbols::run): Report object files here.
5308 (Finish_group::run): Report end of archive at end of group.
5309 * reloc.cc: Include layout.h, incremental.h.
5310 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5311 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5312 (Sized_relobj::incremental_relocs_scan): New function.
5313 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5314 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5315 (Sized_relobj::incremental_relocs_write): New function.
5316 (Sized_relobj::incremental_relocs_write_reltype): New function.
5317 * script.cc (read_input_script): Rewrite test for incremental link.
5318 Change call to Incremental_inputs::report_script.
5319 * symtab.h (Symbol_table::first_global_index): New function.
5320 (Symbol_table::output_count): New function.
5321
ce0d1972
DK
53222010-08-12 Doug Kwan <dougkwan@google.com>
5323
5324 * arm.cc (Target_arm::merge_object_attributes): Check command line
5325 options --no-wchar-size-warning and --no-enum-size-warning.
5326 * options.h (General_options): Add ld-compatible options
5327 --no-enum-size-warning and --no-wchar-size-warning.
5328
6e5710ce
ILT
53292010-08-04 Ian Lance Taylor <iant@google.com>
5330
5331 * x86_64.cc (Target_x86_64::Scan::local): Use
5332 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5333 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5334 (Target_x86_64::Scan::global): Likewise.
5335 (Target_x86_64::Relocate::relocate): Likewise.
5336 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5337 Likewise.
5338
fef830db
CC
53392010-08-03 Cary Coutant <ccoutant@google.com>
5340
5341 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5342 to reserve space in merged_strings vector. Keep total input size
5343 for stats.
5344 (Output_merge_string::do_print_merge_stats): Print total input size.
5345 * merge.h (Output_merge_string): Add input_size_ field.
5346 * stringpool.cc (Stringpool_template::string_length): Move
5347 implementations out of Stringpool_template class and place in
5348 stringpool.h.
5349 * stringpool.h (string_length): Move out of Stringpool_template.
5350
1e3811b0
ILT
53512010-08-03 Ian Lance Taylor <iant@google.com>
5352
5353 PR 11712
5354 * layout.cc (relaxation_loop_body): If address of load segment is
5355 set, adjust address to include headers if possible.
5356
7af0c620
ILT
53572010-08-03 Ian Lance Taylor <iant@google.com>
5358
5359 * version.cc (version_string): Bump to 1.10.
5360
22f0da72
ILT
53612010-08-03 Ian Lance Taylor <iant@google.com>
5362
5363 PR 11805
5364 * layout.h (enum Output_section_order): Define.
5365 (class Layout): Update declarations.
5366 * layout.cc (Layout::get_output_section): Add order parameter.
5367 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5368 is_first_non_relro parameters. Change all callers.
5369 (Layout::choose_output_section): Likewise.
5370 (Layout::add_output_section_data): Likewise.
5371 (Layout::make_output_section): Likewise. Set order.
5372 (Layout::default_section_order): New function.
5373 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5374 * output.cc (Output_section::Output_section): Initialize order_.
5375 Don't initialize deleted fields.
5376 (Output_segment::Output_segment): Don't initialize deleted
5377 fields.
5378 (Output_segment::add_output_section_to_load): New function
5379 replacing add_output_section. Change all callers to call this or
5380 add_output_section_to_nonload.
5381 (Output_segment::add_output_section_to_nonload): New function.
5382 (Output_segment::remove_output_section): Rewrite.
5383 (Output_segment::add_initial_output_data): Likewise.
5384 (Output_segment::has_any_data_sections): Likewise.
5385 (Output_segment::is_first_section_relro): Likewise.
5386 (Output_segment::maximum_alignment): Likewise.
5387 (Output_segment::has_dynamic_reloc): New function replacing
5388 dynamic_reloc_count. Change all callers.
5389 (Output_segment::has_dynamic_reloc_list): New function replacing
5390 dynamic_reloc_count_list. Change all callers.
5391 (Output_segment::set_section_addresses): Rewrite.
5392 (Output_segment::set_offset): Rewrite.
5393 (Output_segment::find_first_and_last_list): Remove.
5394 (Output_segment::set_tls_offsets): Rewrite.
5395 (Output_segment::first_section_load_address): Likewise.
5396 (Output_segment::output_section_count): Likewise.
5397 (Output_segment::section_with_lowest_load_address): Likewise.
5398 (Output_segment::write_section_headers): Likewise.
5399 (Output_segment::print_sections_to_map): Likewise.
5400 * output.h (class Output_data): Remove dynamic_reloc_count_
5401 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5402 (Output_data::add_dynamic_reloc): Rewrite.
5403 (Output_data::has_dynamic_reloc): New function.
5404 (Output_data::dynamic_reloc_count): Remove.
5405 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5406 is_last_relro_, is_first_non_relro_, is_interp_,
5407 is_dynamic_linker_section_ fields. Add order and set_order
5408 functions. Remove is_relro_local, set_is_relro_local,
5409 is_last_relro, set_is_last_relro, is_first_non_relro,
5410 set_is_first_non_relro functions, is_interp, set_is_interp,
5411 is_dynamic_linker_section, and set_is_dynamic_linker_section
5412 functions.
5413 (class Output_segment): Change Output_data_list from std::list to
5414 std:;vector. Add output_lists_ field. Remove output_data_ and
5415 output_bss_ fields. Update declarations.
5416
3ff2ccb0
ILT
54172010-08-02 Ian Lance Taylor <iant@google.com>
5418
5419 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5420 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5421 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5422
88a4108b
ILT
54232010-08-02 Ian Lance Taylor <iant@google.com>
5424
5425 PR 11855
5426 * script.cc (Script_options::Script_options): Initialize
5427 symbol_definitions_ and symbol_references_.
5428 (Script_options::add_symbol_assignment): Update
5429 symbol_definitions_ and symbol_references_.
5430 (Script_options::add_symbol_reference): New function.
5431 (script_symbol): New function.
5432 * script.h (class Script_options): Add symbol_definitions_ and
5433 symbol_references_ fields.
5434 (Script_options::referenced_const_iterator): New type.
5435 (Script_options::referenced_begin): New function.
5436 (Script_options::referenced_end): New function.
5437 (Script_options::is_referenced): New function.
5438 (Script_options::any_unreferenced): New function.
5439 * script-c.h (script_symbol): Declare.
5440 * yyscript.y (exp): Call script_symbol.
5441 * symtab.cc: Include "script.h".
5442 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5443 Change all callers. Check symbols referenced by scripts.
5444 (Symbol_table::add_undefined_symbols_from_command_line): Add
5445 layout parameter. Change all callers.
5446 (Symbol_table::do_add_undefined_symbols_from_command_line):
5447 Likewise. Break out loop body. Check symbols referenced by
5448 scripts.
5449 (Symbol_table::add_undefined_symbol_from_command_line): New
5450 function broken out of
5451 do_add_undefined_symbols_from_command_line.
5452 * symtab.h (class Symbol_table): Update declarations.
5453 * archive.cc: Include "layout.h".
5454 (Archive::should_include_member): Add layout parameter. Change
5455 all callers. Check for symbol mentioned in expression.
5456 * archive.h (class Archive): Update declaration.
5457 * object.cc (Sized_relobj::do_should_include_member): Add layout
5458 parameter.
5459 * object.h (Object::should_include_member): Add layout parameter.
5460 Change all callers.
5461 (Object::do_should_include_member): Add layout parameter.
5462 (class Sized_relobj): Update declaration.
5463 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5464 parameter.
5465 * dynobj.h (class Sized_dynobj): Update declaration.
5466 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5467 layout parameter.
5468 * plugin.h (class Sized_pluginobj): Update declaration.
5469
5f1ab67a
ILT
54702010-08-02 Ian Lance Taylor <iant@google.com>
5471
5472 PR 11866
5473 * output.cc (Output_segment::set_offset): Search for the first and
5474 last sections rather than assuming that the list is in order.
5475 (Output_segment::find_first_and_last_list): New function.
5476 * output.h (class Output_segment): Update declarations.
5477 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5478 (relro_strip_test_SOURCES): New variable.
5479 (relro_strip_test_DEPENDENCIES): New variable.
5480 (relro_strip_test_LDFLAGS): New variable.
5481 (relro_strip_test_LDADD): New variable.
5482 (relro_strip_test.so): New target.
5483
a8df5856
ILT
54842010-08-02 Ian Lance Taylor <iant@google.com>
5485
5486 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5487 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5488 (Target_i386::got_tlsdesc_section): New function.
5489 (Target_i386::got_section): Create space for GOT entries for
5490 TLSDESC relocations.
5491 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5492 R_386_TLS_GOTDESC.
5493 (Target_i386::Scan::global): Likewise.
5494 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5495 using TLSDESC GOT.
5496 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5497 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5498 (Target_x86_64::got_tlsdesc_section): New function.
5499 (Target_x86_64::got_section): Create space for GOT entries for
5500 TLSDESC relocations.
5501 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5502 R_386_TLS_GOTDESC.
5503 (Target_x86_64::Scan::global): Likewise.
5504 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5505 using TLSDESC GOT.
5506
0c10a0a6
ILT
55072010-08-02 Ian Lance Taylor <iant@google.com>
5508
5509 * testsuite/final_layout.sh: Use dc to convert from hex to
5510 decimal.
5511
41cbeecc
ST
55122010-07-29 Sriraman Tallam <tmsriram@google.com>
5513
5514 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5515 paramter to the call to gold::gc_process_relocs.
5516 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5517 paramter to the call to gold::gc_process_relocs.
5518 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5519 parameter to the call to gold::gc_process_relocs.
5520 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5521 template parameter to the call to gold::gc_process_relocs.
5522 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5523 paramter to the call to gold::gc_process_relocs.
5524 * gc.h (get_embedded_addend_size): New function.
5525 (gc_process_relocs): Save the size of the reloc for use by ICF.
5526 * icf.cc (get_section_contents): Get the addend from the text section
5527 for SHT_REL relocation sections.
5528 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5529 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5530 * int_encoding.h (read_from_pointer): New overloaded function.
5531 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5532 * testsuite/icf_sht_rel_addend_test.sh: New file.
5533 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5534 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5535
6ea55b82
RW
55362010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5537
5538 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5539 * Makefile.in: Regenerate.
5540 * testsuite/Makefile.in: Regenerate.
5541
9691462b
ILT
55422010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5543
5544 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5545 * gold/testsuite/debug_msg.cc: Likewise.
5546 * gold/testsuite/odr_violation1.cc
5547 * gold/testsuite/odr_violation2.cc
5548
76897331
CC
55492010-07-21 Cary Coutant <ccoutant@google.com>
5550
5551 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5552 string, and length fields.
5553 (Output_merge_string::Merged_strings_list): New type.
5554 (Output_merge_string::Merged_strings_lists): New typedef.
5555 (Output_merge_string): Replace merged_strings_ with
5556 merged_strings_lists_.
5557 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5558 Merged_strings_list per input object and section. Don't store pointer
5559 to the string. Don't store length with each merged string entry.
5560 (Output_merge_string::finalize_merged_data): Loop over list of merged
5561 strings lists. Recompute length of each merged string.
5562
78384e8f
CC
55632010-07-15 Cary Coutant <ccoutant@google.com>
5564
5565 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5566 here.
5567
783659f9
ILT
55682010-07-14 Ian Lance Taylor <iant@google.com>
5569
5570 * descriptors.cc (Descriptors::open): Report correct name in error
5571 message.
5572
131687b4
DK
55732010-07-13 Doug Kwan <dougkwan@google.com>
5574
5575 * arm.cc (Arm_input_section::Arm_input_section): For a
5576 SHT_ARM_EXIDX section, always keeps the input sections.
5577 (Arm_input_section::set_exidx_section_link): New method.
5578 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5579 has_errors_ to false.
5580 (Arm_exidx_input_section::has_errors,
5581 Arm_exidx_input_section::set_has_errors): New methods.
5582 (Arm_exidx_input_section::has_errors_): New data member.
5583 (Arm_relobj::get_exidx_shndx_list): New method.
5584 (Arm_output_section::append_text_sections_to_list): Do not skip
5585 section without SHF_EXECINSTR.
5586 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5587 errors.
2e702c99 5588 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5589 section header. Make error messages more verbose. Check for
5590 a non-executable section linked to an EXIDX section.
5591 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5592 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5593 check that there is no deferred EXIDX section if we exit early.
5594 Instead of not making an EXIDX section in case of an error, make one
5595 and set the has_errors flag of it.
5596 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5597 in a relocatable link.
5598 (Target_arm::do_relax): Look for the EXIDX output section instead of
5599 assuming that it is called .ARM.exidx.
2e702c99 5600 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5601 section list. Do not check for SHF_EXECINSTR section flags but
5602 skip any input section with errors.
5603 * output.cc (Output_section::Output_section): Initialize
5604 always_keeps_input_sections_ to false.
5605 (Output_section::add_input_section): Check for
5606 always_keeps_input_sections_.
5607 * output.h (Output_section::always_keeps_input_sections,
5608 Output_section::set_always_keeps_input_sections): New methods.
5609 (Output_section::always_keeps_input_sections): New data member.
5610
69517287
RÁE
56112010-07-13 Rafael Espindola <espindola@google.com>
5612
5613 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5614 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5615
82742395
ILT
56162010-07-13 Philip Herron <herron.philip@googlemail.com>
5617 Ian Lance Taylor <iant@google.com>
5618
5619 * output.h (Output_section_lookup_maps::add_merge_section):
5620 Correct check of whether value was inserted.
5621 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5622 (Output_section_lookup_maps::add_relaxed_input_section):
5623 Likewise.
5624 * arm.cc (Target_arm::got_section): Remove used local os.
5625 * i386.cc (Target_i386::got_section): Likewise.
5626 * x86_64.cc (Target_x86_64::got_section): Likewise.
5627 * sparc.cc (Target_sparc::got_section): Likewise.
5628 (Target_sparc::relocate): Remove unused local have_got_offset.
5629 * powerpc.cc (Target_powerpc::relocate): Likewise.
5630
f2d707b5
ILT
56312010-07-13 Ian Lance Taylor <iant@google.com>
5632
241531d6
ILT
5633 * compressed_output.cc (zlib_decompress): Fix signature in
5634 !HAVE_ZLIB_H case.
5635
f2d707b5
ILT
5636 * archive.cc (Archive::include_member): Unlock an external member
5637 of a thin archive. Don't bother to delete an object we know is
5638 NULL.
5639
a2e47362
CC
56402010-07-12 Cary Coutant <ccoutant@google.com>
5641
5642 * compressed_output.cc (zlib_decompress): New function.
5643 (get_uncompressed_size): New function.
5644 (decompress_input_section): New function.
5645 * compressed_output.h (get_uncompressed_size): New function.
5646 (decompress_input_section): New function.
5647 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5648 Handle compressed debug sections.
5649 * layout.cc (is_compressed_debug_section): New function.
5650 (Layout::output_section_name): Map compressed section names to
5651 canonical names.
5652 * layout.h (is_compressed_debug_section): New function.
5653 (is_debug_info_section): Recognize compressed debug sections.
5654 * merge.cc: Include compressed_output.h.
5655 (Output_merge_data::do_add_input_section): Handle compressed
5656 debug sections.
5657 (Output_merge_string::do_add_input_section): Handle compressed
5658 debug sections.
5659 * object.cc: Include compressed_output.h.
5660 (Sized_relobj::Sized_relobj): Initialize new data members.
5661 (build_compressed_section_map): New function.
5662 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5663 * object.h (Object::section_is_compressed): New method.
5664 (Object::do_section_is_compressed): New method.
5665 (Sized_relobj::Compressed_section_map): New type.
5666 (Sized_relobj::do_section_is_compressed): New method.
5667 (Sized_relobj::compressed_sections_): New data member.
5668 * output.cc (Output_section::add_input_section): Handle compressed
5669 debug sections.
5670 * reloc.cc: Include compressed_output.h.
5671 (Sized_relobj::write_sections): Handle compressed debug sections.
5672
ce279a62
CC
56732010-07-08 Cary Coutant <ccoutant@google.com>
5674
5675 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5676 weak when resolving to a dynamic def.
5677 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5678 for weak undef/dynamic def cases. Adjust callers.
5679 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5680 undef_binding_weak_.
5681 (Symbol_table::sized_write_globals): Adjust symbol binding.
5682 (Symbol_table::sized_write_symbol): Add binding parameter.
5683 * symtab.h (Symbol::set_undef_binding): New method.
5684 (Symbol::is_undef_binding_weak): New method.
5685 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5686 (Symbol_table::should_override): Add new parameter.
5687 (Symbol_table::sized_write_symbol): Add new parameter.
5688
5689 * testsuite/weak_undef_file1.cc: Add new test case.
5690 * testsuite/weak_undef_file2.cc: Fix header comment.
5691 * testsuite/weak_undef_test.cc: Add new test case.
5692
b2286c10
DK
56932010-06-29 Doug Kwan <dougkwan@google.com>
5694
5695 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5696 Initialize USE_SYMBOL_.
5697 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5698 definition.
5699 (Arm_reloc_property::uses_symbol_): New data member declaration.
5700 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5701 uses symbol value and symbol is undefined but not weakly undefined.
5702
4802450a
RÁE
57032010-06-28 Rafael Espindola <espindola@google.com>
5704
5705 * plugin.cc (Plugin::load): Use dlerror.
5706
e5ca47ba
ILT
57072010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5708
5709 * symtab.cc (detect_odr_violations): When reporting an ODR
5710 violation, report an object where the symbol is defined.
5711
8a75a161
DK
57122010-06-25 Doug Kwan <dougkwan@google.com>
5713
5714 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5715 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5716 definition.
5717 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5718 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5719 target hook to detect function points.
5720 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5721 * icf.h (Icf::check_section_for_function_pointers): Change type of
5722 parameter SECTION_NAME to const reference to std::string. Use
5723 target hook to determine if section may have unsafe pointers.
5724 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5725 method definition.
5726
42218b9f
RÁE
57272010-06-21 Rafael Espindola <espindola@google.com>
5728
5729 * fileread.cc (Input_file::find_fie): New
5730 (Input_file::open): Use Input_file::find_fie.
5731 * fileread.h (Input_file::find_fie): New
5732 * plugin.cc (set_extra_library_path): New.
5733 (Plugin::load): Add set_extra_library_path to the transfer vector.
5734 (Plugin_manager::set_extra_library_path): New.
5735 (Plugin_manager::add_input_file): Use the extra search path if set.
5736 (set_extra_library_path(): New.
5737 * plugin.h (Plugin_manager): Add set_extra_library_path and
5738 extra_search_path_.
5739
a0506cca
CC
57402010-06-19 Cary Coutant <ccoutant@google.com>
5741
5742 * layout.cc (gdb_sections): Add .debug_types.
5743 (lines_only_debug_sections): Likewise.
5744
6508b958
RÁE
57452010-06-18 Rafael Espindola <espindola@google.com>
5746
5747 * plugin.cc (add_input_file,add_input_library)
5748 (Plugin_manager::add_input_file): Make filename arguments const.
5749 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5750 const.
5751
3e235302
DK
57522010-06-16 Doug Kwan <dougkwan@google.com>
5753
5754 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5755 .ARM.attributes section if we have not merged any input
5756 attributes sections.
5757
106e8a6c
DK
57582010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5759
5760 * arm.cc: Allow combining objects with no EABI version
5761 information.
5762
91ff43fe
RÁE
57632010-06-15 Rafael Espindola <espindola@google.com>
5764
5765 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5766
68ed838c
ILT
57672010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5768
5769 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5770 (struct iovec): Correct !HAVE_READV definition.
5771
f3a2388f
CC
57722010-06-10 Cary Coutant <ccoutant@google.com>
5773
5774 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5775 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5776 reloc sections.
5777 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5778
5779 PR 11683
5780 * symtab.h (Symbol::is_placeholder): New member function.
5781 * target-reloc.h (relocate_section): Check for placeholder symbols.
5782
5783 * testsuite/Makefile.am (plugin_test_8): New test.
5784 (plugin_test_9): New test.
5785 * testsuite/Makefile.in: Regenerate.
5786
e1df38aa
NC
57872010-06-09 Nick Clifton <nickc@redhat.com>
5788
5789 * yyscript.y (input_list_element): Allow strings prefixed with
5790 the '-' character. Treat these as libraries.
5791 * script.cc (script_add_library): New function. Adds a library
5792 specified by "-l<name>" found in an input script.
5793 * script-c.h: Add prototype for script_add_library.
5794
25bbe950
DK
57952010-06-07 Doug Kwan <dougkwan@google.com>
5796
5797 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5798 Restrict stub-group size to be within long conditional branch
5799 range when working around cortex-A8 erratum.
5800
0f32ea4c
ILT
58012010-06-07 Damien Diederen <dd@crosstwine.com>
5802
5803 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5804 #ifdef typo.
5805
8fe2a369
ST
58062010-06-03 Sriraman Tallam <tmsriram@google.com>
5807
5808 PR gold/11658
5809 * output.cc
5810 (Output_section::Input_section_sort_entry::compare_section_ordering):
5811 Change to return non-zero correctly.
5812 (Output_section::Input_section_sort_section_order_index_compare
5813 ::operator()): Change to fix ambiguity in comparisons.
5814
6e9ba2ca
ST
58152010-06-01 Sriraman Tallam <tmsriram@google.com>
5816
5817 * gold.h (is_wildcard_string): New function.
5818 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5819 (Layout::layout_eh_frame): Ditto.
5820 (Layout::find_section_order_index): New method.
5821 (Layout::read_layout_from_file): New method.
5822 * layout.h (Layout::find_section_order_index): New method.
5823 (Layout::read_layout_from_file): New method.
5824 (Layout::input_section_position_): New private member.
5825 (Layout::input_section_glob_): New private member.
5826 * main.cc (main): Call read_layout_from_file here.
5827 * options.h (--section-ordering-file): New option.
5828 * output.cc (Output_section::input_section_order_specified_): New
5829 member.
5830 (Output_section::Output_section): Initialize new member.
5831 (Output_section::add_input_section): Add new parameter.
5832 Keep input sections when --section-ordering-file is used.
5833 (Output_section::set_final_data_size): Sort input sections when
5834 section ordering file is specified.
5835 (Output_section::Input_section_sort_entry): Add new parameter.
5836 Check sorting type.
5837 (Output_section::Input_section_sort_entry::compare_section_ordering):
5838 New method.
5839 (Output_section::Input_section_sort_compare::operator()): Change to
5840 consider section_order_index.
5841 (Output_section::Input_section_sort_init_fini_compare::operator()):
5842 Change to consider section_order_index.
5843 (Output_section::Input_section_sort_section_order_index_compare
5844 ::operator()): New method.
5845 (Output_section::sort_attached_input_sections): Change to sort
5846 according to section order when specified.
e1df38aa
NC
5847 (Output_section::add_input_section<32, true>): Add new parameter.
5848 (Output_section::add_input_section<64, true>): Add new parameter.
5849 (Output_section::add_input_section<32, false>): Add new parameter.
5850 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5851 * output.h (Output_section::add_input_section): Add new parameter.
5852 (Output_section::input_section_order_specified): New
5853 method.
5854 (Output_section::set_input_section_order_specified): New method.
5855 (Input_section::Input_section): Initialize section_order_index_.
5856 (Input_section::section_order_index): New method.
5857 (Input_section::set_section_order_index): New method.
5858 (Input_section::section_order_index_): New member.
5859 (Input_section::Input_section_sort_section_order_index_compare): New
5860 struct.
5861 (Output_section::input_section_order_specified_): New member.
5862 * script-sections.cc (is_wildcard_string): Delete and move modified
5863 method to gold.h.
5864 (Output_section_element_input::Output_section_element_input): Modify
5865 call to is_wildcard_string.
5866 (Output_section_element_input::Input_section_pattern
5867 ::Input_section_pattern): Ditto.
5868 (Output_section_element_input::Output_section_element_input): Ditto.
5869 * testsuite/Makefile.am (final_layout): New test case.
5870 * testsuite/Makefile.in: Regenerate.
5871 * testsuite/final_layout.cc: New file.
5872 * testsuite/final_layout.sh: New file.
5873
3537c84b
RÁE
58742010-06-01 Rafael Espindola <espindola@google.com>
5875
5876 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5877
105b6afd
RÁE
58782010-06-01 Rafael Espindola <espindola@google.com>
5879
5880 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5881 visibility of symbols.
5882
29e11421
DK
58832010-05-27 Doug Kwan <dougkwan@google.com>
5884
5885 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5886 from start of output section instead of address for a local symbol
5887 in a merged or relaxed section when doing a relocatable link.
5888
5e0f337e
RÁE
58892010-05-26 Rafael Espindola <espindola@google.com>
5890
703d02da 5891 PR 11604
5e0f337e
RÁE
5892 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5893 adding sections the garbage collector removed.
5894 * gold/testsuite/Makefile.am: Add test.
5895 * gold/testsuite/Makefile.in: Regenerate.
5896 * gold/testsuite/plugin_test_7.sh: New.
5897 * gold/testsuite/plugin_test_7_1.c: New.
5898 * gold/testsuite/plugin_test_7_2.c: New.
5899
f4187277
RÁE
59002010-05-26 Rafael Espindola <espindola@google.com>
5901
5902 * script-sections.cc (Output_section_definition::set_section_addresses):
5903 Check for --section-start.
5904
5c388529
DK
59052010-05-26 Doug Kwan <dougkwan@google.com>
5906
5907 * arm.cc (Arm_scan_relocatable_relocs): New class.
5908 (Target_arm::relocate_special_relocatable): New method.
5909 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5910 (Arm_relocate_functions::thumb_branch_common): Same.
5911 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5912 instead of Default_scan_relocatable_relocs.
5913 * target-reloc.h (relocate_for_relocatable): Let target handle
5914 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5915 * target.h (Sized_target::relocate_special_relocatable): New method.
5916
bca1c3ae
ILT
59172010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5918
5919 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5920
0439c796
DK
59212010-05-23 Doug Kwan <dougkwan@google.com>
5922
5923 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5924 instead of a cast.
5925 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5926 with a direct branch, not a conditional branch, to a stub.
5927 * merge.cc (Output_merge_base::record_input_section): New method
5928 defintion.
5929 (Output_merge_data::do_add_input_section): Record input section if
5930 keeps-input-sections flag is set.
5931 (Output_merge_string::do_add_input_section): Ditto.
5932 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5933 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5934 INPUT_SECTIONS_.
5935 (Output_merge_base::keeps_input_sections,
5936 Output_merge_base::set_keeps_input_sections,
5937 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5938 method definitions.
5939 (Output_merge_base::Input_sections): New type declaration.
5940 (Output_merge_base::input_sections_begin,
5941 Output_merge_base::input_sections_end,
5942 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5943 (Output_merge_base::bool keeps_input_sections_,
5944 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5945 Output_merge_base::input_sections_): New data members.
5946 (Output_merge_data::do_set_keeps_input_sections): New method
5947 defintion.
5948 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5949 * output.cc (Output_section::Input_section::relobj): Move method
5950 defintion from class declaration to here and handle merge sections.
5951 (Output_section::Input_section::shndx): Ditto.
5952 (Output_section::Output_section): Remove initializations of removed
5953 data members and initialize new data member LOOKUP_MAPS_.
5954 (Output_section::add_input_section): Set keeps-input-sections flag
5955 for a newly created merge output section as appropriate. Adjust code
5956 to use Output_section_lookup_maps class.
5957 (Output_section::add_relaxed_input_section): Adjst code for lookup
5958 maps code refactoring.
2e702c99 5959 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5960 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5961 class. If adding input section to a newly created merge output
5962 section fails, remove the new merge section.
5963 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5964 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5965 (Output_section::find_merge_section): Ditto.
0439c796 5966 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5967 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5968 Output_section_lookup_maps class.
5969 (Output_section::get_input_sections): Export merge sections. Adjust
5970 code to use Output_section_lookup_maps class.
5971 (Output_section:::add_script_input_section): Adjust code to use
5972 Output_section_lookup_maps class. Update lookup maps for merge
5973 sections also.
5974 (Output_section::discard_states): Use Output_section_lookup_maps.
5975 (Output_section::restore_states): Same.
5976 * output.h (Merge_section_properties): Move class defintion out of
5977 Output_section.
5978 (Output_section_lookup_maps): New class.
5979 (Output_section::Input_section::is_merge_section): New method
5980 defintion.
5981 (Output_section::Input_section::relobj): Move defintion out of class
5982 defintion. Declare method only.
5983 (Output_section::Input_section::shndx): Ditto.
5984 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5985 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5986 (Output_section::Merge_section_by_properties_map,
5987 Output_section::Output_section_data_by_input_section_map,
5988 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5989 Remove types.
2e702c99 5990 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5991 KEEPS_INPUT_SECTIONS.
5992 (Output_section::build_lookup_maps): New method declaration.
5993 (Output_section::merge_section_map_,
5994 Output_section::merge_section_by_properties_map_,
5995 Output_section::relaxed_input_section_map_,
5996 Output_section::is_relaxed_input_section_map_valid_): Remove data
5997 members.
5998 (Output_section::lookup_maps_): New data member.
5999
76295588
L
60002010-05-21 Doug Kwan <dougkwan@google.com>
6001
6002 PR gold/11619
6003 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6004 avoid a compilation error.
6005
d103a984
RÁE
60062010-05-19 Rafael Espindola <espindola@google.com>
6007
6008 * script-sections.cc (Output_section_definition::allocate_to_segment):
6009 Update the phdrs_list even when the output section is NULL.
6010 * testsuite/Makefile.am: Add test.
6011 * testsuite/Makefile.in: Regenerate.
6012 * testsuite/script_test_9.cc: New.
6013 * testsuite/script_test_9.sh: New.
6014 * testsuite/script_test_9.t: New.
6015
6625d24e
DK
60162010-05-19 Doug Kwan <dougkwan@google.com>
6017
6018 * arm.cc (Arm_input_section::original_size): New method.
6019 (Arm_input_section::do_addralign): Add a cast.
6020 (Arm_input_section::do_output_offset): Remove static cast.
6021 (Arm_input_section::original_addralign,
6022 Arm_input_section::original_size_): Change type to uint32_t.
6023 (Arm_input_section::init): Add safe casts for section alignment
6024 and size.
6025 (Arm_input_section::set_final_data_size): Do not set address and
6026 offset of stub table.
6027 (Arm_output_section::fix_exidx_coverage): Change use of of
6028 Output_section::Simple_input_section to that of
6029 Output_section::Input_section.
6030 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6031 except for the first pass.
6032 * output.cc (Output_section::get_input_sections): Change type of
6033 input_sections to std::list<Input_section>.
6034 (Output_section::add_script_input_section): Rename from
6035 Output_section::add_simple_input_section. Change type of SIS
6036 parameter from Simple_input_section to Input_section.
6037 * output.h (Output_section::Simple_input_section): Remove class.
6038 (Output_section::Input_section): Change class visibility to public.
6039 (Output_section::Input_section::addralign): Use stored alignments
6040 for special input sections if set.
6041 (Output_section::Input_section::set_addralign): New method.
6042 (Output_section::get_input_sections): Change parameter type from
6043 list of Simple_input_section to list of Input_section.
6044 (Output_section::add_script_input_section): Rename from
6045 Output_section::add_simple_input_section. Change first parameter's
6046 type from Simple_input_section to Input_section and remove the
6047 second and third parameters.
6048 * script-sections.cc (Input_section::Input_section_list): Change
6049 type to list of Output_section::Input_section/
6050 (Input_section_info::Input_section_info): Change parameter type of
6051 INPUT_SECTION to Output_section::Input_section.
6052 (Input_section_info::input_section): Change return type.
6053 (Input_section_info::input_section_): Change type to
6054 Output_section::Input_section.
6055 (Output_section_element_input::set_section_addresses): Adjust code
6056 to use Output_section::Input_section instead of
6057 Output_section::Simple_input_section. Adjust code for renaming
6058 of Output_section::add_simple_input_section.
6059 (Orphan_output_section::set_section_addresses): Ditto.
6060
e1e82ea4
RW
60612010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6062
6063 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6064 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6065
91e75c8a
RÁE
60662010-05-18 Rafael Espindola <espindola@google.com>
6067
6068 * options.cc (General_options::finalize): Handle -nostdlib.
6069 * options.h (nostdlib): New option.
6070 * script.cc (script_add_search_dir): Handle -nostdlib.
6071
da59ad79
DK
60722010-05-12 Doug Kwan <dougkwan@google.com>
6073
6074 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6075 attributes section only if there no attributes section after merging.
6076 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6077 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6078 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6079 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6080 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6081 and arm_attr_merge_7.stdout.
6082 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6083 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6084 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6085 arm_attr_merge_7b.o): New rules.
6086 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6087 arm_attr_merge_7
6088 * testsuite/Makefile.in: Regenerate.
6089 * testsuite/arm_attr_merge.sh: New file.
6090 * testsuite/arm_attr_merge_[67][ab].s: Same.
6091
3e01a7fd
NC
60922010-05-05 Nick Clifton <nickc@redhat.com>
6093
6094 * po/es.po: Updated Spanish translation.
6095
7ad2014a
L
60962010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6097
6098 * Makefile.am (install-exec-local): Properly install gold as
6099 default cross linker.
6100 * Makefile.in: Regenerated.
6101
4fda8867
NC
61022010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6103 Nick Clifton <nickc@redhat.com>
6104
6105 * configure.ac (install_as_default): Define and set to false
6106 unless --enable-gold or --enable-gold=both/gold has been
6107 specified.
6108 * configure: Regenerate.
6109
6110 * Makefile.am (install-exec-local): Install the executable as
6111 'ld.gold'. If install_as_default is true then also install it as
6112 'ld'.
6113 * Makefile.in: Regenerated.
6114
bd288ea2
ILT
61152010-04-24 Ian Lance Taylor <iant@google.com>
6116
6117 * layout.cc (Layout::layout_reloc): In relocatable link don't
6118 combine reloc sections for grouped sections.
6119
ef38fd8a
ST
61202010-04-23 Sriraman Tallam <tmsriram@google.com>
6121
6122 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6123 sections that are not ordinary to icf.
6124 * icf.cc (get_section_contents): Handle relocation pointing to section
6125 with no object or shndx information.
6126 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6127 * testsuite/Makefile.in: Regenerate.
6128 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6129 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6130
f6973bdc
ILT
61312010-04-22 Ian Lance Taylor <iant@google.com>
6132
6133 * expression.cc (Expression::Expression_eval_info): Add
6134 result_alignment_pointer field.
6135 (Expression::eval_with_dot): Add result_alignment_pointer
6136 parameter. Change all callers.
6137 (Expression::eval_maybe_dot): Likewise.
6138 (class Binary_expression): Add alignment_pointer parameter to
6139 left_value and right_value. Change all callers.
6140 (BINARY_EXPRESSION): Set result alignment.
6141 (class Trinary_expression): Add alignment_pointer parameter to
6142 arg2_value and arg3_value. Change all callers.
6143 (Trinary_cond::value): Set result alignment.
6144 (Max_expression::value, Min_expression::value): Likewise.
6145 (Align_expression::value): Likewise.
6146 * script-sections.cc (class Sections_element): Add dot_alignment
6147 parameter to set_section_addresses virtual function. Update
6148 instantiations.
6149 (class Output_section_element): Likewise.
6150 (Script_sections::create_segments): Add dot_alignment parameter.
6151 Change all callers.
6152 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6153 (Script_sections::set_phdrs_clause_addresses): Likewise.
6154 * script-sections.h: Update declarations.
6155 * script.h: Update declarations.
6156 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6157 min_p_align.
6158 * testsuite/script_test_3.t: Set large alignment.
6159 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6160 segment has expected alignment.
6161
9c9c98a5
NC
61622010-04-22 Nick Clifton <nickc@redhat.com>
6163
6164 * po/gold.pot: Updated by the Translation project.
6165 * po/vi.po: Updated Vietnamese translation.
6166
2253bfba
L
61672010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6168
6169 * testsuite/Makefile.am (check_PROGRAMS): Add
6170 icf_virtual_function_folding_test.
6171 * testsuite/Makefile.in: Regenerated.
6172
85fdf906
AH
61732010-04-15 Andrew Haley <aph@redhat.com>
6174
6175 * options.h (merge_exidx_entries): New option.
6176 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6177 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6178 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6179 (Target_arm::merge_exidx_entries): New function.
6180 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6181 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6182 to Arm_exidx_fixup constructor.
6183 Add new arg, merge_exidx_entries.
6184 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6185 Arm_output_section::fix_exidx_coverage.
6186
ce97fa81
ST
61872010-04-18 Sriraman Tallam <tmsriram@google.com>
6188
6189 * icf.cc (get_section_contents): Check for preemptible functions.
6190 Ignore addend when appropriate.
6191 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6192 section folded.
6193 (add_from_relobj): Check for section folded.
6194 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6195 * symtab.h (should_add_dynsym_entry): Add new parameter.
6196 * target-reloc.h (scan_relocs): Check for section folded.
6197 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6198 Check reloc types for function pointers in shared objects.
6199 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6200 case.
6201 (icf_preemptible_functions_test): New test case.
6202 (icf_string_merge_test): New test case.
6203 * testsuite.Makefile.in: Regenerate.
6204 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6205 bar_glob. Refactor code.
6206 * testsuite/icf_preemptible_functions_test.cc: New file.
6207 * testsuite/icf_preemptible_functions_test.sh: New file.
6208 * testsuite/icf_string_merge_test.cc: New file.
6209 * testsuite/icf_string_merge_test.sh: New file.
6210 * testsuite/icf_virtual_function_folding_test.cc: New file.
6211 * testsuite/icf_virtual_function_folding_test.sh: New file.
6212
04ceb17c
DK
62132010-04-14 Doug Kwan <dougkwan@google.com>
6214
6215 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6216 for local symbol recounting if we remove a section due to ICF.
6217 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6218 there are no regular objects in input.
6219
153e7da4
DK
62202010-04-13 Doug Kwan <dougkwan@google.com>
6221
6222 * arm.cc (Arm_input_section::set_final_data_size): Compute
6223 accurate final data size instead of using current data size.
6224
4dbd9faf
DK
62252010-04-09 Doug Kwan <dougkwan@google.com>
6226
6227 * layout.cc (Layout::choose_output_section): Handle script section
6228 types.
6229 (Layout::make_output_section_for_script): Add section type parameter.
6230 Handle script section types.
6231 * layout.h (Layout::make_output_section_for_script): Add section
6232 type parameter.
6233 * output.cc (Output_section::Output_section): Initialize data member
6234 is_noload_.
6235 (Output_section::do_reset_address_and_file_offset): Do not set address
6236 to 0 if section is a NOLOAD section.
6237 * output.h (Output_section::is_noload): New method.
6238 (Output_section::set_is_noload): Ditto.
6239 (Output_section::is_noload_): New data member.
6240 * script-c.h (Script_section_type): New enum type.
6241 (struct Parser_output_section_header): Add new file section_type.
6242 * script-sections.cc (Sections_element::output_section_name): Add
6243 parameter for returning script section type.
6244 (Output_section_definition::output_section_name): Ditto.
6245 (Output_section_definition::section_type)P; New method.
6246 (Output_section_definiton::script_section_type_name): Ditto.
6247 (Output_section_definition::script_section_type_): New data member.
6248 (Output_section_definition::Output_section_definition): Initialize
6249 data member Output_section_definition::script_section_type_.
6250 (Output_section_definition::create_sections): Pass script section type
6251 to Layout::make_output_section_for_script.
6252 (Output_section_definition::output_section_name): Return script
6253 section type to caller.
6254 (Output_section_definition::set_section_address): Do not advance
6255 dot value and load address if section type is NOLOAD. Set address
6256 of NOLOAD sections regardless of section flags.
6257 (Output_section_definition::print): Print section type if it is
6258 not SCRIPT_SECTION_TYPE_NONE.
6259 (Output_section_definition::section_type): New method.
6260 (Output_section_definition::script_section_type_name): Ditto.
6261 (Script_sections::output_section_name): Add new parameter
6262 PSECTION_TYPE for returning script section type. Pass it to
6263 section elements. Handle discard sections.
6264 (Sort_output_sections::operator()): Handle NOLOAD sections.
6265 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6266 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6267 returning script section type.
6268 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6269 INFO and NOLOAD.
6270 * yyscript.y (union): Add new field SECTION_TYPE.
6271 (COPY, DSECT, INFO, NOLOAD): New tokens.
6272 (opt_address_and_section_type): Change type to output_section_header.
6273 (section_type): New non-terminal
6274 (section_header): Handle section type.
2253bfba 6275 (opt_address_and_section_type): Return section type value.
4dbd9faf 6276
721ea635
L
62772010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6278
6279 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6280 * testsuite/plugin_common_test_2.c (foo): Likewise.
6281
6bf924b0
DK
62822010-04-08 Doug Kwan <dougkwan@google.com>
6283
6284 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6285 Output_merge_data.
6286 * output.cc (Output_section::add_merge_input_section): Simplify
6287 code and return status of Output_merge_base::add_input_section.
e1df38aa 6288 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6289 returns true.
6290
24af6f92
DK
62912010-04-07 Doug Kwan <dougkwan@google.com>
6292
6293 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6294 if section is marked as containing instructions but has no mapping
6295 symbols.
6296 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6297 correct section index.
6298 (Arm_relobj::find_linked_text_section): Ditto.
6299
00698fc5
CC
63002010-04-07 Cary Coutant <ccoutant@google.com>
6301
6302 * archive.cc (include_member): Destroy Read_symbols_data object before
6303 releasing file.
6304 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6305 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6306 (Read_symbols_data::~Read_symbols_data) New destructor.
6307 (Section_relocs::Section_relocs) New constructor.
6308 (Section_relocs::~Section_relocs) New destructor.
6309 (Read_relocs_data::Read_relocs_data) New constructor.
6310 (Read_relocs_data::~Read_relocs_data) New destructor.
6311 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6312 pointers to NULL after deleting.
6313
7296d933
DK
63142010-04-07 Doug Kwan <dougkwan@google.com>
6315
6316 * arm.cc: Replace "endianity" with "endianness" in comments.
6317 (Arm_exidx_cantunwind): Ditto.
6318 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6319 (Arm_relobj::merge_flags_and_attributes): New method.
6320 (Arm_relobj::merge_flags_and_attributes_): New data member.
6321 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6322 (Arm_relobj::scan_sections_for_stubs): Ditto.
6323 (Arm_relobj::do_read_symbols): Check to see if we really want to
6324 merge processor-specific flags and attributes. Exit early if
6325 an object is empty except for section names and the undefined symbol.
6326 (Target_arm::do_finalize_sections): Move check for ELF format to
6327 Arm_relobj::do_read_symbols. Merge processor specific flags and
6328 attributes from a regular object only when we have determined that
6329 it is aapropriate. Do not create an .ARM.attributes section in
6330 output if there is no regular input object.
6331 (Target_arm::merge_processor_specific_flags): Check
6332 --warn-mismatch before printing any error.
6333 (Target_arm::merge_object_attributes): Ditto.
6334 * gold.cc (queue_middle_tasks): Handle the case in which there is
6335 no regular object in input.
6336 * options.cc (General_options::parse_EB): New method.
6337 (General_options::parse_EL): Same.
6338 (General_options::General_options): Initialize endianness_.
6339 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6340 New options.
6341 (General_options::Endianness): New enum.
6342 (General_options::endianness): New method.
6343 (General_options::endianness_): New data member.
6344 * parameters.cc (Parameters::set_options): Check target endianness.
6345 (Parameters::set_target_once): Ditto.
6346 (Parameters::check_target_endianness): New method.
6347 (parameters_force_valid_target): If either -EL or -EB is specified,
6348 use it to define endianness of default target.
6349 * parameters.h (Parameters::check_target_endianness): New method
6350 declaration.
6351 * target.h (class Target): Change "endianity" to "endianness"
6352 in comments.
6353
efc8d4f2
RW
63542010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6355
6356 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6357 * configure: Regenerate.
6358 * Makefile.in: Regenerate.
6359 * testsuite/Makefile.in: Regenerate.
6360
be234d88
CC
63612010-04-06 Cary Coutant <ccoutant@google.com>
6362
6363 gcc PR lto/42757
6364 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6365 prevailing definitions of common symbols.
6366 * testsuite/plugin_test_6.sh: New test case.
6367 * testsuite/plugin_common_test_1.c: New test case.
6368 * testsuite/plugin_common_test_2.c: New test case.
6369 * testsuite/Makefile.am (plugin_test_6): New test case.
6370 * testsuite/Makefile.in: Regenerate.
6371
bd32c6bd
NC
63722010-04-06 Nick Clifton <nickc@redhat.com>
6373
6374 * po/vi.po: New Vietnamese translation.
6375
323c532f
DK
63762010-03-30 Doug Kwan <dougkwan@google.com>
6377
6378 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6379
4fcd97eb
DK
63802010-03-25 Doug Kwan <dougkwan@google.com>
6381
6382 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6383 to avoid a conversion warning on a 32-bit host.
6384
4ebf39db
ILT
63852010-03-24 Ian Lance Taylor <iant@google.com>
6386
6387 * testsuite/script_test_3.t: Add a TLS segment.
6388 * testsuite/Makefile.am (check_PROGRAMS): Add
6389 tls_phdrs_script_test.
6390 (tls_phdrs_script_test_SOURCES): Define.
6391 (tls_phdrs_script_test_DEPENDENCIES): Define.
6392 (tls_phdrs_script_test_LDFLAGS): Define.
6393 (tls_phdrs_script_test_LDADD): Define.
6394 * testsuite/Makefile.in: Rebuild.
6395
4a599bdd
CC
63962010-03-23 Cary Coutant <ccoutant@google.com>
6397
6398 * fileread.cc (find_or_make_view): Fix comment.
6399
6c93b22c
ILT
64002010-03-23 Ian Lance Taylor <iant@google.com>
6401
6402 * script-sections.cc (class Orphan_section_placement): Define
6403 PLACE_TLS and PLACE_TLS_BSS.
6404 (Orphan_section_placement::Orphan_section_placement): Initialize
6405 new places.
6406 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6407 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6408 (tls_script_test_SOURCES): Define.
6409 (tls_script_test_DEPENDENCIES): Define.
6410 (tls_script_test_LDFLAGS): Define.
6411 (tls_script_test_LDADD): Define.
6412 * testsuite/Makefile.in: Rebuild.
6413
a2c7281b
DK
64142010-03-22 Doug Kwan <dougkwan@google.com>
6415
6416 * arm.cc (Arm_relocate_functions::abs8,
6417 Arm_relocate_functions::abs16): Use correct check for overflow
6418 specified in the ARM ELF specs.
6419 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6420 target of a BLX instruction specially.
6421 (Reloc_stub::stub_type_for_reloc): Ditto.
6422 (Relocate::relocate): Use symbolic names instead of numeric relocation
6423 codes to report error.
6424 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6425 workaround.
6426 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6427 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6428 thumb2_blx_out_of_range.stdout
6429 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6430 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6431 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6432 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6433 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6434 thumb2_blx_in_range, thumb2_blx_in_range.o,
6435 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6436 thumb2_blx_out_of_range.o): New rules.
2e702c99 6437 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6438 thumb2_blx_in_range and thumb2_blx_out_of_range.
6439 * testsuite/Makefile.in: Regenerate.
6440 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6441 * testsuite/thumb_blx_in_range.s: New file.
6442 * testsuite/thumb_blx_out_of_range.s: New file.
6443
b0193076
RÁE
64442010-03-22 Rafael Espindola <espindola@google.com>
6445
6446 * archive.cc (Should_include): Move to archive.h.
6447 (should_include_member): Make it a member of Archive.
6448 (Lib_group): New.
6449 (Add_lib_group_symbols): New.
6450 * archive.h: Include options.h.
6451 (Archive_member): Moved from Archive.
6452 (Should_include): Moved from archive.cc.
6453 (Lib_group): New.
6454 (Add_lib_group_symbols): New.
6455 * dynobj.cc (do_should_include_member): New.
6456 * dynobj.h (do_should_include_member): New.
6457 * gold.cc (queue_initial_tasks): Update call to queue.
6458 * main.cc (main): Print lib group stats.
6459 * object.cc (do_should_include_member): New.
6460 * object.h: Include archive.h.
6461 (Object::should_include_member): New.
6462 (Object::do_should_include_member): New.
6463 (Sized_relobj::do_should_include_member): New.
6464 * options.cc (General_options::parse_start_lib): New.
6465 (General_options::parse_end_lib): New.
6466 (Input_arguments::add_file): Handle lib groups.
6467 (Input_arguments::start_group): Check we are not in a lib.
6468 (Input_arguments::start_lib): New.
6469 (Input_arguments::end_lib): New.
6470 * options.h (General_options): Add start_lib and end_lib.
6471 (Input_argument::lib_): New.
6472 (Input_argument::lib): New.
6473 (Input_argument::is_lib): New.
6474 (Input_file_lib): New.
6475 (Input_arguments::in_lib_): New.
6476 (Input_arguments::in_lib): New.
6477 (Input_arguments::start_lib): New.
6478 (Input_arguments::end_lib_): New.
6479 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6480 in unused members as preempted.
6481 (Sized_pluginobj::do_should_include_member): New.
6482 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6483 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6484 return the blocker.
6485 (Read_symbols::do_whole_lib_group): New.
6486 (Read_symbols::do_lib_group): New.
6487 (Read_symbols::do_read_symbols): Handle lib groups.
6488 (Read_symbols::get_name): Handle lib groups.
6489 * readsyms.h (Read_symbols): Add an archive member pointer.
6490 (Read_symbols::do_whole_lib_group): New.
6491 (Read_symbols::do_lib_group): New.
6492 (Read_symbols::member_): New.
6493 * script.cc (read_input_script): Update call to queue_soon.
6494
d099120c
DK
64952010-03-19 Doug Kwan <dougkwan@google.com>
6496
6497 * arm.cc (Stub_table::Stub_table): Initialize new data members
6498 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6499 (Stub_table::add_reloc_stub): Assign stub offset and update
6500 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6501 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6502 New data members.
2e702c99 6503 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6504 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6505 instead of going over all reloc stubs.
2e702c99 6506 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6507 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6508 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6509 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6510 Stringpool_template::offset_.
6511 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6512 Stringpool_template::offset_ to zero.
6513
1aa37384
DK
65142010-03-15 Doug Kwan <dougkwan@google.com>
6515
6516 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6517 offset_.
6518 (Stringpool_template::new_key_offset): New method.
6519 (Stringpool_template::add_string): Assign offsets when adding new
6520 strings.
6521 (Stringpool_template::set_string_offsets): Do not set string offsets
6522 when not optimizing.
6523 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6524 member size_.
2e702c99
RM
6525 (Chunked_vector::clear): Clear size_.
6526 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6527 (Chunked_vector::size): Return size_.
6528 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6529 (Chunked_vector::size_): New data member.
1aa37384
DK
6530 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6531 (Stringpool_template::new_key_offset): New method declaration.
6532 (Stringpool_template::offset_): New data member.
6533
b672b057
RÁE
65342010-03-15 Rafael Espindola <espindola@google.com>
6535
6536 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6537 Add_symbols' constructor.
6538 * readsyms.h (Add_symbols): Remove the input_group member.
6539
b6848d3c
ILT
65402010-03-10 Ian Lance Taylor <iant@google.com>
6541
6542 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6543 target to ask whether a reference to a symbol requires a stack
6544 split.
6545 * target.h (Target::is_call_to_non_split): New function.
6546 (Target::do_is_call_to_non_split): Declare virtual function.
6547 * target.cc: Include "symtab.h".
6548 (Target::do_is_call_to_non_split): New function.
6549 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6550
a2a5469e
CC
65512010-03-10 Cary Coutant <ccoutant@google.com>
6552
6553 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6554 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6555 (File_read::open[2]): Add whole_file_view_ to list of views.
6556 (File_read::make_view): Remove test of whole_file_view_.
6557 (File_read::find_or_make_view): Create whole_file_view_ if
6558 necessary.
6559 (File_read::clear_views): Replace bool parameter with enum;
6560 adjust all callers. Don't delete views with permanent data;
6561 do delete cached views and views from archives if
6562 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6563 if clearing the corresponding view.
6564 * fileread.h (File_read::Clear_views_mode): New enum.
6565 (File_read::View::is_permanent_view): New method.
6566 (File_read::clear_views): Replace bool parameter
6567 with enum; adjust all callers.
6568 * options.h (General_options): Change keep_files_mapped option;
6569 add map_whole_files.
6570 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6571 releasing the file.
6572 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6573 the file.
6574
8861f32b
DM
65752010-03-10 David S. Miller <davem@davemloft.net>
6576
6577 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6578
d62d0f5f
ST
65792010-03-09 Sriraman Tallam <tmsriram@google.com>
6580
6581 * icf.cc (get_section_contents): Add '@' marker after processing the
6582 merge reloc.
6583
9177756d
DK
65842010-03-08 Doug Kwan <dougkwan@google.com>
6585
6586 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6587 due to a conversion warning.
6588 (Arm_relobj::update_output_local_symbol_count): Check for local
6589 symbol with unset output index.
6590
9e9e071b
ILT
65912010-03-05 Ian Lance Taylor <iant@google.com>
6592
6593 * options.h (class General_options): Add --spare-dynamic-tags.
6594 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6595 --spare-dynamic-tags.
6596
a81ee015
ILT
65972010-03-05 Ian Lance Taylor <iant@google.com>
6598
6599 * incremental.cc: Include "libiberty.h".
6600
44ec90b9
RO
66012010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6602
6603 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6604 function, is_info_ member.
6605 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6606 (Versions::Versions): Update caller.
6607 (Versions::define_base_version): Likewise.
6608 (Versions::add_def): Likewise.
6609
0897ed3b
ST
66102010-03-03 Sriraman Tallam <tmsriram@google.com>
6611
6612 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6613 (Scan::possible_function_pointer_reloc): New function.
6614 (Scan::local_reloc_may_be_function_pointer): Change to call
6615 possible_function_pointer_reloc.
6616 (Scan::global_reloc_may_be_function_pointer): Ditto.
6617 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6618 relocations in ".data.rel.ro._ZTV" section.
6619 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6620 * testsuite/icf_safe_so_test.cc: Ditto.
6621 * testsuite/icf_safe_test.cc: Ditto.
6622 * testsuite/icf_safe_test.sh: Ditto.
6623
d3bbad62
ILT
66242010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6625 Ian Lance Taylor <iant@google.com>
6626
6627 * target-reloc.h (relocate_section): Check the symbol table index
6628 for -1U before setting the local symbol index.
6629 (scan_relocatable_relocs): If copying the relocation, record that
6630 the local symbol is required.
6631 * object.h (Symbol_value::is_output_symtab_index_set): New
6632 function.
6633 (Symbol_value::may_be_discarded_from_output_symtab): New
6634 function.
6635 (Symbol_value::has_output_symtab_entry): New function.
6636 (Symbol_value::needs_output_symtab_entry): Remove.
6637 (Symbol_value::output_symtab_index): Make sure the symbol index is
6638 set.
6639 (Symbol_value::set_output_symtab_index): Make sure the symbol
6640 index is not set. Make sure the new index is valid.
6641 (Symbol_value::set_must_have_output_symtab_entry): New function.
6642 (Symbol_value::has_output_dynsym_entry): New function.
6643 (Symbol_value::set_output_dynsym_index): Make sure the new index
6644 is valid.
6645 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6646 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6647 local symbol if permitted.
6648 (Sized_relobj::do_finalize_local_symbols): Call
6649 is_output_symtab_index_set rather than needs_output_symtab_entry.
6650 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6651 rather than needs_output_symtab_entry. Call
6652 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6653 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6654 is_output_symtab_index_set rather than needs_output_symtab_entry.
6655 * testsuite/discard_locals_relocatable_test.c: New file.
6656 * testsuite/discard_locals_test.sh: Test -r.
6657 * testsuite/Makefile.am (check_DATA): Add
6658 discard_locals_relocatable_test1.syms,
6659 discard_local_relocatable_test2.syms.
6660 (MOSTLYCLEANFILES): Likewise. Also add
6661 discard_locals_relocatable_test1.lout and
6662 discard_locals_relocatable_test2.out.
6663 (discard_locals_relocatable_test1.syms): New target.
6664 (discard_locals_relocatable_test.o): New target.
6665 (discard_locals_relocatable_test1.out): New target.
6666 (discard_locals_relocatable_test2.syms): New target.
6667 (discard_locals_relocatable_test2.out): New target.
6668 (various): Add missing ../ld-new dependencies.
6669 * testsuite/Makefile.in: Rebuild.
6670
7e8ccf26
NC
66712010-03-03 Nick Clifton <nickc@redhat.com>
6672
6673 * po/fi.po: New Finnish translation.
6674
2a0ff005
DK
66752010-03-01 Doug Kwan <dougkwan@google.com>
6676
6677 * layout.cc (Layout::Layout): Force section types of .init_array*,
6678 .preinit_array* and .fini_array* sections.
6679 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6680 Fix check of return value of std::string::find.().
6681 (Output_section::Input_section_sort_compare::operator()): Remove
6682 comment about .init_array.
6683 (Output_section::Input_section_sort_init_fini_compare::operator()):
6684 New method.
6685 (Output_section::sort_attached_input_sections): Handle .init_array
6686 and .fini_array specially.
6687 * output.h (Output_section::Inut_section_sort_compare): Update
6688 comment.
6689 (Output_section::Input_section_sort_init_fini_compare): New struct.
6690
c3e4ae29
DK
66912010-02-26 Doug Kwan <dougkwan@google.com>
6692
6693 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6694 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6695 * testsuite/debug_msg.sh: Avoid matching source line number for
6696 use of global variable undef_int.
6697
2fd9ae7a
DK
66982010-02-26 Doug Kwan <dougkwan@google.com>
6699
6700 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6701 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6702 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6703 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6704 * options.cc (General_options::General_options): Initialize member
6705 fix_v4bx_.
6706 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6707 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6708 and rm_no_fix_v4bx.stdout
6709 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6710 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6711 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6712 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6713 and arm_no_fix_v4bx.
6714 * Makefile.in: Regenerate.
6715 * testsuite/arm_fix_v4bx.s: New file.
6716 * testsuite/arm_fix_v4bx.sh: Ditto.
6717
67ec7d0b
DK
67182010-02-24 Doug Kwan <dougkwan@google.com>
6719
6720 * arm.cc (Target_arm::got_section): Make the .got section the first
6721 non RELRO section in the data segment.
6722 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6723 suffixes of section names.
6724
10165461
DK
67252010-02-24 Doug Kwan <dougkwan@google.com>
6726
6727 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6728 flags and attributes merging if an input file is a binary file.
6729 * fileread.cc (Input_file::open): Record format of original file.
6730 * fileread.h (Input_file::Format): New enum type.
2e702c99 6731 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6732 (Input_file::format): New method definition.
6733 (Input_file::format_):: New data member.
6734
4a54abbb
DK
67352010-02-24 Doug Kwan <dougkwan@google.com>
6736
6737 * arm.cc (Arm_output_data_got): New class.
6738 (ARM_TCB_SIZE): New constant
6739 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6740 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6741 If user uses a script with a SECTIONS clause, issue only a warning
6742 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6743 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6744 garbage collection.
6745 (Target_arm::got_mode_index_entry): Handle static linking.
6746 (Target_arm::Scan::local): Ditto.
6747 (Target_arm::Scan::global): Ditto.
6748 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6749 all incorrectly implemented relocations.
e1df38aa 6750 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6751 Arm_output_section::fix_exidx_coverage.
6752 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6753 from ".ARM.exidx." and ".ARM.extab.".
6754
ca419a6f
ILT
67552010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6756
6757 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6758 section if it does not already exist.
6759 * attributes.cc (Attributes_section_data::Attributes_section_data):
6760 Don't crash if size is zero.
6761
135b9c78
ILT
67622010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6763 Ian Lance Taylor <iant@google.com>
6764
6765 * gold.cc (queue_middle_tasks): If no input files were opened,
6766 exit.
6767 * workqueue.h (Task_function::Task_function): Assert that there is
6768 a blocker.
6769
bb0bfe4f
DK
67702010-02-22 Doug Kwan <dougkwan@google.com>
6771
6772 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6773 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6774 types to avoid warnings due to different uint64_t implementations
6775 on different hosts.
6776
2a2b6d42
DK
67772010-02-21 Doug Kwan <dougkwan@google.com>
6778
6779 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6780 handling of the maximum backward branch offset.
2e702c99 6781 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6782 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6783 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6784 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6785 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6786 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6787 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6788 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6789 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6790 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6791 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6792 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6793 thumb2_bl_out_of_range.o): New rules.
6794 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6795 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6796 thumb2_bl_out_of_range
6797 * testsuite/Makefile.in: Regenerate.
6798 * testsuite/arm_bl_in_range.s: New file.
6799 * testsuite/arm_bl_out_of_range.s: Ditto.
6800 * testsuite/arm_branch_in_range.sh: Ditto.
6801 * testsuite/arm_branch_range.t: Ditto.
6802 * testsuite/thumb2_branch_range.t: Ditto.
6803 * testsuite/thumb_bl_in_range.s: Ditto.
6804 * testsuite/thumb_bl_out_of_range.s: Ditto.
6805 * testsuite/thumb_branch_range.t: Ditto.
6806
b487ad64
ST
68072010-02-20 Sriraman Tallam <tmsriram@google.com>
6808
6809 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6810 Add reloc offset information.
6811 * icf.cc (get_section_contents): Change iterators to point to the new
6812 vectors. Add reloc offset information to the contents.
6813 * icf.h (Icf::Sections_reachable_info): New typedef.
6814 (Icf::Sections_reachable_list): New typedef.
6815 (Icf::Offset_info): New typedef.
6816 (Icf::Reloc_info): New struct typedef.
6817 (Icf::Reloc_info_list): New typedef.
6818 (Icf::symbol_reloc_list): Delete method.
6819 (Icf::addend_reloc_list): Delete method.
6820 (Icf::section_reloc_list): Delete method.
6821 (Icf::reloc_info_list): New method.
6822 (Icf::reloc_info_list_): New member.
6823
f96accdf
DK
68242010-02-19 Doug Kwan <dougkwan@google.com>
6825
6826 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6827 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6828 * arm.cc (Arm_relocation_functions): New forward declaration.
6829 (Target_arm::Target_arm): Initialize new data members
6830 got_mod_index_offset_ and tls_base_symbol_defined_.
6831 (Target_arm::Relocate::relocate_tls): New method.
6832 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6833 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6834 New methods.
2e702c99 6835 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6836 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6837 (Target_arm::got_mod_index_offset_,
6838 Target_arm::tls_base_symbol_defined_): New data members.
6839 (Target_arm::Scan::local, Target::Scan::global,
6840 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6841 relocations.
6842
c8761b9a
DK
68432010-02-18 Doug Kwan <dougkwan@google.com>
6844
6845 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6846 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6847 text section as a parameter becuase some broken tools may not set
6848 the link in section header.
6849 (Target_arm::has_got_section): New method.
6850 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6851 without any mapping symbol as data only. Remove warning.
6852 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6853 link in its section header, try to discover the link by inspecting the
6854 REL31 relocation at the beginning of the section.
6855 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6856 in error message.
6857 (Target_arm::Scan::global): Treat any reference to the symbol
6858 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6859
21bb3914
ST
68602010-02-12 Sriraman Tallam <tmsriram@google.com>
6861
6862 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6863 (Scan::global_reloc_may_be_function_pointer): New function.
6864 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6865 (Scan::global_reloc_may_be_function_pointer): New function.
6866 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6867 (Scan::global_reloc_may_be_function_pointer): New function.
6868 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6869 (Scan::global_reloc_may_be_function_pointer): New function.
6870 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6871 (Scan::global_reloc_may_be_function_pointer): New function.
6872 (Scan::possible_function_pointer_reloc): New function.
6873 (Target_x86_64::can_check_for_function_pointers): New function.
6874 * gc.h (gc_process_relocs): Scan relocation types to determine if
6875 function pointers were taken for targets that support it.
6876 * icf.cc (Icf::find_identical_sections): Include functions for
6877 folding in safe ICF whose pointer is not taken.
6878 * icf.h (Secn_fptr_taken_set): New typedef.
6879 (fptr_section_id_): New member.
6880 (section_has_function_pointers): New function.
6881 (set_section_has_function_pointers): New function.
6882 (check_section_for_function_pointers): New function.
6883 * options.h: Fix comment for safe ICF option.
6884 * target.h (can_check_for_function_pointers): New function.
6885 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6886 Modify icf_safe_test for X86-64.
6887 * testsuite/Makefile.in: Regenerate.
6888 * testsuite/icf_safe_so_test.cc: New file.
6889 * testsuite/icf_safe_so_test.sh: New file.
6890 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6891 (main): Change to take pointer to function kept_func_3.
6892 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6893 folding is done correctly for X86-64.
6894
0da6fa6c
DM
68952010-02-12 David S. Miller <davem@davemloft.net>
6896
6897 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6898 is_symbolless parameter.
6899 (Output_reloc<SHT_REL>::is_symbolless): New.
6900 (Output_reloc<SHT_REL>::is_symbolless_): New.
6901 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6902 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6903 (Output_reloc<SHT_RELA>::is_symbolless): New.
6904 (Output_data_reloc::add_global): Handle is_symbolless.
6905 (Output_data_reloc::add_global_relative): Likewise.
6906 (Output_data_reloc::add_local): Likewise.
6907 (Output_data_reloc::add_local_relative): Likewise.
6908 (Output_data_reloc::add_symbolless_global_addend): New.
6909 (Output_data_reloc::add_symbolless_local_addend): New.
6910 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6911 is_symbolless.
6912 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6913 instead of ->is_relative_
6914 (Output_reloc::write): Likewise.
6915 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6916 (Output_reloc::write_rel): Simplify.
6917
6918 * sparc.cc (Target_sparc::Scan::local): Use
6919 ->add_symbolless_local_addend as needed.
6920 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6921 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6922 based upon relocation offset.
6923
e4782e83
DK
69242010-02-11 Doug Kwan <dougkwan@google.com>
6925
6926 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6927 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6928 beginning of function.
6929 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6930 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6931 parameter is_32bit in calls to should_apply_static_reloc.
6932 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6933 (check_DATA): Add arm_abs_global.stdout.
6934 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6935 arm_abs_global.stdout): New rules.
6936 (MOSTLLYCLEANFILES): Add arm_abs_global
6937 * Makefile.in: Regenerate.
6938 * testsuite/arm_abs_global.s: New file.
6939 * testsuite/arm_abs_global.sh: Ditto.
6940 * testsuite/arm_abs_lib.s: Ditto.
6941
93ceb764
ILT
69422010-02-11 Ian Lance Taylor <iant@google.com>
6943
6944 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6945 Read_relocs task.
6946 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6947 Allocate_commons_task first.
6948 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6949 task, rather than symtab_lock_.
6950 (Gc_process_relocs::~Gc_process_relocs): New function.
6951 (Gc_process_relocs::is_runnable): Check this_blocker_.
6952 (Gc_process_relocs::locks): Use next_blocker_ rather than
6953 blocker_.
6954 (Scan_relocs::~Scan_relocs): New function.
6955 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6956 symtab_lock_.
6957 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6958 next_blocker_.
6959 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6960 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6961 constructor accordingly.
6962 (class Gc_process_relocs): Likewise.
6963 (class Scan_relocs): Likewise.
6964 * common.h (class Allocate_commons_task): Remove symtab_lock_
6965 field, and corresponding constructor parameter.
6966 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6967 symtab_lock_.
6968 (Allocate_commons_task::locks): Likewise.
6969
114dfbe1
ILT
69702010-02-11 Ian Lance Taylor <iant@google.com>
6971
6972 * gold-threads.h (class Once): Define.
6973 (class Initialize_lock): Rewrite as child of Once.
6974 * gold-threads.cc (class Once_initialize): Define.
6975 (once_pointer_control): New static variable.
6976 (once_pointer, once_arg): New static variables.
6977 (c_run_once): New static function.
6978 (Once::Once, Once::run_once, Once::internal_run): New functions.
6979 (class Initialize_lock_once): Remove.
6980 (initialize_lock_control): Remove.
6981 (initialize_lock_pointer): Remove.
6982 (initialize_lock_once): Remove.
6983 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6984 (Initialize_lock::initialize): Rewrite.
6985 (Initialize_lock::do_run_once): New function.
6986 * archive.cc (Archive::interpret_header): Only clear name if it is
6987 not already empty.
6988 * fileread.cc: Include "gold-threads.h"
6989 (file_counts_lock): New static variable.
6990 (file_counts_initialize_lock): Likewise.
6991 (File_read::release): Only increment counts when using --stats.
6992 Use a lock around the increment.
6993 * parameters.cc (class Set_parameters_target_once): Define.
6994 (set_parameters_target_once): New static variable.
6995 (Parameters::Parameters): Move here from parameters.h.
6996 (Parameters::set_target): Rewrite.
6997 (Parameters::set_target_once): New function.
6998 (Parameters::clear_target): Move here and rewrite.
6999 * parameters.h (class Parameters): Update declarations. Add
7000 set_parameters_target_once_ field.
7001 (Parameters::Parameters): Move to parameters.cc.
7002 (Parameters::clear_target): Likewise.
7003 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7004 task.
7005 (Start_group::~Start_group): New function.
7006 (Start_group::is_runnable): New function.
7007 (Start_group::locks, Start_group::run): New functions.
7008 (Finish_group::run): Change saw_undefined to size_t.
7009 * readsyms.h (class Start_group): Define.
7010 (class Finish_group): Change saw_undefined_ field to size_t.
7011 (Finish_group::Finish_group): Remove saw_undefined and
7012 this_blocker parameters. Change all callers.
7013 (Finish_group::set_saw_undefined): New function.
7014 (Finish_group::set_blocker): New function.
7015 * symtab.h (class Symbol_table): Change saw_undefined to return
7016 size_t. Change saw_undefined_ field to size_t.
7017 * target-select.cc (Set_target_once::do_run_once): New function.
7018 (Target_selector::Target_selector): Initialize set_target_once_
7019 field. Don't initialize lock_ and initialize_lock_ fields.
7020 (Target_selector::instantiate_target): Rewrite.
7021 (Target_selector::set_target): New function.
7022 * target-select.h (class Set_target_once): Define.
7023 (class Target_selector): Update declarations. Make
7024 Set_target_once a friend. Remove lock_ and initialize_lock_
7025 fields. Add set_target_once_ field.
7026
fa17a3f4
ILT
70272010-02-10 Ian Lance Taylor <iant@google.com>
7028
7029 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7030 queueing any tasks.
7031 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7032 (queue_middle_tasks): Add all blockers before queueing any tasks.
7033 (queue_final_tasks): Likewise.
7034 * token.h (Task_token::add_blockers): New function.
7035 * object.h (Input_objects::number_of_relobjs): New function.
7036
c7177d31
ILT
70372010-02-10 Ian Lance Taylor <iant@google.com>
7038
5de0e392
ILT
7039 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7040 shared, not if not position independent.
7041 * x86_64.cc (Relocate::relocate_tls): Likewise.
7042 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7043 (tls_pie_pic_test): New target.
7044 * testsuite/Makefile.in: Rebuild.
7045
c7177d31
ILT
7046 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7047 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7048 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7049 * testsuite/Makefile.in: Rebuild.
7050
684b268a
DM
70512010-02-09 David S. Miller <davem@davemloft.net>
7052
7053 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7054 R_SPARC_RELATIVE using ->add_local_relative().
7055 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7056
612a8d3d
DM
7057 * output.h (Output_data_dynamic::add_section_size): New method
7058 that takes two Output_data objects.
7059 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7060 entry param. Handle it in initializers.
7061 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7062 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7063 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7064 arg.
7065 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7066 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7067 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7068 for dynrel_includes_plt.
7069 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7070 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7071 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7072 before .rela.plt
7073 (Target_sparc::do_finalize_sections): Update to pass true for
7074 dynrel_includes_plt.
7075 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7076 output before .rela.plt
7077 (Target_powerpc::do_finalize_sections): Update to pass true for
7078 dynrel_includes_plt when 32-bit.
7079
cb1be87e
DK
70802010-02-08 Doug Kwan <dougkwan@google.com>
7081
7082 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7083 method.
7084 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7085 Arm_relobj::scan_section_for_cortex_a8_stubs,
7086 Arm_relobj::do_relocation_section): Instead of calling
7087 Output_section::output_address, use faster
7088 Arm_relobj::simple_input_section_output_address.
7089
705b5121
DM
70902010-02-08 David S. Miller <davem@davemloft.net>
7091
7092 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7093 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7094 relocation helper function.
7095
024c4466
DM
7096 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7097 just like R_SPARC_GOT{10,13,22}.
7098 (Target_sparc::Scan::local): Likewise.
7099 (Target_sparc::Relocate:relocate): Likewise.
7100
9109c078
ILT
71012010-02-06 Ian Lance Taylor <iant@google.com>
7102
7103 * configure.ac: Rewrite targetobjs duplicate removal code to use
7104 only shell constructs.
7105 * configure: Rebuild.
7106
cf846138
DK
71072010-02-05 Doug Kwan <dougkwan@google.com>
7108
7109 PR 11247
7110 * arm.cc (Arm_relobj::section_is_scannable): New method.
7111 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7112 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7113
6cfaf60b
DK
71142010-02-04 Doug Kwan <dougkwan@google.com>
7115
7116 PR 11247
7117 * arm-reloc-property.cc (cstdio): Include.
7118 * configure.ac (targetobjs): Remove duplicates.
7119 * configure: Regenerate.
7120 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7121 big and little endian version for a given address size.
7122
5c57f1be
DK
71232010-02-03 Doug Kwan <dougkwan@google.com>
7124
7125 * arm-reloc-property.cc
7126 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7127 definition.
7128 * arm-reloc-property.h
7129 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7130 New method definition.
7131 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7132 declaration.
7133 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7134 overflow to N.
7135 (GOT_PREL): Change implemented to Y.
7136 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7137 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7138 (Arm_relocate_functions::movw_abs_nc): Remove method.
7139 (Arm_relocate_functions::movt_abs): Ditto.
7140 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7141 (Arm_relocate_functions::thm_movt_abs): Ditto.
7142 (Arm_relocate_functions::movw_rel_nc): Ditto.
7143 (Arm_relocate_functions::movw_rel): Ditto.
7144 (Arm_relocate_functions::movt_rel): Ditto.
7145 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7146 (Arm_relocate_functions:thm_movw_rel): Ditto.
7147 (Arm_relocate_functions:thm_movt_rel): Ditto.
7148 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7149 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7150 New method definitions.
7151 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7152 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7153 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7154 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7155 (Target_arm::Relocate::relocate): Check for non-static or
7156 unimplemented relocation code and exit early. Change calls to
7157 Target_arm::reloc_uses_thumb_bit and
7158 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7159 instead. Refactor code to handle similar relocations to increase
7160 code sharing. Remove check for unsupported relocation code in switch
7161 statement.
7162 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7163 relocation property table to find out size. Change error message to
7164 print out the name of a relocation code instead of the numeric value.
7165 (Target_arm::scan_reloc_for_stub): Use relocation property table
7166 instead of calling Target_arm::reloc_uses_thumb_bit().
7167
218c5831
DK
71682010-02-02 Doug Kwan <dougkwan@google.com>
7169
7170 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7171 types of relaxed input section.
7172
0d31c79d
DK
71732010-02-02 Doug Kwan <dougkwan@google.com>
7174
7175 * Makefile.am (HFILES): Add arm-reloc-property.h.
7176 (DEFFILES): New.
2e702c99
RM
7177 (TARGETSOURCES): Add arm-reloc-property.cc
7178 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7179 (libgold_a_SOURCES): $(DEFFILES)
7180 * Makefile.in: Regenerate.
7181 * arm-reloc-property.cc: New file.
7182 * arm-reloc-property.h: New file.
7183 * arm-reloc.def: New file.
7184 * arm.cc: Update comments.
7185 (arm-reloc-property.h): New included header.
7186 (arm_reloc_property_table): New global variable.
7187 (Target_arm::do_select_as_default_target): New method definition.
7188 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7189 arm-reloc-property to targ_extra_obj.
7190 * parameters.cc (set_parameters_target): Call
7191 Target::select_as_default_target().
7192 * target.h (Target::select_as_default_target): New method definition.
7193 (Target::do_select_as_default_target): Same.
7194
546c7457
DK
71952010-02-01 Doug Kwan <dougkwan@google.com>
7196
7197 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7198 first_output_text_section_.
7199 (Arm_exidx_fixup::first_output_text_section): New method definition.
7200 (Arm_exidx_fixup::first_output_text_section_): New data member.
7201 (Arm_exidx_fixup::process_exidx_section): Record the first text
7202 output section seen.
7203 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7204 and entsize in output section header.
7205
11b861d5
DK
72062010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7207
7208 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7209 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7210 (Arm_relocate_functions::thm_alu11): New Method.
7211 (Arm_relocate_functions::thm_pc8): New Method.
7212 (Arm_relocate_functions::thm_pc12): New Method.
7213 (Target_arm::Scan::local): Handle the relocations.
7214 (Target_arm::Scan::global): Likewise.
7215 (Target_arm::Relocate::relocate): Likewise.
7216 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7217
c9a2c125
DK
72182010-01-29 Doug Kwan <dougkwan@google.com>
7219
7220 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7221 of relocation types as ld.
7222
1521477a
DK
72232010-01-29 Doug Kwan <dougkwan@google.com>
7224
7225 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7226 to public.
7227 (Arm_relocate_functions::thumb_branch_common): Ditto.
7228 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7229 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7230 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7231 Arm_relocate_functions::jump24): Remove.
7232 (Target_arm::Relocate::relocate): Adjust code to call
7233 Arm_relocation_functions::arm_branch_common and
7234 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7235 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7236
e7eca48c
DK
72372010-01-29 Doug Kwan <dougkwan@google.com>
7238
7239 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7240 output_local_symbol_count_needs_update_.
7241 (Arm_relobj::output_local_symbol_count_needs_update,
7242 Arm_relobj::set_output_local_symbol_count_needs_update,
7243 Arm_relobj::update_output_local_symbol_count): New methods.
7244 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7245 member.
7246 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7247 of pointed function as in a R_ARM_PREL31 relocation.
7248 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7249 for output local symbol count updating.
7250 (Target_arm::do_relax): Update output local symbol counts in objects
7251 if necessary.
7252 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7253
02961d7e
ILT
72542010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7255
7256 * arm.cc: Added support for the ARM relocations:
7257 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7258 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7259 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7260 movw_prel_nc).
7261 (Arm_relocate_functions::movw_rel): New method.
7262 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7263 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7264 thm_movw_prel_nc).
7265 (Arm_relocate_functions::thm_movw_rel): New method.
7266 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7267 thm_movt_prel).
7268 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7269 relocations.
7270 (Target_arm::Scan::global): Likewise.
7271 (Target_arm::Relocate::relocate): Likewise.
7272 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7273 Likewise.
7274
b10d2873
ILT
72752010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7276
7277 * arm.cc: Added support for ARM group relocations.
7278 (Target_arm::reloc_needs_sym_origin): New method.
7279 (Arm_relocate_functions::calc_grp_kn): New method.
7280 (Arm_relocate_functions::calc_grp_residual): New method.
7281 (Arm_relocate_functions::calc_grp_gn): New method.
7282 (Arm_relocate_functions::arm_grp_alu): New Method.
7283 (Arm_relocate_functions::arm_grp_ldr): New Method.
7284 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7285 (Arm_relocate_functions::arm_grp_ldc): New Method.
7286 (Target_arm::Scan::local): Handle the ARM group relocations.
7287 (Target_arm::Scan::global): Likewise.
7288 (Target_arm::Relocate::relocate): Likewise.
7289 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7290 Likewise.
7291
2b328d4e
DK
72922010-01-26 Doug Kwan <dougkwan@google.com>
7293
7294 * arm.cc (set): Include.
7295 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7296 pointer type.
2e702c99 7297 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7298 (Arm_output_section::append_text_sections_to_list): New method.
7299 (Arm_output_section::fix_exidx_coverage): Ditto.
7300 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7301 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7302 Relobj::set_section_offset() instead of
7303 Sized_relobj::invalidate_section_offset().
2e702c99 7304 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7305 parameter for section headers. Ignore relocation sections for
7306 unallocated sections and EXIDX sections.
7307 (Target_arm::fix_exidx_coverage): New method.
7308 (Target_arm::output_section_address_less_than): New type.
7309 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7310 linked text section instead of the EXIDX section.
7311 (Arm_output_section::create_stub_group): Add an assertion to check
7312 that this is not an EXIDX output section.
7313 (Arm_output_section::append_text_sections_to_list): New method.
7314 (Arm_output_section::fix_exidx_coverage): Ditto.
7315 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7316 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7317 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7318 first pass.
7319 (Target_arm::fix_exidx_coverage): New method.
7320 * object.h (Relobj::set_output_section): New method.
7321 (Sized_relobj::invalidate_section_offset): Remove method.
7322 (Sized_relobj::do_invalidate_section_offset): Remove method.
7323 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7324
c7f3c371
DK
73252010-01-25 Doug Kwan <dougkwan@google.com>
7326
7327 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7328 Fix warning due to signed and unsigned comparison on a 32-bit host.
7329
8923b24c
DK
73302010-01-22 Doug Kwan <dougkwan@google.com>
7331
7332 * arm.cc (Target_arm::do_relax): Record an output section for section
7333 offset adjustment it contains any stub table that has changed.
7334 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7335 offsets in an output section if necessary.
7336 * output.cc (Output_section::Output_section): Initialize
7337 section_offsets_need_adjustments_.
7338 (Output_section::add_input_section_for_script): Renamed to
7339 Output_section::add_simple_input_section.
7340 (Output_section::save_states): Add a comment.
7341 (Output_section::discard_states): New method defintion.
7342 (Output_section::adjust_section_offsets): Same.
7343 * output.h (Output_section::add_input_section_for_script): Renamed to
7344 Output_section::add_simple_input_section.
7345 (Output_section::discard_states): New method declaration.
7346 (Output_section::adjust_section_offsets): Same.
7347 (Output_section::section_offsets_need_adjustment,
7348 Output_section::set_section_offsets_need_adjustment): New method
7349 definitions.
7350 (Output_section::section_offsets_need_adjustment_): New data member.
7351 * script-sections.cc
7352 (Output_section_element_input::set_section_address): Adjust code for
7353 renaming of Output_section::add_input_section_for_script.
7354 (Orphan_output_section::set_section_address): Same.
7355
9b2fd367
DK
73562010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7357
7358 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7359 Fix_v4bx enum values .
7360 * gold/options.h (General_options): New option definitions.
7361 (General_options::fix_v4bx): New method.
7362 (General_options::Fix_v4bx): New enum.
7363 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7364 (General_options::parse_fix_v4bx_interworking): New method.
7365
80d0d023
DK
73662010-01-22 Doug Kwan <dougkwan@google.com>
7367
7368 * arm.cc (Arm_exidx_fixup): New class.
7369
af2cdeae
DK
73702010-01-21 Doug Kwan <dougkwan@google.com>
7371
7372 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7373 classes.
7374 (Arm_exidx_section_offset_map): New type.
7375
993d07c1
DK
73762010-01-21 Doug Kwan <dougkwan@google.com>
7377
7378 * arm.cc (Arm_exidx_input_section): New class.
7379 (Arm_relobj::exidx_input_section_by_link,
7380 Arm_relobj::exidx_input_section_by_shndx,
7381 Arm_relobj::make_exidx_input_section): New methods.
7382 (read_arm_attributes_section): Remove.
7383 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7384 information about them.
7385 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7386 to here.
7387
5ac169d4
DK
73882010-01-20 Doug Kwan <dougkwan@google.com>
7389
7390 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7391 Input_section_specifier to Section_id.
7392 (Target_arm::new_arm_input_section: Adjust code for change of key
7393 type.
7394 (Target_arm::find_arm_input_section): Ditto.
7395 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7396 (Section_id): Remove.
7397 (Garbage_collection::Section_id_hash): Remove.
7398 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7399 (Section_id): Remove.
7400 (Icf::Section_id_hash): Remove.
7401 * object.h (Section_id, Const_section_id, Section_id_hash,
7402 Const_section_id_hash): New type definitions.
7403 * output.cc (Output_section::add_relaxed_input_section): Change to
7404 use Const_section_id instead of Input_section_specifier as key type.
7405 (Output_section::add_merge_input_section): Ditto.
7406 (Output_section::build_relaxation_map): Change to use Section_id
7407 instead of Input_section_specifier as key type.
2e702c99 7408 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7409 Ditto.
7410 (Output_section::convert_input_sections_to_relaxed_sections): Change
7411 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7412 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7413 (Output_section::find_relaxed_input_section): Ditto.
7414 * output.h (Input_section_specifier): Remove class.
7415 (Output_section::Output_section_data_by_input_section_map): Change
7416 key type to Const_section_id.
7417 (Output_section::Output_relaxed_input_section_by_input_section_map):
7418 Ditto.
7419 (Output_section::Relaxation_map): Change key type to Section_id.
7420
a2162063
ILT
74212010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7422
7423 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7424 (class Arm_v4bx_stub): New class.
7425 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7426 (Stub_factory::make_arm_v4bx_stub): New method.
7427 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7428 (Stub_table::empty): Handle v4bx stubs.
7429 (Stub_table::add_arm_v4bx_stub): New method.
7430 (Stub_table::find_arm_v4bx_stub): New method.
7431 (Arm_relocate_functions::v4bx): New method.
7432 (Target_arm::fix_v4bx): New method.
7433 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7434 (Stub_table::relocate_stubs): Likewise.
7435 (Stub_table::do_write): Likewise.
7436 (Stub_table::update_data_size_and_addralign): Likewise.
7437 (Stub_table::finalize_stubs): Likewise.
7438 (Target_arm::Scan::local): Likewise.
7439 (Target_arm::Scan::global): Likewise.
7440 (Target_arm::do_finalize_sections): Likewise.
7441 (Target_arm::Relocate::relocate): Likewise.
7442 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7443 Likewise.
7444 (Target_arm::scan_reloc_for_stub): Likewise.
7445 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7446
5696ab0b
ILT
74472010-01-19 Ian Lance Taylor <iant@google.com>
7448
7449 * output.cc (Output_section_headers::do_sized_write): Write large
7450 segment count to sh_info field.
7451 (Output_file_header::do_sized_write): For large segment count,
7452 write PN_XNUM to e_phnum field.
7453
800d0f56
ILT
74542010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7455
7456 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7457 (Arm_relocate_functions::thm_jump8): New function.
7458 (Arm_relocate_functions::thm_jump11): New function.
7459 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7460 R_ARM_THM_JUMP11.
7461 (Target_arm::Scan::global): Likewise.
7462 (Target_arm::Relocate::relocate): Likewise.
7463 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7464 Likewise.
7465
41263c05
DK
74662010-01-14 Doug Kwan <dougkwan@google.com>
7467
7468 * arm.cc (map, utility): Include headers.
7469 (Target_arm::apply_cortex_a8_workaround): New method.
7470 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7471 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7472 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7473 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7474 the --[no-]fix-cortex-a8 command line options.
7475 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7476 (Target_arm::relocate_stub): Use addend in instruction template.
7477 * options.h (DEFINE_bool): Set the user-set flag.
7478 (General_options): Add --[no-]-fix-cortex options.
7479 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7480 : Update fast look-up map after conversion.
41263c05 7481
459e9b03
ST
74822010-01-14 Sriraman Tallam <tmsriram@google.com>
7483
7484 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7485 in the first pass of do_layout.
7486
b521dfe4
DK
74872010-01-13 Doug Kwan <dougkwan@google.com>
7488
7489 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7490 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7491 apparent compiler problem of not folding static constant integral
7492 data members of elfcpp::Elf_sizes<32>.
7493
44272192
DK
74942010-01-13 Doug Kwan <dougkwan@google.com>
7495
7496 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7497 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7498 Arm_relobj::scan_section_for_cortex_a8_erratum,
7499 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7500 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7501 sections to scan for relocation stubs into a new method
7502 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7503 relocation and Cortex-A8 stub scanning.
7504 (Target_arm::do_relax): Force stubs to be after stubbed sections
7505 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7506 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7507 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7508
44b71ece
ILT
75092010-01-12 Ian Lance Taylor <iant@google.com>
7510
7511 * target-reloc.h (visibility_error): New inline function.
7512 (relocate_section): Call visibility_error.
7513 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7514 (MOSTLYCLEANFILES): Likewise.
7515 (protected_4_pic.o, protected_3.err): New targets.
7516 * testsuite/protected_4.cc: New file.
7517
a120bc7f
DK
75182010-01-12 Doug Kwan <dougkwan@google.com>
7519
7520 * arm.cc (Cortex_a8_reloc): New class.
7521 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7522 and cortex_a8_relocs_info_.
7523 (Target_arm::fix_cortex_a8): New method definition.
7524 (Target_arm::Cortex_a8_relocs_info): New type.
7525 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7526 New data member declarations.
7527 (Target_arm::scan_reloc_for_stub): Record information about
7528 relocations for THUMB branches that might be exempted from the
7529 Cortex-A8 workaround.
7530 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7531 at the beginning of a relaxation pass.
7532
20138696
DK
75332010-01-12 Doug Kwan <dougkwan@google.com>
7534
7535 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7536 (Arm_relobj::Mapping_symbol_position,
7537 Arm_reloj::Mapping_symbol_position_less,
7538 Arm_relobj::Mapping_symbols_info): New types.
7539 (Target_arm::is_mapping_symbol_name): New method definition.
7540 (Arm_relobj::do_count_local_symbols): Save information about mapping
7541 symbols.
7542
089d69dc
DK
75432010-01-11 Doug Kwan <dougkwan@google.com>
7544
7545 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7546 Arm_relocate_functions::thumb32_branch_upper,
7547 Arm_relocate_functions::thumb32_branch_lower,
7548 Arm_relocate_functions::thumb32_cond_branch_offset,
7549 Arm_relocate_functions::thumb32_cond_branch_upper,
7550 Arm_relocate_functions::thumb32_cond_branch_lower,
7551 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7552 branch offset encoding.
7553 (Arm_relocate_functions::thumb_branch_common): Use new branch
7554 offset encoding methods to avoid code duplication.
7555 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7556 (Stub_addend_reader::operator()): Use new branch encoding method
7557 to avoid code duplication.
7558
99e5bff2
DK
75592010-01-11 Doug Kwan <dougkwan@google.com>
7560
7561 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7562 (Target_arm::do_finalize_sections): Define special EXIDX section
7563 symbols only if referenced.
7564 * gc.h (Garbage_collection::add_reference): New method.
7565 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7566 code duplication.
7567
98e090bd
ILT
75682010-01-11 Ian Lance Taylor <iant@google.com>
7569
d0a91bd8
ILT
7570 * script.cc (Version_script_info::build_expression_list_lookup):
7571 Change complaing about duplicate wildcard match from error to
7572 warning.
7573
98e090bd
ILT
7574 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7575 of 2009-12-30.
7576 (Version_script_info::Version_script_info): Initialize globs_,
7577 default_version_, default_is_global_, and exact_. Don't
7578 initialize globals_ or locals_.
7579 (Version_script_info::build_lookup_tables): Build local symbols
7580 first.
7581 (Version_script_info::unquote): New function.
7582 (Version_script_info::add_exact_match): New function.
7583 (Version_script_info::build_expression_list_lookup): Remove lookup
7584 parameter. Add is_global parameter. Change all callers. Handle
7585 wildcard pattern specially. Unquote pattern. Call
7586 add_exact_match.
7587 (Version_script_info::get_name_to_match): New function.
7588 (Version_script_info::get_symbol_version): New function.
7589 (Version_script_info::get_symbol_version_helper): Remove.
7590 (Version_script_info::check_unmatched_names): Call unquote.
7591 * script.h (class Version_script_info): Change get_symbol_version
7592 to be non-inline and add is_global parameter; change all callers.
7593 Rewrite symbol_is_local. Update declarations. Define struct
7594 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7595 Remove globals_ and locals_ members. Add exact_, globs_,
7596 default_version_, is_global_.
7597 (Version_script_info::Glob): Remove pattern, add expression and
7598 is_global. Update constructor. Change all callers.
7599 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7600 default version.
7601 (Versions::symbol_section_contents): If a symbol is undefined, or
7602 defined in a dynamic object, set the version index to
7603 VER_NDX_LOCAL.
7604 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7605 symbol_is_local.
7606 (Symbol_table::add_from_pluginobj): Likewise.
7607 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7608
d56962d3
DK
76092010-01-11 Doug Kwan <dougkwan@google.com>
7610
7611 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7612 (incremental_dump_LDADD): Add linking option for libintl.
7613 * Makefile.in: Regenerate.
7614
94e6ee91
L
76152010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7616
7617 PR gold/11144
7618 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7619 instead of -Ds.
7620 * testsuite/Makefile.in: Regenerated.
7621
e96c574b
DK
76222010-01-10 Doug Kwan <dougkwan@google.com>
7623
7624 * options.h (DEFINE_var): Use parentheses around argument varname__
7625 in macro body to avoid any unintended subsequent substitutions.
7626
7198066b
ILT
76272010-01-10 Ian Lance Taylor <iant@google.com>
7628
ba4d53bf
ILT
7629 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7630 candidates before doing symbol resolution.
7631
7198066b
ILT
7632 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7633 ODR candidates if only one is weak.
7634
a2beed37
ILT
76352010-01-08 Ian Lance Taylor <iant@google.com>
7636
7637 * script.cc (Version_script_info::build_expression_list_lookup):
7638 Don't warn about ambiguous version, just record the ambiguity.
7639 (Version_script_info::get_symbol_version_helper): Give error if
7640 version is ambiguous.
7641
2fb7225c
DK
76422010-01-08 Doug Kwan <dougkwan@google.com>
7643
7644 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7645 prev_data_size_ and prev_addralign_. Remove initializer for
7646 deleted data member has_been_changed_.
7647 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7648 to determine if the table is empty.
7649 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7650 Remove.
7651 (Stub_table::add_reloc_stub): Define method in class definition
7652 instead of just declaring it there.
7653 (Stub_table::add_cortex_a8_stub): New method definition.
7654 (Stub_table::update_data_size_and_addralign): Ditto.
7655 (Stub_table::finalize_stubs): Ditto.
7656 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7657 (Stub_table::do_addralign_): Return address alignment in the
7658 (Stub_table::do_reset_address_and_file_offset): Define method in
7659 class definition instead of declaring it there. Set current data
7660 size to be the data size of the previous pass.
7661 (Stub_table::set_final_data_size): Use current data size as the
7662 final data size.
7663 (Stub_table::relocate_stub): Change parameter type of stub from
7664 Reloc_stub pointer to Stub pointer.
7665 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7666 (Stub_table::Cortex_a8_stub_list): New typedef.
7667 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7668 Stub_table::prev_addralign_): New data member.
7669 (Arm_relobj::Arm_relobj): Initialize data member
7670 section_has_cortex_a8_workaround_.
7671 (Arm_relobj::section_has_cortex_a8_workaround,
7672 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7673 definitions.
7674 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7675 declarations.
7676 (Target_arm::relocate_stub): Change parameter type of stub from
7677 Reloc_stub pointer to Stub pointer.
7678 (Insn_template::size, Insn_template::alignment): Handle
7679 THUMB16_SPECIAL_TYPE.
7680 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7681 Stub_table::update_data_size_and_addralign,
7682 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7683 definitions.
7684 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7685 (Stub_table::do_write): Ditto.
7686 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7687
880cd20d
ILT
76882010-01-08 Ian Lance Taylor <iant@google.com>
7689
7690 PR 11108
7691 * symtab.h (class Symbol): Remove fields is_target_special_ and
7692 has_plt_offset_. Add field is_defined_in_discarded_section_.
7693 (Symbol::is_defined_in_discarded_section): New function.
7694 (Symbol::set_is_defined_in_discarded_section): New function.
7695 (Symbol::has_plt_offset): Rewrite.
7696 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7697 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7698 Don't initialize is_target_special_ or has_plt_offset_.
7699 Initialize is_defined_in_discarded_section_.
7700 (Symbol_table::add_from_relobj): If appropriate, set
7701 is_defined_in_discarded_section.
7702 * resolve.cc (Symbol::override_base_with_special): Don't test
7703 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7704 * target-reloc.h (relocate_section): Do special handling for
7705 symbols defined in discarded sections for global symbols as well
7706 as local symbols.
7707
2703e3eb
ILT
77082010-01-08 Ian Lance Taylor <iant@google.com>
7709
7710 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7711 the SHT_SYMTAB case.
7712
339d40a3
ILT
77132010-01-08 Ian Lance Taylor <iant@google.com>
7714
7715 * object.cc (Sized_relobj::do_layout): Don't get confused if
7716 layout_eh_frame returns NULL.
7717
abecea76
ILT
77182010-01-08 Ian Lance Taylor <iant@google.com>
7719
7720 PR 11084
7721 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7722 dynamic symbol table, use the normal symbol table.
7723 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7724 symbol table.
7725
6b7dd3f3
ILT
77262010-01-08 Ian Lance Taylor <iant@google.com>
7727
7728 PR 11072
7729 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7730 sections.
7731
36c50e63
L
77322010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7733
7734 * version.cc (print_version): Change to "Copyright 2010".
7735
e291e7b9
ILT
77362010-01-08 Ian Lance Taylor <iant@google.com>
7737
7738 PR 10287
7739 PR 11063
7740 * i386.cc (class Target_i386): Change return type of plt_section
7741 to be non-const.
7742 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7743 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7744 tls_desc_rel_ field.
7745 (Output_data_plt_i386::rel_tls_desc): New function.
7746 (Target_i386::rel_tls_desc_section): New function.
7747 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7748 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7749 R_386_TLS_DESC reloc in rel_tls_desc_section.
7750 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7751 Define struct Tlsdesc_info.
7752 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7753 (Target_x86_64::do_reloc_symbol_index): New function.
7754 (Target_x86_64::add_tlsdesc_info): New function.
7755 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7756 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7757 tlsdesc_rel_ field.
7758 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7759 all callers.
7760 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7761 (Target_x86_64::rela_tlsdesc_section): New function.
7762 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7763 handling.
7764 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7765 (Target_x86_64::do_reloc_addend): New function.
7766 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7767 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7768 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7769 (Output_reloc::type): New function.
7770 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7771 (Output_reloc::is_target_specific): New function.
7772 (Output_reloc::target_arg): New function.
7773 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7774 absolute relocs and target specific relocs.
7775 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7776 add_target_specific.
7777 (class Output_data_reloc) [SHT_RELA]: Likewise.
7778 * output.cc (Output_reloc::Output_reloc): Add four new versions
7779 for absolute relocs and target specific relocs.
7780 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7781 (Output_reloc::get_symbol_index): Likewise.
7782 (Output_reloc::local_section_offset): Check that local_sym_index_
7783 is not TARGET_CODE or 0.
7784 (Output_reloc::symbol_value): Likewise.
7785 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7786 reloc.
7787 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7788 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7789 functions.
7790 * layout.cc (add_target_dynamic_tags): Use output section for
7791 DT_PLTRELSZ and DT_JMPREL.
7792
3a44184e
ILT
77932010-01-07 Ian Lance Taylor <iant@google.com>
7794
7795 PR 11061
7796 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7797 function.
7798 (class Output_data_reloc_generic): Define.
7799 (class Output_data_reloc_base): Change base class to
7800 Output_data_reloc_generic. Change add() method to call
7801 bump_relative_reloc_count for a relative reloc. Remove
7802 sort_relocs_ field.
7803 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7804 to sort_relocs().
7805 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7806 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7807 appropriate.
7808 * layout.h (class Layout): Update declaration.
7809
ea715a34
ILT
78102010-01-07 Ian Lance Taylor <iant@google.com>
7811
7812 * output.h (class Output_data): Add const version of
7813 output_section and do_output_section.
7814 (class Output_section_data): Add const version of
7815 do_output_section.
7816 (class Output_section): Likewise.
7817 * layout.cc (Layout::add_target_dynamic_tags): New function.
7818 * layout.h (class Layout): Update declarations.
7819 * arm.cc (Target_arm::do_finalize_sections): Use
7820 add_target_dynamic_tags.
7821 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7822 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7823 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7824 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7825
659948a4
ILT
78262010-01-07 Ian Lance Taylor <iant@google.com>
7827
7828 PR 11042
7829 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7830 object as needed.
7831
9d3b86f6
ILT
78322010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7833 Ian Lance Taylor <iant@google.com>
7834
7835 PR 11019
7836 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7837 Xindex::read_symtab_xindex.
7838
bb0d3eb0
DK
78392010-01-07 Doug Kwan <dougkwan@google.com>
7840
7841 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7842 (Insn_template::thumb16_bcond_insn): New method declaration.
7843 (Insn_template): Fix spelling.
7844 (Stub::thumb16_special): New method declaration.
7845 (Stub::do_write): Define virtual method which was previously pure
7846 virtual.
7847 (Stub::do_thumb16_special): New method declaration.
7848 (Stub::do_fixed_endian_write): New template member.
7849 (Reloc_stub::do_write): Remove.
7850 (Reloc_stub::do_fixed_endian_write): Remove.
7851 (Cortex_a8_stub): New class definition.
7852 (Stub_factory::make_cortex_a8_stub): New method definition.
7853 (Stub_factory::Stub_factory): Add missing static storage class
7854 qualifier for elf32_arm_stub_a8_veneer_blx.
7855
ffeef7df
ILT
78562010-01-07 Ian Lance Taylor <iant@google.com>
7857
dc3f80fe
ILT
7858 PR 10980
7859 * options.h (class General_options): Add --warn-unresolved-symbols
7860 and --error-unresolved-symbols.
7861 * errors.cc (Errors::undefined_symbol): Implement
7862 --warn-unresolved-symbols.
7863
ffeef7df
ILT
7864 * options.h (class General_options): Add -z text and -z textoff.
7865 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7866
f1ec9ded
ST
78672010-01-06 Sriraman Tallam <tmsriram@google.com>
7868
7869 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7870 (Garbage_collection::cident_sections): New function.
7871 (Garbage_collection::add_cident_section): New function.
7872 (Garbage_collection::cident_sections_): New member.
7873 (gc_process_relocs): Add references to sections whose names are C
7874 identifiers.
7875 * gold.h (cident_section_start_prefix): New constant.
7876 (cident_section_stop_prefix): New constant.
7877 (is_cident): New function.
7878 * layout.cc (Layout::define_section_symbols): Replace string constants
7879 with the newly defined constants.
7880 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7881 C identifiers.
7882 * testsuite/Makefile.am: Add gc_orphan_section_test.
7883 * testsuite/Makefile.in: Regenerate.
7884 * testsuite/gc_orphan_section_test.cc: New file.
7885 * testsuite/gc_orphan_section_test.sh: New file.
7886
6eda8c29
ILT
78872010-01-06 Ian Lance Taylor <iant@google.com>
7888
b9674e17
ILT
7889 PR 10980
7890 * options.h (class General_options): Add --warn-shared-textrel.
7891 * layout.cc (Layout::finish_dynamic_section): Implement
7892 --warn-shared-textrel.
7893
6eda8c29
ILT
7894 PR 10980
7895 * options.h (class General_options): Add --warn-multiple-gp.
7896
32dcd44e
ILT
78972010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7898
7899 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7900 $(THREADSLIB) and $(LIBDL).
7901 * Makefile.in: Rebuild.
7902
a192ba05
ILT
79032010-01-06 Ian Lance Taylor <iant@google.com>
7904
7905 PR 10980
7906 * options.cc (General_options::parse_section_start): New function.
7907 (General_options::section_start): New function.
7908 (General_options::General_options): Initialize all members.
7909 * options.h: Include <map>
7910 (class General_options): Add --section-start. Add section_starts_
7911 member.
7912 * layout.cc (Layout::attach_allocated_section_to_segment): If
7913 --section-start was used, set the address of the segment. Remove
7914 local sort_sections.
7915 (Layout::relaxation_loop_body): If the address of the load segment
7916 has been set by --section-start, don't use it.
7917 * output.h (Output_segment::update_flags_for_output_section): New
7918 function.
7919 * output.cc (Output_segment::add_output_section): Call
7920 update_flags_for_output_section.
7921
dde3f402
ILT
79222010-01-05 Ian Lance Taylor <iant@google.com>
7923
62dfdd4d
ILT
7924 PR 10980
7925 * options.h (class General_options): Add --undefined-version.
7926 * script.cc (struct Version_expression): Add was_matched_by_symbol
7927 field.
7928 (Version_script_info::matched_symbol): New function.
7929 (Version_script_info::get_symbol_version_helper): Call
7930 matched_symbol.
7931 (Version_script_info::check_unmatched_names): New function.
7932 * script.h (class Version_script_info): Update declarations.
7933 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7934
9c4ae156
ILT
7935 * options.h (class General_options): Use DEFINE_bool_alias for
7936 allow_multiple_definition.
7937 * resolve.cc (Symbol_table::should_override): Don't test
7938 allow_multiple_definition.
7939
dde3f402
ILT
7940 PR 10980
7941 * options.h (class General_options): Add --cref.
7942 * main.cc (main): Print cref table if --cref. Don't close mapfile
7943 until after printing cref table.
7944 * cref.cc: Include "symtab.h".
7945 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7946 (Cref_table_compare::operator()): New function.
7947 (Cref_inputs::gather_cref): New function.
7948 (filecol): New static const.
7949 (Cref_inputs::print_cref): New function.
7950 (Cref::print_cref): New function.
7951 * cref.h: Include <cstdio>.
7952 (class Cref): Update declarations.
7953 * mapfile.h (Mapfile::file): New function.
7954 * object.h (class Object): Define Symbols. Declare virtual
7955 do_get_global_symbols.
7956 (Object::get_global_symbols): New function.
7957 * object.cc (Input_objects::add_object): Pass object to cref_ if
7958 --cref.
7959 (Input_objects::archive_start): Likewise.
7960 (Input_objects::archive_stop): Likewise.
7961 (Input_objects::print_cref): New function.
7962 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7963 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7964 --cref.
7965 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7966 function.
7967 * plugin.h (class Sized_pluginobj): Update declarations.
7968
8781f709
ILT
79692010-01-05 Ian Lance Taylor <iant@google.com>
7970
7971 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7972 to is_default_version. Rename insdef to insdefault.
7973 (Symbol_table::add_from_relobj): Rename def to is_default_version
7974 and local to is_forced_local.
7975 (Symbol_table::add_from_pluginobj): Likewise.
7976 (Symbol_table::add_from_dynobj): Likewise.
7977 (Symbol_table::define_special_symbol): Rename insdef to
7978 insdefault.
7979
fe35d28d
ILT
79802010-01-04 Ian Lance Taylor <iant@google.com>
7981
30bc8c46
ILT
7982 PR 10980
7983 * options.h (class General_options): Add
7984 --allow-multiple-definition and -z muldefs.
7985 * resolve.cc (Symbol_table::should_override): Don't warn about a
7986 multiple symbol definition if --allow-multiple-definition or -z
7987 muldefs.
7988
7eaea549
ILT
7989 PR 10980
7990 * options.h (class General_options): Add --add-needed and
7991 --copy-dt-needed-entries. Tweak --as-needed help entry.
7992 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7993 error if --copy-dt-needed-entries aka --add-needed is used and
7994 would cause a change in behaviour.
7995
fe35d28d
ILT
7996 PR 10980
7997 * options.h (class General_options): Add -G as a short version of
7998 --shared. Add no-op options -assert, -g, and -i.
7999
55a2bb35
ST
80002010-01-04 Sriraman Tallam <tmsriram@google.com>
8001
8002 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8003 check for .text or .gnu.linkonce.t sections.
8004 * icf.cc (Icf::find_identical_sections): Ditto.
8005 Change the detection for mangled function name within the section
8006 name.
8007 * icf.h (is_section_foldable_candidate): New function.
8008
719328e1
ILT
80092009-12-30 Ian Lance Taylor <iant@google.com>
8010
8011 PR 10980
8012 * options.h (class General_options): Permit two dashes with
8013 --retain-symbols-file.
8014
d7bb5745
ILT
80152009-12-30 Ian Lance Taylor <iant@google.com>
8016
403a15dd
ILT
8017 PR 10979
8018 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8019 don't put the file header and segment headers in the text
8020 segment.
8021
eda294df
ILT
8022 PR 10979
8023 * common.cc (Sort_commons::operator()): Stabilize sort when both
8024 entries are NULL.
8025 (Symbol_table::do_allocate_commons_list): When allocating common
8026 symbols, skip a symbol which is no longer common.
8027 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8028 an object before checking its type.
8029 * testsuite/common_test_2.c: New file.
8030 * testsuite/common_test_3.c: New file.
8031 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8032 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8033 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8034 (common_test_2_pic.o, common_test_2.so): New targets.
8035 (common_test_3_pic.o, common_test_3.so): New targets.
8036 * testsuite/Makefile.in: Rebuild.
8037
d7bb5745
ILT
8038 PR 10979
8039 * script.cc (read_input_script): If we see a new SECTIONS clause,
8040 and we have added an input section, give an error.
8041 * layout.h (class Layout): Add have_added_input_section function.
8042 Add have_added_input_section_ field.
8043 * layout.cc (Layout::Layout): Initialize
8044 have_added_input_section_.
8045 (Layout::layout): Set have_added_input_section_.
8046 (Layout::layout_eh_frame): Likewise.
8047
fc59c572
ILT
80482009-12-30 Ian Lance Taylor <iant@google.com>
8049
8050 PR 10931
8051 * options.h (class General_options): Add --sort-common option.
8052 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8053 * common.cc (Sort_common): Add sort_order parameter to
8054 constructor. Add sort_order_ field.
8055 (Sort_commons::operator): Check sort_order_.
8056 (Symbol_table::allocate_commons): Determine the sort order.
8057 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8058 Change all callers.
8059 (Symbol_table::do_allocate_commons_list): Likewise.
8060
1c74fab0
ILT
80612009-12-30 Ian Lance Taylor <iant@google.com>
8062
8063 PR 10916
8064 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8065 symbols from this object, don't change the visibility of an
8066 undefined symbol.
8067 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8068
6affe781
ILT
80692009-12-30 Ian Lance Taylor <iant@google.com>
8070
8071 PR 10861
8072 * script.h (class Version_script_info): Define Language enum.
8073 Update declarations. Define Glob, Exact, and Lookup types. Add
8074 new fields globals_, locals_, and is_finalized_.
8075 * script.cc: Various formatting fixes.
8076 (class Parser_closure): Change language_stack_ from a vector of
8077 std::string to one of Version_script_info::Language. Adjust all
8078 uses accordingly.
8079 (class Lazy_demangler): Remove.
8080 (struct Version_expression): Change language from std::string to
8081 Version_script_info::Language.
8082 (Version_script_info::Version_script_info): New function.
8083 (Version_script_info::~Version_script_info): Don't call clear.
8084 (Version_script_info::finalize): New function.
8085 (Version_script_info::build_lookup_tables): New function.
8086 (Version_script_info::build_expression_list_lookup): New
8087 function.
8088 (Version_script_info::get_symbol_version_helper): Rewrite to use
8089 lookup tables.
8090 (Version_script_info::print_expression_list): Adjust to use
8091 Version_script_info::Language.
8092 (script_push_lex_into_version_mode): Check that the version script
8093 has not been finalized.
8094 (version_script_push_lang): Change language string to
8095 Version_script_info::Language.
8096 * options.cc (Command_line::version_script): New function.
8097 * options.h (class General_options): Add finalize_dynamic_list
8098 function. Change version_script from declaration to definition.
8099 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8100 * testsuite/version_script.map: Remove duplicate def of foo.
8101 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8102 version_script.map.
8103 * testsuite/Makefile.in: Rebuild.
8104
818bf354
ILT
81052009-12-30 Ian Lance Taylor <iant@google.com>
8106
8107 PR 10843
8108 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8109 if the input symbol index is 0, make the output symbol index 0.
8110
ebcc8304
ILT
81112009-12-30 Ian Lance Taylor <iant@google.com>
8112
8113 PR 10670
8114 * options.h (class General_options): Add -x/--discard-all.
8115 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8116 --discard-all. If the local symbol needs a dynamic entry, check
8117 that before handling --discard-locals.
8118
176fe33f
ILT
81192009-12-30 Ian Lance Taylor <iant@google.com>
8120
bb321bb1
ILT
8121 PR 10450
8122 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8123 flags to PF_R.
8124 (Output_segment::add_output_section): Don't change the flags if
8125 the type is PT_TLS.
8126
176fe33f
ILT
8127 PR 10450
8128 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8129 GNU hash table if they need a dynamic value. Otherwise, don't add
8130 them if they are defined in a dynamic object or are forced local.
8131
e8cd95c7
ILT
81322009-12-29 Ian Lance Taylor <iant@google.com>
8133
1b81fb71
ILT
8134 PR 10450
8135 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8136 .gnu.hash table for a 32-bit target.
8137
8d6d383d
ILT
8138 PR 10450
8139 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8140 regular and a dynamic object only needs a dynamic symbol table
8141 entry if it is externally visible.
8142
e785ec03
ILT
8143 PR 10450
8144 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8145 constructor. Add global_offset_table_ field.
8146 (Target_i386::got_section): Set global_offset_table_.
8147 (Target_i386::do_finalize_sections): Set global_offset_table_
8148 size.
8149 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8150 in constructor. Add global_offset_table_ field.
8151 (Target_x86_64::got_section): Set global_offset_table_.
8152 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8153 size.
8154
1a2dff53
ILT
8155 * layout.cc (Layout::Layout): Initialize increase_relro_.
8156 (Layout::get_output_section): Add is_relro, is_last_relro, and
8157 is_first_non_relro parameters. Change all callers.
8158 (Layout::choose_output_section): Likewise.
8159 (Layout::add_output_section_data): Likewise.
8160 (Layout::make_output_section): Likewise.
8161 (Layout::set_segment_offsets): Clear increase_relro when using a
8162 linker script.
8163 * layout.h (class Layout): Add increase_relro method. Add
8164 increase_relro_ field. Update declarations.
8165 * output.cc (Output_section::Output_section): Initialize
8166 is_last_relro_ and is_first_non_relro_.
8167 (Output_segment::add_output_section): Group relro sections is
8168 do_sort is true. Handle is_last_relro and is_first_non_relro.
8169 (Output_segment::maximum_alignment): Remove relro handling.
8170 (Output_segment::set_section_addresses): Add increase_relro
8171 parameter. Change all callers. Add initial alignment to align
8172 relro sections on separate page. Remove old relro handling.
8173 (Output_segment::set_section_list_addresses): Remove in_relro
8174 parameter. Change all callers.
8175 (Output_segment::set_offset): Add increase parameter. Change all
8176 callers. Remove old relro handling.
8177 * output.h (class Output_section): Add new methods: is_last_relro,
8178 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8179 Add is_last_relro_ and is_first_non_relro_ fields.
8180 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8181 Create separate .got.plt section. Call increase_relro.
8182 * x86_64.cc (Target_x86_64::got_section): Likewise.
8183 * testsuite/relro_script_test.t: Add .got.plt.
8184
f0ba79e2
ILT
8185 PR 10450
8186 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8187 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8188 (Layout::finalize): Call set_dynamic_symbol_size.
8189 (Layout::set_dynamic_symbol_size): New function.
8190 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8191 set_dynamic_symbol_size.
8192
e8cd95c7
ILT
8193 PR 10450
8194 * output.h (class Output_section): Add is_entsize_zero_ field.
8195 * output.cc (Output_section::Output_section): Initialize
8196 is_entsize_zero_.
8197 (Output_section::set_entsize): If two different entsizes are
8198 requested, force it to zero.
8199 (Output_section::add_input_section): Set flags for .debug_str
8200 before updating section flags. Set entsize.
8201 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8202 and SHF_STRING if all input sections have those flags.
8203
3e1b9a8a
RÁE
82042009-12-29 Rafael Espindola <espindola@google.com>
8205
8206 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8207 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8208 reporting.
3e1b9a8a 8209
3dcad376
ST
82102009-12-29 Sriraman Tallam <tmsriram@google.com>
8211
8212 * options.cc (General_options::parse_version): Allow -v to exit
8213 without an error if there is nothing to link.
8214
084e2665
ILT
82152009-12-29 Ian Lance Taylor <iant@google.com>
8216
8217 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8218 using a version of gcc before 4.1.
8219 * configure: Rebuild.
8220
250acde3
CD
82212009-12-28 Chris Demetriou <cgd@google.com>
8222
8223 * attributes.cc (Output_attributes_section_data::do_write): Use
8224 std::vector::front rather than std::vector::data.
8225
99fff23b
ILT
82262009-12-28 Ian Lance Taylor <iant@google.com>
8227
8228 * symtab.h (class Symbol_table): Add enum Defined.
8229 * resolve.cc (Symbol_table::should_override): Add defined
8230 parameter. Change all callers. Test whether object is NULL
8231 before calling a method on it.
8232 (Symbol_table::report_resolve_problem): Add defined parameter.
8233 Change all callers.
8234 (Symbol_table::should_override_with_special): Likewise.
8235 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8236 parameter. Change all callers.
8237 (Symbol_table::do_define_in_output_data): Likewise.
8238 (Symbol_table::define_in_output_segment): Likewise.
8239 (Symbol_table::do_define_in_output_segment): Likewise.
8240 (Symbol_table::define_as_constant): Likewise.
8241 (Symbol_table::do_define_as_constant): Likewise.
8242 * script.h (class Symbol_assignment): Add is_defsym parameter to
8243 constructor; change all callers.
8244 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8245 parameter. Change all callers. Add is_defsym_ field.
8246 (class Parser_closure): Add parsing_defsym parameter to
8247 constructor; change all callers. Add parsing_defsym accessor
8248 function. Add parsing_defsym_ field.
8249
556bd683
ILT
82502009-12-28 Ian Lance Taylor <iant@google.com>
8251
8252 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8253 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8254
1782c879
ILT
82552009-12-23 Ian Lance Taylor <iant@google.com>
8256
8257 * i386.cc (Target_i386::do_calls_non_split): Recognize
8258 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8259 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8260 -fsplit-stack prologue when using %r11.
1782c879 8261
329ca2b1
ST
82622009-12-21 Sriraman Tallam <tmsriram@google.com>
8263
8264 * options.cc (General_options::parse_version): Make -v continue and do
8265 the link like GNU ld does.
8266
d675ff46
RÁE
82672009-12-17 Rafael Avila de Espindola <espindola@google.com>
8268
8269 * Makefile.am (CCFILES): Add timer.cc.
8270 (HFILES): Add timer.h.
8271 * configure.ac: Check for sysconf and times.
8272 * main.cc: include timer.h.
8273 (main): Use Timer instead of get_run_time.
8274 * timer.cc: New.
8275 * timer.h: New.
8276 * workqueue.cc: include timer.h.
8277 (Workqueue::find_and_run_task):
8278 Report user, sys and wall time.
8279 * Makefile.in: Regenerate.
8280 * config.in: Regenerate.
8281 * configure: Regenerate.
8282
d6344fb5
DK
82832009-12-16 Doug Kwan <dougkwan@google.com>
8284
8285 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8286 sections.
8287 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8288 relaxed input sections.
8289 * output.cc (Output_section::find_relaxed_input_section): Change
8290 return type to Output_relaxed_input_section pointer. Adjust code
8291 for new type of relaxed_input_section_map_.
8292 * output.h (Output_section::find_relaxed_input_section): Change
8293 return type to Output_relaxed_input_section pointer.
8294 (Output_section::Output_relaxed_input_section_by_input_section_map):
8295 New type.
8296 (Output_section::relaxed_input_section_map_): Change type to
8297 Output_section::Output_relaxed_input_section_by_input_section_map.
8298 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8299 input section.
8300
0e0d5469
ILT
83012009-12-15 Ian Lance Taylor <iant@google.com>
8302
8303 * layout.cc (Layout::create_shstrtab): Only write out after input
8304 sections if we are compressing debug sections.
8305
0649a889
ILT
83062009-12-15 Ian Lance Taylor <iant@google.com>
8307
8308 * archive.cc (Archive::add_symbols): Only look up a symbol without
8309 a version if there is, in fact, a version.
8310
2ea97941
ILT
83112009-12-14 Ian Lance Taylor <iant@google.com>
8312
8313 Revert -Wshadow changes, all changes from:
8314 2009-12-11 Doug Kwan <dougkwan@google.com>
8315 2009-12-11 Nick Clifton <nickc@redhat.com>
8316 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8317
b0eec2cc
DK
83182009-12-11 Doug Kwan <dougkwan@google.com>
8319
8320 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8321 due to -Wshadow.
8322 * attributes.cc (Object_attribute::size): Ditto.
8323 (Attributes_section_data::size): Ditto.
8324 (Attributes_section_data::Attributes_section_data): Ditto.
8325 (Output_attributes_section_data::do_write): Ditto.
8326 * attributes.h (Object_attribute::set_type): Ditto.
8327 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8328
91d6fa6a
NC
83292009-12-11 Nick Clifton <nickc@redhat.com>
8330
8331 * archive.cc: Fix shadowed variable warnings.
8332 * arm.cc: Likewise.
8333 * compressed_output.cc: Likewise.
8334 * compressed_output.h: Likewise.
8335 * configure: Likewise.
8336 * dwarf_reader.cc: Likewise.
8337 * dynobj.cc: Likewise.
8338 * dynobj.h: Likewise.
8339 * ehframe.cc: Likewise.
8340 * ehframe.h: Likewise.
8341 * errors.cc: Likewise.
8342 * expression.cc: Likewise.
8343 * fileread.cc: Likewise.
8344 * fileread.h: Likewise.
8345 * freebsd.h: Likewise.
8346 * i386.cc: Likewise.
8347 * icf.cc: Likewise.
8348 * incremental.h: Likewise.
8349 * layout.cc: Likewise.
8350 * layout.h: Likewise.
8351 * mapfile.cc: Likewise.
8352 * merge.cc: Likewise.
8353 * merge.h: Likewise.
8354 * object.cc: Likewise.
8355 * object.h: Likewise.
8356 * options.h: Likewise.
8357 * output.cc: Likewise.
8358 * output.h: Likewise.
8359 * parameters.cc: Likewise.
8360 * plugin.cc: Likewise.
8361 * powerpc.cc: Likewise.
8362 * reduced_debug_output.cc: Likewise.
8363 * reduced_debug_output.h: Likewise.
8364 * reloc.cc: Likewise.
8365 * reloc.h: Likewise.
8366 * resolve.cc: Likewise.
8367 * script-sections.cc: Likewise.
8368 * script.cc: Likewise.
8369 * script.h: Likewise.
8370 * sparc.cc: Likewise.
8371 * symtab.cc: Likewise.
8372 * symtab.h: Likewise.
8373 * target-select.cc: Likewise.
8374 * target-select.h: Likewise.
8375 * token.h: Likewise.
8376 * workqueue.cc: Likewise.
8377 * workqueue.h: Likewise.
8378 * x86_64.cc: Likewise.
8379
a0351a69
DK
83802009-12-10 Doug Kwan <dougkwan@google.com>
8381
8382 * arm.cc (attributes.h): New include.
8383 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8384 (Arm_relobj::~Arm_relobj): Delete object pointed by
8385 attributes_section_data_.
8386 (Arm_relobj::attributes_section_data): New method definition.
8387 (Arm_relobj::attributes_section_data_): New data member declaration.
8388 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8389 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8390 attributes_section_data_.
8391 (Arm_dynobj::attributes_section_data): New method definition.
8392 (Arm_dynobj::attributes_section_data_): New data member declaration.
8393 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8394 initialization value of may_use_blx_ to false.
2e702c99 8395 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8396 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8397 object attributes to compute results instead of hard-coding.
8398 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8399 Target_arm::get_secondary_compatible_arch,
8400 Target_arm::set_secondary_compatible_arch
8401 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8402 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8403 New method declarations.
8404 (Target_arm::get_aeabi_object_attribute): New method definition.
8405 (Target_arm::attributes_section_data_): New data member declaration.
8406 (read_arm_attributes_section): New template definition.
8407 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8408 (Arm_dynobj::do_read_symbols): Ditto.
8409 (Target_arm::do_finalize_sections): Merge attributes sections from
8410 input. Check for BLX use after attributes section merging.
8411 Fix __exidx_start and __exidx_end visibility. Create an
8412 .ARM.attributes section if necessary.
8413 (Target_arm::get_secondary_compatible_arch,
8414 Target_arm::set_secondary_compatible_arch,
8415 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8416 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8417 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8418 New method definitions.
8419
b59befec
ILT
84202009-12-09 Ian Lance Taylor <iant@google.com>
8421
8422 * plugin.cc (Plugin::load): Don't cast from void* to a function
8423 pointer.
8424
1276bc89
ILT
84252009-12-09 Ian Lance Taylor <iant@google.com>
8426
8427 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8428 information fields.
8429
2f2de248
L
84302009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8431
8432 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8433 Replace two_file_shared_1.so with two_file_shared_2.so.
8434 * testsuite/Makefile.in: Regenerated.
8435
4f787271
DK
84362009-12-08 Doug Kwan <dougkwan@google.com>
8437
8438 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8439 (HFILES): Add attributes.h and int_encoding.h.
8440 * Makefile.in: Regenerate.
8441 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8442 function definitions to int_encoding.cc
8443 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8444 prototypes to int_encoding.h
8445 * reduced_debug_output.cc (int_encoding.h): New include.
8446 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8447 function definitions to int_encoding.cc
8448 (insert_into_vector, read_from_pointer): Move template definitions to
8449 int_encoding.h
8450 * attributes.cc: New file.
8451 * attributes.h: New file.
8452 * int_encoding.cc: New file.
8453 * int_encoding.h: New file.
8454
20b52f1a
RÁE
84552009-12-07 Rafael Avila de Espindola <espindola@google.com>
8456
8457 PR gold/11055
8458 * incremental-dump.cc (dump_incremental_inputs): New.
8459 (main): Use dump_incremental_inputs.
8460
53d7974c
L
84612009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8462
8463 PR gold/10893
8464 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8465 checking elfcpp::STT_FUNC.
8466 (Target_i386::Relocate::relocate): Likewise.
8467 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8468
8469 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8470 symbols from shared libraries into normal FUNC symbols.
8471
8472 * symtab.h (Symbol): Add is_func and use it.
8473
05a352e6
DK
84742009-12-05 Doug Kwan <dougkwan@google.com>
8475
8476 * arm.cc (Target_arm::arm_info): Initialize new fields
8477 attributes_section and attributes_vendor.
8478 * i386.cc (Target_i386::i386_info): Same.
8479 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8480 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8481 fields attributes_section and attributes_vendor.
53d7974c 8482 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8483 * target.h (Target::attributes_section, Target::attributes_vendor,
8484 Target::is_attributes_section, Target::attribute_arg_type,
8485 Target::attributes_order): New method definitions.
8486 (Target::Target_info::attributes_section,
8487 Target::Target_info::attributes_vendor): New fields.
8488 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8489 virtual method definitions.
8490 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8491 attributes_section and attributes_vendor.
8492 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8493
f4e5969c
DK
84942009-12-05 Doug Kwan <dougkwan@google.com>
8495
8496 * arm.cc: Update comments about interworking and stub generation.
8497 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8498 considered as non-PIC.
8499 (Arm_relocate_functions::base_abs): Fix formatting.
8500 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8501 of function to use GOT entry address instead of offset.
8502 (Target_arm::Scan::global): Issue an error if a symbol would need a
8503 PLT does not get one because it is untyped. Remove code to create
8504 dynamic symbols for relative branches.
8505 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8506 takes unsigned integer instead of boolean.
8507
1abce4a6
L
85082009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8509
8510 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8511 (two_file_test_LDADD): Likewise.
8512 (common_test_1_LDADD): Likewise.
8513 (exception_test_LDADD) Likewise.
8514 (weak_test_LDADD): Likewise.
8515 (many_sections_test_LDADD): Likewise.
8516 (initpri1_LDADD): Likewise.
8517 (script_test_1_LDADD): Likewise.
8518 (script_test_2_LDADD): Likewise.
8519 (justsyms_LDADD): Likewise.
8520 (binary_test_LDADD): Likewise.
8521 (large_LDADD): Likewise.
8522 * testsuite/Makefile.in: Regenerated.
8523
adcf2816 85242009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8525
adcf2816
L
8526 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8527 (Symbol_table::override_with_special): Likewise.
8528 (Symbol_table::add_from_object): Likewise.
8529
28e67f5d
RÁE
85302009-12-04 Rafael Avila de Espindola <espindola@google.com>
8531
8532 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8533 Don't set the data_offset twice.
8534
ae10a101
RÁE
85352009-12-04 Rafael Avila de Espindola <espindola@google.com>
8536
8537 * testsuite/Makefile.in: Regenerate.
8538
f59f41f3
DK
85392009-12-03 Doug Kwan <dougkwan@google.com>
8540
8541 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8542 (Target_arm::do_finalize_sections): Add parameter for symbol table
8543 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8544 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8545 parameter for symbol table pointer.
8546 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8547 an additional parameter for a pointer to symbol table.
8548 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8549 parameter for a symbol table pointer.
8550 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8551 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8552 Ditto.
8553 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8554 parameter for a symbol table pointer.
8555
ca55d848
RÁE
85562009-12-03 Rafael Avila de Espindola <espindola@google.com>
8557
8558 * incremental.cc (Incremental_inputs_header)
8559 (Incremental_inputs_header_write, Incremental_inputs_entry)
8560 (Incremental_inputs_entry_write): Move ...
8561 * incremental.h (Incremental_inputs_header)
8562 (Incremental_inputs_header_write, Incremental_inputs_entry)
8563 (Incremental_inputs_entry_write): here.
8564
3aec4f9c
RÁE
85652009-12-02 Rafael Avila de Espindola <espindola@google.com>
8566
8567 * incremental.cc (make_sized_incremental_binary): Set the target.
8568 Error if it is incompatible.
8569 * output.h (Output_file): Add filename method.
8570
9c0ae74d
RÁE
85712009-12-02 Rafael Avila de Espindola <espindola@google.com>
8572
8573 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8574 from the get_* methods.
8575
a45500ae
RÁE
85762009-12-02 Rafael Avila de Espindola <espindola@google.com>
8577
8578 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8579 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8580 Write 0 for the data_offset of scripts.
8581
325e6408
RÁE
85822009-12-02 Rafael Avila de Espindola <espindola@google.com>
8583
8584 * testsuite/Makefile.am: Add the incremental_test.sh test.
8585 * testsuite/incremental_test.sh: New.
8586 * testsuite/incremental_test_1.c: New.
8587 * testsuite/incremental_test_2.c: New.
8588
954c3e2e
RÁE
85892009-12-01 Rafael Avila de Espindola <espindola@google.com>
8590
703d02da 8591 * incremental-dump.cc (main): Fix typos.
954c3e2e 8592
f8086623
RÁE
85932009-11-27 Rafael Avila de Espindola <espindola@google.com>
8594
8595 PR gold/11025
8596 * incremental-dump.cc (main): Use llu to print 64 bit values.
8597
3b0dd6ac
L
85982009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8599 H.J. Lu <hongjiu.lu@intel.com>
8600
8601 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8602 $(LIBDL).
8603 (incremental_dump_LDADD): Likewise.
8604 * Makefile.in: Regenerated.
8605
a6d1ef57 86062009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8607
a6d1ef57
DK
8608 Revert:
8609
8610 2009-11-25 Doug Kwan <dougkwan@google.com>
8611
8612 * arm.cc (Target_arm::Target_arm): Move method definition
8613 outside of class definition. Add code to handle
8614 --target1-rel, --target1-abs and --target2= options.
8615 (Target_arm::get_reloc_reloc_type): Change method to be
8616 non-static and const.
8617 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8618 New data member declaration.
8619 (Target_arm::Scan::local, Target_arm::Scan::global,
8620 Target_arm::Relocate::relocate,
8621 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8622 Adjust call to Target_arm::get_real_reloc_type.
8623 (Target_arm::get_real_reloc_type): Use command line options
8624 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8625 * options.h (--target1-rel, --target1-abs, --target2): New
8626 ARM-only options.
8627
50aeb7d4
DK
86282009-11-25 Doug Kwan <dougkwan@google.com>
8629
8630 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8631 class definition. Add code to handle --target1-rel, --target1-abs
8632 and --target2= options.
8633 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8634 and const.
8635 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8636 member declaration.
8637 (Target_arm::Scan::local, Target_arm::Scan::global,
8638 Target_arm::Relocate::relocate,
8639 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8640 call to Target_arm::get_real_reloc_type.
8641 (Target_arm::get_real_reloc_type): Use command line options to
8642 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8643 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8644 options.
8645
51938283
DK
86462009-11-25 Doug Kwan <dougkwan@google.com>
8647
8648 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8649 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8650 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8651 formatting.
8652 (Arm_relocate_functions::thm_call): Replace body with a call to
8653 Arm_relocate_functions::thumb_branch_common.
8654 (Arm_relocate_functions::thm_jump24,
8655 Arm_relocate_functions::thm_xpc22): New method definitions.
8656 (Arm_relocate_functions::thumb_branch_common): New method definition.
8657 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8658 operator.
8659 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8660 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8661
e2b8f3c4
RÁE
86622009-11-24 Rafael Avila de Espindola <espindola@google.com>
8663
8664 * Makefile.am: Build incremental-dump
8665 * Makefile.in: Regenerate.
8666 * incremental-dump.cc: New.
8667 * incremental.cc (Incremental_inputs_header_data,
8668 Incremental_inputs_entry_data): Move to incremental.h
8669 * incremental.h: (Incremental_inputs_header_data,
8670 Incremental_inputs_entry_data): Move from incremental.cc
8671
bcba9aec
RÁE
86722009-11-24 Rafael Avila de Espindola <espindola@google.com>
8673
8674 * incremental.cc (Incremental_inputs_header,
8675 Incremental_inputs_header_write, Incremental_inputs_entry,
8676 Incremental_inputs_entry_write): Add a typedef with the data type.
8677
7c3afe08
RÁE
86782009-11-24 Rafael Avila de Espindola <espindola@google.com>
8679
8680 * incremental.cc (Incremental_inputs_header,
8681 Incremental_inputs_header_write, Incremental_inputs_entry,
8682 Incremental_inputs_entry_write): Update comment about which
8683 type has the filed descriptions.
8684
d204b6e9
DK
86852009-11-15 Doug Kwan <dougkwan@google.com>
8686
8687 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8688 (Arm_relocate_functions::arm_branch_common): Change method defintion
8689 in class definition to a method declaration and update list of formal
8690 parameters.
8691 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8692 Arm_relocation_functions::jump24): Adjust call to
8693 Arm_relocate_functions::arm_branch_common. Update list of formal
8694 parameters.
8695 (Arm_relocate_functions::xpc25): New method definition.
8696 (Arm_relocate_functions::arm_branch_common): Move method defintion
8697 out from class definition. Use stubs for mode-switching and extending
8698 branch ranges.
8699 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8700 specially. Change code to enable use of stubs in ARM branches.
8701
43d12afe
DK
87022009-11-10 Doug Kwan <dougkwan@google.com>
8703
8704 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8705 in method declaration.
8706 (Target_arm::relocate_stub): New method declaration.
8707 (Target_arm::default_target): Change to return a pointer instead of
8708 a const reference.
8709 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8710 Target_arm::default_target.
8711 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8712 method definition.
8713 (Target_arm::relocate_section): Adjust view.
8714 (Target_arm::relocate_stub): New method definition.
8715
ac33a407
DK
87162009-11-10 Doug Kwan <dougkwan@google.com>
8717
8718 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8719 a format warning.
8720 * incremental.cc (open_incremental_binary): Initialized local
8721 variables to avoid warnings.
8722 * object.cc (make_elf_object): Ditto.
8723 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8724 a format warning.
e1df38aa 8725
88ee28e9
L
8726009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8727
8728 PR gold/10930
8729 * testsuite/plugin_test.c: Include "config.h".
8730
2daedcd6
DK
87312009-11-09 Doug Kwan <dougkwan@google.com>
8732
8733 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8734 (arm_symbol_value): Remove.
8735 (Arm_relocate_functions::arm_branch_common,
8736 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8737 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8738 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8739 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8740 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8741 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8742 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8743 Arm_relocate_functions::thm_mobw_abs_nc,
8744 Arm_relocate_functions::thm_mov_abs,
8745 Arm_relocate_functions::movw_prel_nc,
8746 Arm_relocate_functions::thm_movt_abs,
8747 Arm_relocate_functions::movt_prel,
8748 Arm_relocate_functions::thm_movw_prel_nc,
8749 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8750 (Target_arm::Relocate::relocate): Only decompose address into two
8751 parts if relocation type uses the thumb-bit and pass the actual
8752 bit instead of a flag indicating that the thumb-bit is used. Adjust
8753 calls to methods in Arm_relocate_functions for this change.
8754
1276bc89 87552009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8756
8757 PR 10925
8758 * reloc.cc: Instantiate
8759 Sized_relobj::initialize_input_to_output_maps and
8760 Sized_relobj:free_input_to_output_maps.
8761
e53ad1b5
ILT
87622009-11-06 Ian Lance Taylor <iant@google.com>
8763
8764 PR 10876
8765 * defstd.cc (in_segment): Set only_if_ref true for "end".
8766
eb44217c
DK
87672009-11-06 Doug Kwan <dougkwan@google.com>
8768
8769 * arm.cc (class Reloc_stub): Correct a comment.
8770 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8771 (Target_arm::scan_section_for_stubs): New method declaration.
8772 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8773 Change methods from private to protected.
8774 (Target_arm::do_may_relax): New method definition.
8775 (Target_arm::do_relax, Target_arm::group_sections,
8776 Target_arm::scan_reloc_for_stub,
8777 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8778 (Target_arm::arm_input_section_map_): New data member declaration.
8779 (Target_arm::scan_reloc_for_stub,
8780 Target_arm::scan_reloc_section_for_stubs,
8781 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8782 Target_arm::do_relax): New method definitions.
8783
5d329b7d
ILT
87842009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8785
8786 * configure.ac: Check for (struct stat)::st_mtim
8787 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8788 * config.in: Regenerate.
8789 * configure: Regenerate.
8790
96a0d71b
ILT
87912009-11-05 Ian Lance Taylor <iant@google.com>
8792
8793 PR 10910
8794 * output.cc (Output_segment::add_output_section): Add missing
8795 return statement.
8796
594c8e5e
ILT
87972009-11-04 Ian Lance Taylor <iant@google.com>
8798
8799 PR 10880
8800 * object.h (class Object): Add is_needed and set_is_needed
8801 methods. Add is_needed_ field. Make bool fields into bitfields.
8802 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8803 defined in a dynamic object and referenced by a regular object,
8804 set is_needed for the dynamic object.
8805 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8806 if the file is marked with as_needed and it is not needed.
8807
22b127cc
ILT
88082009-11-04 Ian Lance Taylor <iant@google.com>
8809
8810 PR 10887
8811 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8812 tags if data is discarded by linker script.
8813 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8814 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8815 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8816 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8817
f5c870d2
ILT
88182009-11-04 Ian Lance Taylor <iant@google.com>
8819
8820 * layout.cc (Layout::get_output_section): Add is_interp and
8821 is_dynamic_linker_section parameters. Change all callers.
8822 (Layout::choose_output_section): Likewise.
8823 (Layout::make_output_section): Likewise.
8824 (Layout::add_output_section_data): Add is_dynamic_linker_section
8825 parameter. Change all callers.
8826 * layout.h (class Layout): Update declarations.
8827 * output.h (class Output_section): Add is_interp, set_is_interp,
8828 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8829 Add is_interp_, is_dynamic_linker_section_ fields. Change
8830 generate_code_fills_at_write_ to a bitfield.
8831 * output.cc (Output_section::Output_sections): Initialize new
8832 fields.
8833 (Output_segment::add_output_section): Add do_sort parameter.
8834 Change all callers.
8835
1ae4d23b
ILT
88362009-11-03 Ian Lance Taylor <iant@google.com>
8837
8838 PR 10860
8839 * options.h (class General_options): Add --warn-common.
8840 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8841 merging two common symbols.
8842 (Symbol_table::should_override): Handle --warn-common when merging
8843 a common symbol with a defined symbol. Use report_resolve_problem
8844 for multiple definitions.
8845 (Symbol_table::report_resolve_problem): New function.
8846 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8847
55da9579
DK
88482009-11-03 Doug Kwan <dougkwan@google.com>
8849
8850 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8851 stub_factory_.
8852 (Target_arm::stub_factory): New method definition.
8853 (Target_arm::new_arm_input_section,
8854 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8855 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8856 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8857 New type definitions.
8858 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8859 member declarations.
8860 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8861 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8862 New method definitions.
8863
37a9ac43
ILT
88642009-11-03 Ian Lance Taylor <iant@google.com>
8865
8866 * options.h (class General_options): Add --warn_constructors.
8867
b3d6a3d4
ILT
88682009-11-03 Ian Lance Taylor <iant@google.com>
8869
8870 PR 10893
8871 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8872 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8873
934b01dd
ILT
88742009-11-03 Ian Lance Taylor <iant@google.com>
8875
8876 PR 10895
8877 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8878 --msgid-bugs-address.
8879 (install-pdf): New target.
8880 (install-data_yes): Look up one directory to find mkinstalldirs.
8881
03c1939b
L
88822009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8883
8884 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8885 tree.
8886
ebd95253
DK
88872009-10-30 Doug Kwan <dougkwan@google.com>
8888
8889 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8890
e9bbb538
DK
88912009-10-30 Doug Kwan <dougkwan@google.com>
8892
8893 * arm.cc (Stub_addend_reader): New struct template definition
8894 and partial specializations.
8895 (Stub_addend_reader::operator()): New method definition for a
8896 partially specialized template.
8897
d5b40221
DK
88982009-10-30 Doug Kwan <dougkwan@google.com>
8899
8900 * arm.cc (Arm_relobj::processor_specific_flags): New method
8901 definition.
8902 (Arm_relobj::do_read_symbols): New method declaration.
8903 (Arm_relobj::processor_specific_flags_): New data member declaration.
8904 (Arm_dynobj): New class definition.
8905 (Target_arm::do_finalize_sections): Add input_objects parameter.
8906 (Target_arm::do_adjust_elf_header): New method declaration.
8907 (Target_arm::are_eabi_versions_compatible,
8908 (Target_arm::merge_processor_specific_flags): New method declaration.
8909 (Target_arm::do_make_elf_object): New overloaded method definitions
8910 and declaration.
8911 (Arm_relobj::do_read_symbols): New method definition.
8912 (Arm_dynobj::do_read_symbols): Ditto.
8913 (Target_arm::do_finalize_sections): Add input_objects parameters.
8914 Merge processor-specific flags from all input objects.
8915 (Target_arm::are_eabi_versions_compatible,
8916 Target_arm::merge_processor_specific_flags,
8917 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8918 New method definitions.
8919 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8920 Input_objects pointer type parameter.
8921 * layout.cc (Layout::finalize): Pass input objects to target's.
8922 finalize_sections function.
8923 * output.cc (Output_file_header::do_sized_write): Set ELF file
8924 header's processor-specific flags.
8925 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8926 Input_objects pointer type parameter.
8927 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8928 * target.h (Input_objects): New forward class declaration.
8929 (Target::processor_specific_flags,
8930 Target::are_processor_specific_flags_sect): New method definitions.
8931 (Target::finalize_sections): Add input_objects parameter.
8932 (Target::Target): Initialize processor_specific_flags_ and
8933 are_processor_specific_flags_set_.
8934 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8935 parameter.
8936 (Target::set_processor_specific_flags): New method definition.
8937 (Target::processor_specific_flags_,
8938 Target::are_processor_specific_flags_set_): New data member
8939 declarations.
8940 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8941 Input_objects pointer type parameter.
8942
ebabffbd
DK
89432009-10-30 Doug Kwan <dougkwan@google.com>
8944
8945 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8946
ad0f2072
ILT
89472009-10-28 Ian Lance Taylor <iant@google.com>
8948
8949 * object.h (class Relobj): Drop options parameter from
8950 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8951 do_scan_relocs, do_relocate. Change all callers.
8952 (class Sized_relobj): Drop options parameters from
8953 do_gc_process_relocs, do_scan_relocs, do_relocate,
8954 do_relocate_sections, relocate_sections, emit_relocs_scan,
8955 emit_relocs_scan_reltype. Change all callers.
8956 (struct Relocate_info): Remove options field and all references to
8957 it.
8958 * reloc.h (class Read_relocs): Remove options constructor
8959 parameter and options_ field. Change all callers.
8960 (class Gc_process_relocs, class Scan_relocs): Likewise.
8961 (class Relocate_task): Likewise.
8962 * target-reloc.h (scan_relocs): Remove options parameter. Change
8963 all callers.
8964 (scan_relocatable_relocs): Likewise.
8965 * target.h (class Sized_target): Remove options parameter from
8966 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8967 all callers.
8968 * gc.h (gc_process_relocs): Remove options parameter. Change all
8969 callers.
8970 * arm.cc: Update functions to remove options parameters.
8971 * i386.cc: Likewise.
8972 * powerpc.cc: Likewise.
8973 * sparc.cc: Likewise.
8974 * x86_64.cc: Likewise.
8975 * testsuite/testfile.cc: Likewise.
8976
8ffa3667
DK
89772009-10-28 Doug Kwan <dougkwan@google.com>
8978
8979 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8980 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8981 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8982 New method definitions.
8983
40f36857
CC
89842009-10-28 Cary Coutant <ccoutant@google.com>
8985
8986 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8987 (Plugin::cleanup_done_): New member.
8988 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8989 (Plugin_manager::cleanup_done_): Remove.
8990 (Plugin_manager::add_input_file): Edit error message.
8991 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8992 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8993
2c849493
ILT
89942009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8995
8996 * fileread.cc: (File_read::View::~View): Use the new
8997 data_ownership_ filed.
8998 (File_read::~File_read): Dispose the new whole_file_view_.
8999 (File_read::open): Mmap the whole file if needed.
9000 (File_read::open): Use whole_file_view_ instead of contents_.
9001 (File_read::find_view): Use whole_file_view_ if applicable.
9002 (File_read::do_read): Use whole_file_view_ instead of contents_.
9003 (File_read::make_view): Use whole_file_view_ instead of contents_,
9004 update File_read::View::View call.
9005 (File_read::find_or_make_view): Update File_read::View::View
9006 call.
9007 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9008 remove contents_
9009 (File_read::View::Data_ownership): New enum.
9010 (File_read::View::View): Replace bool mapped_ with Data_ownership
9011 argument.
9012 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9013 (File_read::View::data_ownership_): New field.
9014 (File_read::contents_): Remove (replaced by whole_file_view_).
9015 (File_read::whole_file_view_): New field.
9016 * options.h (class General_options): Add --keep-files-mapped.
9017
24998053
CC
90182009-10-27 Cary Coutant <ccoutant@google.com>
9019
9020 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9021 * testsuite/Makefile.am (plugin_test_5): New test case.
9022 * testsuite/Makefile.in: Regenerate.
9023
72adc4fa
DK
90242009-10-25 Doug Kwan <dougkwan@google.com>
9025
9026 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9027 from private to protected to allow access by child class.
9028 (Sized_relobj::do_relocate_sections): New method declaration.
9029 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9030 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9031 Sized_relobj::relocate_sections. Instantiate template explicitly
9032 for different target sizes and endianity.
9033
07f508a2
DK
90342009-10-24 Doug Kwan <dougkwan@google.com>
9035
9036 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9037 (Arm_input_section::as_arm_input_section): New method.
9038 (Arm_output_section): New class definition.
9039 (Arm_output_section::create_stub_group,
9040 Arm_output_section::group_sections): New method definitions.
9041
10ad9fe5
DK
90422009-10-22 Doug Kwan <dougkwan@google.com>
9043
9044 * arm.cc (Arm_input_section): New class definition.
9045 (Arm_input_section::init, Arm_input_section:do_write,
9046 Arm_input_section::set_final_data_size,
9047 Arm_input_section::do_reset_address_and_file_offset): New method
9048 definitions.
9049
56ee5e00
DK
90502009-10-21 Doug Kwan <dougkwan@google.com>
9051
9052 * arm.cc (Stub_table, Arm_input_section): New forward class
9053 declarations.
9054 (Stub_table): New class defintion.
9055 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9056 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9057 New method definition.
9058
b569affa
DK
90592009-10-21 Doug Kwan <dougkwan@google.com>
9060
9061 * arm.cc: Update copyright comments.
9062 (Target_arm): New forward class template declaration.
9063 (Arm_address): New type.
9064 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9065 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9066 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9067 constants.
9068 (Insn_template): Same.
9069 (DEF_STUBS): New macro.
9070 (Stub_type): New enum type.
9071 (Stub_template): New class definition.
9072 (Stub): Same.
9073 (Reloc_stub): Same.
9074 (Stub_factory): Same.
9075 (Target_arm::Target_arm): Initialize may_use_blx_ and
9076 should_force_pic_veneer_.
9077 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9078 Target_arm::should_force_pic_veneer,
9079 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9080 Target_arm::using_thumb_only, Target_arm:;default_target): New
9081 method defintions.
9082 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9083 New data member declarations.
9084 (Insn_template::size, Insn_template::alignment): New method defintions.
9085 (Stub_template::Stub_template): New method definition.
9086 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9087 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9088 (Stub_factory::Stub_factory): New method definition.
9089 * gold.h (string_hash): New template.
9090 * output.h (Input_section_specifier::hash_value): Use
9091 gold::string_hash.
9092 (Input_section_specifier::string_hash): Remove.
9093 * stringpool.cc (Stringpool_template::string_hash): Use
9094 gold::string_hash.
9095
6c172549
DK
90962009-10-20 Doug Kwan <dougkwan@google.com>
9097
9098 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9099 symbols of relaxed input sections.
9100 * output.h (Output_section::find_relaxed_input_section): Make
9101 method public.
9102
c5617f2f
DK
91032009-10-16 Doug Kwan <dougkwan@google.com>
9104
9105 * dynobj.cc (Versions::Versions): Initialize version_script_.
9106 Only insert base version symbol definition for a shared object
9107 if version script defines any version versions.
9108 (Versions::define_base_version): New method definition.
9109 (Versions::add_def): Check that base version is not needed.
9110 (Versions::add_need): Define base version lazily.
9111 * dynobj.h (Versions::define_base_version): New method declaration.
9112 (Versions::needs_base_version_): New data member declaration.
9113 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9114 (check_DATA): Add no_version_test.stdout.
9115 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9116 New make rules.
9117 * testsuite/Makefile.in: Regenerate.
9118 * testsuite/no_version_test.c: New file.
9119 * testsuite/no_version_test.sh: Ditto.
9120
3c12dcdb
DK
91212009-10-16 Doug Kwan <dougkwan@google.com>
9122
9123 * expression.cc (class Segment_start_expression): New class definition.
9124 (Segment_start_expression::value): New method definition.
9125 (script_exp_function_segment_start): Return a new
9126 Segment_start_expression.
9127 * gold/script-c.h (script_saw_segment_start_expression): New function
9128 prototype.
9129 * script-sections.cc (Script_sections::Script_sections): Initialize
9130 SAW_SEGMENT_START_EXPRESSION_ to false.
9131 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9132 and -Tbbs options to specify section addresses if given in
9133 command line and no SEGMENT_START expression is seen in a script.
9134 * script-sections.h (Script_sections::saw_segment_start_expression,
9135 Script_sections::set_saw_segment_start_expression): New method
9136 definition.
9137 (Script_sections::saw_segment_start_expression_): New data member
9138 declaration.
9139 * script.cc (script_saw_segment_start_expression): New function.
9140 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9141 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9142 script_test_7.sh and script_test_8.sh.
9143 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9144 script_test_8.stdout.
9145 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9146 (script_test_6, script_test_6.stdout, script_test_7,
9147 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9148 * Makefile.in: Regenerate.
9149 * testsuite/script_test_6.sh: New file.
9150 * testsuite/script_test_6.t: Same.
9151 * testsuite/script_test_7.sh: Same.
9152 * testsuite/script_test_7.t: Same.
9153 * testsuite/script_test_8.sh: Same.
9154
64b1ae37
DK
91552009-10-16 Doug Kwan <dougkwan@google.com>
9156
9157 * output.cc (Output_segment::set_section_list_address): Cast
9158 expressions to unsigned long long type to avoid format warnings.
9159
661be1e2
ILT
91602009-10-15 Ian Lance Taylor <iant@google.com>
9161
12edd763 9162 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9163 dot assignment to script_sections_.
12edd763
ILT
9164 * script-sections.cc (Script_sections::add_dot_assignment):
9165 Initialize if necessary.
9166
68b6574b
ILT
9167 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9168 program headers with no load segment if there is a linker script.
9169
661be1e2
ILT
9170 * layout.cc (Layout::set_segment_offsets): Align the file offset
9171 to the segment aligment for -N or -n with no load segment.
9172 * output.cc (Output_segment::add_output_section): Don't crash if
9173 the first section is a TLS section.
9174 (Output_segment::set_section_list_addresses): Print an error
9175 message if the address moves backward in a linker script.
9176 * script-sections.cc
9177 (Output_section_element_input::set_section_addresses): Don't
9178 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9179 (Orphan_output_section::set_section_addresses): Likewise.
9180
f15f61a7
DK
91812009-10-15 Doug Kwan <dougkwan@google.com>
9182
9183 * layout.cc (Layout::finish_dynamic_section): Generate tags
9184 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9185 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9186 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9187
82bb573a
ILT
91882009-10-14 Ian Lance Taylor <iant@google.com>
9189
9190 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9191 fields.
9192 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9193 data_shdr fields of relinfo.
9194 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9195 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9196 R_386_TLS_LDO_32, adjust based on section flags.
9197 (Target_i386::Relocate::fix_up_ldo): Remove.
9198
374ad285
ILT
91992009-10-13 Ian Lance Taylor <iant@google.com>
9200
9201 Add support for -pie.
9202 * options.h (class General_options): Add -pie and
9203 --pic-executable.
9204 (General_options::output_is_position_independent): Test -pie.
9205 (General_options::output_is_executable): Return true if not shared
9206 and not relocatable.
9207 (General_options::output_is_pie): Remove.
9208 * options.cc (General_options::finalize): Reject incompatible uses
9209 of -pie.
9210 * gold.cc (queue_middle_tasks): A -pie link is not static.
9211 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9212 * symtab.cc (Symbol::final_value_is_known): Return false if
9213 output_is_position_independent.
9214 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9215 output_is_position_independent.
9216 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9217 output_is_position_independent.
9218 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9219 output_is_position_independent.
9220 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9221 two_file_pie_test.
9222 (basic_pie_test.o, basic_pie_test): New targets.
9223 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9224 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9225 (two_file_pie_test): New target.
9226 * testsuite/Makefile.in: Rebuild.
9227 * README: Remove note saying that -pie is not supported.
9228
c6585162
ILT
92292009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9230
9231 * options.h (class General_options): Add -init and -fini.
9232 * layout.cc (Layout::finish_dynamic_section): Emit
9233 given init and fini functions.
9234
032ce4e9
ST
92352009-10-13 Sriraman Tallam <tmsriram@google.com>
9236
9237 * gc.h (gc_process_relocs): Check if icf is enabled using new
9238 function.
9239 * gold.cc (queue_initial_tasks): Likewise.
9240 (queue_middle_tasks): Likewise.
9241 * object.cc (do_layout): Likewise.
9242 * symtab.cc (is_section_folded): Likewise.
9243 * main.cc (main): Likewise.
9244 * reloc.cc (Read_relocs::run): Likewise.
9245 (Sized_relobj::do_scan_relocs): Likewise.
9246 * icf.cc (is_function_ctor_or_dtor): New function.
9247 (Icf::find_identical_sections): Check if function is ctor or dtor when
9248 safe icf is chosen.
9249 * options.h (General_options::icf): Change option to be an enum.
9250 (Icf_status): New enum.
9251 (icf_enabled): New method.
9252 (icf_safe_folding): New method.
9253 (set_icf_status): New method.
9254 (icf_status_): New variable.
9255 * (options.cc) (General_options::finalize): Set icf_status_.
9256 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9257 icf_test and icf_keep_unique_test to use the --icf enum flag.
9258 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9259 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9260
f345227a
ST
92612009-10-12 Sriraman Tallam <tmsriram@google.com>
9262
9263 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9264 includes to gc.h and icf.h.
9265 * arm.cc: Include gc.h.
9266 * gold.cc: Likewise.
9267 * i386.cc: Likewise.
9268 * powerpc.cc: Likewise.
9269 * sparc.cc: Likewise.
9270 * x86_64.cc: Likewise.
9271 * gc.h: Include icf.h.
9272
1c7814ed
ILT
92732009-10-11 Ian Lance Taylor <iant@google.com>
9274
9275 * plugin.cc: Include "gold.h" before other header files.
9276
ae3b5189
CD
92772009-10-10 Chris Demetriou <cgd@google.com>
9278
9279 * options.h (Input_file_argument::Input_file_type): New enum.
9280 (Input_file_argument::is_lib_): Replace with...
9281 (Input_file_argument::type_): New member.
9282 (Input_file_argument::Input_file_argument): Take Input_file_type
9283 'type' rather than boolean 'is_lib' as second argument.
9284 (Input_file_argument::is_lib): Use type_.
9285 (Input_file_argument::is_searched_file): New function.
9286 (Input_file_argument::may_need_search): Handle is_searched_file.
9287 * options.cc (General_options::parse_library): Support -l:filename.
9288 (General_options::parse_just_symbols): Update for Input_file_argument
9289 changes.
9290 (Command_line::process): Likewise.
9291 * archive.cc (Archive::get_file_and_offset): Likewise.
9292 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9293 * script.cc (read_script_file, script_add_file): Likewise.
9294 * fileread.cc (Input_file::Input_file): Likewise.
9295 (Input_file::will_search_for): Handle is_searched_file.
9296 (Input_file::open): Likewise.
9297 * readsyms.cc (Read_symbols::get_name): Likewise.
9298 * testsuite/Makefile.am (searched_file_test): New test.
9299 * testsuite/Makefile.in: Regenerate.
9300 * testsuite/searched_file_test.cc: New file.
9301 * testsuite/searched_file_test_lib.cc: New file.
9302
f3048a1d
ILT
93032009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9304 Ian Lance Taylor <iant@google.com>
9305
9306 * descriptor.cc: Include <cstdio> and "binary-io.h".
9307 (Descriptors::open): Open the files in binary mode always.
9308 * script.cc (Lex::get_token): Treat \r as whitespace.
9309
d4780e57
ILT
93102009-10-09 Ian Lance Taylor <iant@google.com>
9311
9312 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9313
d9a893b8
ILT
93142009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9315 Ian Lance Taylor <iant@google.com>
9316
9317 * configure.ac: Check for readv function also.
9318 * fileread.cc (readv): Define if not HAVE_READV.
9319 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9320 does not exist.
9321 * config.in: Regenerate.
9322 * configure: Regenerate.
9323
c0a62865
DK
93242009-10-09 Doug Kwan <dougkwan@google.com>
9325
9326 * layout.cc (Layout::make_output_section): Call target hook to make
9327 ordinary output section.
9328 (Layout::finalize): Adjust parameter list of call the
9329 Target::may_relax().
9330 * layout.h (class Layout::section_list): New method.
9331 * merge.h (Output_merge_base::entsize): Change visibility to public.
9332 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9333 New methods.
9334 (Output_merge_string::do_is_string): New method.
9335 * object.cc (Sized_relobj::do_setup): renamed from
9336 Sized_relobj::set_up.
9337 * object.h (Sized_relobj::adjust_shndx,
9338 Sized_relobj::initializ_input_to_output_maps,
9339 Sized_relobj::free_input_to_output_maps): Change visibilities to
9340 protected.
9341 (Sized_relobj::setup): Virtualize.
9342 (Sized_relobj::do_setup): New method declaration.
9343 (Sized_relobj::invalidate_section_offset,
9344 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9345 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9346 * options.cc (parse_int): New function.
9347 * options.h (parse_int): New declaration.
9348 (DEFINE_int): New macro.
9349 (stub_group_size): New option.
9350 * output.cc (Output_section::Output_section): Initialize memebers
9351 merge_section_map_, merge_section_by_properties_map_,
9352 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9353 (Output_section::add_input_section): Handled deferred code-fill
9354 generation and remove an old comment.
9355 (Output_section::add_relaxed_input_section): New method definition.
9356 (Output_section::add_merge_input_section): Use merge section by
9357 properties map to speed to search. Update merge section maps
9358 as appropriate.
9359 (Output_section::build_relaxation_map): New method definition.
9360 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9361 Same.
9362 (Output_section::relax_input_section): Renamed to
9363 Output_section::convert_input_sections_to_relaxed_sections and change
9364 interface to take a vector of pointers to relaxed sections.
9365 (Output_section::find_merge_section,
9366 Output_section::find_relaxed_input_section): New method definitions.
9367 (Output_section::is_input_address_mapped,
9368 Output_section::output_offset, Output_section::output_address):
9369 Use output section data maps to speed up searching.
9370 (Output_section::find_starting_output_address): Add comments.
9371 (Output_section::do_write,
9372 Output_section::write_to_postprocessing_buffer): Do code-fill
9373 generation as appropriate.
9374 (Output_section::get_input_sections): Invalidate relaxed input section
9375 map.
9376 (Output_section::restore_states): Adjust type of checkpoint .
9377 Invalidate relaxed input section map.
9378 * output.h (Output_merge_base): New class declaration.
9379 (Input_section_specifier): New class defintion.
9380 (class Output_relaxed_input_section) Change base class to
9381 Output_section_data_build.
9382 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9383 base class initializer.
9384 (Output_section::add_relaxed_input_section): New method declaration.
9385 (Output_section::Input_section): Change visibility to protected.
2e702c99 9386 (Output_section::Input_section::relobj,
c0a62865
DK
9387 Output_section::Input_section::shndx): Handle relaxed input sections.
9388 Output_section::input_sections) Change visibility to protected. Also
9389 define overload to return a non-const pointer.
9390 (Output_section::Merge_section_properties): New class defintion.
9391 (Output_section::Merge_section_by_properties_map,
9392 Output_section::Output_section_data_by_input_section_map,
9393 Output_section::Relaxation_map): New types.
9394 (Output_section::relax_input_section): Rename method to
9395 Output_section::convert_input_sections_to_relaxed_sections and change
9396 interface to take a vector of relaxed section pointers.
9397 (Output_section::find_merge_section,
9398 Output_section::find_relaxed_input_section,
9399 Output_section::build_relaxation_map,
9400 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9401 New method declarations.
9402 (Output_section::merge_section_map_
9403 Output_section::merge_section_by_properties_map_,
9404 Output_section::relaxed_input_section_map_,
9405 Output_section::is_relaxed_input_section_map_valid_,
9406 Output_section::generate_code_fills_at_write_): New data members.
9407 * script-sections.cc
9408 (Output_section_element_input::set_section_addresses): Call
9409 current_data_size and addralign methods of relaxed input sections.
9410 (Orphan_output_section::set_section_addresses): Call current_data_size
9411 and addralign methods of relaxed input sections.
9412 * symtab.cc (Symbol_table::compute_final_value): Extract template
9413 from the body of Symbol_table::sized_finalize_symbol.
9414 (Symbol_table::sized_finalized_symbol): Call
9415 Symbol_table::compute_final_value.
9416 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9417 (Symbol_table::compute_final_value): New templated method declaration.
9418 * target.cc (Target::do_make_output_section): New method defintion.
9419 * target.h (Target::make_output_section): New method declaration.
9420 (Target::relax): Add more parameters for input objects, symbol table
9421 and layout. Adjust call to do_relax.
9422 (Target::do_make_output_section): New method declaration.
9423 (Target::do_relax): Add parameters for input objects, symbol table
9424 and layout.
9425
d446d6c4
ILT
94262009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9427
9428 * pread.c: Include stdio.h.
9429
bc06c745
ILT
94302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9431
9432 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9433 defined.
9434
75aea3d0
ILT
94352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9436
9437 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9438 Change read_shndx type to unsigned int.
9439 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9440 int.
9441 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9442 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9443 Change read_shndx type to unsigned int.
9444 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9445 int.
9446 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9447 * layout.cc (Layout::create_symtab_sections): Cast the result of
9448 local_symcount * symsize to off_t in the gold_assert.
9449
be8fcb75
ILT
94502009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9451
9452 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9453 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9454 R_ARM_BASE_ABS.
9455 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9456 (Arm_relocate_functions::thm_abs5): New function.
9457 (Arm_relocate_functions::abs12): New function.
9458 (Arm_relocate_functions::abs16): New function.
9459 (Arm_relocate_functions::base_abs): New function.
9460 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9461 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9462 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9463 R_ARM_BASE_ABS.
9464 (Scan::global): Likewise.
9465 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9466 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9467 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9468 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9469 R_ARM_BASE_ABS.
9470
c2a122b6
ILT
94712009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9472
9473 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9474 (Arm_relocate_functions::movt_prel): New function.
9475 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9476 (Arm_relocate_functions::thm_movt_prel): New function.
9477 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9478 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9479 (Scan::global, Relocate::relocate): Likewise.
9480 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9481
c4aa1e2d
ILT
94822009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9483
9484 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9485 Incremental_checker.
9486 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9487 unsigned int.
9488 (class Incremental_inputs_header): New class.
9489 (Incremental_inputs_header_writer): Edit comment.
9490 (Incremental_inputs_entry): New class.
9491 (Incremental_inputs_entry_writer): Edit comment.
9492 (Sized_incremental_binary::do_find_incremental_inputs_section):
9493 Add *strtab_shndx parameter, fill it.
9494 (Sized_incremental_binary::do_check_inputs): New method.
9495 (Incremental_checker::can_incrementally_link_output_file): Use
9496 Sized_incremental_binary::check_inputs.
9497 (Incremental_inputs::report_command_line): Save command line in
9498 command_line_.
9499 * incremental.h:
9500 (Incremental_binary::find_incremental_inputs_section): New
9501 method.
9502 (Incremental_binary::do_find_incremental_inputs_section): Add
9503 strtab_shndx parameter.
9504 (Incremental_binary::do_check_inputs): New pure virtual method.
9505 (Sized_incremental_binary::do_check_inputs): Declare.
9506 (Incremental_checker::Incremental_checker): Add incremental_inputs
9507 parameter, use it to initialize incremental_inputs_.
9508 (Incremental_checker::incremental_inputs_): New field.
9509 (Incremental_checker::command_line): New method.
9510 (Incremental_checker::inputs): New method.
9511 (Incremental_checker::command_line_): New field.
9512
c549a694
ILT
95132009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9514
9515 * incremental.cc: Include <cstdarg> and "target-select.h".
9516 (vexplain_no_incremental): New function.
9517 (explain_no_incremental): New function.
9518 (Incremental_binary::error): New method.
9519 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9520 method.
9521 (make_sized_incremental_binary): New function.
9522 (open_incremental_binary): New function.
9523 (can_incrementally_link_file): Add checks if output is ELF and has
9524 inputs section.
9525 * incremental.h: Include "elfcpp_file.h" and "output.h".
9526 (Incremental_binary): New class.
9527 (Sized_incremental_binary): New class.
9528 (open_incremental_binary): Declare.
9529 * object.cc (is_elf_object): Use
9530 elfcpp::Elf_recognizer::is_elf_file.
9531 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9532 * output.h (Output_file::filesize): New method.
9533
fd3c5f0b
ILT
95342009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9535
9536 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9537 New function.
9538 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9539 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9540 function.
9541 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9542 function.
9543 (Arm_relocate_functions::movw_abs_nc): New function.
9544 (Arm_relocate_functions::movt_abs): New function.
9545 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9546 (Arm_relocate_functions::thm_movt_abs): New function.
9547 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9548 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9549 (Scan::global): Likewise.
9550 (Relocate::relocate): Likewise.
9551 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9552
7f5309a5
ILT
95532009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9554
9555 * arm.cc (Arm_relocate_functions::got_prel) New function.
9556 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9557 (Relocate::relocate): Likewise.
9558 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9559
364c7fa5
ILT
95602009-10-06 Ian Lance Taylor <iant@google.com>
9561
9562 * options.h (class General_options): Define
9563 split_stack_adjust_size parameter.
9564 * object.h (class Object): Add uses_split_stack_ and
9565 has_no_split_stack_ fields. Add uses_split_stack and
9566 has_no_split_stack accessor functions. Declare
9567 handle_split_stack_section.
9568 (class Reloc_symbol_changes): Define.
9569 (class Sized_relobj): Define Function_offsets. Declare
9570 split_stack_adjust, split_stack_adjust_reltype, and
9571 find_functions.
9572 * object.cc (Object::handle_split_stack_section): New function.
9573 (Sized_relobj::do_layout): Call handle_split_stack_section.
9574 * dynobj.cc (Sized_dynobj::do_layout): Call
9575 handle_split_stack_section.
9576 * reloc.cc (Sized_relobj::relocate_sections): Call
9577 split_stack_adjust for executable sections in split_stack
9578 objects. Pass reloc_map to relocate_section.
9579 (Sized_relobj::split_stack_adjust): New function.
9580 (Sized_relobj::split_stack_adjust_reltype): New function.
9581 (Sized_relobj::find_functions): New function.
9582 * target-reloc.h: Include "object.h".
9583 (relocate_section): Add reloc_symbol_changes parameter. Change
9584 all callers.
9585 * target.h (class Target): Add calls_non_split method. Declare
9586 do_calls_non_split virtual method. Declare match_view and
9587 set_view_to_nop.
9588 * target.cc: Include "elfcpp.h".
9589 (Target::do_calls_non_split): New function.
9590 (Target::match_view): New function.
9591 (Target::set_view_to_nop): New function.
9592 * gold.cc (queue_middle_tasks): Give an error if mixing
9593 split-stack and non-split-stack objects with -r.
9594 * i386.cc (Target_i386::relocate_section): Add
9595 reloc_symbol_changes parameter.
9596 (Target_i386::do_calls_non_split): New function.
9597 * x86_64.cc (Target_x86_64::relocate_section): Add
9598 reloc_symbol_changes parameter.
9599 (Target_x86_64::do_calls_non_split): New function.
9600 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9601 parameter.
9602 * powerpc.cc (Target_powerpc::relocate_section): Add
9603 reloc_symbol_changes parameter.
9604 * sparc.cc (Target_sparc::relocate_section): Add
9605 reloc_symbol_changes parameter.
9606 * configure.ac: Call AM_CONDITIONAL for the default target.
9607 * configure: Rebuild.
9608 * testsuite/Makefile.am (TEST_AS): New variable.
9609 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9610 (check_DATA): Add split_i386 and split_x86_64 files.
9611 (SPLIT_DEFSYMS): Define.
9612 (split_i386_[1234n].o): New targets.
9613 (split_i386_[124]): New targets.
9614 (split_i386_[1234r].stdout): New targets.
9615 (split_x86_64_[1234n].o): New targets.
9616 (split_x86_64_[124]): New targets.
9617 (split_x86_64_[1234r].stdout): New targets.
9618 (MOSTLYCLEANFILES): Add new executables.
9619 * testsuite/split_i386.sh: New file.
9620 * testsuite/split_x86_64.sh: New file.
9621 * testsuite/split_i386_1.s: New file.
9622 * testsuite/split_i386_2.s: New file.
9623 * testsuite/split_i386_3.s: New file.
9624 * testsuite/split_i386_4.s: New file.
9625 * testsuite/split_i386_n.s: New file.
9626 * testsuite/split_x86_64_1.s: New file.
9627 * testsuite/split_x86_64_2.s: New file.
9628 * testsuite/split_x86_64_3.s: New file.
9629 * testsuite/split_x86_64_4.s: New file.
9630 * testsuite/split_x86_64_n.s: New file.
9631 * testsuite/testfile.cc (Target_test): Update relocation_section
9632 function.
9633 * testsuite/Makefile.in: Rebuild.
9634
e8a9fcda
ILT
96352009-10-06 Ian Lance Taylor <iant@google.com>
9636
9637 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9638 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9639 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9640 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9641 the address on ldo_addrs_.
9642 (Target_i386::Relocate::fix_up_ldo): New function.
9643
e99daf92
ILT
96442009-10-06 Rafael Espindola <espindola@google.com>
9645
9646 * plugin.cc (add_input_library): New.
9647 (Plugin::load): Add add_input_library to tv.
9648 (Plugin_manager::add_input_file): Add the is_lib argument.
9649 (add_input_file): Update call to Plugin_manager::add_input_file.
9650 (add_input_library): New.
9651 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9652
966d4097
DK
96532009-09-30 Doug Kwan <dougkwan@google.com>
9654
9655 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9656 symbol and call Symbol::may_need_copy_reloc to determine if
9657 a copy reloc is needed.
9658 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9659 nocopyreloc is given in command line.
9660 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9661 given in command line.
9662 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9663 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9664 of the removed Target_i386::may_need_copy_reloc.
9665 * options.h (copyreloc): New option with default value false.
9666 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9667 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9668 instead of the removed Target_powerpc::may_need_copy_reloc.
9669 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9670 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9671 instead of the removed Target_sparc::may_need_copy_reloc.
9672 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9673 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9674 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9675 instead of the removed Target_x86_64::may_need_copy_reloc.
9676
029ba973
ILT
96772009-09-30 Ian Lance Taylor <iant@google.com>
9678
9679 * object.h (class Object): Remove target_ field, and target,
9680 sized_target, and set_target methods.
9681 (Object::sized_target): Remove.
9682 (class Sized_relobj): Update declarations. Remove sized_target.
9683 * object.cc (Sized_relobj::setup): Remove target parameter.
9684 Change all callers.
9685 (Input_objects::add_object): Don't do anything with the target.
9686 (make_elf_sized_object): Add punconfigured parameter. Change all
9687 callers. Set or test parameter target.
9688 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9689 Change all callers.
9690 * parameters.cc (Parameters::set_target): Change parameter type to
9691 be non-const.
9692 (Parameters::default_target): Remove.
9693 (set_parameters_target): Change parameter type to be non-const.
9694 (parameters_force_valid_target): New function.
9695 (parameters_clear_target): New function.
9696 * parameters.h (class Parameters): Update declarations. Remove
9697 default_target method. Add sized_target and clear_target
9698 methods. Change target_ to be non-const.
9699 (set_parameters_target): Update declaration.
9700 (parameters_force_valid_target): Declare.
9701 (parameters_clear_target): Declare.
9702 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9703 as NULL if we aren't searching.
9704 (Add_symbols::run): Don't check for compatible target.
9705 * fileread.cc (Input_file::open_binary): Call
9706 parameters_force_valid_target.
9707 * gold.cc (queue_middle_tasks): Likewise.
9708 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9709 set_target on object.
9710 * dynobj.h (class Sized_dynobj): Update declarations.
9711 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9712 make_elf_object returns NULL.
9713 (Archive::include_member): Don't check whether object target is
9714 compatible.
9715 * output.cc (Output_section::add_input_section): Get target from
9716 parameters.
9717 (Output_section::relax_input_section): Likewise.
9718 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9719 parameters.
9720 (Sized_relobj::do_scan_relocs): Likewise.
9721 (Sized_relobj::relocate_sections): Likewise.
9722 * resolve.cc (Symbol_table::resolve): Likewise.
9723 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9724 parameter. Change all callers.
9725 (Symbol_table::add_from_object): Get target from parameters.
9726 (Symbol_table::add_from_relobj): Don't check object target.
9727 (Symbol_table::add_from_dynobj): Likewise.
9728 (Symbol_table::define_special_symbol): Get target from
9729 parameters.
9730 * symtab.h (class Symbol_table): Update declaration.
9731 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9732 parameter. Change all callers. Clear parameter target.
9733 (Binary_test): Test target here.
9734 * testsuite/object_unittest.cc (gold_testsuite): Remove
9735 target_test_pointer parameter. Change all callers.
9736 (Object_test): Test target here.
9737
a6a22b83
ILT
97382009-09-26 Ian Lance Taylor <iant@google.com>
9739
9740 * testsuite/initpri1.c: Don't try to use constructor priorities if
9741 compiling with gcc before 4.3.
9742
6a8f49fe
ILT
97432009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9744
9745 * testsuite/retain_symbols_file_test.sh (check_present): Change
9746 output file name to retain_symbols_file_test.stdout.
9747 (check_absent): Likewise.
9748
8c604651
CS
97492009-09-18 Craig Silverstein <csilvers@google.com>
9750
9751 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9752 * options.cc: Include <cerrno> and <fstream>.
9753 (General_options::finalize): Parse -retain-symbols-file tag.
9754 * options.h: New flag.
9755 (General_options): New method should_retain_symbol, new
9756 variable symbols_to_retain.
9757 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9758 should_retain_symbol map.
9759 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9760 * testsuite/Makefile.in: Regenerate.
9761 * testsuite/retain_symbols_file_test.sh: New file.
9762
ca58b19f
NC
97632009-09-18 Nick Clifton <nickc@redhat.com>
9764
9765 * po/es.po: Updated Spanish translation.
9766
20e6d0d6
DK
97672009-09-17 Doug Kwan <dougkwan@google.com>
9768
9769 * debug.h (DEBUG_RELAXATION): New constant.
9770 (DEBUG_ALL): Add DEBUG_RELAXATION.
9771 (debug_string_to_enum): Add relaxation debug option.
9772 * layout.cc
9773 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9774 Layout::Relaxation_debug_check::read_sections,
9775 Layout::Relaxation_debug_check::read_sections): New method definitions.
9776 (Layout::Layout): Initialize data members
9777 record_output_section_data_from_scrips_,
9778 script_output_section_data_list_ and relaxation_debug_check_.
9779 (Layout::save_segments, Layout::restore_segments,
9780 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9781 Layout::relaxation_loop_body): New method definitions.
9782 (Layout::finalize): Support relaxation. Move section layout code to
9783 Layout::relaxation_loop_body.
9784 (Layout::set_asection_address_from_script): Move code for orphan
9785 section placement out.
9786 (Layout::place_orphan_sections_in_script): New method definition.
9787 * layout.h (Output_segment_headers, Output_file_header):
9788 New forward class declarations.
9789 (Layout::~Layout): Define.
9790 (Layout::new_output_section_data_from_script): New method definition.
9791 (Layout::place_orphan_sections_in_script): New method declaration.
9792 (Layout::Segment_states): New type declaration.
9793 (Layout::save_segments, Layout::restore_segments,
9794 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9795 Layout::relaxation_loop_body): New method declarations.
9796 (Layout::Output_section_data_list): New type declaration.
9797 (Layout::Relaxation_debug_check): New class definition.
9798 (Layout::record_output_section_data_from_script_,
9799 Layout::script_output_section_data_list_, Layout::segment_states_,
9800 Layout::relaxation_debug_check_): New data members.
9801 * output.cc: (Output_section_headers::do_size): New method definition.
9802 (Output_section_headers::Output_section_headers): Move size
9803 computation to Output_section_headers::do_size.
9804 (Output_segment_headers::do_size): New method definition.
e1df38aa 9805 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9806 Output_file_header::do_size and call it.
9807 (Output_file_header::do_size): New method definition.
9808 (Output_data_group::Output_data_group): Adjust call to
9809 Output_section_data.
9810 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9811 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9812 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9813 RELAXED_INPUT_SECTION_CODE.
9814 (Output_section::Output_section): Initialize data member checkpoint_.
9815 (Output_section::~Output_section): Delete checkpoint object pointed
9816 by checkpoint_.
9817 (Output_section::add_input_section): Always add an Input_section if
9818 relaxing.
9819 (Output_section::add_merge_input_section): Add assert.
9820 (Output_section::relax_input_section): New method definition.
9821 (Output_section::set_final_data_size): Set load address to zero for
9822 an unallocated section.
9823 (Output_section::do_address_and_file_offset_have_reset_values):
9824 New method definition.
9825 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9826 Handle relaxed input section.
9827 (Output_section::sort_attached_input_sections): Checkpoint input
9828 section list lazily.
9829 (Output_section::get_input_sections): Change type of input_sections to
9830 list of Simple_input_section pointers. Checkpoint input section list
9831 lazily. Also handle relaxed input sections.
9832 (Output_section::add_input_section_for_script): Take a reference to
9833 a Simple_input_section object instead of Relobj pointer and section
9834 index as parameter. Handle relaxed input sections.
9835 (Output_section::save_states, Output_section::restore_states): New
9836 method definitions.
9837 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9838 (Output_data::is_data_size_fixed): New method definition.
9839 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9840 if it is fixed.
9841 (Output_data::address_and_file_offset_have_reset_values): New method
9842 definition.
9843 (Output_data::do_address_and_file_offset_have_reset_values): New method
9844 definition.
9845 (Output_data::set_data_size): Check that data size is not fixed.
9846 (Output_data::fix_data_size): New method definition.
9847 (Output_data::is_data_size_fixed_): New data member.
9848 (Output_section_headers::set_final_data_size): New method definition.
9849 (Output_section_headers::do_size): New method declaration.
9850 (Output_segment_headers::set_final_data_size): New method definition.
9851 (Output_segment_headers::do_size): New method declaration.
9852 (Output_file_header::set_final_data_size)::New method definition.
9853 (Output_file_header::do_size)::New method declaration.
9854 (Output_section_data::Output_section_data): Add new parameter
9855 is_data_size_fixed and use it to fix data size.
9856 (Output_data_const::Output_data_const): Adjust call to base class
9857 constructor and fix data size.
9858 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9859 base class constructor and fix data size.
9860 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9861 base class constructor and fix data size.
9862 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9863 class constructor and fix data size.
9864 (Output_data_group::set_final_data_size): New method definition.
9865 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9866 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9867 class constructor and fix data size.
9868 (Output_relaxed_input_section): New class definition.
9869 (Output_section::Simple_input_section): New class definition.
9870 (Output_section::get_input_sections): Adjust parameter list.
9871 (Output_section::add_input_section_for_script): Same.
9872 (Output_section::save_states, Output_section::restore_states,
9873 Output_section::do_address_and_file_offset_have_reset_values,
9874 (Output_section::Input_section::Input_section): Handle
9875 RELAXED_INPUT_SECTION_CODE. Add new overload for
9876 Output_relaxed_input_section.
9877 (Output_section::Input_section::is_input_section,
9878 Output_section::Input_section::set_output_section): Handle relaxed
9879 input section.
9880 (Output_section::Input_section::is_relaxed_input_section,
9881 Output_section::Input_section::output_section_data,
9882 Output_section::Input_section::relaxed_input_section): New method
9883 definitions.
9884 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9885 value.
9886 (Output_section::Input_section::u1_): Update comments.
9887 (Output_section::Input_section::u2_): Add new union member poris.
9888 (Output_section::Checkpoint_output_section): New classs definition.
9889 (Output_section::relax_input_section): New method declaration.
9890 (Output_section::checkpoint_): New data member.
9891 (Output_segment): Update comments.
9892 (Output_segment::Output_segment): Un-privatize copy constructor.
9893 (Output_segment::operator=): Un-privatize.
9894 * script-sections.cc (Output_section_element::Input_section_list):
9895 Change element type to Output_section::Simple_input_section.
9896 (Output_section_element_dot_assignment::set_section_addresses):
9897 Register output section data for relaxation clean up.
9898 (Output_data_exression::Output_data_expression): Adjust call to base
9899 constructor to fix data size.
9900 (Output_section_element_data::set_section_addresses): Register
9901 Output_data_expression object for relaxation clean up.
9902 (struct Input_section_info): Replace Relobj pointer and section index
9903 pair with Output_section::Simple_input_section and Convert struct to a
9904 class.
9905 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9906 Input_section_info data member to use accessors.
20e6d0d6
DK
9907 (Output_section_element_input::set_section_addresses): Use layout
9908 parameter. Adjust code to use Output_section::Simple_input_section
9909 and Input_secction_info classes. Register filler for relaxation
9910 clean up.
9911 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9912 and section index pair with Output_section::Simple_input_section
9913 class. Adjust code accordingly.
9914 (Phdrs_element::release_segment): New method definition.
9915 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9916 segment list.
9917 (Script_sections::release_segments): New method definition.
9918 * gold/script-sections.h (Script_sections::release_segments): New
9919 method declaration.
9920 * gold/target.h (Target::may_relax, Target::relax,
9921 Target::do_may_relax, Target::do_relax): New method definitions.
9922
5e445df6
ILT
99232009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9924
9925 * arm.cc (has_signed_unsigned_overflow): New function.
9926 (Arm_relocate_functions::abs8): New function.
9927 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9928 (Target_arm::Scan::global): Likewise.
9929 (Target_arm::relocate::relocate): Likewise.
9930 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9931 Likewise.
9932
8c604651 99332009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9934
9935 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9936 * testsuite/Makefile.in: Regenerate.
9937
1e9cc1c2
NC
99382009-09-11 Nick Clifton <nickc@redhat.com>
9939
9940 * po/gold.pot: Updated by the Translation project.
9941
6a89f575
CC
99422009-09-08 Cary Coutant <ccoutant@google.com>
9943
9944 * output.cc (Output_file::open): Add execute permission to empty file.
9945 * testsuite/Makefile.am (permission_test): New test.
9946 * testsuite/Makefile.in: Regenerate.
9947
fdcac5af
ILT
99482009-09-02 Ian Lance Taylor <iant@google.com>
9949
9950 * output.cc (Output_file::resize): Call map_no_anonymous rather
9951 than map.
9952
44453f85
ILT
99532009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9954
9955 * gold.cc: Include "incremental.h".
9956 (queue_initial_tasks): Call Incremental_checker methods.
9957 * incremental.cc: Include "output.h".
9958 (Incremental_checker::can_incrementally_link_output_file): New
9959 method.
9960 * incremental.h (Incremental_checker): New class.
9961
9962 * output.cc (Output_file::open_for_modification): New method.
9963 (Output_file::map_anonymous): Changed return type to bool. Record
9964 map in base_ field.
9965 (Output_file::map_no_anonymous): New method, broken out of map.
9966 (Output_file::map): Use map_no_anonymous and map_anonymous.
9967 * output.h (class Output_file): Update declarations.
9968
293c1386
CC
99692009-08-24 Cary Coutant <ccoutant@google.com>
9970
9971 * options.h (Command_line::Pre_options): New class.
9972 (Command_line::pre_options): New member.
9973 * options.cc (gold::options::ready_to_register): New variable.
9974 (One_option::register_option): Do nothing if not registering options.
9975 Assert if same short option registered twice.
9976 (General_options::General_options): Turn off option registration when
9977 done constructing.
9978 (Command_line::Pre_options::Pre_options): New constructor.
9979
f773f3d2
CC
99802009-08-24 Cary Coutant <ccoutant@google.com>
9981
06a73cfe
CC
9982 * options.h (General_options::no_keep_memory): Remove incorrect
9983 short option.
f773f3d2 9984
a15af8e2
RW
99852009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9986
9987 * Makefile.am (am__skiplex, am__skipyacc): New.
9988 * Makefile.in: Regenerate.
9989
c462b41b
RW
99902009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9991
14ec8efd
RW
9992 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9993 (INCLUDES): ... this.
9994 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9995 (AM_CPPFLAGS): Renamed from ...
9996 (INCLUDE): ... this.
9997 * Makefile.in, testsuite/Makefile.in: Regenerate.
9998
81ecdfbb
RW
9999 * Makefile.in: Regenerate.
10000 * aclocal.m4: Likewise.
10001 * config.in: Likewise.
10002 * configure: Likewise.
10003 * testsuite/Makefile.in: Likewise.
10004
c462b41b
RW
10005 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10006 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10007 * Makefile.in: Regenerate.
10008 * testsuite/Makefile.in: Regenerate.
10009
2da73f13
CC
100102009-08-19 Cary Coutant <ccoutant@google.com>
10011
10012 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10013 symbols in shared libraries overridden by hidden or internal symbols
10014 in the main program.
10015
2db70501
CD
100162009-08-19 Chris Demetriou <cgd@google.com>
10017
10018 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10019 checking source file names in error messages.
10020
f733487b
DK
100212009-08-18 Doug Kwan <dougkwan@google.com>
10022
10023 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10024 an elcpp::Ehdr as parameter. Adjust call to set_target.
10025 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10026 an elfcpp::Ehdr as parameter.
10027 * object.cc (Object::set_target): Remove the version that looks up
10028 a target and sets it.
10029 (Sized_relobj::setup): Take a Target object instead of
10030 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10031 (make_elf_sized_object): Find target and ask target to
10032 make an ELF object.
10033 * object.h: (Object::set_target): Remove the version that looks up
10034 a target and sets it.
10035 (Sized_relobj::setup): Take a Target object instead of
10036 an elfcpp:Ehdr as parameter.
10037 * target.cc: Include dynobj.h.
10038 (Target::do_make_elf_object_implementation): New.
2e702c99 10039 (Target::do_make_elf_object): New.
f733487b
DK
10040 * target.h (Target::make_elf_object): New template declaration.
10041 (Target::do_make_elf_object): New method declarations.
10042 (Target::do_make_elf_object_implementation): New template declaration.
10043
cc70f101
ILT
100442009-08-14 Ian Lance Taylor <iant@google.com>
10045
10046 * gold.h (FUNCTION_NAME): Define.
10047 (gold_unreachable): Use FUNCTION_NAME.
10048
ef5e0cb1
ST
100492009-08-12 Sriraman Tallam <tmsriram@google.com>
10050
10051 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10052 symbol in the --keep-unique list is not found.
10053
48c187ce
ST
100542009-08-12 Sriraman Tallam <tmsriram@google.com>
10055
10056 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10057 been maked as --keep-unique.
10058 (Icf::unfold_section): New function.
10059 * icf.h (Icf::unfold_section): New function.
10060 * options.h (General_options::keep_unique): New option.
10061 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10062 * testsuite/Makefile.in: Regenerate.
10063 * testsuite/icf_keep_unique_test.sh: New file.
10064 * testsuite/icf_keep_unique_test.cc: New file.
10065
645afe0c
CC
100662009-08-12 Cary Coutant <ccoutant@google.com>
10067
10068 PR 10471
10069 * resolve.cc (Symbol_table::resolve): Check for references from
10070 dynamic objects to hidden and internal symbols.
10071 * testsuite/Makefile.am (hidden_test.sh): New test.
10072 * testsuite/Makefile.in: Regenerate.
10073 * testsuite/hidden_test.sh: New script.
10074 * testsuite/hidden_test_1.c: New test source.
10075 * testsuite/hidden_test_main.c: New test source.
10076
11af873f
DK
100772009-08-11 Doug Kwan <dougkwan@google.com>
10078
10079 * arm.cc: Update comments.
10080 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10081 segment to locate the .ARM.exidx section if present.
10082
b9f7d72d
DK
100832009-08-09 Doug Kwan <dougkwan@google.com>
10084
10085 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10086 patch.
10087
ddd3c53c
ST
100882009-08-07 Sriraman Tallam <tmsriram@google.com>
10089 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10090 compiler warnings.
10091
27721062
ST
100922009-08-06 Sriraman Tallam <tmsriram@google.com>
10093
10094 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10095 valid tls_segment only for non-debug-section relocations.
10096 * testsuite/Makefile.am: Add gc_tls_test.
10097 * testsuite/Makefile.in: Regenerate.
10098 * testsuite/gc_tls_test.cc: New file.
10099 * testsuite/gc_tls_test.sh: New file.
10100
ef15dade 101012009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10102
ef15dade
ST
10103 * icf.cc: New file.
10104 * icf.h: New file.
10105 * Makefile.am (CCFILES): Add icf.cc.
10106 (HFILES): Add icf.h
10107 * Makefile.in: Regenerate.
10108 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10109 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10110 section, symbol and addend information for the relocs.
10111 * gold.cc (queue_middle_tasks): Call identical code folding.
10112 * gold.h: Add defines for multimap.
10113 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10114 to the call of finalize_local_symbols.
10115 * main.cc (main): Create object of class Icf.
10116 * object.cc (Sized_relobj::do_layout): Allow this function to be
10117 called twice during icf.
10118 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10119 to sections marked as identical by icf.
10120 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10121 when available.
10122 (Sized_relobj::do_section_entsize): New function.
10123 * object.h (Object::section_entsize): New function.
10124 (Object::do_section_entsize): New pure virtual function.
10125 (Relobj::finalize_local_symbols): Add new parameter.
10126 (Relobj::do_section_entsize): New function.
10127 * options.h (General_options::icf): New option.
10128 (General_options::icf_iterations): New option.
10129 (General_options::print_icf_sections): New option.
10130 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10131 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10132 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10133 icf.
10134 * symtab.cc (Symbol_table::is_section_folded): New function.
10135 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10136 to sections marked as identical by icf.
10137 * symtab.h (Symbol_table::set_icf): New function.
10138 (Symbol_table::icf): New function.
10139 (Symbol_table::is_section_folded): New function.
10140 (Symbol_table::icf_): New data member.
10141 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10142 * testsuite/Makefile.am: Add commands to build icf_test.
10143 * testsuite/Makefile.in: Regenerate.
10144 * testsuite/icf_test.sh: New file.
10145 * testsuite/icf_test.cc: New file.
10146
c3b65ac4
CD
101472009-07-24 Chris Demetriou <cgd@google.com>
10148
10149 * layout.cc (is_compressible_debug_section): Fix incorrect
10150 comment about compressed section names.
10151
1caf2c51
ILT
101522009-07-20 Ian Lance Taylor <ian@airs.com>
10153
10154 PR 10419
10155 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10156
1ef4d87f
ILT
101572009-07-16 Ian Lance Taylor <iant@google.com>
10158
10159 PR 10400
10160 * layout.h: #include <map>.
10161 (class Kept_section): Change from struct to class. Add accessors
10162 and setters. Add section size to Comdat_group mapping. Change
10163 Comdat_group to std::map. Add is_comdat_ field. Add
10164 linkonce_size field in union.
10165 (class Layout): Update declaration of find_or_add_kept_section.
10166 Don't declare find_kept_object.
10167 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10168 parameter. Add object, shndx, is_comdat, and is_group_name
10169 parameters. Change all callers. Adjust for new Kept_section.
10170 (Layout::find_kept_object): Remove.
10171 * object.cc (Sized_relobj::include_section_group): Update use of
10172 Kept_section. Rename secnum to shndx. Only record
10173 Kept_comdat_section if sections are the same size.
10174 (Sized_relobj::include_linkonce_section): Update use of
10175 Kept_section. Only record Kept_comdat_section if sections are the
10176 same size. Set size of linkonce section.
10177 (Sized_relobj::map_to_kept_section): Update call to
10178 get_kept_comdat_section.
10179 * object.h (class Sized_relobj): Rename fields in
10180 Kept_comdat_section to drop trailing underscores; change object
10181 field to Relobj*. Change Kept_comdat_section_table to store
10182 struct rather than pointer.
10183 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10184 Add kept_object and kept_shndx parameters. Change all callers.
10185 (Sized_relobj::get_kept_comdat_section): Change return type to
10186 bool. Add kept_object and kept_shndx parameters. Change all
10187 callers.
10188 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10189 Layout::find_or_add_kept_section.
10190
37c3b7b0
ILT
101912009-07-09 Ian Lance Taylor <iant@google.com>
10192
10193 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10194 Reserve space in the hash table.
10195
98fa85cb
ILT
101962009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10197
10198 * fileread.cc (File_read::get_mtime): New method.
10199 * fileread.h (Timespec): New structure.
10200 (File_read::get_mtime): New method.
10201 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10202 Renamed from timestamp_nsec.
10203 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10204 Elf_Xword.
e1df38aa 10205 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10206 timestamp_nsec.
e1df38aa 10207 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10208 (Incremental_inputs::report_obejct): Save mtime; style fix.
10209 (Incremental_inputs::report_script): Save mtime; style fix.
10210 (Incremental_inputs::finalize_inputs): Style fix.
10211 (Incremental_inputs::finalize): Style fix.
10212 (Incremental_inputs::create_input_section_data): Store inputs
10213 mtime.
10214 * incremental.h (Incremental_inputs::report_script): Add mtime
10215 argument.
10216 (Incremental_inputs::Input_info::Input_info): Intialize only one
10217 union member.
10218 (Incremental_inputs::Input_info::archive): Move to nameless
10219 union.
10220 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10221 (Incremental_inputs::Input_info::script): Move to nameless union.
10222 (Incremental_inputs::mtime): New field.
10223 * script.cc (read_input_script): Pass file mtime to
10224 Incremental_input.
10225 * script.h (Script_info::inputs): Style fix.
10226
c9d70757
ILT
102272009-07-01 Ian Lance Taylor <ian@airs.com>
10228
10229 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10230 instead of 32.
10231
9c547ec3
ILT
102322009-06-24 Ian Lance Taylor <iant@google.com>
10233
10234 PR 10156
10235 * layout.cc (Layout::choose_output_section): If we find an
10236 existing section, update the flags.
10237 (Layout::create_notes): New function, broken out of
10238 Layout::finalize.
10239 (Layout::finalize): Don't create note sections.
10240 (Layout::create_note): Don't crash if linker script discards
10241 section.
10242 (Layout::create_gold_note): Likewise.
10243 (Layout::create_build_id): Likewise. Don't set
10244 after_input_sections on the section.
10245 (Layout::create_executable_stack_info): Remove target parameter.
10246 Change caller.
10247 * layout.h (class Layout): Declare create_notes. Update
10248 declaration of create_executable_stack_info.
10249 * gold.cc (queue_middle_tasks): Call create_notes.
10250 * output.cc (Output_section::update_flags_for_input_section): Move
10251 here from output.h. If SHF_ALLOC flag is newly set, mark address
10252 invalid.
10253 * output.h (Output_data::mark_address_invalid): New function.
10254 (class Output_section): Only declare, not define,
10255 update_flags_for_input_section. Remove set_flags.
10256
55458500
ILT
102572009-06-24 Ian Lance Taylor <iant@google.com>
10258
10259 * script-sections.cc (Output_section_definition::
10260 set_section_addresses): Rename shadowing local load_address to
10261 laddr.
10262
1307d6cd
ILT
102632009-06-24 Ian Lance Taylor <iant@google.com>
10264
10265 PR 10244
10266 * reloc.cc (relocate_sections): Skip empty relocation sections.
10267
ec3f783e
ILT
102682009-06-23 Ian Lance Taylor <iant@google.com>
10269
10270 PR 10156
10271 * layout.cc (Layout::create_note): Use choose_output_section
10272 rather than make_output_section.
10273
459c9f1c
ILT
102742009-06-23 Ian Lance Taylor <iant@google.com>
10275
10276 PR 10237
10277 * options.cc (General_options::parse_V): Set printed_version_.
10278 (General_options::General_options): Initialize printed_version_.
10279 * options.h (class General_options): Add printed_version_ field.
10280 * gold.cc (queue_initial_tasks): If there are no input files,
10281 don't give a fatal error if we printed the version information.
10282 (queue_middle_tasks): If using -r with a shared object, give a
10283 fatal error rather than an ordinary error.
10284
1518dc8f
ILT
102852009-06-23 Ian Lance Taylor <iant@google.com>
10286
10287 PR 10219
10288 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10289 (Layout::make_output_section): Set have_stabstr_section_ if we see
10290 a .stab*str section.
10291 (Layout::finalize): Call link_stabs_sections.
10292 (Layout::link_stabs_sections): New file.
10293 * layout.h (class Layout): Add have_stabstr_section_ field.
10294 Declare link_stabs_sections.
10295
3d857b98
DK
102962009-06-23 Doug Kwan <dougkwan@google.com>
10297
10298 * Makefile.am (libgold_a_LIBADD): New.
10299 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10300 * Makefile.in: Regenerate.
3d857b98
DK
10301 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10302 * configure: Regenerate.
10303 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10304 * fileread.cc: Include sys/state.h
10305 * gold.h: Declare memmem and strndup if found missing.
10306 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10307
0639a6f6
ILT
103082009-06-23 Ian Lance Taylor <iant@google.com>
10309
10310 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10311 * configure: Rebuild.
10312
8d63875c
ILT
103132009-06-23 Ian Lance Taylor <iant@google.com>
10314
10315 PR 10147
10316 * object.cc (Object::section_contents): Don't try to get a view if
10317 the section has length zero.
10318 (Object::handle_gnu_warning_section): If the section is empty, use
10319 the name of the section as the warning.
10320
f7c8a183
ILT
103212009-06-23 Ian Lance Taylor <iant@google.com>
10322
10323 PR 10133
10324 * stringpool.h (class Stringpool_template): Add optimize_ field.
10325 (Stringpool_template::set_optimize): New function.
10326 * stringpool.cc (Stringpool_template::Stringpool_template):
10327 Initialize optimize_ field.
10328 (Stringpool_template::set_string_offsets): Test local optimize
10329 fild rather than parameter.
10330 * layout.cc (Layout::Layout): Call set_optimize on the section
10331 name stringpool.
10332
e6a307ba
ILT
103332009-06-22 Ian Lance Taylor <iant@google.com>
10334
10335 PR 10030
10336 * yyscript.y: Parse TARGET.
10337 * script.cc (script_set_target): New function.
10338 * script-c.h (script_set_target): Declare.
10339 * options.cc (General_options::string_to_object_format): Rename
10340 from string_to_object_format in anonymous namespace. Change
10341 callers.
10342 * options.h (class General_options): Declare
10343 string_to_object_format.
10344
3ee173de
ILT
103452009-06-22 Ian Lance Taylor <iant@google.com>
10346
10347 * script-sections.cc (Script_sections::create_segments): Don't put
10348 program headers in a PT_LOAD segment if -n or -N.
10349
103502009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10351
10352 PR 10141
10353 * options.h (class General_options): Add -z lazy and -z now. Sort
10354 -z options into alphabetical order.
10355 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10356
cd6739a1 103572009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10358
10359 * layout.cc (Layout::make_output_section): Call
10360 Target::new_output_section.
10361 (Layout::attach_allocated_section_to_segment): Put large section
10362 sections in a separate load segment with the large segment flag
10363 set.
10364 (Layout::segment_precedes): Sort large data segments after other
10365 load segments.
10366 (align_file_offset): New static function.
10367 (Layout::set_segment_offsets): Use align_file_offset.
10368 * output.h (class Output_section): Add is_small_section_ and
10369 is_large_section_ fields.
10370 (Output_section::is_small_section): New function.
10371 (Output_section::set_is_small_section): New function.
10372 (Output_section::is_large_section): New function.
10373 (Output_section::set_is_large_section): New function.
10374 (Output_section::is_large_data_section): New function.
10375 (class Output_segment): Add is_large_data_segment_ field.
10376 (Output_segment::is_large_data_segment): New function.
10377 (Output_segment::set_is_large_data_segment): New function.
10378 * output.cc (Output_section::Output_section): Initialize new
10379 fields.
10380 (Output_segment::Output_segment): Likewise.
10381 (Output_segment::add_output_section): Add assertion that large
10382 data sections always go in large data segments. Force small data
10383 sections to the end of the list of data sections. Force small BSS
10384 sections to the start of the list of BSS sections. For large BSS
10385 sections to the end of the list of BSS sections.
10386 * symtab.h (class Symbol): Declare is_common_shndx.
10387 (Symbol::is_defined): Check Symbol::is_common_shndx.
10388 (Symbol::is_common): Likewise.
10389 (class Symbol_table): Define enum Commons_section_type. Update
10390 declarations. Add small_commons_ and large_commons_ fields.
10391 * symtab.cc (Symbol::is_common_shndx): New function.
10392 (Symbol_table::Symbol_table): Initialize new fields.
10393 (Symbol_table::add_from_object): Put small and large common
10394 symbols in the right list.
10395 (Symbol_table::sized_finalized_symbol): Check
10396 Symbol::is_common_shndx.
10397 (Symbol_table::sized_write_globals): Likewise.
10398 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10399 common symbol lists. Don't call do_allocate_commons_list if the
10400 list is empty.
10401 (Symbol_table::do_allocate_commons_list): Remove is_tls
10402 parameter. Add comons_section_type parameter. Change all
10403 callers. Handle small and large common symbols.
10404 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10405 Symbol::is_common_shndx.
10406 * resolve.cc (symbol_to_bits): Likewise.
10407 * target.h (Target::small_common_shndx): New function.
10408 (Target::small_common_section_flags): New function.
10409 (Target::large_common_shndx): New function.
10410 (Target::large_common_section_flags): New function.
10411 (Target::new_output_section): New function.
10412 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10413 small_common_section_flags, and large_common_section_flags
10414 fields.
10415 (Target::do_new_output_section): New virtual function.
10416 * arm.cc (Target_arm::arm_info): Initialize new fields.
10417 * i386.cc (Target_i386::i386_info): Likewise.
10418 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10419 Likewise.
10420 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10421 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10422 (Target_x86_64::do_new_output_section): New function.
10423 * configure.ac: Define conditional MCMODEL_MEDIUM.
10424 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10425 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10426 (large_LDFLAGS): Define.
10427 * testsuite/large.c: New file.
10428 * testsuite/testfile.cc (Target_test::test_target_info):
10429 Initialize new fields.
10430 * configure, testsuite/Makefile.in: Rebuild.
10431
bb04269c
DK
104322009-06-05 Doug Kwan <dougkwan@google.com>
10433
10434 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10435 * Makefile.in: Regenerate.
bb04269c
DK
10436 * i386.cc (class Target_i386): Define new virtual method to
10437 override do_is_local_label_name in parent.
10438 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10439 local symbols if --discard-locals or -X is given.
10440 * options.h (class General_options): Declare new options
10441 '--discard-locals' and '-X' for discarding locals.
10442 * target.h (class Target): Define new methods is_local_label_name.
10443 Declare new virtual method do_is_local_label_name.
10444 * target.cc: New file.
10445 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10446 (check_SCRIPTS): Add discard_locals_test.sh.
10447 (check_DATA): Add discard_local_tests.syms.
10448 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10449 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10450 * testsuite/Makefile.in: Regenerate.
10451 * testsuite/discard_locals_test.c: New file.
10452 * testsuite/discard_locals_test.sh: Same.
10453
805bb01c
DK
104542009-06-05 Doug Kwan <dougkwan@google.com>
10455
10456 * object.cc (Sized_relobj::Sized_relobj): Initialize
10457 discarded_eh_frame_shndx_ to -1U.
10458 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10459 section.
10460 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10461 a discarded .eh_frame section.
10462 (Sized_relobj::do_finalize_local_symbols): Ditto.
10463 * object.h (class Sized_relobj): Declare new member
10464 discarded_eh_frame_shndx_.
10465 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10466 (local_labels_test.o, local_labels_test): New rules.
10467 * testsuite/Makefile.in: Regenerate.
10468
1dcd334d
DK
104692009-06-04 Doug Kwan <dougkwan@google.com>
10470
10471 * layout.cc (Layout::section_name_mapping): Add mapping for
10472 special ARM sections.
10473
96d49306
DK
104742009-06-03 Doug Kwan <dougkwan@google.com>
10475
10476 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10477 (utils::has_overflow): Same.
10478
dff16297
ILT
104792009-06-03 Ian Lance Taylor <iant@google.com>
10480
10481 * layout.cc (Layout::section_name_mapping): New array, replacing
10482 Layout::linkonce_mapping.
10483 (Layout::section_name_mapping_count): New variable, replacing
10484 Layout::linkonce_mapping_count.
10485 (Layout::linkonce_output_name): Remove.
10486 (Layout::output_section_name): Rewrite.
10487 * layout.h (class Layout): Rename Linkonce_mapping to
10488 Section_name_mapping, linkonce_mapping to section_name_mapping,
10489 linkonce_mapping_count to section_name_mapping_count. Don't
10490 declare linkonce_output_name.
10491
c121c671
DK
104922009-06-03 Doug Kwan <dougkwan@google.com>
10493
10494 * gold/arm.cc (namespace utils): New.
10495 (Target_arm::reloc_is_non_pic): Define new method.
10496 (class Arm_relocate_functions): New.
10497 (Target_arm::Relocate::relocate): Handle relocation types used by
10498 Android.
10499
07800fab
ILT
105002009-06-03 Ian Lance Taylor <iant@google.com>
10501
10502 * arm.cc (Target_arm::scan::global): Use || instead of |.
10503
c121c671
DK
105042009-06-02 Doug Kwan <dougkwan@google.com>
10505
10506 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10507 issued_non_pic_error_.
10508 (class Target_arm::Scan): Declare new method check_non_pic.
10509 Define new method symbol_needs_plt_entry.
10510 Declare new data member issued_non_pic_error_.
10511 (class Target_arm::Relocate): Declare new method
10512 should_apply_static_reloc.
10513 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10514 (Target_arm::Scan::check_non_pic): Define new method.
10515 (Target_arm::Scan::local): Handle a small subset of reloc types used
10516 by Android.
10517 (Target_arm::Scan::local): Same.
10518 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10519
b19b0c6d
ILT
105202009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10521
10522 * incremental.cc (Incremental_inputs::report_command_line): Filter
10523 out --incremental-* options.
10524
94cdfcff
DK
105252009-05-29 Doug Kwan <dougkwan@google.com>
10526
10527 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10528 template class.
10529 (class Target_arm): Update comment.
10530 (Target_arm::Target_arm): Initialize new data members GOT_,
10531 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10532 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10533 and Target_arm::rel_dyn_section.
10534 Declare new_enum Target_arm::Got_type.
10535 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10536 and DYNBSS_.
10537 Update commments for member do_dynsym_value.
10538 (Target_arm::got_size, Target_arm::plt_section,
10539 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10540 new methods inside class defintion.
10541 (Target_arm::got_section): Define new method.
10542 (Target_arm::rel_dyn_section): Same.
10543 (Output_data_plt_arm): New template class.
10544 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10545 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10546 (Output_data_plt_arm::add_entry): Same.
10547 (Output_data_plt_arm::first_plt_entry): Define new
10548 static data member for PLT instruction template.
10549 (Output_data_plt_arm::plt_entry): Same.
10550 (Output_data_plt_arm::do_write): Define new method.
10551 (Target_arm::make_plt_entry): Same.
10552 (Target_arm::do_finalize_sections): Same.
10553 (Target_arm::do_dynsym_value): Same.
10554
4a657b0d
DK
105552009-05-28 Doug Kwan <dougkwan@google.com>
10556
10557 * Makefile.am (TARGETSOURCES): Add arm.cc.
10558 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10559 * Makefile.in: Regenerate.
10560 * arm.cc: New file.
10561 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10562
e7ae8c36
DK
105632009-05-26 Doug Kwan <dougkwan@google.com>
10564
10565 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10566 (General_options::check_excluded_libs): Strip off directories in
10567 archive name before matching like GNU ld does.
10568 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10569 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10570 (exclude_libs_test_LDFLAGS): Add linker option
10571 -Wl,--exclude-libs,libexclude_libs_test_3
10572 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10573 an explicit archive without using -l.
10574 (alt/libexclude_libs_test_3.a): New make rule.
10575 * testsuite/Makefile.in: Regenerate.
10576 * testsuite/exclude_libs_test.c : Declare lib3_default().
10577 (main): Call it.
10578 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10579 * exclude_libs_test_3.c: New file.
10580
f12e7348
NC
105812009-05-26 Nick Clifton <nickc@redhat.com>
10582
10583 * po/id.po: New Indonesian translation.
10584 * po/gold.pot: Updated template file.
10585
4daadc0d
ST
105862009-05-22 Sriraman Tallam <tmsriram@google.com>
10587
e1df38aa 10588 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10589 gc_comdat_test files. Add -Wl,--gc-sections to build
10590 gc_comdat_test.
10591 * testsuite/Makefile.in: Regenerate.
10592 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10593
531813ad
ST
105942009-05-21 Sriraman Tallam <tmsriram@google.com>
10595
10596 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10597 kept comdat section was garbage collected.
10598 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10599 * testsuite/Makefile.in: Regenerate.
10600 * testsuite/gc_comdat_test.sh: New file.
10601 * testsuite/gc_comdat_test_1.cc: New file.
10602 * testsuite/gc_comdat_test_2.cc: New file.
10603
65514900
CC
106042009-05-19 Doug Kwan <dougkwan@google.com>
10605
10606 * archive.cc (Archive::Archive): Move constructor from archive.h
10607 to here. Initialize no_export_.
10608 (Archive::get_elf_object_for_member): Set no_export flag of object.
10609 * archive.h (Archive::Archive): Move constructor body to
10610 archive.cc.
10611 (Archive::no_export): New method.
10612 (Archive::no_export_): New field.
10613 * object.h (Object::Object): Initialize no_export_ to false.
10614 (Object::no_export, Object::set_no_export): New methods.
10615 (Object::no_export_): New field.
10616 * options.cc (General_options::parse_exclude_libs): New method.
10617 (General_options::check_excluded_libs) Same.
10618 * options.h (exclude_libs): New option.
10619 (General_options::check_excluded_libs): New method declaration.
10620 (General_options::excluded_libs_): New field.
10621 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10622 default or protected visibility if an object has no-export flag set.
10623 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10624 (check_SCRIPTS): Add exclude_libs_test.sh.
10625 (check_DATA): Add exclude_libs_test.syms.
10626 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10627 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10628 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10629 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10630 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10631 libexclude_libs_test_2.a): New rules.
10632 * testsuite/Makefile.in: Regenerate.
10633 * testsuite/exclude_libs_test.c: New file.
10634 * testsuite/exclude_libs_test.sh: Ditto.
10635 * testsuite/exclude_libs_test_1.c: Ditto.
10636 * testsuite/exclude_libs_test_2.c: Ditto.
10637
1b77ea50
ILT
106382009-05-15 Ian Lance Taylor <iant@google.com>
10639
10640 * configure.ac: Check for declarations for cases where libiberty.h
10641 checks HAVE_DECL_xxx.
10642 * configure, config.in: Rebuild.
10643
072fe7ce
ILT
106442009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10645
10646 * gold.h (Incremental_argument_list): Remove (invalid) forward
10647 declaration.
10648 * incremental.cc (Incremental_inputs::report_achive): New method.
10649 (Incremental_inputs::report_object): New method.
10650 (Incremental_inputs::report_script): New method.
10651 (Incremental_inputs::finalize_inputs): New method.
10652 (Incremental_inputs::finalize): Call finalize_inputs().
10653 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10654 Create inputs entries.
10655 * incremental.h (Incremental_input_type): New enum.
10656 (Incremental_inputs::Incremental_input): Initialize new fields.
10657 (Incremental_inputs::report_inputs): New method.
10658 (Incremental_inputs::report_achive): New method.
10659 (Incremental_inputs::report_object): New method.
10660 (Incremental_inputs::report_script): New method.
10661 (Incremental_inputs::finalize_inputs): New method.
10662 (Incremental_inputs::Input_info): New struct.
10663 (Incremental_inputs::Input_info_map): New typedef.
10664 (Incremental_inputs::lock_): New field.
10665 (Incremental_inputs::Inputs_): New field.
10666 (Incremental_inputs::Inputs_map): New field.
10667 * main.cc (main): Call Incremental_input::report_inputs.
10668 * options.h (Input_argument_list): Typedef moved from
10669 Input_arguments.
10670 (Input_file_group::Files): Remove, use ::Input_argument_list.
10671 (Input_file_group::Input_argument_list): Remove, use
10672 ::Input_argument_list.
10673 * plugin.cc (Plugin_manager::add_input_file): Add error in
10674 incremental build.
10675 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10676 functions.
10677 * script.cc (read_input_script): Call
10678 Incremental_input::report_script.
10679 * script.h (Script_info): New class.
10680
b0481b0b
ILT
106812009-04-27 Ian Lance Taylor <iant@google.com>
10682
10683 * x86_64.cc (do_adjust_output_section): Set entsize to
10684 plt_entry_size.
10685
b22a5a41 106862009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10687
10688 * output.cc (Output_file::close): After short writes, continue
10689 writing from the correct offset in the buffer being written.
10690
40fde488
CD
106912009-04-23 Chris Demetriou <cgd@google.com>
10692
10693 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10694 * configure: Regenerate.
10695 * config.in: Regenerate.
10696 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10697 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10698
3ce2c28e
ILT
106992009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10700
10701 * incremental.cc (Incremental_inputs_header_data): Renamed from
10702 Incremental_input_header_data.
10703 (Incremental_inputs_header_data::data_size): New field.
10704 (Incremental_inputs_header_data::put_input_file_count): Renamed
10705 from input_file_count.
10706 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10707 from command_line_offset.
10708 (Incremental_inputs_header_data::put_reserved): Renamed from
10709 put_reserved.
10710 (Incremental_inputs_entry_data): Renamed from
10711 Incremental_input_entry_data.
10712 (Incremental_inputs_entry_data::data_size): New field.
10713 (Incremental_inputs::report_command_line): New method.
10714 (Incremental_inputs::finalize): New method.
10715 (Incremental_inputs::create_incremental_inputs_data): New method.
10716 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10717 * incremental.h: New file.
10718 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10719 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10720 incremental builds.
703d02da 10721 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10722 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10723 (Layout::create_incremental_info_sections): New method.
10724 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10725 * main.cc (main): Notify Incremental_input of the command line.
10726
e55bde5e
ILT
107272009-04-01 Ian Lance Taylor <iant@google.com>
10728 Mikolaj Zalewski <mikolajz@google.com>
10729
10730 * gold.h (reserve_unordered_map): Define, three versions, one for
10731 each version of Unordered_map.
10732 * layout.cc (Layout::Layout): Remove options parameter. Add
10733 number_of_input_files parameter. Don't initialize options_.
10734 Initialize number_of_input_files_ and resized_signatures_. Move
10735 sections_are_attached_.
10736 (Layout::layout_group): Reserve space for group_signatures_.
10737 (Layout::find_or_add_kept_section): Change name parameter to be a
10738 reference. Resize signatures_ map when it gets large enough.
10739 (Layout::layout_eh_frame): Use parameters->options() instead of
10740 this->options_.
10741 (Layout::make_output_section): Likewise.
10742 (Layout::attach_allocated_section_to_segment): Likewise.
10743 (Layout::finalize, Layout::create_executable_stack): Likewise.
10744 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10745 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10746 * layout.h (class Layout): Update declarations. Remove options_
10747 field. Add number_of_input_files_ and resized_signatures_
10748 fields. Move sections_are_attached_ field.
10749 * main.cc (main): Pass number of input files to Layout
10750 constructor. Don't pass options.
10751
154b857c
ILT
107522009-03-30 Ian Lance Taylor <iant@google.com>
10753
10754 * ffsll.c (ffsll): Correct implementation.
10755
2f35ab9b
ILT
107562009-03-27 Ian Lance Taylor <iant@google.com>
10757
fd03461a
ILT
10758 * ffsll.c: New file.
10759 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10760 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10761 * ftruncate.c (ftruncate): Declare before definition.
10762 * mremap.c (mremap): Likewise.
10763 * pread.c (pread): Likewise.
10764 * configure, Makefile.in, config.in: Rebuild.
10765
2f35ab9b
ILT
10766 * mremap.c: New file.
10767 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10768 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10769 (mremap): Declare if HAVE_MREMAP is not defined.
10770 * configure, Makefile.in, config.in: Rebuild.
10771
33aea2fd
CC
107722009-03-27 Cary Coutant <ccoutant@google.com>
10773
10774 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10775 position independent.
10776 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10777 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10778
6d479619
CC
107792009-03-24 Cary Coutant <ccoutant@google.com>
10780
10781 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10782 an executable.
10783 (needs_dynamic_reloc): Likewise.
10784
afc06bb8
ILT
107852009-03-24 Ian Lance Taylor <iant@google.com>
10786
10787 * yyscript.y (file_cmd): Recognize EXTERN.
10788 (extern_name_list, extern_name_list_body): New nonterminals.
10789 * script.cc (script_add_extern): Define.
10790 * script-c.h (script_add_extern): Declare.
10791
f6060a4d
ILT
107922009-03-24 Rafael Avila de Espindola <espindola@google.com>
10793
10794 * object.cc (is_elf_object): Define.
10795 * object.h (is_elf_object): Declare.
10796 * archive.cc (Archive::get_elf_object_for_member): Call
10797 is_elf_object.
33aea2fd 10798 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10799
26736d8e
ILT
108002009-03-24 Elliott Hughes <enh@google.com>
10801
10802 * output.cc (Output_file::map_anonymous): Define.
10803 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10804 try an anonymous one. Report the size if the mmap fails.
10805 * output.h (class Output_file): Declare map_anonymous.
10806
22fd9730
ILT
108072009-03-24 Ian Lance Taylor <iant@google.com>
10808
10809 * target-select.cc (instantiate_target): Don't acquire the lock if
10810 the instantiated_target_ field has already been set.
10811
cb010894
ILT
108122009-03-23 Ian Lance Taylor <iant@google.com>
10813
7f055c20
ILT
10814 * gold-threads.h (class Initialize_lock): Define.
10815 * gold-threads.cc (class Initialize_lock_once): Define.
10816 (initialize_lock_control): New static variable.
10817 (initialize_lock_pointer): New static variable.
10818 (initialize_lock_once): New static function.
10819 (Initialize_lock::Initialize_lock): Define.
10820 (Initialize_lock::initialize): Define.
10821 * target-select.h: Include "gold-threads.h".
10822 (class Target_selector): Add lock_ and initialize_lock_ fields.
10823 Don't define instantiate_target, just declare it.
10824 * target-select.cc (Target_selector::Target_selector): Initialize
10825 new fields.
10826 (Target_selector::instantiate_target): Define.
10827 * descriptors.h: Include "gold-threads.h".
10828 (class Descriptors): Add initialize_lock_ field.
10829 * descriptors.cc (Descriptors::Descriptors): Initialize new
10830 field.
10831 (Descriptors::open): Use initialize_lock_ field
10832 * errors.h (class Errors): Add initialize_lock_ field.
10833 * errors.cc (Errors::Errors): Initialize new field.
10834 (Errors::initialize_lock): Use initialize_lock_ field.
10835 * powerpc.cc (class Target_selector_powerpc): Remove
10836 instantiated_target_ field. In do_recognize call
10837 instantiate_target rather than do_instantiate_target. In
10838 do_instantiate_target just allocate a new target.
10839 * sparc.cc (class Target_selector_sparc): Likewise.
10840
36959681
ILT
10841 * freebsd.h: New file.
10842 * i386.cc: Include "freebsd.h".
10843 (Target_i386): Derive from Target_freebsd rather than
10844 Sized_target.
10845 (Target_selector_i386): Derive from Target_selector_freebsd rather
10846 than Target_selector.
10847 * x86_64.cc: Include "freebsd.h".
10848 (Target_x86_64): Derive from Target_freebsd rather than
10849 Sized_target.
10850 (Target_selector_x86_64): Derive from Target_selector_freebsd
10851 rather than Target_selector.
10852 * target.h (class Target): Add adjust_elf_header and
10853 do_adjust_elf_header.
10854 * output.cc (Output_file_header:: do_sized_write): Call target
10855 adjust_elf_header routine.
10856 * configure.tgt: Set targ_osabi.
10857 * configure.ac: Define GOLD_DEFAULT_OSABI.
10858 * parameters.cc (Parameters::default_target): Pass
10859 GOLD_DEFAULT_OSABI to select_target.
10860 * target-select.h (class Target_selector): Make instantiate_target
10861 protected rather than private.
10862 * Makefile.am (HFILES): Add freebsd.h.
10863 * configure, Makefile.in, config.in: Rebuild.
10864
cb010894
ILT
10865 * merge.cc (do_add_input_section): Correct pend value. Change
10866 message about last entry not being null terminated from error to
10867 warning.
10868
0e879927
ILT
108692009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10870
10871 * incremental.cc: New file.
10872 * Makefile.am (CCFILES): Add incremental.cc.
10873 * Makefile.in: Rebuild.
10874
41105937
PP
108752009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10876
10877 * layout.cc (Layout::output_section_name): Preserve names
10878 of '.note.' sections.
e1df38aa 10879
60439920
ILT
108802009-03-19 Ian Lance Taylor <iant@google.com>
10881
10882 * descriptors.cc (Descriptors::open): Check that the options are
10883 valid before using them.
10884
0d371ad3
ILT
108852009-03-18 Ian Lance Taylor <iant@google.com>
10886
10887 * script-sections.h: Include <list>.
10888 (class Script_sections): Change Sections_elements from std::vector
10889 to std::list. Typedef public Elements_iterator. Add
10890 orphan_section_placement_, data_segment_align_start_, and
10891 saw_data_segment_align_ fields. Remove data_segment_align_index_
10892 field.
10893 * script-sections.cc (class Orphan_section_placement): New class.
10894 (class Sections_element): Add virtual functions is_relro and
10895 orphan_section_init. Remove virtual function place_orphan_here.
10896 (class Output_section_definition): Add is_relro and
10897 orphan_section_init. Remove place_orphan_here.
10898 (class Orphan_output_section): Likewise.
10899 (Script_sections::Script_sections): Update for field changes.
10900 (Script_sections::data_segment_align): Set saw_data_segment_align_
10901 and data_segment_align_start_, not data_segment_align_index.
10902 (Script_sections::data_segment_relro_end): Check
10903 saw_data_segment_align_. Use data_segment_align_start_ rather
10904 than data_segment_align_index_.
10905 (Script_sections::place_orphan): Rewrite to use
10906 Orphan_section_placement.
10907
9201d894
ILT
109082009-03-17 Ian Lance Taylor <iant@google.com>
10909
9c5b8369
ILT
10910 * archive.cc (Archive::add_symbols): Check for a version attached
10911 to the symbol name in the archive map.
10912 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10913 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10914 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10915 (ver_test_11.a): New target.
10916 * testsuite/Makefile.in: Rebuild.
10917
9201d894
ILT
10918 * configure.ac: Check for chsize and posix_fallocate. Replace
10919 ftruncate.
10920 * ftruncate.c: New file, from gnulib.
10921 * output.cc (posix_fallocate): Define dummy version if not
10922 HAVE_POSIX_FALLOCATE.
10923 (Output_file::map): Call posix_fallocate rather than lseek and
10924 write.
10925 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10926 * configure, Makefile.in, config.in: Rebuild.
10927
ef4ab7a8 109282009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10929
ef4ab7a8
PP
10930 * layout.h (Layout::create_note): Add section_name parameter.
10931 * layout.cc (Layout::create_note): Likewise.
10932 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10933
8c500701
ILT
109342009-03-17 Ian Lance Taylor <iant@google.com>
10935
e85b18e1
ILT
10936 * descriptors.cc: Include "options.h".
10937 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10938 (Descriptors::open): Always use O_CLOEXEC when opening a new
10939 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10940 then set FD_CLOEXEC.
10941
9efe6174
ILT
10942 * sparc.cc (class Target_sparc): Add has_got_section.
10943 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10944 make sure we have a GOT section.
10945
10946 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10947 (Target_sparc::Scan::local): Likewise.
10948 (Target_sparc::Scan::global): Likewise.
10949 (Target_sparc::Relocate::relocate): Likewise.
10950 (Target_sparc::Relocate::relocate_tls): Likewise.
10951
8c500701
ILT
10952 * symtab.cc (Symbol_table::define_default_version): New function,
10953 broken out of add_from_object.
10954 (Symbol_table::add_from_object): Call define_default_version.
10955 (Symbol_table::define_special_symbol): Add resolve_oldsym
10956 parameter. Change all callers. If the version for a symbol comes
10957 from a version script, resolve it with the symbol with the same
10958 name with no version. Also add the symbol without a version if
10959 appropriate.
10960 (do_define_in_output_data): If resolving with oldsym, don't delete
10961 sym.
10962 (do_define_in_output_segment): Likewise.
10963 (do_define_as_constant): Likewise.
10964 * symtab.h (class Symbol_table): Update declarations.
10965
f1ed28fb
ILT
109662009-03-13 Ian Lance Taylor <iant@google.com>
10967
15f8229b
ILT
10968 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10969 (Read_symbols::requeue): New function.
10970 (Read_symbols::do_read_symbols): If make_elf_object fails because
10971 the target type is not configured, and the file was searched for,
10972 issue a warning and retry with the next directory.
10973 (Add_symbols::run): If the file has an incompatible format, and
10974 it was searched for, requeue the Read_symbols task. On error,
10975 release the object.
10976 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10977 dirindex parameter to constructor. Change all callers. Declare
10978 incompatible_warning and requeue.
10979 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10980 input_argument_ and input_group_ fields. Add them to
10981 constructor. Change all callers.
10982 (class Read_script): Add dirindex_ field. Add it to constructor.
10983 Change all callers.
10984 * archive.cc (Archive::setup): Remove input_objects parameter.
10985 Change all callers.
10986 (Archive::get_file_and_offset): Likewise.
10987 (Archive::read_all_symbols): Likewise.
10988 (Archive::read_symbols): Likewise.
10989 (Archive::get_elf_object_for_member): Remove input_objects
10990 parameter. Add punconfigured parameter. Change all callers.
10991 (Archive::add_symbols): Change return type to bool. Check return
10992 value of include_member.
10993 (Archive::include_all_members): Likewise.
10994 (Archive::include_member): Change return type to bool. Return
10995 false if first included object has incompatible target. Set
10996 included_member_ field.
10997 (Add_archive_symbols::run): If add_symbols returns false, requeue
10998 Read_symbols task.
10999 * archive.h (class Archive): Add included_member_ field.
11000 Initialize it in constructor. Add input_file and searched_for
11001 methods. Update declarations.
11002 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11003 input_argument_ fields. Add them to constructor. Change all
11004 callers.
11005 * script.cc: Include "target-select.h".
11006 (class Parser_closure): Add skip_on_incompatible_target_ and
11007 found_incompatible_target_ fields. Add
11008 skip_on_incompatible_target parameter to constructor. Change all
11009 callers. Add methods skip_on_incompatible_target,
11010 clear_skip_on_incompatible_target, found_incompatible_target, and
11011 set_found_incompatible_target.
11012 (read_input_script): Add dirindex parameter. Change all callers.
11013 If parser finds an incompatible target, requeue Read_symbols
11014 task.
11015 (script_set_symbol): Clear skip_on_incompatible_target in
11016 closure.
11017 (script_add_assertion, script_parse_option): Likewise.
11018 (script_start_sections, script_add_phdr): Likewise.
11019 (script_check_output_format): New function.
11020 * script.h (read_input_script): Update declaration.
11021 * script-c.h (script_check_output_format): Declare.
11022 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11023 (ignore_cmd): Remove OUTPUT_FORMAT.
11024 * fileread.cc (Input_file::Input_file): Add explicit this.
11025 (Input_file::will_search_for): New function.
11026 (Input_file::open): Add pindex parameter. Change all callers.
11027 * fileread.h (class Input_file): Add input_file_argument method.
11028 Declare will_search_for. Update declarations.
11029 * object.cc (make_elf_object): Add punconfigured parameter.
11030 Change all callers.
11031 * object.h (class Object): Make input_file public. Add
11032 searched_for method.
11033 (make_elf_object): Update declaration.
11034 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11035 restart search.
11036 * dirsearch.h (class Dirsearch): Update declaration.
11037 * options.h (class General_options): Add --warn-search-mismatch.
11038 * parameters.cc (Parameters::is_compatible_target): New function.
11039 * parameters.h (class Parameters): Declare is_compatible_target.
11040 * workqueue.cc (Workqueue::add_blocker): New function.
11041 * workqueue.h (class Workqueue): Declare add_blocker.
11042
f1ed28fb
ILT
11043 * fileread.cc (Input_file::open): Remove options parameter.
11044 Change all callers.
11045 (Input_file::open_binary): Likewise.
11046 * script.cc (read_input_script): Likewise.
11047 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11048 options parameter from constructor. Change all callers.
11049 (class Read_script): Likewise.
11050 * fileread.h (class Input_file): Update declarations.
11051 * script.h (read_input_script): Update declaration.
11052
34dd024a
NC
110532009-03-10 Nick Clifton <nickc@redhat.com>
11054
11055 * po/es.po: New Spanish translation.
11056
6d71b17c
CC
110572009-03-06 Cary Coutant <ccoutant@google.com>
11058
11059 * options.cc (parse_short_option): Keep dash_z from registering itself.
11060
031cdbed
ILT
110612009-03-03 Ian Lance Taylor <iant@google.com>
11062
11063 PR 9918
11064 * target-reloc.h (relocate_section): Pass output_section to
11065 relocate.
11066 * i386.cc (Target_i386::should_apply_static_reloc): Add
11067 output_section parameter. Change all callers.
11068 (Target_i386::Relocate::relocate): Add output_section parameter.
11069 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11070 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11071 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11072 * testsuite/two_file_shared.sh: New script.
11073 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11074 (check_DATA): Add two_file_shared.dbg.
11075 (two_file_shared.dbg): New target.
11076 * testsuite/Makefile.in: Rebuild.
11077
15d5fa16
ILT
110782009-03-01 Ian Lance Taylor <iant@google.com>
11079
11080 * configure.ac: Check for byteswap.h.
11081 * configure: Rebuild.
11082 * config.in: Rebuild.
11083
8a4c0b0d
ILT
110842009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11085
11086 * layout.cc (Layout::find_or_add_kept_section): New function.
11087 (Layout::add_comdat): Removed.
11088 * layout.h (struct Kept_section): Move out of class Layout.
11089 Remove trailing underscores from field names. Add group_sections
11090 field. Rename group_ field to is_group. Change all uses.
11091 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11092 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11093 comdat_groups_ field.
11094 (Sized_relobj::include_section_group): Use
11095 find_or_add_kept_section and Kept_section::group_sections.
11096 (Sized_relobj::include_linkonce_section): Likewise.
11097 * object.cc (class Sized_relobj): Don't define Comdat_group or
11098 Comdat_group_table. Remove find_comdat_group and
11099 add_comdat_group. Remove comdat_groups_ field.
11100 * plugin.cc (include_comdat_group): Use
11101 Layout::find_or_add_kept_section.
11102
b4ecf66b
ILT
111032009-02-28 Ian Lance Taylor <iant@google.com>
11104
14359ca0
ILT
11105 * README: --gc-sections and map files are now supported. Document
11106 some build requirements.
11107
b4ecf66b
ILT
11108 PR 6992
11109 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11110 relocatable link set the value of the section symbol to zero.
11111 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11112 relocatable link don't include the section address in the local
11113 symbol value.
11114
0602e05a
ILT
111152009-02-27 Ian Lance Taylor <iant@google.com>
11116
fd9d194f
ILT
11117 PR 6811
11118 * options.h (class Search_directory): Add is_system_directory.
11119 (class General_options): Declare is_in_system_directory.
11120 * options.cc (get_relative_sysroot): Make static.
11121 (get_default_sysroot): Make static.
11122 (General_optoins::is_in_system_directory): New function.
11123 * fileread.cc (Input_file::is_in_system_directory): New function.
11124 * fileread.h (class Input_file): Declare is_in_system_directory.
11125 * object.h (class Object): Add is_in_system_directory.
11126 (class Input_objects): Remove system_library_directory_ field.
11127 * object.cc (Input_objects::add_object): Don't set
11128 system_library_directory_.
11129 (input_objects::found_in_system_library_directory): Remove.
11130 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11131 parameter. Change all callers.
11132 (Symbol_table::sized_write_globals): Likewise.
11133 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11134 Call Object::is_in_system_directory.
11135 * symtab.h (class Symbol_table): Update declarations.
11136
61edd21f
ILT
11137 PR 5990
11138 * descriptors.h (Open_descriptor): Add is_on_stack field.
11139 * descriptors.cc (Descriptors::open): If the descriptor is on the
11140 top of the stack, remove it. Initialize is_on_stack field.
11141 (Descriptors::release): Only add pod to stack if it is not on the
11142 stack already.
11143 (Descriptors::close_some_descriptor): Clear stack_next and
11144 is_on_stack fields.
11145
e29e076a
ILT
11146 PR 7091
11147 * output.cc (Output_section::find_starting_output_address): Rename
11148 from starting_output_address; add PADDR parameter; change return
11149 type.
11150 * output.h (class Output_section): Declare
11151 find_starting_output_address instead of starting_output_address.
11152 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11153 section symbol for which we can't find a merge section.
11154
0602e05a
ILT
11155 PR 9836
11156 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11157 hidden or internal, force the symbol to be local.
11158 * resolve.cc (Symbol::override_visibility): Define.
11159 (Symbol::override_base): Use override_visibility.
11160 (Symbol_table::resolve): Likewise.
11161 (Symbol::override_base_with_special): Likewise.
11162 (Symbol_table::override_with_special): If the visibility is hidden
11163 or internal, force the symbol to be local.
11164 * symtab.h (class Symbol): Add set_visibility and
11165 override_visibility.
11166 * testsuite/ver_test_1.sh: New file.
11167 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11168 (check_DATA): Add ver_test_1.syms.
11169 (ver_test_1.syms): New target.
11170 * testsuite/Makefile.in: Rebuild.
11171
401a9a73
CC
111722009-02-25 Cary Coutant <ccoutant@google.com>
11173
11174 * layout.cc (Layout::choose_output_section): Don't rename sections
11175 when using a linker script that has a SECTIONS clause.
11176 * Makefile.in: Regenerate.
11177
11178 * testsuite/Makefile.am (script_test_5.sh): New test case.
11179 * testsuite/Makefile.in: Regenerate.
11180 * testsuite/script_test_5.cc: New file.
11181 * testsuite/script_test_5.sh: New file.
11182 * testsuite/script_test_5.t: New file.
11183
f488e4b0
CC
111842009-02-13 Rafael Avila de Espindola <espindola@google.com>
11185
11186 * archive.cc (Archive::include_member): Update calls to add_symbols.
11187 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11188 the Layout argument.
11189 * dynobj.h (do_add_symbols): Add the Layout argument.
11190 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11191 Layout argument.
11192 * object.h (Object::add_symbols): Add the Layout argument.
11193 (Object::do_add_symbols): Add the Layout argument.
11194 (Sized_relobj::do_add_symbols): Add the Layout argument.
11195 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11196 Unify the two versions.
11197 (Add_plugin_symbols): Remove.
11198 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11199 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11200 (Add_plugin_symbols): Remove.
11201 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11202 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11203 (Add_symbols::run): Make it work with Pulginobj.
11204
89dd1680
ILT
112052009-02-06 Ian Lance Taylor <iant@google.com>
11206
11207 * object.cc (Sized_relobj::do_layout): Make info message start
11208 with lower case letter.
11209
266d0a74
ILT
112102009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11211
602b464e
ILT
11212 * binary.cc: Fix file comment.
11213
266d0a74
ILT
11214 * options.h (enum Incremental_disposition): Define.
11215 (class General_options): Add new options: --incremental,
11216 --incremental_changed, --incremental_unchanged,
11217 --incremental_unknown. Add incremental_disposition_ and
11218 implicit_incremental_ fields.
11219 (General_options::incremental_disposition): New function.
11220 (class Position_dependent_options): Add incremental_disposition
11221 option.
11222 (Position_dependent_options::copy_from_options): Set incremental
11223 dispositions.
11224 * options.cc (General_options::parse_incremental_changed): New
11225 function.
2e702c99
RM
11226 (General_options::parse_incremental_unchanged): New function.
11227 (General_options::parse_incremental_unknown): New function.
11228 (General_options::General_options): Initialize new fields
266d0a74 11229 incremental_disposition_ and implicit_incremental_.
2e702c99 11230 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11231 without --incremental.
11232
f073bbf7
CD
112332009-02-06 Chris Demetriou <cgd@google.com>
11234
11235 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11236 pointer and to report location as the file name associated with
11237 the symbol.
11238 (gold_undefined_symbol_at_location): New function to replace the
11239 old gold_undefined_symbol functionality.
11240 * target-reloc.h (relocate_section): Update to use
11241 gold_undefined_symbol_at_location.
11242 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11243 Call gold_undefined_symbol function rather than gold_error.
11244 * errors.h (Errors::undefined_symbol): Take location as a
11245 string, rather than calculating it from a relocation.
11246 * errors.cc (Errors::fatal): Print "fatal error:" before the
11247 formatted message.
11248 (Errors::error, Errors::error_at_location): Print "error: "
11249 before the formatted message.
11250 (Errors::undefined_symbol): Take location as a string, rather
11251 than calculating it from a relocation.
11252 (gold_undefined_symbol_at_location): New function akin to
11253 old gold_undefined_symbol, calculates location from relocation.
11254 (gold_undefined_symbol): Change to take only a Symbol pointer
11255 and to report location as the file name associated with the symbol.
11256 * testsuite/debug_msg.sh: Update for changed error messages.
11257 * testsuite/undef_symbol.sh: Likewise.
11258
8e94a90c
ILT
112592009-02-04 Duncan Sands <baldrick@free.fr>
11260
11261 PR 9812
11262 * reduced_debug_output.h
11263 (Output_reduced_debug_abbrev_section::failed): Use format for
11264 gold_warning.
11265 (Output_reduced_debug_info_section::faild): Likewise.
11266
88a0e15b
ILT
112672009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11268
11269 * script.cc (Lazy_demangler): New class.
2e702c99 11270 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11271 symbol only once.
11272
5efc7cd2
CC
112732009-01-29 Cary Coutant <ccoutant@google.com>
11274
11275 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11276 to __tls_get_addr.
11277 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11278
e0ebcf42
ILT
112792009-01-28 Ian Lance Taylor <iant@google.com>
11280
5efc7cd2 11281 * version.cc (version_string): Bump to 1.9.
75fe7426 11282
e0ebcf42
ILT
11283 * gold.h: Include <cstring> and <stdint.h>.
11284 * version.cc: Include <cstdio>.
11285 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11286 warning.
11287 * reduced_debug_output.cc (insert_into_vector): Rename from
11288 Insert_into_vector; change all callers. Use Swap_unaligned to
11289 avoid aliasing issue; remove union since it is unnecessary.
11290
8e2813be 112912009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11292
11293 * Makefile.am (CCFILES): Add gc.cc.
11294 (HFILES): Add gc.h.
11295 * Makefile.in: Regenerate.
11296 * gold.cc (Gc_runner): New class.
11297 (queue_initial_tasks): Call garbage collection related tasks
11298 when corresponding options are invoked.
11299 (queue_middle_gc_tasks): New function.
11300 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11301 processed early before laying out sections during garbage collection.
11302 * gold.h (queue_middle_gc_tasks): New function.
11303 (is_prefix_of): Move from "layout.cc".
11304 * i386.cc (Target_i386::gc_process_relocs): New function.
11305 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11306 * main.cc (main): Create object of class "Garbage_collection".
11307 * object.cc (Relobj::copy_symbols_data): New function.
11308 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11309 (Sized_relobj::do_layout): Allow this function to be called twice
11310 during garbage collection and defer layout of section during the
6d03d481
ST
11311 first call.
11312 * object.h (Relobj::get_symbols_data): New function.
11313 (Relobj::is_section_name_included): New function.
11314 (Relobj::copy_symbols_data): New function.
11315 (Relobj::set_symbols_data): New function.
11316 (Relobj::get_relocs_data): New function.
11317 (Relobj::set_relocs_data): New function.
11318 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11319 (Relobj::gc_process_relocs): New function.
11320 (Relobj::do_gc_process_relocs): New pure virtual function.
11321 (Relobj::sd_): New data member.
11322 (Sized_relobj::is_output_section_offset_invalid): New function.
11323 (Sized_relobj::do_gc_process_relocs): New function.
11324 * options.h (General_options::gc_sections): Modify to not be a no-op.
11325 (General_options::print_gc_sections): New option.
11326 * plugin.cc (Plugin_finish::run): Remove function call to
11327 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11328 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11329 * reloc.cc (Read_relocs::run): Add task to process relocs and
11330 determine unreferenced sections when doing garbage collection.
11331 (Gc_process_relocs): New class.
11332 (Sized_relobj::do_gc_process_relocs): New function.
11333 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11334 sections that are garbage collected.
11335 * reloc.h (Gc_process_relocs): New class.
11336 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11337 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11338 symbols whose corresponding sections are garbage collected.
11339 (Symbol_table::Symbol_table): Add new parameter for the garbage
11340 collection object.
11341 (Symbol_table::gc_mark_undef_symbols): New function.
11342 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11343 (Symbol_table::gc_mark_dyn_syms): New function.
11344 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11345 as garbage.
11346 (Symbol_table::add_from_object): Likewise.
11347 (Symbol_table::add_from_relobj): When building shared objects, do not
11348 treat externally visible symbols as garbage.
11349 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11350 table information for static and relocatable links.
11351 * symtab.h (Symbol_table::set_gc): New function.
11352 (Symbol_table::gc): New function.
11353 (Symbol_table::gc_mark_undef_symbols): New function.
11354 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11355 (Symbol_table::gc_mark_dyn_syms): New function.
11356 (Symbol_table::gc_): New data member.
e1df38aa 11357 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11358 function.
11359 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11360 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11361
3b293544
CF
113622009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11363
11364 * options.h (General_options::gc_sections): Define as a no-op for now.
11365 (General_options::no_keep_memory): Ditto.
11366 (General_options::Bshareable): Define.
11367 * options.cc (General_options::finalize): Honor -Bshareable.
11368
83d22aa8
AS
113692009-01-20 Andreas Schwab <schwab@suse.de>
11370
11371 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11372 read the value in the contents, since we don't use it. Use the
11373 template endianness when writing.
11374 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11375
cd536b21
AS
113762009-01-19 Andreas Schwab <schwab@suse.de>
11377
11378 * configure.tgt (powerpc64-*): Fix targ_obj.
11379
99e9a495
ILT
113802009-01-15 Ian Lance Taylor <iant@google.com>
11381
11382 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11383 local symbols when stripping all symbols.
11384
bbbfea06
CC
113852009-01-14 Cary Coutant <ccoutant@google.com>
11386
99e9a495 11387 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11388
0f7c0701
CC
113892009-01-14 Cary Coutant <ccoutant@google.com>
11390
11391 * archive.cc (Archive::get_elf_object_for_member): Remove call
11392 to File_read::claim_for_plugin.
11393 * descriptors.cc (Descriptors::open): Remove reference to
11394 is_claimed.
11395 (Descriptors::claim_for_plugin): Remove.
11396 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11397 (Descriptors::is_claimed): Remove.
11398 (claim_descriptor_for_plugin): Remove.
11399 * fileread.cc (File_read::claim_for_plugin): Remove.
11400 * fileread.h (File_read::claim_for_plugin): Remove.
11401 (File_read::descriptor): Reopen descriptor if necessary.
11402 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11403 (Plugin_manager::all_symbols_read): Add task parameter. Change
11404 all callers.
11405 (Plugin_manager::get_input_file): New function.
11406 (Plugin_manager::release_input_file): New function.
11407 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11408 corresponding data member.
11409 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11410 and pass to base constructor. Change all callers.
11411 (get_input_file, release_input_file): New functions.
11412 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11413 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11414 (Plugin_manager::all_symbols_read): Add task parameter.
11415 (Plugin_manager::get_input_file): New function.
11416 (Plugin_manager::release_input_file): New function.
11417 (Plugin_manager::task_): New data member.
11418 (Pluginobj::Pluginobj): Add filesize parameter.
11419 (Pluginobj::filename): New function.
11420 (Pluginobj::descriptor): New function.
11421 (Pluginobj::filesize): New function.
11422 (Pluginobj::filesize_): New data member.
11423 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11424 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11425 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11426
11427 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11428 with archive libraries.
11429 * testsuite/Makefile.in: Regenerate.
11430 * testsuite/plugin_test.c (struct sym_info): New type.
11431 (get_input_file, release_input_file): New static variables.
11432 (onload): Capture new transfer vector entries.
11433 (claim_file_hook): Stop reading at end of file according to filesize.
11434 Factor out parsing of readelf output into separate function.
11435 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11436 APIs and get the source file name from the symbol table. Convert
11437 source file name to corresponding object file name. Print info
11438 message when adding new input files.
11439 (parse_readelf_line): New function.
11440 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11441 * testsuite/plugin_test_2.sh: Likewise.
11442 * testsuite/plugin_test_3.sh: Likewise.
11443 * testsuite/plugin_test_4.sh: New test case.
11444
62a6d109
ILT
114452009-01-07 Ian Lance Taylor <iant@google.com>
11446
11447 * version.cc (version_string): Bump to 1.8.
11448
483620e8
CC
114492008-12-23 Cary Coutant <ccoutant@google.com>
11450
11451 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11452 * plugin.cc (Plugin_manager::finish): Rename as
11453 layout_deferred_objects. Move cleanup to separate function.
11454 (Plugin_manager::cleanup): New function.
11455 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11456 separately.
11457 * plugin.h (Plugin_manager::finish): Rename as
11458 layout_deferred_objects.
11459 (Plugin_manager::cleanup): New function.
11460 (Plugin_manager::cleanup_done): New field.
11461
d66a9eb3
CC
114622008-12-23 Cary Coutant <ccoutant@google.com>
11463
11464 * plugin.cc (is_visible_from_outside): New function.
11465 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11466 so we don't return "IR only" status for exported symbols or -r links.
11467
11468 * testsuite/Makefile.am (plugin_test_3): New test case.
11469 * testsuite/Makefile.in: Regenerate.
11470 * testsuite/plugin_test_3.sh: New file.
11471
5995b570
CC
114722008-12-22 Cary Coutant <ccoutant@google.com>
11473
11474 * object.cc (Sized_relobj::layout_section): New function.
11475 (Sized_relobj::do_layout): Defer layout of input sections until after
11476 plugin has provided replacement files.
11477 (Sized_relobj::do_layout_deferred_sections): New function.
11478 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11479 (Relobj::layout_deferred_sections): New function.
11480 (Relobj::do_layout_deferred_sections): New function.
11481 (Sized_relobj::do_layout_deferred_sections): New function.
11482 (Sized_relobj::layout_section): New function.
11483 (Sized_relobj::Deferred_layout): New structure.
11484 (Sized_relobj::deferred_layout_): New field.
11485 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11486 Change all callers. Layout deferred sections.
11487 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11488 references.
11489 (Plugin_hook::run): Move code from do_plugin_hook inline.
11490 (Plugin_hook::do_plugin_hook): Remove.
11491 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11492 (Plugin_manager::finish): Renamed, was cleanup.
11493 (Plugin_manager::should_defer_layout): New function.
11494 (Plugin_manager::add_deferred_layout_object): New function.
11495 (Plugin_manager::Deferred_layout_list): New type.
11496 (Plugin_manager::deferred_layout_objects_): New field.
11497 (Plugin_hook::do_plugin_hook): Remove.
11498
ee769c88
ILT
114992008-12-17 Ian Lance Taylor <iant@google.com>
11500
11501 * options.h (class General_options): Add --no case for
11502 --export-dynamic.
11503
abc8dcba
CC
115042008-12-16 Cary Coutant <ccoutant@google.com>
11505
11506 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11507 vector.
11508 (Plugin_manager::claim_file): Create plugin object even if
11509 plugin did not call the add_symbols callback.
11510 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11511 asking for more symbols than were added.
11512 * testsuite/Makefile.am (plugin_test_1): Add test case with
11513 no global symbols.
11514 (empty.syms): New target.
11515 * testsuite/Makefile.in: Regenerate.
11516 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11517 message. Don't call add_symbols if no globals.
11518 (all_symbols_read_hook): Don't provide replacement for empty
11519 claimed file.
11520
b0074644
ILT
115212008-12-12 Ian Lance Taylor <iant@google.com>
11522
68943102
ILT
11523 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11524 r_type == 0 for a local symbol with r_sym == 0.
11525 (scan_relocatable_relocs): Pass r_sym to
11526 local_non_section_strategy.
11527 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11528 r_sym parameter.
11529
b0074644
ILT
11530 * configure.ac: Update test for TLS descriptors: they are
11531 supported as of glibc 2.9.
11532 * configure: Rebuild.
11533
c2508178
ILT
115342008-12-11 Ian Lance Taylor <iant@google.com>
11535
11536 PR 7091
11537 * target-reloc.h (Default_scan_relocatable_relocs): For each
11538 function, map r_type == 0 to RELOC_DISCARD.
11539
2756a258
CC
115402008-12-10 Cary Coutant <ccoutant@google.com>
11541
11542 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11543 object to override a kept COMDAT group from a plugin object.
11544
bb6f53d3
ILT
115452008-12-09 Ian Lance Taylor <iant@google.com>
11546
fbc558e1
ILT
11547 PR 7088
11548 * yyscript.y (file_cmd): Handle INPUT.
11549
bb6f53d3
ILT
11550 * testsuite/initpri1.c: Change all declarations to be full
11551 prototypes by adding void, to avoid compiler warnings.
11552
4674ecfc
CC
115532008-12-05 Rafael Avila de Espindola <espindola@google.com>
11554
11555 * options.cc (General_options::parse_plugin_opt): New.
11556 (General_options::add_plugin): The argument now is just the filename.
11557 (General_options::add_plugin_option): New.
11558 * options.h (plugin_opt): New.
11559 (add_plugin): Change argument name.
11560 (add_plugin_option): New.
11561 * plugin.cc (Plugin::load): Don't parse the plugin option.
11562 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11563 (Plugin::add_option): New.
11564 (Plugin::args_): Change type.
11565 (Plugin::filename_): New.
11566 (Plugin_manager::add_plugin_option): New.
11567 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11568 * testsuite/Makefile.in: Regenerate.
11569
fd06b4aa
CC
115702008-12-05 Cary Coutant <ccoutant@google.com>
11571
11572 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11573 Handle --strip-lto-sections option.
11574 * options.h (strip_lto_sections): New option.
11575
6c52134c
CC
115762008-12-01 Cary Coutant <ccoutant@google.com>
11577
11578 * plugin.cc (ld_plugin_message): Change format parameter to const.
11579 Fix mismatch between new[] and delete.
11580
a45248e0
CC
115812008-11-14 Cary Coutant <ccoutant@google.com>
11582
11583 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11584 instead of -1U.
11585
c82fbeee
CS
115862008-11-05 Craig Silverstein <csilvers@google.com>
11587
11588 * options.cc (General_options::parse_dynamic_list): New function.
11589 * options.h (General_options): New flags dynamic_list,
11590 dynamic_list_data, dynamic_list_cpp_new, and
11591 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11592 (General_options::in_dynamic_list): New function.
11593 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11594 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11595 (Lex::can_continue_name): Likewise.
11596 (yylex): Likewise.
11597 (read_script_file): New parameter script_options.
11598 (read_dynamic_list): New function.
11599 (Script_options::define_dynamic_list): New function.
11600 (dynamic_list_keyword_parsecodes): New variable.
11601 (dynamic_list_keywords): New variable.
11602 * script.h (Script_options::define_dynamic_list): New function
11603 prototype.
11604 (read_dynamic_list): New function prototype.
11605 * symtab.cc (strprefix): New macro.
11606 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11607 dynamic_list_data, dynamic_list_cpp_new, and
11608 dynamic_list_cpp_typeinfo.
11609 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11610 (dynamic_list_expr): New rule.
11611 (dynamic_list_nodes): Likewise.
11612 (dynamic_list_node): Likewise.
11613 * testsuite/Makefile.am (dynamic_list): New test.
11614 * testsuite/Makefile.in: Regenerated.
11615 * testsuite/dynamic_list.t: New file.
11616 * testsuite/dynamic_list.sh: New file.
11617
e0bb29a5
CS
116182008-11-05 Craig Silverstein <csilvers@google.com>
11619
11620 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11621 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11622 (t11_last): Likewise.
11623 * testsuite/ver_test_6.c (main): Likewise.
11624
4e1e25e0
CC
116252008-10-07 Cary Coutant <ccoutant@google.com>
11626
11627 * options.c (General_options::finalize): Add check for -static and
11628 -shared.
11629 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11630 is not empty.
11631
92f03fcb
CC
116322008-10-02 Cary Coutant <ccoutant@google.com>
11633
11634 * plugin.cc (make_sized_plugin_object): Fix conditional
11635 compilation to work when not all targets are enabled.
11636
fbd8a257
CC
116372008-09-29 Cary Coutant <ccoutant@google.com>
11638
11639 * archive.cc (Archive::get_file_and_offset): Use filename instead
11640 of name to get library path.
11641 (Archive::include_member): Unlock external member of a thin archive.
11642
11643 * testsuite/Makefile.am (TEST_AR): New variable.
11644 (thin_archive_test_1): New test.
11645 (thin_archive_test_2): New test.
81636b3f
CC
11646 * testsuite/Makefile.in: Regenerate.
11647 * testsuite/thin_archive_main.cc: New file.
11648 * testsuite/thin_archive_test_1.cc: New file.
11649 * testsuite/thin_archive_test_2.cc: New file.
11650 * testsuite/thin_archive_test_3.cc: New file.
11651 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11652
eff45813
CC
116532008-09-29 Cary Coutant <ccoutant@google.com>
11654
11655 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11656 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11657 instead of -1U.
11658 (Sized_relobj::do_finalize_local_symbols): Likewise.
11659 (Sized_relobj::map_to_kept_section): Likewise.
11660 * object.h (Sized_relobj::invalid_address): New constant.
11661 (Sized_relobj::do_output_section_offset): Check for invalid_address
11662 and return -1ULL.
11663 * output.cc (Output_reloc::local_section_offset): Use constant
11664 invalid_address instead of -1U.
11665 (Output_reloc::get_address): Likewise.
11666 (Output_section::output_address): Change -1U to -1ULL.
11667 * output.h (Output_reloc::invalid_address): New constant.
11668 * reloc.cc (Sized_relobj::write_sections): Use constant
11669 invalid_address instead of -1U.
11670 (Sized_relobj::relocate_sections): Likewise.
11671 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11672 values for merge sections.
11673 * target-reloc.h (relocate_for_relocatable): Use constant
11674 invalid_address instead of -1U.
11675
89fc3421
CC
116762008-09-19 Cary Coutant <ccoutant@google.com>
11677
11678 Add plugin functionality for link-time optimization (LTO).
11679 * configure.ac (plugins): Add --enable-plugins option.
11680 * configure: Regenerate.
11681 * config.in: Regenerate.
11682 * Makefile.am (LIBDL): New variable.
11683 (CCFILES): Add plugin.cc.
11684 (HFILES): Add plugin.h.
11685 (ldadd_var): Add LIBDL.
11686 * Makefile.in: Regenerate.
11687
11688 * archive.cc: Include "plugin.h".
11689 (Archive::setup): Don't preread archive symbols when using a plugin.
11690 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11691 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11692 files.
11693 (Archive::include_member): Add symbols from plugin objects.
11694 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11695 * descriptors.cc (Descriptors::open): Check for file descriptors
11696 abandoned by plugins.
11697 (Descriptors::claim_for_plugin): New function.
11698 * descriptors.h (Descriptors::claim_for_plugin): New function.
11699 (Open_descriptor::is_claimed): New field.
11700 (claim_descriptor_for_plugin): New function.
11701 * fileread.cc (File_read::claim_for_plugin): New function.
11702 * fileread.h (File_read::claim_for_plugin): New function.
11703 (File_read::descriptor): New function.
11704 * gold.cc: Include "plugin.h".
11705 (queue_initial_tasks): Add task to call plugin hooks for generating
11706 new object files.
11707 * main.cc: Include "plugin.h".
11708 (main): Load plugin libraries.
11709 * object.h (Pluginobj): Declare.
11710 (Object::pluginobj): New function.
11711 (Object::do_pluginobj): New function.
11712 (Object::set_target): New function.
11713 * options.cc: Include "plugin.h".
11714 (General_options::parse_plugin): New function.
11715 (General_options::General_options): Initialize plugins_ field.
11716 (General_options::add_plugin): New function.
11717 * options.h (Plugin_manager): Declare.
11718 (General_options): Add --plugin option.
11719 (General_options::has_plugins): New function.
11720 (General_options::plugins): New function.
11721 (General_options::add_plugin): New function.
11722 (General_options::plugins_): New field.
11723 * plugin.cc: New file.
11724 * plugin.h: New file.
11725 * readsyms.cc: Include "plugin.h".
11726 (Read_symbols::do_read_symbols): Check for archive before checking
11727 for ELF file. Call plugin hooks to claim files.
11728 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11729 from a real object file; force override when processing replacement
11730 files.
11731 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11732 (Symbol::init_base_object): Likewise.
11733 (Symbol::init_base_output_data): Likewise.
11734 (Symbol::init_base_output_segment): Likewise.
11735 (Symbol::init_base_constant): Likewise.
11736 (Symbol::init_base_undefined): Likewise.
11737 (Symbol::output_section): Assert that object is not a plugin.
11738 (Symbol_table::add_from_pluginobj): New function.
11739 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11740 undefined.
11741 (Symbol_table::sized_write_globals): Likewise.
11742 (Symbol_table::add_from_pluginobj): Instantiate template.
11743 * symtab.h (Sized_pluginobj): Declare.
11744 (Symbol::in_real_elf): New function.
11745 (Symbol::set_in_real_elf): New function.
11746 (Symbol::in_real_elf_): New field.
11747 (Symbol_table::add_from_pluginobj): New function.
11748
11749 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11750 (LIBDL): New variable.
11751 (LDADD): Add LIBDL.
11752 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11753 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11754 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11755 (MOSTLYCLEANFILES): Likewise.
11756 * testsuite/Makefile.in: Regenerate.
11757 * testsuite/plugin_test.c: New file.
11758 * testsuite/plugin_test_1.sh: New file.
11759 * testsuite/plugin_test_2.sh: New file.
11760
de31bda5
ILT
117612008-09-16 Ian Lance Taylor <iant@google.com>
11762
9c2d0ef9
ILT
11763 * target-reloc.h (relocate_section): Check whether a symbol is
11764 defined by the ABI before reporting an undefined symbol error.
11765 * target.h (Target::is_defined_by_abi): Make parameter const.
11766 (Target::do_is_defined_by_abi): Likewise.
11767 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11768 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11769 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11770 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11771 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11772 * testsuite/Makefile.in: Rebuild.
11773
de31bda5
ILT
11774 * fileread.cc (make_view): Add casts to avoid warning.
11775
9fa33bee
AO
117762008-09-16 Alexandre Oliva <aoliva@redhat.com>
11777
11778 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11779 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11780
183fd0e3
AO
117812008-09-16 Alexandre Oliva <aoliva@redhat.com>
11782
11783 * options.h (General_options::output_is_executable): New.
11784 (General_options::output_is_pie): New.
11785 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11786 for shared libraries.
11787 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11788
7be8330a
CD
117892008-09-11 Chris Demetriou <cgd@google.com>
11790
11791 * options.h (origin): New -z option.
11792 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11793 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11794 in DT_FLAGS_1.
11795
a9caad02
CC
117962008-09-05 Cary Coutant <ccoutant@google.com>
11797
11798 * fileread.cc (File_read::make_view): Add check for attempt to map
11799 beyond end of file.
11800
ae6dce4d
CC
118012008-09-05 Cary Coutant <ccoutant@google.com>
11802
11803 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11804 explicit instantiations.
11805
d7ab2a47
KVH
118062008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11807
11808 PR gold/6858
11809 * options.cc (General_options::finalize): Allow undefined symbols
11810 in shlibs if linking -shared.
11811
11812 PR gold/6859
11813 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11814 symbols as not needing a dynsym entry.
11815
1e52a9c1
CS
118162008-08-20 Craig Silverstein <csilvers@google.com>
11817
11818 * fileread.cc (File_read::open): Do not lock the file unless it
11819 was successfully opened.
11820
d85c80a3
CC
118212008-08-14 Cary Coutant <ccoutant@google.com>
11822
11823 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11824 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11825 * testsuite/tls_test.cc (struct int128): 128-bit struct
11826 for testing TLS relocs with non-zero addend.
11827 (v12): New TLS variable.
11828 (t12): New test.
11829 (t_last): Add check for v12.
11830 * testsuite/tls_test.h (t12): New function.
11831 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11832
2d924fd9
ILT
118332008-08-13 Ian Lance Taylor <iant@google.com>
11834
11835 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11836 set tls_segment_ or relro_segment_.
11837 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11838 when appropriate.
11839 * output.h (Output_section::clear_is_relro): New function.
11840 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11841 sections specially even when output_data_ is empty.
11842 (Output_segment::maximum_alignment): When first section is relro,
11843 only force alignment for PT_LOAD segments.
11844 * script.cc (script_data_segment_align): New function.
11845 (script_data_segment_relro_end): New function.
11846 * script-c.h (script_data_segment_align): Declare.
11847 (script_data_segment_relro_end): Declare.
11848 * script-sections.h (class Script_sections): Declare
11849 data_segment_align and data_segment_relro_end. Add fields
11850 segment_align_index_ and saw_relro_end_.
11851 * script-sections.cc (class Sections_element): Add set_is_relro
11852 virtual function. Add new bool* parameter to place_orphan_here.
11853 Add get_output_section virtual function.
11854 (class Output_section_definition): Add set_is_relro. Add new
11855 bool* parameter to place_orphan_here. Add get_output_section.
11856 Add is_relro_ field.
11857 (Output_section_definition::Output_section_definition): Initialize
11858 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11859 and is_relro_ fields.
11860 (Output_section_definition::place_orphan_here): Add is_relro
11861 parameter.
11862 (Output_section_definition::set_section_addresses): Set relro for
11863 output section.
11864 (Output_section_definition::alternate_constraint): Likewise.
11865 (class Orphan_output_section): Add new bool* parameter to
11866 place_orphan_here. Add get_output_section.
11867 (Orphan_output_section::place_orphan_here): Add is_relro
11868 parameter.
11869 (Script_sections::Script_sections): Initialize
11870 data_segment_align_index_ and saw_relro_end_.
11871 (Script_sections::data_segment_align): New function.
11872 (Script_sections::data_segment_relro_end): New function.
11873 (Script_sections::place_orphan): Set or clear is_relro.
11874 (Script_sections::set_section_addresses): Force alignment of first
11875 TLS section.
11876 * yyscript.y (exp): Call script_data_segment_align and
11877 script_data_segment_relro_end.
11878 * testsuite/relro_script_test.t: New file.
11879 * testsuite/relro_test.cc (using_script): Declare.
11880 (t1, t2): Test using_script.
11881 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11882 (relro_script_test_SOURCES): Define.
11883 (relro_script_test_DEPENDENCIES): Define.
11884 (relro_script_test_LDFLAGS): Define.
11885 (relro_script_test_LDADD): Define.
11886 (relro_script_test.so): New target.
11887 * testsuite/Makefile.in: Rebuild.
11888
f827c9a9
CC
118892008-08-06 Cary Coutant <ccoutant@google.com>
11890
11891 * archive.cc (Archive::total_archives, Archive::total_members)
11892 (Archive::total_members_loaded): New variables.
11893 (Archive::setup): Add parameter. Add option to preread
11894 archive symbols.
11895 (Archive::read_armap): Add counter.
11896 (Archive::get_file_and_offset): New function.
11897 (Archive::get_elf_object_for_member): New function.
11898 (Archive::read_all_symbols): New function.
11899 (Archive::read_symbols): New function.
11900 (Archive::add_symbols): Add counters.
11901 (Archive::include_all_members): Use armap to find members if it's
11902 already built.
11903 (Archive::include_member): Skip reading symbols if already read.
11904 Factored code into Archive::get_file_and_offset and
11905 Archive::get_elf_object_for_member. Changed call to
11906 Mapfile::report_include_archive_member.
11907 (Archive::print_stats): New function.
11908 * archive.h: Declare Object and Read_symbols_data classes.
11909 (Archive::Archive): Add initializers for new members.
11910 (Archive::setup): Add parameter.
11911 (Archive::print_stats): New function.
11912 (Archive::total_archives, Archive::total_members)
11913 (Archive::total_members_loaded): New variables.
11914 (Archive::get_file_and_offset): New function.
11915 (Archive::get_elf_object_for_member): New function.
11916 (Archive::read_all_symbols): New function.
11917 (Archive::read_symbols): New function.
11918 (Archive::Archive_member): New class.
11919 (Archive::members_): New member.
11920 (Archive::num_members_): New member.
11921 * main.cc: Include archive.h.
11922 (main): Call Archive::print_stats.
11923 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11924 archive parameter; member_name is now the fully-decorated name.
11925 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11926 * options.h: (General_options): Add --preread-archive-symbols option.
11927 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11928 Archive::setup.
11929
de4c45bd
ILT
119302008-08-04 Ian Lance Taylor <iant@google.com>
11931
11932 * symtab.h (Symbol::use_plt_offset): New function.
11933 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11934 * powerpc.cc (Relocate::relocate): Likewise.
11935 * sparc.cc (Relocate::relocate): Likewise.
11936 * x86_64.cc (Relocate::relocate): Likewise.
11937 * testsuite/weak_plt.sh: New test.
11938 * testsuite/weak_plt_main.cc: New test.
11939 * testsuite/weak_plt_shared.cc: New test.
11940 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11941 (check_PROGRAMS): Add weak_plt.
11942 (check_DATA): Add weak_plt_shared.so.
11943 (weak_plt_main_pic.o, weak_plt): New targets.
11944 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11945 * testsuite/Makefile.in: Rebuild.
11946
11947 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11948 gcctestdir/ld.
11949 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11950 * testsuite/Makefile.in: Rebuild.
11951
323ee3f4
AM
119522008-08-04 Alan Modra <amodra@bigpond.net.au>
11953
11954 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11955 * Makefile.in: Regenerate.
11956 * po/POTFILES.in: Regenerate.
11957
7c07ecec
ILT
119582008-07-29 Ian Lance Taylor <iant@google.com>
11959
11960 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11961 symbols before other symbols.
11962 * testsuite/script_test_2.cc (test_addr): Declare.
11963 (test_addr_alias): Declare.
11964 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11965 values.
7c07ecec
ILT
11966 * testsuite/script_test_2.t: Define test_addr_alias and
11967 test_addr.
11968
5778530e
ILT
119692008-07-24 Ian Lance Taylor <iant@google.com>
11970
2a00e4fb
ILT
11971 PR 5990
11972 * descriptors.cc: New file.
11973 * descriptors.h: New file.
11974 * gold-threads.h (class Hold_optional_lock): New class.
11975 * fileread.cc: Include "descriptors.h".
11976 (File_read::~File_read): Release descriptor rather than closing
11977 it.
11978 (File_read::open) [file]: Call open_descriptor rather than open.
11979 Set is_descriptor_opened_.
11980 (File_read::open) [memory]: Assert that descriptor is not open.
11981 (File_read::reopen_descriptor): New function.
11982 (File_read::release): Release descriptor.
11983 (File_read::do_read): Make non-const. Reopen descriptor.
11984 (File_read::read): Make non-const.
11985 (File_read::make_view): Reopen descriptor.
11986 (File_read::do_readv): Likewise.
11987 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11988 Update declarations.
11989 * layout.cc: Include "descriptors.h".
11990 (Layout::create_build_id): Use open_descriptor rather than open.
11991 * output.cc: Include "descriptors.h".
11992 (Output_file::open): Use open_descriptor rather than open.
11993 * archive.cc (Archive::const_iterator): Change Archive to be
11994 non-const.
11995 (Archive::begin, Archive::end): Make non-const.
11996 (Archive::count_members): Likewise.
11997 * archive.h (class Archive): Update declarations.
11998 * object.h (Object::read): Make non-const.
11999 * Makefile.am (CCFILES): Add descriptors.cc.
12000 (HFILES): Add descriptors.h.
12001 * Makefile.in: Rebuild.
12002
801647d1
ILT
12003 PR 6716
12004 * gold.h: Always include <clocale>. Add Solaris workarounds
12005 following code in binutils/sysdep.h.
12006
5edd166e
ILT
12007 PR 6048
12008 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12009 this->eh_frame_hdr_ is NULL before using it.
12010
c89ad728
ILT
12011 * dynobj.cc (Versions::Versions): Update comment.
12012
aa86f06b
ILT
12013 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12014 the base version name.
12015
5778530e
ILT
12016 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12017 array size plus one.
12018 (Stringpool_template::set_string_offsets): Subtract one from key
12019 before using it as an array index.
12020 (Stringpool_template::get_offset_with_length): Likewise.
12021 (Stringpool_template::write_to_buffer): Likewise.
12022 * stringpool.h (Stringpool_template::get_offset_from_key):
12023 Likewise.
12024
057ead22
ILT
120252008-07-23 Ian Lance Taylor <iant@google.com>
12026
7f649c59
ILT
12027 PR 6658
12028 * object.h (Merged_symbol_value::value): Do our best to handle a
12029 negative addend.
12030
057ead22
ILT
12031 PR 6647
12032 * script.cc (Version_script_info::get_versions): Don't add empty
12033 version tag to return value.
12034 (Version_script_info::get_symbol_version_helper): Change return
12035 type to bool. Add pversion parameter. Change all callers.
12036 (script_register_vers_node): Don't require a non-NULL tag.
12037 * script.h (class Version_script_info): Update declarations.
12038 (Version_script_info::get_symbol_version): Change return type to
12039 bool. Add version parameter. Change all callers.
12040 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12041 handling. Handle an empty version from a version script.
12042 (Symbol_table::define_special_symbol): Likewise.
12043 * testsuite/ver_test_10.script: New file.
12044 * testsuite/ver_test_10.sh: New file.
12045 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12046 (check_DATA): Add ver_test_10.syms.
12047 (ver_test_10.syms, ver_test_10.so): New target.
12048 * testsuite/Makefile.in: Rebuild.
12049
58e54ac2
CD
120502008-07-23 Simon Baldwin <simonb@google.com>
12051
12052 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12053 to zero for undefined symbols from dynamic libraries.
12054
95d14cd3
ILT
120552008-07-23 Ian Lance Taylor <iant@google.com>
12056
12057 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12058 Change all callers.
12059 * symtab.h (class Symbol_table): Update declaration.
12060 * testsuite/ver_test_9.cc: New file.
12061 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12062 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12063 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12064 (ver_test_9.so, ver_test_9.o): New targets.
12065 * testsuite/Makefile.in: Rebuild.
12066
92de84a6
ILT
120672008-07-22 Ian Lance Taylor <iant@google.com>
12068
34810851
ILT
12069 * options.h (class General_options): Define --check-sections.
12070 * layout.cc (Layout::set_segment_offsets): Handle
12071 --check-sections.
12072
af6156ef
ILT
12073 * options.h (class General_options): Define -n/--nmagic and
12074 -N/--omagic.
12075 * options.cc (General_options::finalize): For -n/--nmagic or
12076 -N/--omagic, set -static.
12077 * layout.cc (Layout::attach_allocated_section_to_segment): If
12078 -N/--omagic, don't put read-only and read-write sections in
12079 different segments.
12080 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12081 finding a read-only segment.
12082 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12083 don't set the minimum segment alignment to the common page size,
12084 and don't set the file offset to the address modulo the page size.
12085 * script-sections.cc (Script_sections::create_segments): If
12086 -n/--omagic, don't put read-only and read-write sections in
12087 different segments.
12088
92de84a6
ILT
12089 * cref.cc: New file.
12090 * cref.h: New file.
12091 * options.h (class General_options): Add --print-symbol-counts.
12092 * main.cc (main): Issue defined symbol report if requested.
12093 * archive.cc (Archive::interpret_header): Make into a const member
12094 function.
12095 (Archive::add_symbols): Call Input_objects::archive_start and
12096 archive_stop.
12097 (Archive::const_iterator): Define new class.
12098 (Archive::begin, Archive::end): New functions.
12099 (Archive::include_all_members): Rewrite to use iterator.
12100 (Archive::count_members): New function.
12101 * archive.h (class Archive): Update declarations.
12102 (Archive::filename): New function.
12103 * object.cc: Include "cref.h".
12104 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12105 (Sized_relobj::do_get_global_symbol_counts): New function.
12106 (Input_objects::add_object): Add object to cross-referencer.
12107 (Input_objects::archive_start): New function.
12108 (Input_objects::archive_stop): New function.
12109 (Input_objects::print_symbol_counts): New function.
12110 * object.h: Declare Cref and Archive.
12111 (Object::get_global_symbol_counts): New function.
12112 (Object::do_get_global_symbol_counts): New pure virtual function.
12113 (class Sized_relobj): Add defined_count_ field. Update
12114 declarations.
12115 (class Input_objects): Add cref_ field. Update constructor.
12116 Update declarations.
12117 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12118 defined_count_.
12119 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12120 symbol counts.
12121 (Sized_dynobj::do_get_global_symbol_counts): New function.
12122 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12123 defined_count_. Update declarations. Define Symbols typedef.
12124 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12125 parameter. Change all callers.
12126 (Symbol_table::add_from_dynobj): Add sympointers and defined
12127 parameters. Change all callers.
12128 * symtab.h (class Symbol_table): Update declarations.
12129 * Makefile.am (CCFILES): Add cref.cc.
12130 (HFILES): Add cref.h.
12131 * Makefile.in: Rebuild.
12132
3f7c5e1d
CD
121332008-07-22 Simon Baldwin <simonb@google.com>
12134
12135 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12136 to zero when writing undefined symbols.
12137
e0b64032
ILT
121382008-07-22 Ian Lance Taylor <iant@google.com>
12139
12140 * output.cc (Output_section::add_input_section): Don't try to
12141 merge empty merge sections.
12142
096b02cf
CS
121432008-07-21 Craig Silverstein <csilvers@google.com>
12144
12145 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12146 Include symbol version in error message.
cd536b21 12147
1d1f116d
CD
121482008-07-20 Chris Demetriou <cgd@google.com>
12149
cd536b21 12150 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12151 (RANDOM_SEED_CFLAGS): New substituted variable.
12152 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12153 * configure: Rebuild.
12154 * Makefile.in: Likewise.
12155 * testsuite/Makefile.in: Likewise.
12156
a18f591e
ILT
121572008-07-18 Ian Lance Taylor <iant@google.com>
12158
12159 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12160 where we see NAME/NULL and NAME/VERSION as separate symbols.
12161 * testsuite/ver_test_main.cc (main): Call t4.
12162 (t4, t4_2a): Define.
12163 * testsuite/ver_test_2.cc (t4_2): Define.
12164 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12165 * testsuite/ver_test_4.cc (t4_2a): Define.
12166 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12167 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12168
c6e3f6ed
ILT
121692008-07-17 Ian Lance Taylor <iant@google.com>
12170
12171 * dynobj.cc (Versions::add_def): If we give an error about a
12172 missing version, go ahead and create the version anyhow.
12173
ef9beddf
ILT
121742008-07-10 Ian Lance Taylor <iant@google.com>
12175
12176 Handle output sections with more than 0x7fffffff bytes.
12177 * object.h (class Relobj): Change map_to_output_ to
12178 output_sections_, and just keep a section pointer. Change all
12179 uses. Move comdat group support to Sized_relobj.
12180 (Relobj::is_section_specially_mapped): Remove.
12181 (Relobj::output_section): Remove poff parameter. Change all
12182 callers.
12183 (Relobj::output_section_offset): New function.
12184 (Relobj::set_section_offset): Rewrite.
12185 (Relobj::map_to_output): Remove.
12186 (Relobj::output_sections): New function.
12187 (Relobj::do_output_section_offset): New pure virtual function.
12188 (Relobj::do_set_section_offset): Likewise.
12189 (class Sized_relobj): Add section_offsets_ field. Add comdat
12190 group support from Relobj. Update declarations.
12191 (Sized_relobj::get_output_section_offset): New function.
12192 (Sized_relobj::do_output_section_offset): New function.
12193 (Sized_relobj::do_set_section_offset): New function.
12194 * object.cc (Relobj::output_section_address): Remove.
12195 (Sized_relobj::Sized_relobj): Initialize new fields.
12196 (Sized_relobj::include_section_group): Cast find_kept_object to
12197 Sized_relobj.
12198 (Sized_relobj::include_linkonce_section): Likewise.
12199 (Sized_relobj::do_layout): Use separate arrays for output section
12200 and output offset.
12201 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12202 output_sections.
12203 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12204 output_sections and section_offsets.
12205 (Sized_relobj::write_local_symbols): Likewise.
12206 (map_to_kept_section): Compute output address directly.
12207 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12208 output_sections and section_offsets.
12209 (Sized_relobj::write_sections): Likewise.
12210 (Sized_relobj::relocate_sections): Likewise.
12211 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12212 * output.h (class Output_reloc): Update declarations. Change
12213 u2_.relobj to Sized_relobj*.
12214 (class Output_data_reloc): Change add functions to use
12215 Sized_relobj*.
12216 * output.cc (Output_reloc::Output_reloc): Change relobj to
12217 Sized_relobj*.
12218 (Output_reloc::local_section_offset): Change return type to
12219 Elf_Addr. Use get_output_section_offset.
12220 (Output_reloc::get_address): Likewise.
12221 (Output_section::is_input_address_mapped): Don't call
12222 is_section_specially_mapped.
12223 (Output_section::output_offset): Likewise.
12224 (Output_section::output_address): Likewise.
12225 (Output_section::starting_output_address): Likewise.
12226 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12227 parameter to Sized_relobj*.
12228 (Copy_relocs::need_copy_reloc): Likewise.
12229 (Copy_relocs::save): Likewise.
12230 * copy-relocs.h (class Copy_relocs): Update declarations.
12231 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12232 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12233 * target-reloc.h (relocate_for_relocatable): Change
12234 offset_in_output_section type to Elf_Addr. Change code that uses
12235 it as well.
12236 * layout.cc (Layout::layout): Always set *off.
12237 * mapfile.cc (Mapfile::print_input_section): Use
12238 output_section_offset.
12239 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12240 Sized_relobj*.
12241 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12242 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12243 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12244
5cb66f97
ILT
122452008-07-03 Ian Lance Taylor <iant@google.com>
12246
12247 * layout.cc (Layout::include_section): Do not discard unrecognized
12248 SHT_STRTAB sections.
12249
afe47622
CS
122502008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12251
12252 * script.cc (Lex::can_continue_name): Make '?' allowable in
12253 version-script names.
12254 * testsuite/version_script.map: Change glob pattern to use '?'
12255
5adf9721
ILT
122562008-06-30 Manish Singh <yosh@gimp.org>
12257
12258 PR 6585
12259 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12260 Correct typo.
12261
e6fde208
ILT
122622008-06-30 Ian Lance Taylor <iant@google.com>
12263
12264 PR 6660
12265 PR 6682
12266 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12267 versions]: Don't try to read the value in the contents, since we
12268 don't use it. Use the template endianness when writing.
12269
3f2e6a2d
CC
122702008-06-25 Cary Coutant <ccoutant@google.com>
12271
12272 * fileread.cc (File_read::make_view): Assert on zero-length view.
12273 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12274 symbol table when there are no symbols to read.
12275
c43d3a48
CS
122762008-06-23 Craig Silverstein <csilvers@google.com>
12277
12278 * version.cc (version_string): Bump to 1.7
12279
5f494ea0
CS
122802008-06-18 Craig Silverstein <csilvers@google.com>
12281
12282 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12283 constant 0xFFFF to type Valtype.
12284 (Powerpc_relocate_functions::rel16_ha): Likewise.
12285
c42e122e
ILT
122862008-06-17 Ian Lance Taylor <iant@google.com>
12287
f34787f8
ILT
12288 * output.h (Output_section::Input_section): Initialize p2align_ to
12289 zero for Output_section_data constructors.
12290 (Output_section::Input_section::addralign): If not an input
12291 section, return the alignment of the Output_section_data.
12292 * testsuite/copy_test.cc: New file.
12293 * testsuite/copy_test_1.cc: New file.
12294 * testsuite/copy_test_2.cc: New file.
12295 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12296 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12297 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12298 (copy_test_1_pic.o, copy_test_1.so): New targets.
12299 (copy_test_2_pic.o, copy_test_2.so): New targets.
12300 * testsuite/Makefile.in: Rebuild.
12301
c42e122e
ILT
12302 * script-sections.cc (Script_sections::place_orphan): Initialize
12303 local variable exact.
12304
ce3ac18a
DE
123052008-06-13 David Edelsohn <edelsohn@gnu.org>
12306
12307 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12308
42cacb20
DE
123092008-06-12 David Edelsohn <edelsohn@gnu.org>
12310 David S. Miller <davem@davemloft.net>
12311
12312 * powerpc.cc: New file.
12313 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12314 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12315 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12316 * Makefile.in: Rebuild.
12317
7b308235
ILT
123182008-06-09 Ian Lance Taylor <iant@google.com>
12319
12320 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12321 <exception>.
12322 (throwing, orig_terminate): New static variables.
12323 (terminate_handler): New static function.
12324 (t2): Set terminate handler.
12325
f0b886e3
ILT
123262008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12327
12328 PR 6584
cd536b21 12329 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12330 alignment.
12331
3e90f135
CC
123322008-05-30 Cary Coutant <ccoutant@google.com>
12333
12334 * archive.cc (Archive::include_all_members) Correct to step
12335 over symbol table and extended name table in thin archives.
12336
e09ad04a
ILT
123372008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12338
12339 PR 6407
12340 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12341 calculation.
12342
62b01cb5
ILT
123432008-05-28 Caleb Howe <cshowe@google.com>
12344
12345 * reduced_debug_output.cc: New file.
12346 * reduced_debug_output.h: New file.
92de84a6 12347 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12348 * options.cc (General_options::finalize): Add strip_debug_non_line
12349 to the strip heirarchy.
12350 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12351 fields.
12352 * layout.cc: Include "reduced_debug_output.h".
12353 (Layout::Layout): Initialize new fields.
12354 (line_only_debug_sections): New static array.
12355 (is_lines_only_debug_sections): New static inline function.
12356 (Layout::include_section): Handle --strip-debug-non-line.
12357 (Layout::make_output_section): If --strip-debug-non-line, build
12358 new output sections for .debug_abbrev and .debug_info.
12359 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12360 gold. Warn about possible overflow.
12361 (read_signed_LEB_128): Likewise.
12362 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12363 (read_signed_LEB_128): Declare.
12364 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12365 (HFILES): Add reduced_debug_output.h.
12366 * Makefile.in: Rebuild.
12367
7d9e3d98
ILT
123682008-05-21 Ian Lance Taylor <iant@google.com>
12369
12370 * mapfile.cc: New file.
12371 * mapfile.h: New file.
12372 * options.h (class General_options): Add -M/--print-map and -Map.
12373 * options.cc (General_options::finalize): Make -M equivalent to
12374 -Map -.
12375 * main.cc: Include <cstdio> and "mapfile.h".
12376 (main): Open mapfile if requested.
12377 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12378 constructor. Change caller.
12379 (queue_initial_tasks): Add mapfile parameter. Change caller.
12380 (queue_middle_tasks): Likewise.
12381 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12382 declarations.
12383 * archive.cc: Include "mapfile.h".
12384 (Archive::add_symbols): Add mapfile parameter. Change all
12385 callers. Pass mapfile, symbol, and reason to include_member.
12386 (Archive::include_all_members): Add mapfile parameter. Change all
12387 callers.
12388 (Archive::include_member): Add mapfile, sym, and why parameters.
12389 Change all callers. Report inclusion to map file.
12390 * archive.h: Include "fileread.h".
12391 (class Archive): Update declarations.
12392 (Archive::file): New const method.
12393 (class Add_archive_symbols): Add mapfile_ field. Update
12394 constructor. Change all callers.
12395 * readsyms.h (class Read_symbols): Likewise.
12396 (class Finish_group): Likewise.
12397 (class Read_script): Likewise.
12398 * common.cc: Include "mapfile.h".
12399 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12400 all callers.
12401 (Symbol_table::do_allocate_commons): Likewise.
12402 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12403 symbol allocation to mapfile.
12404 * common.h (class Allocate_commons_task): Add mapfile_ field.
12405 Update constructor. Change all callers.
12406 * symtab.h (class Symbol_table): Update declarations.
12407 * layout.cc: Include "mapfile.h".
12408 (Layout_task_runner::run): Print information to mapfile.
12409 (Layout::create_gold_note): Change Output_data_fixed_space to
12410 Output_data_zero_fill.
12411 (Layout::create_build_id): Likewise.
12412 (Layout::print_to_mapfile): New function.
12413 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12414 constructor. Change caller.
12415 (class Layout): Declare print_to_mapfile.
12416 * output.cc (Output_section::Input_section::print_to_mapfile): New
12417 function.
12418 (Output_section::add_input_section): If producing a map, always
12419 add to input_sections_ list.
12420 (Output_section::do_print_to_mapfile): New function.
12421 (Output_segment::print_sections_to_mapfile): New function.
12422 (Output_segment::print_section_list_to_mapfile): New function.
12423 * output.h: Include "mapfile.h".
12424 (Output_data::print_to_mapfile): New function.
12425 (Output_data::do_print_to_mapfile): New virtual function.
12426 (Output_segment_headers::do_print_to_mapfile): New function.
12427 (Output_file_header::do_print_to_mapfile): New function.
12428 (Output_data_const::do_print_to_mapfile): New function.
12429 (class Output_data_const_buffer): Add map_name_ field. Update
12430 constructor. Change all callers. Add do_print_to_mapfile
12431 function.
12432 (class Output_data_fixed_space): Likewise.
12433 (class Output_data_space): Likewise.
12434 (class Output_data_zero_fill): New class.
12435 (Output_data_strtab::do_print_to_mapfile): New function.
12436 (Output_data_reloc_base::do_print_to_mapfile): New function.
12437 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12438 (Output_data_group::do_print_to_mapfile): New function.
12439 (Output_data_got::do_print_to_mapfile): New function.
12440 (Output_data_dynamic::do_print_to_mapfile): New function.
12441 (Output_symtab_xindex::do_print_to_mapfile): New function.
12442 (class Output_section): Declare do_print_to_mapflie. Declare
12443 print_to_mapfile in Input_section.
12444 (class Output_segment): Declare new functions.
12445 * object.h (Sized_relobj::symbol_count): New function.
12446 * script-sections.cc
12447 (Output_section_element_dot_assignment::set_section_addresses):
12448 Change Output_data_fixed_space to Output_data_zero_fill.
12449 (Output_data_expression::do_print_to_mapfile): New function.
12450 * script.cc (read_input_script): Add mapfile parameter. Change
12451 all callers.
12452 * script.h (read_input_script): Update declaration.
12453 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12454 (Eh_frame::do_print_to_mapfile): New function.
12455 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12456 (Output_merge_string::do_print_to_mapfile): New function.
12457 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12458 function.
12459 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12460 function.
12461 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12462 function.
12463 * Makefile.am (CCFILES): Add mapfile.cc.
12464 (HFILES): Add mapfile.h.
12465 * Makefile.in: Rebuild.
12466
9f1d377b
ILT
124672008-05-19 Ian Lance Taylor <iant@google.com>
12468
12469 * options.h (class General_options): Add -z relro.
12470 * layout.cc (Layout::Layout): Initialize relro_segment_.
12471 (Layout::add_output_section_data): Return the output section.
12472 (Layout::make_output_section): Rcognize relro sections and mark
12473 them appropriately.
12474 (Layout::attach_allocated_section_to_segment): Put relro sections
12475 in a PT_GNU_RELRO segment.
12476 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12477 section as relro.
12478 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12479 PT_TLS segments.
12480 (Layout::linkonce_mapping): Map d.rel.ro.local to
12481 .data.rel.ro.local.
12482 (Layout::output_section_name): Us .data.rel.ro.local for any
12483 section which begins with that.
12484 * layout.h (class Layout): Update add_output_section_data
12485 declaration. Add relro_segment_ field.
12486 * output.cc (Output_section::Output_section): Initialize is_relro_
12487 and is_relro_local_ fields.
12488 (Output_segment::add_output_section): Group relro sections.
12489 (Output_segment::is_first_section_relro): New function.
12490 (Output_segment::maximum_alignment): If there is a relro section,
12491 align the segment to the common page size.
12492 (Output_segment::set_section_addresses): Track whether we are
12493 looking at relro sections. If the last section is a relro
12494 section, align to the common page size.
12495 (Output_segment::set_section_list_addresses): Add in_relro
12496 parameter. Change all callers. Align to the page size when
12497 moving from relro to non-relro section.
12498 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12499 segment.
12500 * output.h (class Output_section): Add is_relro_ and
12501 is_relro_local_ fields.
12502 (Output_section::is_relro): New function.
12503 (Output_section::set_is_relro): New function.
12504 (Output_section::is_relro_local): New function.
12505 (Output_section::set_is_relro_local): New function.
12506 (class Output_segment): Update declarations.
12507 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12508 * sparc.cc (Target_sparc::got_section): Likewise.
12509 * x86_64.cc (Target_x86_64::got_section): Likewise.
12510 * testsuite/relro_test_main.cc: New file.
12511 * testsuite/relro_test.cc: New file.
12512 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12513 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12514 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12515 (relro_test.so, relro_test_pic.o): New targets.
12516 * testsuite/Makefile.in: Rebuild.
12517
a984ee1d
ILT
125182008-05-16 Ian Lance Taylor <iant@google.com>
12519
01676dcd
ILT
12520 * output.cc (Output_segment::add_output_section): Remove front
12521 parameter.
12522 * output.h (class Output_segment): Remove
12523 add_initial_output_section and overloaded add_output_section.
12524 Update declaration of remaining add_output_section.
12525 * layout.cc (Layout::create_interp): Call add_output_section
12526 rather than add_initial_output_section.
12527 (Layout::finish_dynamic_section): Likewise.
12528
497897f9
ILT
12529 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12530 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12531 know the dynamic type.
12532 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12533 field. Initialize it in constructor.
12534 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12535 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12536 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12537 reloc.
12538
a984ee1d
ILT
12539 * output.cc (Output_reloc::get_address): Change return type to
12540 Elf_Addr.
12541 * output.h (class Output_reloc): Update get_address declaration.
12542 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12543 for section addresses.
12544
55ba0940
ILT
125452008-05-09 Ian Lance Taylor <iant@google.com>
12546
12547 PR 6493
12548 * gold.cc (gold_nomem): Use return value of write.
12549
75517b77
ILT
125502008-05-08 Ian Lance Taylor <iant@google.com>
12551
12552 * symtab.c (Symbol::init_base_output_data): Add version
12553 parameter. Change all callers.
12554 (Symbol::init_base_output_segment): Likewise.
12555 (Symbol::init_base_constant): Likewise.
12556 (Symbol::init_base_undefined): Likewise.
12557 (Sized_symbol::init_output_data): Likewise.
12558 (Sized_symbol::init_output_segment): Likewise.
12559 (Sized_symbol::init_constant): Likewise.
12560 (Sized_symbol::init_undefined): Likewise.
12561 (Symbol_table::do_define_in_output_data): If the new symbol has a
12562 version, mark it as the default.
12563 (Symbol_table::do_define_in_output_segment): Likewise.
12564 (Symbol_table::do_define_as_constant): Likewise.
12565 * symtab.h (class Symbol): Update declarations.
12566 (class Sized_symbol): Likewise.
12567 * resolve.cc (Symbol::override_version): New function.
c42e122e 12568 (Symbol::override_base): Call override_version.
75517b77
ILT
12569 (Symbol::override_base_with_special): Likewise.
12570 * testsuite/ver_script_8.script: New file.
12571 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12572 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12573 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12574 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12575
f1f70eae
ILT
125762008-05-06 Ian Lance Taylor <iant@google.com>
12577
f3e9c5c5
ILT
12578 PR 6049
12579 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12580 functions.
12581 (class General_options): Remove existing --undefined, and add
12582 --no-undefined instead. Add new --undefined as synonym for -u.
12583 * archive.cc (Archive::add_symbols): Check whether symbol was
12584 named with -u.
12585 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12586 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12587 all uses. Add IS_UNDEFINED. Update declarations to split
12588 different versions of init_base. Declare init_base_undefined.
12589 (Symbol::is_defined): Handle IS_UNDEFINED.
12590 (Symbol::is_undefined): Likewise.
12591 (Symbol::is_weak_undefined): Call is_undefined.
12592 (Symbol::is_absolute): Handle IS_CONSTANT.
12593 (class Sized_symbol): Update declarations to split different
12594 versions of init. Declare init_undefined.
12595 (class Symbol_table): Declare new functions.
12596 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12597 Change all callers.
12598 (Symbol::init_base_output_data): Likewise.
12599 (Symbol::init_base_output_segment): Likewise.
12600 (Symbol::init_base_constant): Likewise.
12601 (Symbol::init_base_undefined): New function.
12602 (Sized_symbol::init_object): Rename from init. Change all
12603 callers.
12604 (Sized_symbol::init_output_data): Likewise.
12605 (Sized_symbol::init_output_segment): Likewise.
12606 (Sized_symbol::init_constant): Likewise.
12607 (Sized_symbol::init_undefined): New function.
12608 (Symbol_table::add_undefined_symbols_from_command_line): New
12609 function.
12610 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12611 function.
12612 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12613 (Symbol::output_section): Likewise.
12614 (Symbol::set_output_section): Likewise.
12615 (Symbol_table::sized_finalize_symbol): Likewise.
12616 (Symbol_table::sized_write_globals): Likewise.
12617 * resolve.cc (Symbol_table::should_override): Likewise.
12618 (Symbol::override_base_with_special): Likewise.
12619
8bdcdf2c
ILT
12620 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12621 symbol, change it to have default visibility.
12622 * testsuite/protected_1.cc: New file.
12623 * testsuite/protected_2.cc: New file.
12624 * testsuite/protected_3.cc: New file.
12625 * testsuite/protected_main_1.cc: New file.
12626 * testsuite/protected_main_2.cc: New file.
12627 * testsuite/protected_main_3.cc: New file.
12628 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12629 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12630 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12631 (protected_1.so): New target.
12632 (protected_1_pic.o, protected_2_pic.o): New targets.
12633 (protected_3_pic.o): New target.
12634 (check_PROGRAMS): Add protected_2.
12635 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12636 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12637 * testsuite/Makefile.in: Rebuild.
12638
2b706932
ILT
12639 * options.h (DEFINE_var): Add set_user_set_##varname__.
12640 (DEFINE_bool_alias): New macro.
12641 (class General_options): Define -Bstatic using DEFINE_bool_alias
12642 rather than DEFINE_special. Add --undefined as an alias for -z
12643 defs.
12644 * options.cc (General_options::parse_Bstatic): Remove.
12645
d82a5bcc
ILT
12646 * options.h (class General_options): Add --fatal-warnings.
12647 * main.cc (main): Implement --fatal-warnings.
12648 * errors.h (Errors::warning_count): New function.
12649
f1f70eae
ILT
12650 * options.h (class General_options): Add -Bsymbolic-functions.
12651 * symtab.h (Symbol::is_preemptible): Check for
12652 -Bsymbolic-functions.
12653
8825ac63
ILT
126542008-05-05 Ian Lance Taylor <iant@google.com>
12655
d98bc257
ILT
12656 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12657 as noVARNAME rather than no-VARNAME.
12658 (class General_options): Add option -z combreloc.
12659 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12660 get_address.
12661 (Output_reloc::sort_before) [SHT_REL]: New function.
12662 (Output_reloc::sort_before) [SHT_RELA]: New function.
12663 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12664 Sort_relocs_comparison.
12665 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12666 parameter. Change all callers.
12667 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12668 sort_relocs parameter. Change all callers.
12669 * output.cc (Output_reloc::get_address): New function, broken out
12670 of write_rel.
12671 (Output_reloc::write_rel): Call it.
12672 (Output_reloc::compare): New function.
12673 (Output_data_reloc_base::do_write): Optionally sort relocs.
12674
60b2b4e7
ILT
12675 * configure.ac: If targ_extra_obj is set, link it in.
12676 * configure.tgt: Initialize all variables.
12677 (x86_64*): Set targ_extra_obj and targ_extra_size.
12678 * configure: Rebuild.
12679
8825ac63
ILT
12680 * object.cc (Sized_relobj::include_section_group): Adjust section
12681 indexes read from group data. Build vector to pass to
12682 layout_group.
12683 * layout.cc (Layout::layout_group): Add flags and shndxes
12684 parameters. Remove contents parameter. Change caller. Update
12685 explicit instantiations.
12686 * layout.h (class Layout): Update layout_group declaration.
12687 * output.cc (Output_data_group::Output_data_group): Add flags and
12688 input_shndxes parameters. Remove contents parameter. Change
12689 caller.
12690 (Output_data_group::do_write): Change input_sections_ to
12691 input_shndxes_.
12692 * output.h (class Output_data_group): Update constructor
12693 declaration. Rename input_sections_ to input_shndxes_.
12694 * testsuite/many_sections_test.cc: Add template.
12695
e94cf127
CC
126962008-04-30 Cary Coutant <ccoutant@google.com>
12697
4418b2d5
CC
12698 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12699
e94cf127
CC
12700 * layout.cc (Layout::include_section): Refactored check for debug
12701 info section.
12702 (Layout::add_comdat): Add new parameters. Change type
12703 of signature parameter. Add object and shndx to signatures table.
12704 (Layout::find_kept_object): New function.
12705 * layout.h: Include <cstring>.
12706 (Layout::is_debug_info_section): New function.
12707 (Layout::add_comdat): Add new parameters.
12708 (Layout::find_kept_object): New function.
12709 (Layout::Kept_section): New struct.
12710 (Layout::Signatures): Change type of map range.
12711 * object.cc (Relobj::output_section_address): New function.
12712 (Sized_relobj::include_section_group): Add new parameters. Change
12713 calls to Layout::add_comdat. Change to build table of kept comdat
12714 groups and table mapping discarded sections to kept sections.
12715 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12716 (Sized_relobj::do_layout): Change calls to include_section_group and
12717 include_linkonce_section.
12718 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12719 value to zero when section is discarded.
12720 (Sized_relobj::map_to_kept_section): New function.
12721 * object.h (Relobj::output_section_address): New function.
12722 (Relobj::Comdat_group): New type.
12723 (Relobj::find_comdat_group): New function.
12724 (Relobj::Comdat_group_table): New type.
12725 (Relobj::Kept_comdat_section): New type.
12726 (Relobj::Kept_comdat_section_table): New type.
12727 (Relobj::add_comdat_group): New function.
12728 (Relobj::set_kept_comdat_section): New function.
12729 (Relobj::get_kept_comdat_section): New function.
12730 (Relobj::comdat_groups_): New field.
12731 (Relobj::kept_comdat_sections_): New field.
12732 (Symbol_value::input_value): Update comment.
12733 (Sized_relobj::map_to_kept_section) New function.
12734 (Sized_relobj::include_linkonce_section): Add new parameter.
12735 * target-reloc.h (Comdat_behavior): New type.
12736 (get_comdat_behavior): New function.
12737 (relocate_section): Add code to map a discarded section to the
12738 corresponding kept section when applying a relocation.
12739
e4e5049b
CS
127402008-04-30 Craig Silverstein <csilvers@google.com>
12741
12742 * dwarf_reader.cc (next_generation_count): New static var.
12743 (Addr2line_cache_entry): New struct.
12744 (addr2line_cache): New static var.
12745 (Dwarf_line_info::one_addr2line): Added caching.
12746 (Dwarf_line_info::clear_addr2line_cache): New function.
12747 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12748 cache-size parameter.
12749 (Dwarf_line_info::one_addr2line_cache): New function.
12750 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12751 new cache-size argument to one_addr2line(), and clear cache.
12752
d09e9154
CC
127532008-04-28 Cary Coutant <ccoutant@google.com>
12754
12755 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12756 R_386_PC8 relocations.
12757
7ef73768
ILT
127582008-04-23 Ian Lance Taylor <iant@google.com>
12759
55438702
ILT
12760 * object.cc (Sized_relobj::include_section_group): Check for
12761 invalid section group.
12762
c165fb93
ILT
12763 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12764 header size.
12765
7ef73768
ILT
12766 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12767 than read for file header.
12768 * archive.cc (Archive::include_member): Likewise.
12769
6194aaab
L
127702008-04-23 Paolo Bonzini <bonzini@gnu.org>
12771
12772 * aclocal.m4: Regenerate.
12773 * configure: Regenerate.
12774
d491d34e
ILT
127752008-04-19 Ian Lance Taylor <iant@google.com>
12776
5ea2bac6
ILT
12777 * version.cc (version_string): Bump to 1.6.
12778
7bc3e21a
ILT
12779 * testsuite/Makefile.am (many_sections_r_test): New target.
12780 (many_sections_r_test_SOURCES): Remove.
12781 (many_sections_r_test_DEPENDENCIES): Remove.
12782 (many_sections_r_test_LDFLAGS): Remove.
12783 (many_sections_r_test_LDADD): Remove.
12784
7fcd3aa9
ILT
12785 * object.cc (Sized_relobj::do_add_symbols): Always pass
12786 local_symbol_count_ to add_from_relobj.
12787
4c94d6ae
ILT
12788 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12789 every thousand variables.
12790 * testsuite/Makefile.in: Rebuild.
12791
d491d34e
ILT
12792 * object.cc (Xindex::initialize_symtab_xindex): New function.
12793 (Xindex::read_symtab_xindex): New function.
12794 (Xindex::sym_xindex_to_shndx): New function.
12795 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12796 available.
12797 (Sized_relobj::do_initialize_xindex): New function.
12798 (Sized_relobj::do_read_symbols): Adjust section links.
12799 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12800 parameter. Change all callers.
12801 (Sized_relobj::include_section_group): Adjust section links and
12802 symbol section indexes.
12803 (Sized_relobj::do_layout): Adjust section links.
12804 (Sized_relobj::do_count_local_symbols): Adjust section links and
12805 symbol section indexes.
12806 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12807 ordinary and special symbols.
12808 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12809 dynsym_xindex parameters. Change all callers. Adjust section
12810 links. Use SHN_XINDEX when needed.
12811 (Sized_relobj::get_symbol_location_info): Adjust section links.
12812 Don't get fooled by special symbols.
12813 * object.h (class Xindex): Define.
12814 (class Object): Add xindex_ parameter. Declare virtual functoin
12815 do_initialize_xindex.
12816 (Object::adjust_sym_shndx): New function.
12817 (Object::set_xindex): New protected function.
12818 (class Symbol_value): Add is_ordinary_shndx_ field.
12819 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12820 (Symbol_value::value): Assert ordinary section.
12821 (Symbol_value::initialize_input_to_output_map): Likewise.
12822 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12823 Change all callers.
12824 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12825 all callers.
12826 (class Sized_relobj): Update declarations.
12827 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12828 parameter. Change all callers.
12829 (Sized_relobj::adjust_shndx): New function.
12830 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12831 field.
12832 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12833 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12834 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12835 (Sized_dynobj::read_dynsym_section): Adjust section links.
12836 (Sized_dynobj::read_dynamic): Likewise.
12837 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12838 section links.
12839 (Sized_dynobj::do_initialize_xindex): New function.
12840 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12841 do_initialize_xindex.
12842 (Sized_dynobj::adjust_shndx): New function.
12843 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12844 dynsym_xindex_ fields.
12845 (Layout::finalize): Add a call to set_section_indexes before
12846 creating the symtab sections.
12847 (Layout::set_section_indexes): Don't do anything if the section
12848 already has a section index.
12849 (Layout::create_symtab_sections): Add shnum parameter. Change
12850 caller. Create .symtab_shndx section if needed.
12851 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12852 caller.
12853 (Layout::allocated_output_section_count): New function.
12854 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12855 needed.
12856 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12857 fields. Update declarations.
12858 (Layout::symtab_xindex): New function.
12859 (Layout::dynsym_xindex): New function.
12860 (class Write_symbols_task): Add layout_ field.
12861 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12862 Change caller.
12863 * output.cc (Output_section_headers::Output_section_headers): Add
12864 shstrtab_section parameter. Change all callers.
12865 (Output_section_headers::do_sized_write): Store overflow values
12866 for section count and section string table section index in
12867 section header zero.
12868 (Output_file_header::do_sized_write): Check for overflow of
12869 section count and section string table section index.
12870 (Output_symtab_xindex::do_write): New function.
12871 (Output_symtab_xindex::endian_do_write): New function.
12872 * output.h (class Output_section_headers): Add shstrtab_section_.
12873 Update declarations.
12874 (class Output_symtab_xindex): Define.
12875 (Output_section::has_out_shndx): New function.
12876 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12877 field.
12878 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12879 Change all callers.
12880 (Sized_symbol::init): Likewise.
12881 (Symbol::output_section): Check for ordinary symbol.
12882 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12883 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12884 callers.
12885 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12886 Change all callers. Simplify handling of symbols from sections
12887 not included in the link.
12888 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12889 distinction.
12890 (Weak_alias_sorter::operator()): Assert that symbols are
12891 ordinary.
12892 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12893 distinction.
12894 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12895 parameters. Change all callers.
12896 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12897 symbol distinction. Use SHN_XINDEX when needed.
12898 (Symbol_table::write_section_symbol): Add symtab_xindex
12899 parameter. Change all callers.
12900 (Symbol_table::sized_write_section_symbol): Likewise. Use
12901 SHN_XINDEX when needed.
12902 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12903 declarations.
12904 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12905 (Symbol::is_defined): Check is_ordinary.
12906 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12907 (Symbol::is_absolute, Symbol::is_common): Likewise.
12908 (class Sized_symbol): Update declarations.
12909 (class Symbol_table): Update declarations.
12910 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12911 parameters. Change all callers.
12912 (Sized_symbol::override): Likewise.
12913 (Symbol_table::override): Likewise.
12914 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12915 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12916 is_ordinary, and orig_st_shndx parameters. Change all callers.
12917 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12918 to be in an ordinary section.
12919 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12920 object and is_ordinary parameters. Change all callers.
12921 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12922 Change all callers. Don't add undefined or non-ordinary symbols
12923 to reloc_map_.
12924 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12925 Change all callers.
12926 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12927 declarations.
12928 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12929 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12930 (Sized_relobj::relocate_sections): Likewise.
12931 * target-reloc.h (scan_relocs): Adjust section symbol index.
12932 (scan_relocatable_relocs): Likewise.
12933 * i386.cc (Scan::local): Check for ordinary symbols.
12934 * sparc.cc (Scan::local): Likewise.
12935 * x86_64.cc (Scan::local): Likewise.
12936 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12937 to symbol_section_and_value.
12938 * testsuite/many_sections_test.cc: New file.
12939 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12940 (check_PROGRAMS): Add many_sections_test.
12941 (many_sections_test_SOURCES): Define.
12942 (many_sections_test_DEPENDENCIES): Define.
12943 (many_sections_test_LDFLAGS): Define.
12944 (BUILT_SOURCES): Add many_sections_define.h.
12945 (many_sections_define.h): New target.
12946 (BUILT_SOURCES): Add many_sections_check.h.
12947 (many_sections_check.h): New target.
12948 (check_PROGRAMS): Add many_sections_r_test.
12949 (many_sections_r_test_SOURCES): Define.
12950 (many_sections_r_test_DEPENDENCIES): Define.
12951 (many_sections_r_test_LDFLAGS): Define.
12952 (many_sections_r_test_LDADD): Define.
12953 (many_sections_r_test.o): New target.
12954 * testsuite/Makefile.in: Rebuild.
12955
c5818ff1
CC
129562008-04-17 Cary Coutant <ccoutant@google.com>
12957
12958 * errors.cc (Errors::info): New function.
12959 (gold_info): New function.
12960 * errors.h (Errors::info): New function.
12961 * gold.h (gold_info): New function.
12962 * object.cc (Input_objects::add_object): Print trace output.
12963 * options.cc (options::parse_set): New function.
12964 (General_options::parse_wrap): Deleted.
12965 (General_options::General_options): Deleted initializer.
12966 * options.h (options::String_set): New typedef.
12967 (options::parse_set): New function.
12968 (DEFINE_set): New macro.
12969 (General_options::wrap): Changed to use DEFINE_set. Changed
12970 callers of any_wrap_symbols and is_wrap_symbol.
12971 (General_options::trace, General_options::trace_symbol):
12972 New options.
12973 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12974 (General_options::wrap_symbols_): Deleted.
12975 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12976
b5be4a7c
DM
129772008-04-17 David S. Miller <davem@davemloft.net>
12978
12979 * options.cc (General_options::parse_V): New function.
12980 * options.h: Add entries for -V and -Qy.
12981
155a0dd7
ILT
129822008-04-17 Ian Lance Taylor <iant@google.com>
12983
12984 * common.cc (Symbol_table::allocate_commons): Remove options
12985 parameter. Change caller.
12986 (Symbol_table::do_allocate_commons): Remove options parameter.
12987 Change caller. Just call do_allocate_commons_list twice.
12988 (Symbol_table::do_allocate_commons_list): New function, broken out
12989 of do_allocate_commons.
12990 * common.h (class Allocate_commons_task): Remove options_ field.
12991 Update constructor.
12992 * symtab.cc (Symbol_table::Symbol_table): Initialize
12993 tls_commons_.
12994 (Symbol_table::add_from_object): Put TLS common symbols on
12995 tls_commons_ list.
12996 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12997 which are IN_OUTPUT_DATA.
12998 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12999 allocate_commons and do_allocate_commons declarations. Declare
13000 do_allocate_commons_list.
13001 * gold.cc (queue_middle_tasks): Update creation of
13002 Allocate_commons_task to not pass options.
13003 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13004 (TLS_TEST_C_FLAGS): New variable.
13005 (tls_test_c_pic.o): New target.
13006 (tls_test_shared.so): Link in tls_test_c_pic.o.
13007 (tls_test_c_pic_ie.o): New target.
13008 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13009 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13010 (tls_test_c.o): New target.
13011 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13012 (tls_pic_test_LDADD): Likewise.
13013 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13014 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13015 (tls_test_c_gnu2.o): New target.
13016 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13017 tls_test_c_gnu2.o.
13018 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13019 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13020 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13021 * testsuite/tls_test.cc: Include "config.h".
13022 (t_last): Call t11_last.
13023 * testsuite/tls_test.h (t11, t11_last): Declare.
13024 * testsuite/tls_test_c.c: New file.
13025 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13026 * configure.ac: Check for OpenMP support.
13027 * configure, config.in, Makefile.in: Rebuild.
13028 * testsuite/Makefile.in: Rebuild.
13029
edfbb029
CC
130302008-04-16 Cary Coutant <ccoutant@google.com>
13031
13032 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13033 (Target_i386::tls_base_symbol_defined_): New field.
13034 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13035 (Target_i386::Scan::global): Likewise.
13036 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13037 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13038 (Target_x86_64::tls_base_symbol_defined_): New field.
13039 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13040 (Target_x86_64::Scan::global): Likewise.
13041
f3c69fca
CC
130422008-04-16 Cary Coutant <ccoutant@google.com>
13043
13044 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13045 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13046 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13047 building shared libraries.
13048 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13049 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13050 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13051 * testsuite/Makefile.in: Rebuild.
13052 * testsuite/weak_undef.h: New file.
13053 * testsuite/weak_undef_file1.cc: Add extra test cases.
13054 * testsuite/weak_undef_file2.cc: Likewise.
13055 * testsuite/weak_undef_test.cc: Likewise.
13056
7c414435
DM
130572008-04-16 David S. Miller <davem@davemloft.net>
13058
32b769e1
DM
13059 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13060 Add issued_non_pic_error_ field. Declare check_non_pic.
13061 (Target_sparc::Scan::check_non_pic): New function.
13062 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13063 (Target_sparc::Scan::global): Likewise.
13064
11936fb1
DM
13065 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13066 * configure: Rebuild.
13067
7c414435
DM
13068 * options.h (DEFINE_enable): New macro.
13069 (new_dtags): New enable option.
13070 (initfirst, interpose, loadfltr, nodefaultlib,
13071 nodelete, nodlopen, nodump): New -z options.
13072 * layout.cc (Layout:finish_dynamic_section): If new
13073 dtags enabled, emit DT_RUNPATH. Also, emit a
13074 DT_FLAGS_1 containing any specified -z flags.
13075
85c7bf8b
ILT
130762008-04-16 Ian Lance Taylor <iant@google.com>
13077
12c0daef
ILT
13078 * copy-relocs.cc: New file.
13079 * copy-relocs.h: New file.
13080 * reloc.cc: Remove Copy_relocs code.
13081 * reloc.h: Likewise.
13082 * reloc-types.h (struct Reloc_types) [both versions]: Add
13083 get_reloc_addend_noerror.
13084 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13085 variants of add_global which take an addend which must be zero.
13086 * i386.cc: Include "copy-relocs.h".
13087 (class Target_i386): Change type of copy_relocs_ to variable,
13088 update initializer.
13089 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13090 Change all callers.
13091 (Target_i386::do_finalize_sections): Change handling of
13092 copy_relocs_.
13093 * sparc.cc: Include "copy-relocs.h".
13094 (class Target_sparc): Change type of copy_relocs_ to variable,
13095 update initializer.
13096 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13097 Change all callers.
13098 (Target_sparc::do_finalize_sections): Change handling of
13099 copy_relocs_.
13100 * x86_64.cc: Include "copy-relocs.h".
13101 (class Target_x86_64): Change type of copy_relocs_ to variable,
13102 update initializer.
13103 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13104 class. Change all callers.
13105 (Target_x86_64::do_finalize_sections): Change handling of
13106 copy_relocs_.
13107 * Makefile.am (CCFILES): Add copy-relocs.cc.
13108 (HFILES): Add copy-relocs.h.
13109
4f4995b6
ILT
13110 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13111
85c7bf8b
ILT
13112 * testsuite/script_test_4.sh: Permit leading zeroes.
13113
4f2a9edd
ILT
131142008-04-15 Ian Lance Taylor <iant@google.com>
13115
e6188289
ILT
13116 * script-sections.cc (Script_sections::create_segments): Use
13117 header_size_adjustment even when there is enough room for the
13118 headers.
13119 * testsuite/script_test_4.sh: New file.
13120 * testsuite/script_test_4.t: New file.
13121 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13122 (check_DATA): Add script_test_4.stdout.
13123 (MOSTLYCLEANFILES): Likewise.
13124 (script_test_4): New target.
13125 (script_test_4.stdout): New target.
13126 * testsuite/Makefile.in: Rebuild.
13127
4f2a9edd
ILT
13128 * sparc.cc: Add definitions for Output_data_plt_sparc class
13129 constants.
13130
f5314dd5
DM
131312008-04-14 David S. Miller <davem@davemloft.net>
13132
13133 * sparc.cc: New file.
13134 * Makefile.am (TARGETSOURCES): Add sparc.cc
13135 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13136 * configure.tgt: Document targ_extra_size and
13137 targ_extra_big_endian. Add entries for sparc-* and
13138 sparc64-*.
13139 * configure.ac: Handle targ_extra_size and
13140 targ_extra_big_endian.
13141 * Makefile.in: Rebuild.
13142 * configure: Likewise.
13143 * po/POTFILES.in: Likewise.
13144 * po/gold.pot: Likewise.
13145
154e0e9a
ILT
131462008-04-14 Ian Lance Taylor <iant@google.com>
13147
13148 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13149 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13150 in the name/type/flags to section mapping. Don't call
13151 allocate_output_section.
13152 (Layout::choose_output_section): Change parameter from adjust_name
13153 to is_input_section. Don't permit input sections after sections
13154 are attached to segments. Don't call allocate_output_section.
13155 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13156 not write_enable_output_section.
13157 (Layout::make_output_section): Don't push to
13158 unattached_section_list_ nor call attach_to_segment. Call
13159 attach_section_to_segment if sections are attached.
13160 (Layout::attach_sections_to_segments): New function.
13161 (Layout::attach_section_to_segment): New function.
13162 (Layout::attach_allocated_section_to_segment): Rename from
13163 attach_to_segment. Remove flags parameter.
13164 (Layout::allocate_output_section): Remove function.
13165 (Layout::write_enable_output_section): Remove function.
13166 * layout.h (class Layout): Update for above changes. Add new
13167 field sections_are_attached_.
13168 * output.h (Output_section::update_flags_for_input_section): New
13169 function.
13170 * output.cc (Output_section::add_input_section): Call
13171 update_flags_for_input_section.
13172 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13173
009a67a2
CC
131742008-04-11 Cary Coutant <ccoutant@google.com>
13175
13176 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13177 thought unnecessary.
13178 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13179
759b1a24
ILT
131802008-04-11 Ian Lance Taylor <iant@google.com>
13181
13182 * output.h (class Output_section_data): Remove inline definition
13183 of set_addralign.
13184 * output.cc (Output_section_data::set_addralign): New function.
13185
c2b45e22
CC
131862008-04-11 Cary Coutant <ccoutant@google.com>
13187
13188 Add support for TLS descriptors for i386 and x86_64.
13189 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13190 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13191 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13192 GOT_TYPE_TLS_DESC.
13193 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13194 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13195 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13196 relocations.
13197 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13198 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13199 Fix problem with initial-exec relocations.
13200 (Target_i386::Relocate::relocate_tls): Likewise.
13201 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13202 relaxation.
13203 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13204 support for section-plus-offset dynamic table entries.
13205 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13206 (Output_data_dynamic::Dynamic_entry): Add support for
13207 section-plus-offset dynamic table entries.
13208 (Output_data_dynamic::Classification): Likewise.
13209 (Output_data_dynamic::classification_): Renamed offset_.
13210 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13211 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13212 (Target_x86_64::make_plt_section): New function.
13213 (Target_x86_64::reserve_tlsdesc_entries): New function.
13214 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13215 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13216 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13217 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13218 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13219 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13220 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13221 add extra PLT entry for TLS descriptors.
13222 (Output_data_plt_x86_64::got_): New field.
13223 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13224 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13225 fields.
13226 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13227 descriptors.
13228 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13229 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13230 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13231 R_386_TLS_DESC_CALL relocations.
13232 (Target_x86_64::Scan::global): Likewise.
13233 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13234 for TLS descriptors.
13235 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13236 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13237 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13238 GD-to-IE relaxation.
13239 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13240 and TLS_DESCRIPTORS.
13241 * Makefile.in: Rebuild.
13242 * configure: Rebuild.
13243 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13244 (tls_test_shared2.so): New target.
13245 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13246 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13247 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13248 (tls_shared_gd_to_ie_test_LDADD): New variable.
13249 (tls_shared_gnu2_gd_to_ie_test): New target.
13250 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13251 New targets.
13252 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13253 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13254 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13255 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13256 (tls_shared_gnu2_test): New target.
13257 (tls_test_gnu2_shared.so): New target.
13258 (tls_shared_gnu2_test_SOURCES): New variable.
13259 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13260 (tls_shared_gnu2_test_LDFLAGS): New variable.
13261 (tls_shared_gnu2_test_LDADD): New variable.
13262 * testsuite/Makefile.in: Rebuild.
13263 * testsuite/Makefile.
13264
83bfb6b7
ILT
132652008-04-11 Ian Lance Taylor <iant@google.com>
13266
13267 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13268 justsyms.t.
13269 * testsuite/Makefile.in: Rebuild.
13270
13271 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13272 long.
13273 * testsuite/script_test_2.cc (main): Adjust test.
13274
706e1f5e
ILT
132752008-04-11 David S. Miller <davem@davemloft.net>
13276 Ian Lance Taylor <iant@google.com>
13277
13278 * options.h (General_options): Add entries for '-Y' and
13279 '-relax'.
13280 * options.cc (General_options:finalize): If -Y was used, add those
13281 entries to the library path instead of the default "/lib" and
13282 "/usr/lib".
13283
7c98e6bb
DM
132842008-04-11 David S. Miller <davem@davemloft.net>
13285
13286 * testsuite/justsyms.t: Start at 0x100.
13287 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13288 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13289 long.
13290 * testsuite/script_test_2.cc: Adjust string and section length
13291 checks.
7c98e6bb 13292
99a37bfd
ILT
132932008-04-09 Ian Lance Taylor <iant@google.com>
13294
2cefc357
ILT
13295 PR gold/5996
13296 * script-sections.cc (Sections_element::allocate_to_segment): Add
13297 orphan parameter.
13298 (Output_section_definition::allocate_to_segment): Likewise.
13299 (Orphan_output_section::allocate_to_segment): Likewise.
13300 (Script_sections::attach_sections_using_phdrs_clause): Don't
13301 propagate non-PT_LOAD segments to orphan sections.
13302 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13303 readelf rather than objdump.
13304 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13305 .interp section and PT_INTERP segment are the same size.
13306 * testsuite/Makefile.in: Rebuild.
13307
99a37bfd
ILT
13308 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13309 aliases for symbols defined in the same object.
13310 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13311 (weak_alias_test_SOURCES): New variable.
13312 (weak_alias_test_DEPENDENCIES): New variable.
13313 (weak_alias_test_LDFLAGS): New variable.
13314 (weak_alias_test_LDADD): New variable.
13315 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13316 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13317 (weak_alias_test_3.o): New target.
13318 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13319 * testsuite/weak_alias_test_main.cc: New file.
13320 * testsuite/weak_alias_test_1.cc: New file.
13321 * testsuite/weak_alias_test_2.cc: New file.
13322 * testsuite/weak_alias_test_3.cc: New file.
13323
780e49c5
ILT
133242008-04-08 Ian Lance Taylor <iant@google.com>
13325
cdb0b8f5
ILT
13326 * options.h (class General_options): Add --noinhibit-exec option.
13327 * main.cc (main): Check --noinhibit-exec.
13328
0864d551
ILT
13329 * options.h (class General_options): Define --wrap as a special
13330 option. Add wrap_symbols_ field.
13331 (General_options::any_wrap_symbols): New function.
13332 (General_options::is_wrap_symbol): New function.
13333 * options.cc (General_options::parse_wrap): New function.
13334 (General_options::General_options): Initialize wrap_symbols_.
13335 * symtab.cc (Symbol_table::wrap_symbol): New function.
13336 (Symbol_table::add_from_object): Handle --wrap.
13337 * symtab.h (class Symbol_table): Declare wrap_symbol.
13338 * target.h (Target::wrap_char): New function.
13339 (Target::Target_info): Add wrap_char field.
13340 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13341 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13342 * testsuite/testfile.cc (Target_test::test_target_info):
13343 Likewise.
13344
789aa6de
ILT
13345 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13346 there is one.
13347
2c38906f
ILT
13348 * layout.h (class Layout): Add added_eh_frame_data_ field.
13349 * layout.cc (Layout::Layout): Initialize new field.
13350 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13351 output section until we find a section we merged successfully.
13352 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13353 that the size be non-zero.
13354
780e49c5
ILT
13355 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13356 qualifier.
13357
7fcd0256
ILT
133582008-04-08 Craig Silverstein <csilvers@google.com>
13359
13360 * configure.ac: Export new conditional variable HAVE_ZLIB.
13361 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13362 on HAVE_ZLIB.
13363 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13364 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13365
6835af53
ILT
133662008-04-07 Ian Lance Taylor <iant@google.com>
13367
e24f324c
ILT
13368 * version.cc (version_string): Set to "1.5".
13369
a036edd8
ILT
13370 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13371 Add issued_non_pic_error_ field. Declare check_non_pic.
13372 (Target_x86_64::Scan::check_non_pic): New function.
13373 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13374 (Target_x86_64::Scan::global): Likewise.
13375
624f8810
ILT
13376 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13377 addend parameter. Change caller. Handle merge sections.
13378 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13379 Address to Addend. Don't add in the result of
13380 local_section_offset, pass down the addend and use the returned
13381 value.
13382 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13383 Update declarations of local_section_offset and symbol_value.
13384 * testsuite/two_file_test_1.cc (t18): New function.
13385 * testsuite/two_file_test_2.cc (f18): New function.
13386 * testsuite/two_file_test_main.cc (main): Call t18.
13387 * testsuite/two_file_test.h (t18, f18): Declare.
13388
6835af53
ILT
13389 * configure.ac: Don't test for objdump, c++filt, or readelf.
13390 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13391 conditionals.
13392 (TEST_READELF): New variable.
13393 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13394 (check_PROGRAMS): Add two_file_strip_test.
13395 (two_file_strip_test): New target.
13396 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13397 (two_file_same_shared_strip_test_SOURCES): New variable.
13398 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13399 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13400 (two_file_same_shared_strip_test_LDADD): New variable.
13401 (two_file_shared_strip.so): New target.
13402 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13403 (ver_test_5.syms, ver_test_7.syms): Likewise.
13404 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13405 (strip_test_3.stdout): Use TEST_OBJDUMP.
13406 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13407
86925eef
CC
134082008-04-04 Cary Coutant <ccoutant@google.com>
13409
13410 * symtab.h (Symbol::is_weak_undefined): New function.
13411 (Symbol::is_strong_undefined): New function.
13412 (Symbol::is_absolute): New function.
13413 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13414 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13415 absolute symbols.
13416 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13417 (weak_undef_test): New target.
13418 * testsuite/Makefile.in: Rebuild.
13419 * testsuite/weak_undef_file1.cc: New file.
13420 * testsuite/weak_undef_file2.cc: New file.
13421 * testsuite/weak_undef_test.cc: New file.
13422
126f3ece
ILT
134232008-04-03 Craig Silverstein <csilvers@google.com>
13424
13425 * compressed_output.h (class Output_compressed_section): Use
13426 unsigned buffer.
13427 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13428 add zlib header.
13429 (zlib_compressed_suffix): Removed.
13430 (Output_compressed_section::set_final_data_size): Use unsigned
13431 buffers.
13432 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13433 Fix linker invocation.
13434 (flagstest_o_specialfile_and_compress_debug_sections):
13435 Likewise.
13436 * testsuite/Makefile.in: Regenerated.
13437
deae2a14
DM
134382008-04-02 David S. Miller <davem@davemloft.net>
13439
13440 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13441 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13442
70752818
ILT
134432008-04-02 Craig Silverstein <csilvers@google.com>
13444
13445 * TODO: New file.
13446
39d0cb0e
ILT
134472008-04-02 Ian Lance Taylor <iant@google.com>
13448
13449 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13450 parameters. Update for new key type to views_. Change all
13451 callers.
13452 (File_read::read): Adjust for byteshift in returned view.
13453 (File_read::add_view): New function, broken out of
13454 find_and_make_view.
13455 (File_read::make_view): New function, broken out of
13456 find_and_make_view.
13457 (File_read::find_or_make_view): Add offset and aligned
13458 parameters. Rewrite accordingly. Change all callers.
13459 (File_read::get_view): Add offset and aligned parameters. Adjust
13460 for byteshift in return value.
13461 (File_read::get_lasting_view): Likewise.
13462 * fileread.h (class File_read): Update declarations.
13463 (class File_read::View): Add byteshift_ field. Add byteshift to
13464 constructor. Add byteshift method.
13465 * archive.h (Archive::clear_uncached_views): New function.
13466 (Archive::get_view): Add aligned parameter. Change all callers.
13467 * object.h (Object::get_view): Add aligned parameter. Change all
13468 callers.
13469 (Object::get_lasting_view): Likewise.
13470
13471 * fileread.cc (File_read::release): Don't call clear_views if
13472 there are multiple objects.
13473 * fileread.h (File_read::clear_uncached_views): New function.
13474 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13475 on the archive.
13476
a1207466
CC
134772008-03-31 Cary Coutant <ccoutant@google.com>
13478
13479 Add thin archive support.
13480 * archive.cc (Archive::armagt): New const.
13481 (Archive::setup): Remove task parameter and calls to unlock.
13482 (Archive::unlock_nested_archives): New function.
13483 (Archive::read_header): Add nested_off parameter. Change
13484 all callers.
13485 (Archive::interpret_header): Likewise.
13486 (Archive::include_all_members): Change to handle thin
13487 archives.
13488 (Archive::include_member): Likewise.
13489 * archive.h (Archive::Archive): Add new parameters and
13490 initializers.
13491 (Archive::armagt): New const.
13492 (Archive::setup): Remove task parameter.
13493 (Archive::unlock_nested_archives): New function.
13494 (Archive::read_header): Add nested_off parameter.
13495 (Archive::interpret_header): Likewise.
13496 (Archive::Nested_archive_table): New typedef.
13497 (Archive::is_thin_archive_): New field.
13498 (Archive::nested_archives_): New field.
13499 (Archive::options_): New field.
13500 (Archive::dirpath_): New field.
13501 (Archive::task_): New field.
13502 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13503 for thin archives. Pass additional parameters to
13504 Archive::Archive. Unlock the archive file after calling
13505 Archive::setup.
cd536b21 13506
479f6503
ILT
135072008-03-29 Ian Lance Taylor <iant@google.com>
13508
686c8caf
ILT
13509 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13510 version symbol to be local.
13511 * testsuite/ver_test_4.sh: New file.
13512 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13513 (check_DATA): Add ver_test_4.syms.
13514 (ver_test_4.syms): New target.
13515 * testsuite/Makefile.in: Rebuild.
13516
ab794b6b
ILT
13517 * output.cc
13518 (Output_section::Input_section_sort_entry::has_priority): New
13519 function.
13520 (Output_section::Input_section_sort_entry::match_file_name): New
13521 function.
13522 (Output_section::Input_section_sort_entry::match_section_name):
13523 Remove.
13524 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13525 Remove.
13526 (Output_section::Input_section_sort_entry::match_section_file):
13527 Remove.
13528 (Output_section::Input_section_sort_compare::operator()): Rewrite
13529 using new Input_section_sort_entry functions. Sort crtbegin and
13530 crtend first. Sort sections with no priority before sections with
13531 a priority.
13532 * testsuite/initpri1.c (d3): Check j != 4.
13533 (cd5): New constructor/destructor function.
13534 (main): Check j != 2.
13535
479f6503
ILT
13536 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13537 new symbol when resolving, don't call set_is_default.
13538 * testsuite/ver_test_7.cc: New file.
13539 * testsuite/ver_test_7.sh: New file.
13540 * testsuite/Makefile.am (ver_test_7.so): New target.
13541 (ver_test_7.o): New target.
13542 (check_SCRIPTS): Add ver_test_7.sh.
13543 (check_DATA): Add ver_test_7.syms.
13544 (ver_test_7.syms): New target.
13545
2fd32231
ILT
135462008-03-28 Ian Lance Taylor <iant@google.com>
13547
13548 * layout.cc (Layout::layout): If we see an input section with a
13549 name that needs sorting, set the must_sort flag for the output
13550 section.
13551 (Layout::make_output_section): If the name of the output section
13552 indicates that it might require sorting, set the may_sort flag.
13553 * output.h (Output_section::may_sort_attached_input_sections): New
13554 function.
13555 (Output_section::set_may_sort_attached_input_sections): New
13556 function.
13557 (Output_section::must_sort_attached_input_sections): New
13558 function.
13559 (Output_section::set_must_sort_attached_input_sections): New
13560 function.
13561 (class Output_section): Declare Input_section_sort_entry. Define
13562 Input_section_sort_compare. Declare
13563 sort_attached_input_sections. Add new fields:
13564 may_sort_attached_input_sections_,
13565 must_sort_attached_input_sections_,
13566 attached_input_sections_are_sorted_.
13567 * output.cc (Output_section::Output_section): Initialize new
13568 fields.
13569 (Output_section::add_input_section): Add an entry to
13570 input_sections_ if may_sort or must_sort are true.
13571 (Output_section::set_final_data_size): Call
13572 sort_attached_input_sections if necessary.
13573 (Output_section::Input_section_sort_entry): Define new class.
13574 (Output_section::Input_section_sort_compare::operator()): New
13575 function.
13576 (Output_section::sort_attached_input_sections): New function.
13577 * configure.ac: Check whether the compiler supports constructor
13578 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13579 * testsuite/initpri1.c: New file.
13580 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13581 CONSTRUCTOR_PRIORITY.
13582 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13583 (initpri1_LDFLAGS): New variable.
13584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13585
18e6b24e
ILT
135862008-03-27 Ian Lance Taylor <iant@google.com>
13587
49bdd526
ILT
13588 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13589 * testsuite/common_test_1.c: New file.
13590 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13591 (common_test_1_SOURCES): New variable.
13592 (common_test_1_DEPENDENCIES): New variable.
13593 (common_test_1_LDFLAGS): New variable.
13594
18e6b24e
ILT
13595 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13596 and commons_ correctly when NAME/VERSION does not override
13597 NAME/NULL.
13598 * testsuite/ver_test_6.c: New file.
13599 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13600 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13601 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13602
04bf7072
ILT
136032008-03-26 Ian Lance Taylor <iant@google.com>
13604
5871526f
ILT
13605 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13606 of an undefined symbol from a version script.
13607 * testsuite/Makefile.am (ver_test_5.so): New target.
13608 (ver_test_5.o): New target.
13609 (check_SCRIPTS): Add ver_test_5.sh.
13610 (check_DATA): Add ver_test_5.syms.
13611 (ver_test_5.syms): New target.
13612 * testsuite/ver_test_5.cc: New file.
13613 * testsuite/ver_test_5.script: New file.
13614 * testsuite/ver_test_5.sh: New file.
13615 * Makefile.in, testsuite/Makefile.in: Rebuild.
13616
04bf7072
ILT
13617 PR gold/5986
13618 Fix problems building gold with gcc 4.3.0.
13619 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13620 (gold_error_at_location, gold_warning_at_location): Use it.
13621 * configure.ac: Check whether we can compile and use a template
13622 function with a printf attribute.
13623 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13624 when jumping over bytes.
13625 * object.cc: Instantiate Object::read_section_data.
13626 * debug.h: Include <cstring>
13627 * dwarf_reader.cc: Include <algorithm>
13628 * main.cc: Include <cstring>.
13629 * options.cc: Include <cstring>.
13630 * output.cc: Include <cstring>.
13631 * script.cc: Include <cstring>.
13632 * script.h: Include <string>.
13633 * symtab.cc: Include <cstring> and <algorithm>.
13634 * target-select.cc: Include <cstring>.
13635 * version.cc: Include <string>.
13636 * testsuite/testmain.cc: Include <cstdlib>.
13637 * configure, config.in: Rebuild.
13638
874c5b28
ILT
136392008-03-25 Ian Lance Taylor <iant@google.com>
13640
819d6c3a
ILT
13641 * options.cc: Include "../bfd/bfdver.h".
13642 (options::help): Print bug reporting address.
13643
f4b2c6f5
ILT
13644 * version.cc (print_version): Adjust output for current value of
13645 BFD_VERSION_STRING.
13646
13647 * NEWS: New file.
13648
e96caa79
ILT
13649 * options.cc (options::help): Print list of supported targets.
13650 * target-select.h: Include <vector>.
13651 (class Target_selector): Make machine_, size_, and is_big_endian_
13652 fields const. Add bfd_name_ and instantiated_target_ fields.
13653 (Target_selector::Target_selector): Add bfd_name parameter.
13654 (Target_selector::recognize): Make non-virtual, call
13655 do_recognize.
13656 (Target_selector::recognize_by_name): Make non-virtual, call
13657 do_recognize_by_name.
13658 (Target_selector::supported_names): New function.
13659 (Target_selector::bfd_name): New function.
13660 (Target_selector::do_instantiate_target): New pure virtual
13661 function.
13662 (Target_selector::do_recognize): New virtual function.
13663 (Target_selector::do_recognize_by_name): New virtual function.
13664 (Target_selector::instantiate_target): New private function.
13665 (supported_target_names): Declare.
13666 * target-select.cc (Target_selector::Target_selector): Update for
13667 new parameter and fields.
13668 (select_target_by_name): Check that the name matches before
13669 calling recognize_by_name.
13670 (supported_target_names): New function.
13671 * i386.cc (class Target_selector_i386): Update Target_selector
13672 constructor call. Remove recognize and recognize_by_name. Add
13673 do_instantiate_target.
13674 * x86_64.cc (class Target_selector_x86_64): Likewise.
13675 * testsuite/testfile.cc (class Target_selector_test): Update for
13676 changes to Target_selector.
13677
874c5b28
ILT
13678 * README: Rewrite, with some notes on unsupported features.
13679
0a65a3a7
CC
136802008-03-24 Cary Coutant <ccoutant@google.com>
13681
13682 * i386.cc (Target_i386::Got_type): New enum declaration.
13683 (Target_i386::Scan::local): Updated callers of Output_data_got
13684 member functions.
13685 (Target_i386::Scan::global): Likewise.
13686 (Target_i386::Relocate::relocate): Likewise.
13687 (Target_i386::Relocate::relocate_tls): Likewise.
13688 * object.h (Got_offset_list): New class.
13689 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13690 (Sized_relobj::local_got_offset): Likewise.
13691 (Sized_relobj::set_local_got_offset): Likewise.
13692 (Sized_relobj::local_has_tls_got_offset): Removed.
13693 (Sized_relobj::local_tls_got_offset): Removed.
13694 (Sized_relobj::set_local_tls_got_offset): Removed.
13695 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13696 * output.cc (Output_data_got::add_global): Added got_type parameter.
13697 (Output_data_got::add_global_with_rel): Likewise.
13698 (Output_data_got::add_global_with_rela): Likewise.
13699 (Output_data_got::add_global_pair_with_rel): New function.
13700 (Output_data_got::add_global_pair_with_rela): New function.
13701 (Output_data_got::add_local): Added got_type parameter.
13702 (Output_data_got::add_local_with_rel): Likewise.
13703 (Output_data_got::add_local_with_rela): Likewise.
13704 (Output_data_got::add_local_pair_with_rel): New function.
13705 (Output_data_got::add_local_pair_with_rela): New function.
13706 (Output_data_got::add_global_tls): Removed.
13707 (Output_data_got::add_global_tls_with_rel): Removed.
13708 (Output_data_got::add_global_tls_with_rela): Removed.
13709 (Output_data_got::add_local_tls): Removed.
13710 (Output_data_got::add_local_tls_with_rel): Removed.
13711 (Output_data_got::add_local_tls_with_rela): Removed.
13712 * output.h (Output_data_got::add_global): Added got_type parameter.
13713 (Output_data_got::add_global_with_rel): Likewise.
13714 (Output_data_got::add_global_with_rela): Likewise.
13715 (Output_data_got::add_global_pair_with_rel): New function.
13716 (Output_data_got::add_global_pair_with_rela): New function.
13717 (Output_data_got::add_local): Added got_type parameter.
13718 (Output_data_got::add_local_with_rel): Likewise.
13719 (Output_data_got::add_local_with_rela): Likewise.
13720 (Output_data_got::add_local_pair_with_rel): New function.
13721 (Output_data_got::add_local_pair_with_rela): New function.
13722 (Output_data_got::add_global_tls): Removed.
13723 (Output_data_got::add_global_tls_with_rel): Removed.
13724 (Output_data_got::add_global_tls_with_rela): Removed.
13725 (Output_data_got::add_local_tls): Removed.
13726 (Output_data_got::add_local_tls_with_rel): Removed.
13727 (Output_data_got::add_local_tls_with_rela): Removed.
13728 * resolve.cc (Symbol::override_base_with_special): Removed
13729 reference to has_got_offset_ field.
13730 * symtab.cc (Symbol::init_fields): Replaced initialization
13731 of got_offset_ with got_offsets_. Removed initialization
13732 of has_got_offset_
53fcba31 13733 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13734 (Symbol::got_offset): Likewise.
13735 (Symbol::set_got_offset): Likewise.
13736 (Symbol::has_tls_got_offset): Removed.
13737 (Symbol::tls_got_offset): Removed.
13738 (Symbol::set_tls_got_offset): Removed.
13739 (Symbol::got_offset_): Removed.
13740 (Symbol::tls_mod_got_offset_): Removed.
13741 (Symbol::tls_pair_got_offset_): Removed.
13742 (Symbol::got_offsets_): New field.
13743 (Symbol::has_got_offset): Removed.
13744 (Symbol::has_tls_mod_got_offset): Removed.
13745 (Symbol::has_tls_pair_got_offset): Removed.
13746 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13747 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13748 member functions.
13749 (Target_x86_64::Scan::global): Likewise.
13750 (Target_x86_64::Relocate::relocate): Likewise.
13751 (Target_x86_64::Relocate::relocate_tls): Likewise.
13752
bd52eafb
BE
137532008-03-25 Ben Elliston <bje@au.ibm.com>
13754
13755 * yyscript.y: Fix spelling error in comment.
13756
8b105e34
ILT
137572008-03-24 Ian Lance Taylor <iant@google.com>
13758
8ed814a9
ILT
13759 * options.h (class General_options): Define build_id option.
13760 * layout.h (class Layout): Declare write_build_id, create_note,
13761 create_build_id. Add build_id_note_ member.
13762 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13763 "libiberty.h", "md5.h", "sha1.h".
13764 (Layout::Layout): Initialize eh_frame_data_,
13765 eh_frame_hdr_section_, and build_id_note_.
13766 (Layout::finalize): Call create_build_id.
13767 (Layout::create_note): New function, broken out of
13768 Layout::create_gold_note.
13769 (Layout::create_gold_note): Call create_note.
13770 (Layout::create_build_id): New function.
13771 (Layout::write_build_id): New function.
13772 (Close_task_runner::run): Call write_build_id.
13773
8b105e34
ILT
13774 * x86_64.cc: Correct license to GPLv3.
13775
086a1841
ILT
137762008-03-23 Ian Lance Taylor <iant@google.com>
13777
13778 * options.cc: Include "demangle.h".
13779 (parse_optional_string): New function.
13780 (parse_long_option): Handle takes_optional_argument.
13781 (parse_short_option): Update dash_z initializer. Handle
13782 takes_optional_argument.
13783 (General_options::General_options): Initialize do_demangle_.
13784 (General_options::finalize): Set do_demangle_. Handle demangling
13785 style.
13786 * options.h (parse_optional_string): Declare.
13787 (struct One_option): Add optional_arg field. Update constructor.
13788 Update call constructor calls. Add takes_optional_argument
13789 function.
13790 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13791 (DEFINE_optional_string): Define.
13792 (General_options::demangle): Change from DEFINE_bool to
13793 DEFINE_optional_string.
13794 (General_options::no_demangle): New function.
13795 (General_options::do_demangle): New function.
13796 (General_options::set_do_demangle): New function.
13797 (General_options::execstack_status_): Move definition to end of
13798 class definition.
13799 (General_options::static_): Likewise.
13800 (General_options::do_demangle_): New field.
13801 * object.cc (big_endian>::get_symbol_location_info): Call
13802 Options::do_demangle, not Options::demangle.
13803 * symtab.cc (demangle): Likewise.
13804
cbb93e63
ILT
138052008-03-22 Ian Lance Taylor <iant@google.com>
13806
13807 * gold.h: Include <cstddef> and <sys/types.h>
13808 * options.h: Include <cstring>.
13809
ec531623
ILT
138102008-03-21 Ian Lance Taylor <iant@google.com>
13811
13812 * Added source code to GNU binutils.
This page took 0.866929 seconds and 4 git commands to generate.