PR gold/14726
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e10f9870
AM
12012-10-17 Alan Modra <amodra@gmail.com>
2
3 PR gold/14726
4 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
5
ae034989
ST
62012-10-16 Sriraman Tallam <tmsriram@google.com>
7
8 * layout.cc (Layout::include_section): Keep sections marked
9 SHF_EXCLUDE when doing relocatable links.
10
f3a0ed29
AM
112012-10-16 Alan Modra <amodra@gmail.com>
12
13 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
14 (Target_powerpc::do_finalize_sections): Call it.
15 (Output_data_save_res): New class and supporting functions.
16 (Target_powerpc::symval_for_branch): Only look up .opd entry for
17 normal symbols defined in object files.
18
c6de8ed4
AM
192012-10-12 Alan Modra <amodra@gmail.com>
20
21 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
22 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
23 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
24 section if scan_opd_relocs not yet called.
25 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
26
03e25981
AM
272012-10-12 Alan Modra <amodra@gmail.com>
28
29 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
30 add_local_ifunc_entry): Revert last change.
31 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
32
c9824451
AM
332012-10-05 Alan Modra <amodra@gmail.com>
34
35 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
36 do_plt_address_for_global): New functions.
37 (Output_data_got_powerpc::do_write): Don't segfault when linking
38 statically.
39 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
40 add_local_ifunc_entry): Return true on adding entry..
41 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
42 glink->add_entry call. Remove unused symtab param. Adjust calls.
43 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
44 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
45 set up symbols here.
46 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
47 syms here. Do so even when no .iplt. Don't segfault when linking
48 statically.
49 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
50 new variants without reloc param.
51 (Glink_sym_ent::Glink_sym_ent): Likewise.
52 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
53 reloc when refs will resolve to plt call stub.
54 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
55 R_PPC_PLTREL24 to resolve locally.
56 (Target_powerpc::Scan::global): Correct ifunc handling.
57 (Target_powerpc::Relocate::relocate): Correct local sym glink
58 lookup. Don't destroy "value" when we have a plt call stub,
59 and when checking plt call validity.
60 (Target_powerpc::do_dynsym_value): Simplify.
61
19fec8c1
AM
622012-10-05 Alan Modra <amodra@gmail.com>
63
64 * i386.cc (Output_data_plt_i386::address_for_global,
65 address_for_local): Add plt offset to returned value. Adjust uses.
66 * sparc.cc (Output_data_plt_sparc::address_for_global,
67 address_for_local): Likewise.
68 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
69 address_for_local): Likewise.
70 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
71 address_for_local): Likewise.
72 * target.h (Target::plt_address_for_global, plt_address_for_local):
73 Update comment.
74 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
75 (Output_data_got::Got_entry::write): Nor here.
76 * output.h: Comment fix.
77
e867b647
WL
782012-10-02 Jiong Wang <jiwang@tilera.com>
79
80 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
81 global_offset_table_ value for larget got.
82 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
83
e5d5f5ed
AM
842012-09-29 Alan Modra <amodra@gmail.com>
85
86 * powerpc.cc (Target_powerpc::iplt_): New output section.
87 (Target_powerpc::iplt_section, make_iplt_section,
88 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
89 (Target_powerpc::make_plt_entry): Handle ifunc syms.
90 Target_powerpc::plt_entry_count): Count iplt entries too.
91 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
92 reloc section in constructor. New params.
93 (Target_powerpc::make_plt_section): Create reloc section here instead.
94 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
95 functions.
96 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
97 (Output_data_glink::add_entry, find_entry): New functions to
98 deal with local syms.
99 (Glink_sym_ent): Add support for local syms.
100 (Output_data_glink::do_write): Handle ifunc plt entries.
101 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
102 (Target_powerpc::Scan::local, global): Handle ifunc syms.
103 (Target_powerpc::Relocate::relocate): Likewise.
104 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
105
ec4dbad3
AM
1062012-09-25 Alan Modra <amodra@gmail.com>
107
108 * object.h (Sized_relobj_file::adjust_local_symbol,
109 do_adjust_local_symbol): New functions.
110 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
111 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
112 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
113 and irregular opd entry spacing.
114 (Powerpc_relobj::do_read_relocs): Add opd size checks.
115 (Global_symbol_visitor_opd): New functor.
116 (Target_powerpc::do_finalize_sections): Omit global symbols defined
117 on deleted opd entries.
118
5c0b3823
WL
1192012-09-15 Jiong Wang <jiwang@tilera.com>
120
121 * tilegx.cc: New file.
122 * Makefile.am (TARGETSOURCES): Add tilegx.cc
123 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
124 * configure.tgt: Add entries for tilegx*.
125 * configure.ac: Likewise.
126 * Makefile.in: Rebuild.
127 * configure: Likewise.
128 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
129 tilegx.
130
bfdfa4cd
AM
1312012-09-13 Alan Modra <amodra@gmail.com>
132
133 * target-reloc.h (scan_relocs): Call scan.local for relocs
134 against symbols in discarded sections. Pass is_discarded
135 param.
136 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
137 Add is_discarded param.
138 * powerpc (Target_powerpc::Scan::local): Likewise. Use
139 is_discarded to flag opd entry as discarded. Don't emit dyn
140 relocs on such entries.
141 (Target_powerpc::Scan::global): Similarly detect and handle
142 such opd entries.
143 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
144 opd_ent_. Update all uses.
145 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
146 (Target_powerpc::relocate_section): Zero out discarded opd
147 entry relocs.
148
d77a0555
ILT
1492012-09-12 Ian Lance Taylor <iant@google.com>
150
151 PR gold/14570
152 * output.cc: Rename Output_data_got template parameter from size
153 to got_size for all functions. Compile all variants of
154 Output_data_got.
155 (Output_data_got::Got_entry::write): Correct use of size for
156 symbol value. Use local_is_tls rather than casting to
157 Sized_relobj_file.
158 * object.h (class Object): Add local_is_tls and do_local_is_tls.
159 (class Sized_relobj_file): Add do_local_is_tls.
160 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
161
815a1205
AM
1622012-09-11 Alan Modra <amodra@gmail.com>
163
164 PR gold/14566
165 * layout.cc (Layout::set_segment_offsets): When using
166 common-page-size alignment, ensure we are on a new max-page-size
167 page.
168 * output.cc (Output_segment::set_section_addresses): Use
169 abi_pagesize, not common_pagesize for relro boundary.
170 (Output_segment::set_offset): Likewise.
171
bd73a62d
AM
1722012-09-11 Alan Modra <amodra@gmail.com>
173
174 * output.h (Output_data_got::add_global_tls, add_local_tls,
175 add_local_tls_pair): New functions.
176 (Output_data_got::add_local_pair_with_rel): Remove second
177 reloc param. Expand comment.
178 (Output_data_got::Got_entry): Rename use_plt_offset_ to
179 use_plt_or_tls_offset_, similarly for constructor param.
180 (Output_data_got::Got_entry::write): Add got_index param.
181 * output.cc (Output_data_got::add_global_tls, add_local_tls,
182 add_local_tls_pair): New functions.
183 (Output_data_got::Got_entry::write): Handle tls symbols
184 with use_plt_or_tls_offset_ set specially.
185 (Output_data_got::add_local_pair_with_rel): Only one reloc.
186 (Output_data_got::do_write): Replace iterator with index, pass
187 index to entry write function.
188 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
189 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
190 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
191 call.
192 * i386.cc (Target_i386::Scan::local): Likewise.
193 * sparc.cc (Target_sparc::Scan::local): Likewise.
194 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
195 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
196 do_tls_offset_for_global): New functions.
197 (Target_powerpc::Scan::local): Correct TLS relocations and got
198 entry values.
199 (Target_powerpc::Scan::global): Don't emit unnecessary
200 dynamic relocations on TLS GOT entries.
201
00716ab1
AM
2022012-09-10 Matthias Klose <doko@ubuntu.com>
203
204 * config.in: Disable sanity check for kfreebsd.
205
c891b3f9
SA
2062012-09-10 Sterling Augustine <saugustine@google.com>
207
208 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
209 (Gdb_index::pubtypes_read): New parameter.
210 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
211 to calls.
212 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
213 pubtypes_object_.
214
e81fea4d
AM
2152012-09-09 Alan Modra <amodra@gmail.com>
216
217 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
218 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
219 * gc.h (gc_process_relocs): Call target gc_add_reference.
220 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
221 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
222 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
223 unnecessary cast.
224 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
225 to cater for when we don't need code offset. Update use.
226 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
227 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
228 set_opd_valid): New functions.
229 (Target_powerpc::do_gc_add_reference): New function.
230 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
231 stashed refs.
232 (Target_powerpc::do_gc_mark_symbol): New function.
233
d2d60eef
CC
2342012-09-06 Cary Coutant <ccoutant@google.com>
235
236 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
237 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
238 (Dwarf_die::skip_attributes): Likewise.
239 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
240 * testsuite/gdb_index_test.cc (inline_func_1): New function.
241 (main): Call it.
242 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
243
32ed4573
L
2442012-09-05 H.J. Lu <hongjiu.lu@intel.com>
245
246 * testsuite/script_test_3.t: Add .got.plt output section
247 statement.
248 * testsuite/script_test_4.t: Likewise.
249
f4baf0d4
AM
2502012-09-05 Alan Modra <amodra@gmail.com>
251
252 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
253 update all uses and lose "enum" when using type.
254
864a1b56
AM
2552012-09-05 Alan Modra <amodra@gmail.com>
256
257 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
258 * configure: Regenerate.
259 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
260 (plugin_final_layout.stdout): Likewise.
261 (memory_test): Set page sizes to 0x1000.
262 * testsuite/Makefile.in: Regenerate.
263 * testsuite/discard_locals_test.sh: Add FIXME comment.
264 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
265 * testsuite/pr14265.t: Add .got output section statement.
266 * testsuite/script_test_2.t: Likewise.
267 * testsuite/script_test_3.t: Likewise.
268 * testsuite/script_test_4.t: Likewise.
269 * testsuite/script_test_5.t: Likewise.
270 * testsuite/script_test_6.t: Likewise.
271 * testsuite/script_test_7.t: Likewise.
272 * testsuite/script_test_9.t: Likewise.
273
3ea0a085
AM
2742012-09-05 Alan Modra <amodra@gmail.com>
275
276 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
277 (Powerpc_relocate_functions::Status): New typedef.
278 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
279 (Target_powerpc::Scan::local): Handle REL64.
280 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
281 for REL32 and REL64.
282 (Target_powerpc::symval_for_branch): New function, extracted from..
283 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
284 checks. Report overflow errors.
285
7404fe1b
AM
2862012-09-05 Alan Modra <amodra@gmail.com>
287
288 * object.h (Sized_relobj_file::emit_relocs): Delete.
289 (Sized_relobj_file::emit_relocs_reltype): Delete.
290 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
291 relocate_relocs for --emit-relocs.
292 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
293 * output.h: Update comment.
294 (Output_segment::first_section): New function.
295 (Output_segment::first_section_load_address): Use first_section.
296 * output.cc (Output_segment::first_section): New function extracted..
297 (Output_segment::first_section_load_address): ..from here. Delete.
298 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
299 * target.h (Sized_target::relocate_for_relocatable): Likewise.
300 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
301 adjust call to target.h function.
302 * i386.cc (Target_i386): Likewise.
303 * sparc.cc (Target_sparc): Likewise.
304 * x86_64.cc (Target_x86_64): Likewise.
305 * powerpc.cc (Target_powerpc): Likewise.
306 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
307 first tls section has section symbol for optimised local dynamic
308 output relocs.
309 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
310 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
311 optimised tls code.
312 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
313 Rename to relocate_relocs. Update error message.
314
957564c9
AS
3152012-09-04 Andreas Schwab <schwab@linux-m68k.org>
316
317 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
318 --just-symbols.
319
dd93cd0a
AM
3202012-08-31 Alan Modra <amodra@gmail.com>
321
322 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
323 (Powerpc_relobj::toc_base_offset): New stub function.
324 (Target_powerpc): Add tp_offset, dtp_offset. Rename
325 got_mod_index_offset to tlsld_got_offset. Update all refs.
326 (Target_powerpc::Relocate::enum skip_tls): New.
327 (Target_powerpc::call_tls_get_addr_): New var.
328 (Target_powerpc::is_branch_reloc): Move to file scope.
329 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
330 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
331 New functions.
332 (Target_powerpc::enum Got_type): Delete old values, add new ones.
333 (powerpc_info): Correct common_pagesize for ppc64.
334 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
335 (Powerpc_relocate_functions): Add overflow check enums and functions.
336 Add non-shift version of rela, rela_ua. Delete all rel public
337 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
338 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
339 addr16_ha3, addr14 functions.
340 (Output_data_got_powerpc::add_constant_pair): New function.
341 (Output_data_got_powerpc::got_base_offset): Likewise.
342 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
343 (instruction constants): Sort, add some more.
344 (Output_data_glink::do_write): Add and use Address typedef. Use
345 object->toc_base_offset() stub for 64-bit.
346 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
347 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
348 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
349 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
350 Always treat .opd relocs as against locally defined symbol.
351 Correct condition for RELATIVE relocs.
352 (Target_powerpc::do_finalize_sections): Test for NULL sections.
353 (Target_powerpc::Relocate::relocate): Use plt call stub as value
354 for 32-bit syms with a plt entry. Correct ppc64 toc base
355 calculations. Handle TLS relocs, and more. Add overflow
356 checking and adjust for Powerpc_relocate_functions changes.
357 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
358 Reinstate --emit-relocs code with FIXME.
359
a1373b60
AM
3602012-08-30 Alan Modra <amodra@gmail.com>
361
362 * layout.cc (Layout::set_segment_offsets): Set p_align to
363 abi_pagesize, not common_pagesize.
364 (Layout::relaxation_loop_body): Similarly use abi_pagesize
365 to determine whether file header can go in segment.
366
703d02da
AM
3672012-08-30 Alan Modra <amodra@gmail.com>
368
369 * output.h (Output_reloc::Output_reloc <output section>): Add
370 is_relative param. Adjust calls.
371 (Output_reloc::add_output_section_relative): New functions.
372 * output.cc (Output_reloc::Output_reloc <output section>): Handle
373 is_relative.
374 (Output_reloc::symbol_value): Handle SECTION_CODE.
375
16164a6b
ST
3762012-08-24 Sriraman Tallam <tmsriram@google.com>
377
378 * gold.cc (queue_middle_tasks): Call layout again when unique
379 segments for sections is desired.
380 * layout.cc (Layout::Layout): Initialize new members.
381 (Layout::get_output_section_flags): New function.
382 (Layout::choose_output_section): Call get_output_section_flags.
383 (Layout::layout): Make output section for mapping to a unique segment.
384 (Layout::insert_section_segment_map): New function.
385 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 386 output sections marked so.
16164a6b
ST
387 (Layout::segment_precedes): Check for unique segments when sorting.
388 * layout.h (Layout::Unique_segment_info): New struct.
389 (Layout::Section_segment_map): New typedef.
390 (Layout::insert_section_segment_map): New function.
391 (Layout::get_output_section_flags): New function.
392 (Layout::is_unique_segment_for_sections_specified): New function.
393 (Layout::set_unique_segment_for_sections_specified): New function.
394 (Layout::unique_segment_for_sections_specified_): New member.
395 (Layout::section_segment_map_): New member.
396 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
397 Rename is_gc_pass_one to is_pass_one.
398 Rename is_gc_pass_two to is_pass_two.
399 Rename is_gc_or_icf to is_two_pass.
400 Check for which pass based on whether symbols data is present.
401 Make it two pass when unique segments for sections is desired.
402 * output.cc (Output_section::Output_section): Initialize new
403 members.
404 * output.h (Output_section::is_unique_segment): New function.
405 (Output_section::set_is_unique_segment): New function.
406 (Output_section::is_unique_segment_): New member.
407 (Output_section::extra_segment_flags): New function.
408 (Output_section::set_extra_segment_flags): New function.
409 (Output_section::extra_segment_flags_): New member.
410 (Output_section::segment_alignment): New function.
411 (Output_section::set_segment_alignment): New function.
412 (Output_section::segment_alignment_): New member.
413 (Output_segment::Output_segment): Initialize is_unique_segment_.
414 (Output_segment::is_unique_segment): New function.
415 (Output_segment::set_is_unique_segment): New function.
416 (Output_segment::is_unique_segment_): New member.
417 * plugin.cc (allow_unique_segment_for_sections): New function.
418 (unique_segment_for_sections): New function.
419 (Plugin::load): Add new functions to transfer vector.
420 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
421 * Makefile.in: Regenerate.
422 * testsuite/plugin_final_layout.sh: Check if unique segment
423 functionality works.
424 * testsuite/plugin_section_order.c (onload): Check if new interfaces
425 are available.
426 (allow_unique_segment_for_sections): New global.
427 (unique_segment_for_sections): New global.
428 (claim_file_hook): Call allow_unique_segment_for_sections.
429 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 430
1e2bee4f
CC
4312012-08-22 Cary Coutant <ccoutant@google.com>
432
433 * layout.cc (Layout::include_section): Don't assert on GROUP
434 sections with --emit-relocs.
435
1d5dfe78
CC
4362012-08-21 Cary Coutant <ccoutant@google.com>
437
438 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
439 if --export-dynamic-symbol names an undef symbol.
440
c9269dff
AM
4412012-08-18 Alan Modra <amodra@gmail.com>
442
443 * powerpc.cc: Formatting and white space.
444 (Powerpc_relobj): Rename got2_section_ to special_.
445 Add opd_ent_shndx_ and opd_ent_off_ vectors.
446 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
447 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
448 (Target_powerpc): Add Address typedef and invalid_address. Use
449 throughout.
450 (Target_powerpc::is_branch_reloc): New function.
451 (Powerpc_relocate_functions): Add Address typedef, use throughout.
452 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
453 for dst_mask, value and addend.
454 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
455 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
456 (Output_data_glink::do_write): Correct toc base. Don't try to use
457 uint16_t for 24-bit offset. Use get_output_section_offset and
458 check return.
459 (Target_powerpc::Scan::local): Handle more relocs.
460 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
461 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
462 Plug in toc restoring insn after plt calls. Translate branches
463 to function descriptor symbols to corresponding entry point.
464 (Target_powerpc::relocate_for_relocatable): Check return from
465 get_output_section_offset.
466 * symtab.h: Comment typo.
467
b1759dce
ILT
4682012-08-14 Ian Lance Taylor <iant@google.com>
469
470 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
471 unsupported_relocal_local to call unsupported_reloc_global.
472
b9b2ae8b
NC
4732012-08-14 Nick Clifton <nickc@redhat.com>
474
475 PR ld/14265
476 * script-sections.cc (Sections_element::output_section_name): Add
477 keep return parameter.
478 (Output_section_element::match_name): Add keep return parameter.
479 Return the value of the keep_ member.
480 * script-sections.h (class Output_section): Update
481 output_section_name prototype.
482 * layout.cc (Layout::keep_input_section): New public member
483 function.
484 (Layout::choose_output_section): Pass keep parameter to
485 output_section_name.
486 * layout.h (class Layout): Add keep_input_section.
487 * object.cc (Sized_relobj_file::do_layout): Check for kept input
488 sections.
489 * testsuite/Makefile.am: Add a test.
490 * testsuite/Makefile.in: Regenerate.
491 * testsuite/pr14265.c: Source file for the test.
492 * testsuite/pr14265.t: Linker script for the test.
493 * testsuite/pr14265.sh: Shell script for the test.
494
921b5322
AM
4952012-08-14 Alan Modra <amodra@gmail.com>
496
497 * target.h (Target::output_section_name): New function.
498 (Target::do_output_section_name): New function.
499 * layout.cc (Layout::choose_output_section): Call the above.
500 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
501
6ce78956
AM
5022012-08-14 Alan Modra <amodra@gmail.com>
503
504 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
505 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
506 for replace_constant call.
507 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
508 (Output_data_glink::do_print_to_mapfile): New function.
509 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
510 (Target_powerpc::Relocate::relocate): Likewise.
511
d1a8cabd
AM
5122012-08-14 Alan Modra <amodra@gmail.com>
513
514 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
515 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
516 (Output_data_glink::add_entry,find_entry): Remove shndx param.
517 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
518 all references to shndx_. Handle special case for R_PPC_PLTREL24
519 here.
520 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
521 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
522 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
523 here.
524 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
525 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
526
d83ce4e3
AM
5272012-08-12 Alan Modra <amodra@gmail.com>
528
529 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
530 (glink insn constants): Use uint32_t.
531 (Output_data_glink::add_entry): Use insert, not [] operator.
532
cf43a2fe
AM
5332012-08-11 Alan Modra <amodra@gmail.com>
534
535 * object.h (Sized_relobj_file::find_shdr): New function.
536 (Sized_relobj_file::find_special_sections): New function.
537 * object.cc (Sized_relobj_file::find_shdr): New function.
538 (Sized_relobj_file::find_eh_frame): Use find_shdr.
539 (Sized_relobj_file::find_special_sections): New function, split out..
540 (Sized_relobj_file::do_read_symbols): ..from here.
541 * output.h (Output_data_got::replace_constant): New function.
542 (Output_data_got::num_entries): New function.
543 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
544 (Output_data_got::got_offset): Protected rather than private.
545 (Output_data_got::replace_got_entry): New function.
546 * output.cc (Output_data_got::replace_got_entry): New function.
547 * powerpc.cc (class Powerpc_relobj): New.
548 (class Powerpc_relocate_functions): Delete all psymval variants or
549 convert to value,addend type. Delete pcrela, pcrela_unaligned.
550 Implement _ha functions using corresponding _hi function.
551 (Powerpc_relobj::find_special_sections): New function.
552 (Target_powerpc::do_make_elf_object): New function.
553 (class Output_data_got_powerpc): New.
554 (class Output_data_glink): New.
555 (class Powerpc_scan_relocatable_reloc): New.
556 Many more changes througout file.
557
3c892704
NC
5582012-08-09 Nick Clifton <nickc@redhat.com>
559
560 * po/vi.po: Updated Vietnamese translation.
561
82435b3b
ILT
5622012-08-07 Ian Lance Taylor <iant@google.com>
563
564 * layout.cc (Layout::add_target_dynamic_tags): If
565 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
566 plt_rel.
567
a6dc81d2
NC
5682012-07-30 Nick Clifton <nickc@redhat.com>
569
570 * po/gold.pot: Updated template.
571 * po/es.po: Updated Spanish translation.
572
f1415016
CC
5732012-07-18 Cary Coutant <ccoutant@google.com>
574
575 PR gold/14344
576 * configure.ac: Add check for -gpubnames support.
577 * configure: Regenerate.
578 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
579 support; force -gno-pubnames.
580 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
581 support.
582 (gdb_index_test_4): New test.
583 * testsuite/Makefile.in: Regenerate.
584 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
585 * testsuite/gdb_index_test_2.sh: Likewise.
586 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
587 * testsuite/gdb_index_test_4.sh: New script.
588 * testsuite/gdb_index_test_comm.sh: New script with common code;
589 don't look for space after colon.
590
b7fd7c37
ST
5912012-07-16 Sriraman Tallam <tmsriram@google.com>
592
593 * gold.cc (queue_middle_tasks): Update function order only after
594 deferred objects due to plugins are processed.
595
1f3212db
ILT
5962012-07-11 Ian Lance Taylor <iant@google.com>
597
598 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
599 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
600 (Target_arm::scan_reloc_for_stub): Likewise.
601 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
602 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
603 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
604 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
605 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
606
81c82a68
ILT
6072012-07-10 Dodji Seketeli <dodji@redhat.com>
608 Ian Lance Taylor <iant@google.com>
609
610 PR gold/14309
611 * configure.ac: Test whether std::tr1::hash<off_t> works.
612 * gold.h: Add a specialization for std::tr1::hash<off_t> if
613 needed.
614 * output.h (class Output_fill): Add virtual destructor.
615 * configure, config.in: Rebuild.
616
eabc84f4
RM
6172012-06-22 Roland McGrath <mcgrathr@google.com>
618
619 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
620
370e30b6
RÁE
6212012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
622
623 * plugin.cc (Plugin::load): Handle position independent executables.
624
fb1b895d
CC
6252012-06-06 Cary Coutant <ccoutant@google.com>
626
627 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
628 add .debug_macro.
629 (lines_only_debug_sections): Likewise.
630 (gdb_fast_lookup_sections): New static array.
631 (is_gdb_debug_section): Rename formal parameter.
632 (is_lines_only_debug_section): Likewise.
633 (is_gdb_fast_lookup_section): New function.
634 (Layout::include_section): Check for ".zdebug_" prefix; pass
635 section name suffix to is_gdb_debug_section, et al.; check for
636 fast-lookup sections when building .gdb_index.
637 * options.h (--strip-debug-gdb): Update GDB version number.
638
7c0640fa
CC
6392012-06-06 Cary Coutant <ccoutant@google.com>
640
641 * configure.ac: Add check for fallocate.
642 * configure: Regenerate.
643 * config.in: Regenerate.
644
645 * options.h (class General_options): Add --mmap-output-file and
646 --posix-fallocate options.
647 * output.cc: (posix_fallocate): Remove; replace with...
648 (gold_fallocate): New function.
649 (Output_file::map_no_anonymous): Call gold_fallocate.
650 (Output_file::map): Check --mmap-output-file option.
651
2a49eb69
DK
6522012-06-05 Jing Yu <jingyu@google.com>
653
654 * gold.h (textdomain): Add do {} to empty while(0).
655 (bindtextdomain): Likewise.
656
fad072ac
CC
6572012-06-04 Cary Coutant <ccoutant@google.com>
658
659 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
660 has_dynsym_index.
661
8cc69fb6
ST
6622012-05-25 Sriraman Tallam <tmsriram@google.com>
663
664 * symtab.cc (Symbol_table::define_special_symbol):
665 Initialize *poldsym to prevent uninitialized variable errors.
666
1be75daa
CC
6672012-05-23 Cary Coutant <ccoutant@google.com>
668
669 * layout.cc (Layout::section_name_mapping): Add rules to handle
670 exact match on .data.rel.ro.local or .data.rel.ro.
671 (Layout::output_section_name): Check for exact matches.
672
9b689de0
CC
6732012-05-23 Cary Coutant <ccoutant@google.com>
674
675 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
676 more carefully.
677
b24fdbf5
CC
6782012-05-22 Cary Coutant <ccoutant@google.com>
679
680 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
681 object before exporting symbol.
682
e550e1a2
L
6832012-05-21 H.J. Lu <hongjiu.lu@intel.com>
684
685 * testsuite/tls_test.cc: Include "config.h" first.
686 * testsuite/tls_test_c.c: Likewise.
687
df7b86aa
NC
6882012-05-17 Daniel Richard G. <skunk@iskunk.org>
689 Nick Clifton <nickc@redhat.com>
690
691 PR 14072
692 * configure.in: Add check that sysdep.h has been included before
693 any system header files.
694 * configure: Regenerate.
695 * config.in: Regenerate.
696
1007b503
CC
6972012-05-14 Cary Coutant <ccoutant@google.com>
698
699 * layout.cc (Layout::make_output_section): Mark .tdata section
700 as RELRO.
701 * testsuite/relro_test.cc: Add a TLS variable.
702
fd885f3a
L
7032012-05-10 H.J. Lu <hongjiu.lu@intel.com>
704
705 PR gold/14091
706 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
707 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
708 R_X86_64_64.
709
80f5885c
CC
7102012-05-08 Cary Coutant <ccoutant@google.com>
711
712 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
713 (lines_only_debug_sections): Likewise.
714
2e702c99
RM
7152012-05-02 Roland McGrath <mcgrathr@google.com>
716
717 * nacl.cc: New file.
718 * nacl.h: New file.
719 * Makefile.am (CCFILES, HFILES): Add them.
720 * Makefile.in: Regenerate.
721 * i386.cc (Output_data_plt_i386_nacl): New class.
722 (Output_data_plt_i386_nacl_exec): New class.
723 (Output_data_plt_i386_nacl_dyn): New class.
724 (Target_i386_nacl): New class.
725 (Target_selector_i386_nacl): New class.
726 (target_selector_i386): Use it instead of Target_selector_i386.
727 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
728 (Target_x86_64_nacl): New class.
729 (Target_selector_x86_64_nacl): New class.
730 (target_selector_x86_64, target_selector_x32): Use it instead of
731 Target_selector_x86_64.
732 * arm.cc (Output_data_plt_arm_nacl): New class.
733 (Target_arm_nacl): New class.
734 (Target_selector_arm_nacl): New class.
735 (target_selector_arm, target_selector_armbe): Use it instead of
736 Target_selector_arm.
737
738 * target-select.cc (select_target): Take new Input_file* and off_t
739 arguments, pass them on to recognize method of selector.
740 * object.cc (make_elf_sized_object): Update caller.
741 * parameters.cc (parameters_force_valid_target): Likewise.
742 * incremental.cc (make_sized_incremental_binary): Likewise.
743 * target-select.h: Update decl.
744 (Target_selector::recognize): Take new Input_file* argument,
745 pass it on to do_recognize.
746 (Target_selector::do_recognize): Take new Input_file* argument.
747 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
748 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
749 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
750 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
751
752 * target.h (Target::Target_info): New members isolate_execinstr
753 and rosegment_gap.
754 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
755 * arm.cc (Target_arm::arm_info): Update initializer.
756 * i386.cc (Target_i386::i386_info): Likewise.
757 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
758 * sparc.cc (Target_sparc::sparc_info): Likewise.
759 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
760 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
761 * layout.cc (Layout::attach_allocated_section_to_segment):
762 Take new const Target* argument. If target->isolate_execinstr(), act
763 like --rosegment.
764 (Layout::find_first_load_seg): Take new const Target* argument;
765 if target->isolate_execinstr(), reject PF_X segments.
766 (Layout::relaxation_loop_body): Update caller.
767 (Layout::set_segment_offsets): If target->isolate_execinstr(),
768 reset file offset to zero when we hit LOAD_SEG, and then do a second
769 loop over the segments before LOAD_SEG to reassign offsets after
770 addresses have been determined. Handle target->rosegment_gap().
771 (Layout::attach_section_to_segment): Take new const Target* argument;
772 pass it to attach_allocated_section_to_segment.
773 (Layout::make_output_section): Update caller.
774 (Layout::attach_sections_to_segments): Take new const Target* argument;
775 pass it to attach_section_to_segment.
776 * gold.cc (queue_middle_tasks): Update caller.
777 * layout.h (Layout): Update method decls with new arguments.
778
779 * arm.cc (Target_arm::Target_arm): Take optional argument for the
780 Target_info pointer to use.
781 (Target_arm::do_make_data_plt): New virtual method.
782 (Target_arm::make_data_plt): New method that calls it.
783 (Target_arm::make_plt_entry): Use it.
784 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
785 for the section alignment.
786 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
787 method.
788 (Output_data_plt_arm::first_plt_entry_offset): Call it.
789 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
790 method.
791 (Output_data_plt_arm::get_plt_entry_size): Call it.
792 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
793 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
794 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
795 method.
796 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
797 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
798 method instead of sizeof(plt_entry).
799 (Output_data_plt_arm::add_entry): Likewise.
800 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
801 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
802 than static method.
803 (Target_arm::plt_entry_size): Likewise.
804 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
805 Move to ...
806 (Output_data_plt_arm_standard): ... here, new class.
807 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
808 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
809 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
810
811 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
812 Take additional argument for the PLT entry size.
813 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
814 Use get_plt_entry_size method rather than plt_entry_size variable.
815 (Output_data_plt_x86_64::reserve_slot): Likewise.
816 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
817 (Output_data_plt_x86_64::add_entry): Likewise.
818 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
819 (Output_data_plt_x86_64::address_for_global): Likewise.
820 (Output_data_plt_x86_64::address_for_local): Likewise.
821 (Output_data_plt_x86_64::set_final_data_size): Likewise.
822 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
823 Make method non-static.
824 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
825 method.
826 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
827 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
828 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
829 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
830 virtual method.
831 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
832 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
833 virtual method.
834 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
835 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
836 virtual method.
837 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
838 (Output_data_plt_x86_64::plt_entry_size)
839 (Output_data_plt_x86_64::first_plt_entry)
840 (Output_data_plt_x86_64::plt_entry)
841 (Output_data_plt_x86_64::tlsdesc_plt_entry)
842 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
843 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
844 (Output_data_plt_x86_64_standard): ... here, new class.
845 (Target_x86_64::Target_x86_64): Take optional argument for the
846 Target_info pointer to use.
847 (Target_x86_64::do_make_data_plt): New virtual method.
848 (Target_x86_64::make_data_plt): New method to call it.
849 (Target_x86_64::init_got_plt_for_update): Use that.
850 Call this->plt_->add_eh_frame method here.
851 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
852 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
853 rather than static method.
854 (Target_x86_64::plt_entry_size): Likewise.
855 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
856 rather than plt_entry_size variable. Move guts of PLT filling to...
857 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
858 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
859 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
860
861 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
862 additional argument for the section alignment.
863 Don't do add_eh_frame_for_plt here.
864 (Output_data_plt_i386::first_plt_entry_offset): Make the method
865 non-static. Use get_plt_entry_size method rather than plt_entry_size
866 variable.
867 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
868 method.
869 (Output_data_plt_i386::get_plt_entry_size): Call it.
870 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
871 (Output_data_plt_i386::add_eh_frame): New method to call it.
872 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
873 method.
874 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
875 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
876 method.
877 (Output_data_plt_i386::fill_plt_entry): New method to call it.
878 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
879 method instead of plt_entry_size.
880 (Output_data_plt_i386::plt_entry_size)
881 (Output_data_plt_i386::plt_eh_frame_fde_size)
882 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
883 (Output_data_plt_i386_standard): ... here, new class.
884 (Output_data_plt_i386_exec): New class.
885 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
886 (Output_data_plt_i386_exec::first_plt_entry): ... here.
887 (Output_data_plt_i386::exec_plt_entry): Move to ...
888 (Output_data_plt_i386_exec::plt_entry): ... here.
889 (Output_data_plt_i386_dyn): New class.
890 (Output_data_plt_i386::first_plt_entry): Move to ...
891 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
892 (Output_data_plt_i386::dyn_plt_entry): Move to ...
893 (Output_data_plt_i386_dyn::plt_entry): ... here.
894 (Target_i386::Target_i386): Take optional argument for the Target_info
895 pointer to use.
896 (Target_i386::do_make_data_plt): New virtual method.
897 (Target_i386::make_data_plt): New method to call it.
898 (Target_i386::make_plt_section): Use that.
899 Call this->plt_->add_eh_frame method here.
900 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
901 rather than plt_entry_size variable.
902 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
903 (Output_data_plt_i386::address_for_local): Likewise.
904 (Output_data_plt_i386::do_write): Likewise.
905 Move guts of PLT filling to...
906 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
907 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
908 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
909 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
910
b9b9f2ee
CC
9112012-05-01 Cary Coutant <ccoutant@google.com>
912
913 * dwarf_reader.cc (Dwarf_die::read_attributes)
914 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
915 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
916 * reduced_debug_output.cc
917 (Output_reduced_debug_info_section::get_die_end): Remove
918 DW_FORM_GNU_ref_index. Add default case.
919
57923f48
MW
9202012-04-26 Mark Wielaard <mjw@redhat.com>
921
922 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
923 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
924 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
925 DW_AT_high_pc as offset from DW_AT_low_pc.
926
927 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
928 * testsuite/Makefile.in: Regenerate.
929 * testsuite/gdb_index_test_3.c: New test source file.
930 * testsuite/gdb_index_test_3.sh: New test source file.
931
2c54b4f4
ILT
9322012-04-25 Ian Lance Taylor <iant@google.com>
933
934 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
935 pointer.
936 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
937 as a class, not a struct.
938 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
939 (Target_arm::apply_cortex_a8_workaround): Likewise.
940 * gc.h: Declare Reloc_types as a struct, not a class.
941 * object.h: Declare Symbols_data as a struct.
942 * reloc.h: Declare Read_relocs_data as a struct.
943 * target.h: Declare Relocate_info as a struct.
944
a5a5f7a3
DM
9452012-04-24 David S. Miller <davem@davemloft.net>
946
947 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
948 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
949 and R_SPARC_WPLT30.
950
f038d496
CC
9512012-04-24 Cary Coutant <ccoutant@google.com>
952
953 * incremental-dump.cc (find_input_containing_global): Replace
954 magic number with symbolic constant.
955 (dump_incremental_inputs): Update version number.
956 * incremental.cc (Output_section_incremental_inputs): Update version
957 number; import symbolic constants from Incremental_inputs_reader.
958 (Incremental_inputs::create_data_sections): Align relocations
959 section correctly for 64-bit targets.
960 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
961 constants; add padding.
962 (Output_section_incremental_inputs::write_header): Add assert for
963 header_size.
964 (Output_section_incremental_inputs::write_input_files): Add assert
965 for input_entry_size.
966 (Output_section_incremental_inputs::write_info_blocks): Add padding;
967 add assert for object_info_size, input_section_entry_size,
968 global_sym_entry_size.
969 * incremental.h (Incremental_inputs_reader): Add symbolic constants
970 for data structure sizes; use them.
971 (Incremental_input_entry_reader): Import symbolic constants from
972 Incremental_inputs_reader; use them.
973
a4d85145
DM
9742012-04-23 David S. Miller <davem@davemloft.net>
975
976 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
977 and elf_flags_set_.
978 (Target_sparc::Target_sparc): Initialize new fields.
979 (Target_sparc::do_make_elf_object): New function.
980 (Target_sparc::do_adjust_elf_header): New function.
981
1d509098
CC
9822012-04-23 Cary Coutant <ccoutant@google.com>
983
984 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
985 CU range table of gdb index.
986
7ebeff7f
DM
9872012-04-20 David S. Miller <davem@davemloft.net>
988
989 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
990 instead of false.
991
13cf9988
DM
9922012-04-16 David S. Miller <davem@davemloft.net>
993
2a1079e8
DM
994 * sparc.cc (Target_sparc::got_address): New function.
995 (Sparc_relocate_functions::gdop_hix22): New function.
996 (Sparc_relocate_functions::gdop_lox10): New function.
997 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
998 relocs.
999 (Target_sparc::Scan::local): Likewise if the global symbol is not
1000 preemptible and is not IFUNC.
1001 (Target_sparc::Relocate::relocate): Perform GOTDATA code
1002 transformations for local and non-preemptible non-IFUNC global
1003 symbols.
1004
0bc964fc
DM
1005 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
1006 writing out 64-bit part of ranges.
1007
661d7a80
DM
1008 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
1009 -fpic and -fpie respectively.
1010 * Makefile.in: Regenerate.
1011
8c2bf391
DM
1012 * sparc.cc (class Target_sparc): Add rela_ifunc_.
1013 (Target_sparc::Target_sparc): Initialize new field.
1014 (Target_sparc::do_plt_section_for_global): New function.
1015 (Target_sparc::do_plt_section_for_local): New function.
1016 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
1017 (Target_sparc::make_plt_section): New function, broken out of
1018 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
1019 (Target_sparc::make_plt_entry): Call make_plt_section.
1020 (Target_sparc::make_local_ifunc_plt_entry): New function.
1021 (Target_sparc::rela_ifunc_section): New function.
1022 (Target_sparc::plt_section): Remove const.
1023 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
1024 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
1025 and ifunc_count_ fields.
1026 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
1027 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
1028 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
1029 (Output_data_plt_sparc::rela_ifunc): New function.
1030 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
1031 (Output_data_plt_sparc::has_ifunc_section): New function.
1032 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
1033 (Output_data_plt_sparc::address_for_global): New function.
1034 (Output_data_plt_sparc::address_for_local): New function.
1035 (Output_data_plt_sparc::plt_index_to_offset): New function.
1036 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
1037 and entry_count.
1038 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
1039 entry_count.
1040 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
1041 R_SPARC_JMP_IREL to switch.
1042 (Target_sparc::Scan::check_non_pic): Likewise.
1043 (Target_sparc::Scan::local): Handle IFUNC symbols.
1044 (Target_sparc::Scan::local): Likewise.
1045 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
1046 and plt_address_for_local.
1047 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
1048 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
1049
13cf9988
DM
1050 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
1051 (class Output_data_reloc): Adjust calls to Output_reloc_type.
1052 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
1053 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
1054 global relocs too.
1055 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
1056 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
1057 calls.
1058 * sparc.cc (Target_sparc::Scan::global): Likewise.
1059 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1060
31821be0
CC
10612012-04-16 Cary Coutant <ccoutant@google.com>
1062
1063 * archive.cc (Library_base::should_include_member): Check for
1064 --export-dynamic-symbol.
1065 * options.h (class General_options): Add --export-dynamic-symbol.
1066 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
1067 --export-dynamic-symbol.
1068 (Symbol_table::gc_mark_undef_symbols): Likewise.
1069 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
1070
2615994e
DM
10712012-04-12 David S. Miller <davem@davemloft.net>
1072
1073 * sparc.cc (Reloc::wdisp10): New relocation method.
1074 (Reloc::h34): Likewise.
1075 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
1076 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
1077 R_SPARC_WDISP10.
1078 (Target_sparc::Scan::local): Likewise.
1079 (Target_sparc::Scan::global): Likewise.
1080 (Target_sparc::Relocate::relocate): Likewise.
1081
6782735d
CC
10822012-04-09 Cary Coutant <ccoutant@google.com>
1083
1084 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1085 low_pc == 0.
1086
8c7a0b00
ILT
10872012-04-06 Ian Lance Taylor <iant@google.com>
1088
1089 * timer.cc: #include <unistd.h>.
1090
58797674
RM
10912012-04-06 Roland McGrath <mcgrathr@google.com>
1092
1093 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1094 * config.in: Regenerate.
1095 * configure: Regenerate.
1096
44350750
NC
10972012-04-05 Nick Clifton <nickc@redhat.com>
1098
1099 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1100 (AM_LC_MESSAGES): Add.
1101 * aclocal.m4: Regenerate.
1102 * config.in: Regenerate.
1103 * configure: Regenerate.
1104
c1027032
CC
11052012-03-21 Cary Coutant <ccoutant@google.com>
1106
1107 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1108 * Makefile.in: Regenerate.
1109 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1110 (Sized_elf_reloc_mapper::symbol_section): New function.
1111 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1112 (make_elf_reloc_mapper): New function.
1113 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1114 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1115 (Dwarf_abbrev_table::do_get_abbrev): New function.
1116 (Dwarf_ranges_table::read_ranges_table): New function.
1117 (Dwarf_ranges_table::read_range_list): New function.
1118 (Dwarf_pubnames_table::read_section): New function.
1119 (Dwarf_pubnames_table::read_header): New function.
1120 (Dwarf_pubnames_table::next_name): New function.
1121 (Dwarf_die::Dwarf_die): New function.
1122 (Dwarf_die::read_attributes): New function.
1123 (Dwarf_die::skip_attributes): New function.
1124 (Dwarf_die::set_name): New function.
1125 (Dwarf_die::set_linkage_name): New function.
1126 (Dwarf_die::attribute): New function.
1127 (Dwarf_die::string_attribute): New function.
1128 (Dwarf_die::int_attribute): New function.
1129 (Dwarf_die::uint_attribute): New function.
1130 (Dwarf_die::ref_attribute): New function.
1131 (Dwarf_die::child_offset): New function.
1132 (Dwarf_die::sibling_offset): New function.
1133 (Dwarf_info_reader::check_buffer): New function.
1134 (Dwarf_info_reader::parse): New function.
1135 (Dwarf_info_reader::do_parse): New function.
1136 (Dwarf_info_reader::do_read_string_table): New function.
1137 (Dwarf_info_reader::lookup_reloc): New function.
1138 (Dwarf_info_reader::get_string): New function.
1139 (Dwarf_info_reader::visit_compilation_unit): New function.
1140 (Dwarf_info_reader::visit_type_unit): New function.
1141 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1142 Sized_elf_reloc_mapper.
1143 (Sized_dwarf_line_info::symbol_section): Remove function.
1144 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1145 (Sized_dwarf_line_info::read_line_mappings): Remove object
1146 parameter, adjust callers.
1147 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1148 * dwarf_reader.h: Include <sys/types.h>.
1149 (class Track_relocs): Remove forward declaration.
1150 (class Elf_reloc_mapper): New class.
1151 (class Sized_elf_reloc_mapper): New class.
1152 (class Dwarf_abbrev_table): New class.
1153 (class Dwarf_range_list): New class.
1154 (class Dwarf_ranges_table): New class.
1155 (class Dwarf_pubnames_table): New class.
1156 (class Dwarf_die): New class.
1157 (class Dwarf_info_reader): New class.
1158 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1159 (Sized_dwarf_line_info::symbol_section): Remove member function.
1160 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1161 base class.
1162 * gdb-index.cc: New source file.
1163 * gdb-index.h: New source file.
1164 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1165 and .debug_types sections, call Layout::add_to_gdb_index.
1166 (Sized_relobj_incr::do_section_name): Implement.
1167 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1168 return type; Implement.
1169 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1170 return type.
1171 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1172 parameter list and return type.
1173 (Sized_incr_dynobj::do_section_contents): Likewise.
1174 * layout.cc: Include gdb-index.h.
1175 (Layout::Layout): Initialize gdb_index_data_.
1176 (Layout::init_fixed_output_section): Check for .gdb_index section.
1177 (Layout::add_to_gdb_index): New function. Instantiate.
1178 * layout.h: Add forward declaration for class Gdb_index.
1179 (Layout::add_to_gdb_index): New member function.
1180 (Layout::gdb_index_data_): New data member.
1181 * main.cc: Include gdb-index.h.
1182 (main): Print statistics for gdb index.
1183 * object.cc (Object::section_contents): Move code into
1184 do_section_contents.
1185 (need_decompressed_section): Check for sections needed when building
1186 gdb index.
1187 (build_compressed_section_map): Likewise.
1188 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1189 gdb index.
1190 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1191 sections; call Layout::add_to_gdb_index.
1192 (Sized_relobj_file::do_decompressed_section_contents): Call
1193 do_section_contents directly.
1194 * object.h (Object::do_section_contents): Adjust parameter list and
1195 return type.
1196 (Object::do_decompressed_section_contents): Call do_section_contents
1197 directly.
1198 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1199 return type.
1200 * options.h (class General_options): Add --gdb-index option.
1201 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1202 list and return type.
1203 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1204 * reloc.h (Track_relocs::checkpoint): New function.
1205 (Track_relocs::reset): New function.
1206
1207 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1208 New test cases.
1209 * testsuite/Makefile.in: Regenerate.
1210 * testsuite/gdb_index_test.cc: New test source file.
1211 * testsuite/gdb_index_test_1.sh: New test source file.
1212 * testsuite/gdb_index_test_2.sh: New test source file.
1213
647f1574
DK
12142012-03-19 Doug Kwan <dougkwan@google.com>
1215
1216 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1217 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1218 __exidx_start and __exidx_end. Make symbol table parameter
1219 anonymous as it is not used.
1220 * gold.cc (queue_middle_tasks): Call target hook to define any
1221 target-specific symbols.
1222 * target.h (Target::define_standard_symbols): New method.
1223 (Target::do_define_standard_symbols): Same.
1224 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1225 * testsuite/Makefile.in: Regenerate.
1226 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1227 and __exidx_end.
1228 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1229 relocations are generated for __exidx_start and __exidx_end.
1230
7c6109da
DK
12312012-03-16 Doug Kwan <dougkwan@google.com>
1232
1233 * testsuite/Makefile.am: Disable test initpri3b.
1234 * testsuite/Makefile.in: Regenerate.
1235
7b8957f8
DK
12362012-03-15 Doug Kwan <dougkwan@google.com>
1237
1238 * arm.cc (Target_arm::got_section): Make .got section read-only
1239 if -z now is given.
1240
14dc9ef7
ILT
12412012-03-15 Ian Lance Taylor <iant@google.com>
1242
1243 PR gold/13850
1244 * layout.cc (Layout::make_output_section): Correctly mark
1245 SHT_INIT_ARRAY, et. al., as relro.
1246
fa40b62a
DK
12472012-03-14 Doug Kwan <dougkwan@google.com>
1248
1249 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1250 dynamic relocations for protected symbols in shared objects.
1251
fd325007
ILT
12522012-03-13 Ian Lance Taylor <iant@google.com>
1253
1254 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1255 keep the larger alignment.
1256
e8dd54e1
CC
12572012-03-12 Cary Coutant <ccoutant@google.com>
1258
1259 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1260 handling of DW_LNE_define_file.
1261
feb5f3b0
CC
12622012-03-12 Cary Coutant <ccoutant@google.com>
1263
1264 * reduced_debug_output.cc
1265 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1266 codes to switch.
1267
a1fb4256
CC
12682012-02-29 Cary Coutant <ccoutant@google.com>
1269
1270 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1271
5dd8762a
CC
12722012-02-29 Cary Coutant <ccoutant@google.com>
1273
1274 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1275 Call Object::decompressed_section_contents.
1276 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1277 New dtor.
1278 (Sized_dwarf_line_info::buffer_start_): New data member.
1279 * merge.cc (Output_merge_data::do_add_input_section): Call
1280 Object::decompressed_section_contents.
1281 (Output_merge_string::do_add_input_section): Likewise.
1282 * object.cc (need_decompressed_section): New function.
1283 (build_compressed_section_map): Decompress sections needed later.
1284 (Sized_relobj_file::do_decompressed_section_contents): New function.
1285 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1286 * object.h (Object::decompressed_section_contents): New function.
1287 (Object::discard_decompressed_sections): New function.
1288 (Object::do_decompressed_section_contents): New function.
1289 (Object::do_discard_decompressed_sections): New function.
1290 (Compressed_section_info): New type.
1291 (Compressed_section_map): Include decompressed section contents.
1292 (Sized_relobj_file::do_decompressed_section_contents): New function.
1293 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1294
7b5de7ee
CC
12952012-02-16 Cary Coutant <ccoutant@google.com>
1296
1297 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1298 * testsuite/Makefile.in: Regenerate.
1299
f9fa4a63
CC
13002012-02-14 Cary Coutant <ccoutant@google.com>
1301
1302 * options.cc (General_options::finalize): Disallow -pie and -static.
1303
2c175ebc
DK
13042012-02-03 Doug Kwan <dougkwan@google.com>
1305
1306 * arm.cc (Arm_relocate_functions::abs8,
1307 Arm_relocate_functions::abs16): Use
1308 Bits::has_signed_unsigned_overflow32.
1309 (Arm_relocate_functions::thm_abs8): Correct range of
1310 overflow check.
1311 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1312 in assertions.
1313
90cff06f
DK
13142012-02-02 Doug Kwan <dougkwan@google.com>
1315
1316 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1317 position independent outputs, not just shared objects.
1318
63887f3d
L
13192012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1320
1321 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1322 * configure: Regenerated.
1323
bef2b434
ILT
13242012-01-27 Ian Lance Taylor <iant@google.com>
1325
1326 * reloc.h (Bits): New class with static functions, copied from
1327 namespace utils in arm.cc.
1328 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1329 instead.
1330
c335b55d
L
13312012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1332
1333 * incremental.cc (write_info_blocks): Correct relocation offset.
1334
41194d9f
L
13352012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1336
1337 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1338 (Relocate::tls_gd_to_le): Likewise.
1339
1bae613c
L
13402012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1341
1342 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1343
24482ca0
L
13442012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1345
1346 * configure.ac: Check if -mcmodel=medium works.
1347 * configure: Regenerated.
1348
c2c7840a
CC
13492012-01-24 Cary Coutant <ccoutant@google.com>
1350
1351 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1352 definition and ...
1353 (read_unsigned_LEB_128_x): ... this new function.
1354 (read_signed_LEB_128): Replaced with inline definition and ...
1355 (read_signed_LEB_128_x): ... this new function.
1356 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1357 (read_unsigned_LEB_128): Add inline definition.
1358 (read_signed_LEB_128_x): New function.
1359 (read_signed_LEB_128): Add inline definition.
1360 * testsuite/Makefile.am (leb128_unittest): New unit test.
1361 * testsuite/Makefile.in: Regenerate.
1362 * testsuite/leb128_unittest.cc: New unit test.
1363
833de760 13642012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1365
1366 PR gold/13617
1367 * i386.cc (Target_i386::do_code_fill): When using a jmp
1368 instruction, pad with nop instructions.
1369 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1370
618d6666
L
13712012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1372
1373 * x86_64.cc (gc_process_relocs): Add typename on types used in
1374 template.
1375 (scan_relocs): Likewise.
1376 (relocate_section): Likewise.
1377 (apply_relocation): Likewise.
1378
3660ff06
L
13792012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1380
1381 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1382 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1383 under x32.
1384
fc51264f
L
13852012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1386
1387 * x86_64.cc: Initial support for x32.
1388
dd74ae06
CC
13892012-01-03 Cary Coutant <ccoutant@google.com>
1390
1391 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1392 Use abstract base class for GOT.
1393 * gold/output.h (class Output_data_got_base): New abstract base class.
1394 (class Output_data_got): Derive from new base class, adjust ctors.
1395 (Output_data_got::reserve_slot): Make virtual; rename to
1396 do_reserve_slot; Adjust callers.
1397 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1398 pointer to abstract base class.
1399 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1400
83896202
ILT
14012011-12-18 Ian Lance Taylor <iant@google.com>
1402
1403 * object.h (Relobj::local_symbol_value): New function.
1404 (Relobj::local_plt_offset): New function.
1405 (Relobj::local_has_got_offset): New function.
1406 (Relobj::local_got_offset): New function.
1407 (Relobj::set_local_got_offset): New function.
1408 (Relobj::do_local_symbol_value): New pure virtual function.
1409 (Relobj::do_local_plt_offset): Likewise.
1410 (Relobj::do_local_has_got_offset): Likewise.
1411 (Relobj::do_local_got_offset): Likewise.
1412 (Relobj::do_set_local_got_offset): Likewise.
1413 (Sized_relobj::do_local_has_got_offset): Rename from
1414 local_has_got_offset.
1415 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1416 (Sized_relobj::do_set_local_got_offset): Rename from
1417 set_local_got_offset.
1418 (Sized_relobj_file::do_local_plt_offset): Rename from
1419 local_plt_offset.
1420 (Sized_relobj_file::do_local_symbol_value): New function.
1421 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1422 local_plt_offset.
1423 * output.cc (Output_data_got::Got_entry::write): Change object to
1424 Relobj. Use local_symbol_value.
1425 (Output_data_got::add_global_with_rel): Change rel_dyn to
1426 Output_data_reloc_generic*. Use add_global_generic.
1427 (Output_data_got::add_global_with_rela): Remove. Change all
1428 callers to use add_global_with_rel.
1429 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1430 Output_data_reloc_generic*. Use add_global_generic.
1431 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1432 callers to use add_global_pair_with_rel.
1433 (Output_data_got::add_local): Change object to Relobj*.
1434 (Output_data_got::add_local_plt): Likewise.
1435 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1436 change rel_dyn to Output_data_reloc_generic*. Use
1437 add_local_generic.
1438 (Output_data_got::add_local_with_rela): Remove. Change all
1439 callers to use all_local_with_rel.
1440 (Output_data_got::add_local_pair_with_rel): Change object to
1441 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1442 add_output_section_generic.
1443 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1444 callers to use add_local_pair_with_rel.
1445 (Output_data_got::reserve_local): Change object to Relobj*.
1446 * output.h: (class Output_data_reloc_generic): Add pure virtual
1447 declarations for add_global_generic, add_local_generic,
1448 add_output_section_generic.
1449 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1450 functions for Output_data_reloc_generic. Update declarations for
1451 changes listed in output.cc.
1452 (class Output_data_got): Change template parameter to got_size.
1453 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1454 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1455 function.
1456 (Sized_relobj_incr::do_local_plt_offset): New function.
1457 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1458 add_global_generic.
1459
76677ad0
CC
14602011-12-17 Cary Coutant <ccoutant@google.com>
1461
1462 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1463 * resolve.cc (Symbol_table::resolve): Likewise.
1464 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1465 arrays.
1466 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1467
8b8dd8d5
ILT
14682011-12-16 Ian Lance Taylor <iant@google.com>
1469
1470 * output.h (Output_data_reloc_generic::add): Only call
1471 add_dynamic_reloc if this is a dynamic reloc section.
1472
d55525b9
L
14732011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1474
1475 PR gold/13505
1476 * target-reloc.h (apply_relocation): Replace <64, false> with
1477 <size, big_endian>.
1478
ff81c7c1
NC
14792011-11-25 Nick Clifton <nickc@redhat.com>
1480
1481 * po/it.po: New Italian translation.
1482
628f39be
SA
14832011-11-17 Sterling Augustine <saugustine@google.com>
1484
1485 * script.cc (script_include_directive): Implement.
1486 (read_script_file): New local variables name and search_path. Update
1487 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1488 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1489 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1490
98ef3ea4
SA
14912011-11-11 Sterling Augustine <saugustine@google.com>
1492
1493 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1494 (file_or_sections_cmd): Likewise.
1495
f4a8b6d7
DK
14962011-11-11 Doug Kwan <dougkwan@google.com>
1497
1498 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1499 if --just-symbols is given.
1500
29ab395d
DK
15012011-11-10 Doug Kwan <dougkwan@google.com>
1502
1503 PR gold/13362
1504 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1505 when processing data relocs.
1506 * reloc.h (Relocate_functions::rel_unaligned): New method.
1507 (Relocate_functions::pcrel_unaligned): Ditto.
1508 (Relocate_functions::rel32_unaligned): Ditto.
1509 (Relocate_functions::pcrel32_unaligned): Ditto.
1510
2c339f71
DK
15112011-11-09 Doug Kwan <dougkwan@google.com>
1512
1513 PR gold/13362
1514 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1515 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1516 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1517 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1518 (Relocate_functions::rel_unaligned): New.
1519 (Relocate_functions::rel32_unaligned): New.
1520 * target-reloc.h (relocate_for_relocatable): Add code to handle
1521 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1522 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1523 arm_unaligned_reloc_r): New targets.
1524 * testsuite/Makefile.in: Regenerate.
1525 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1526 linking.
1527
3f3cddf1
ILT
15282011-11-02 Ian Lance Taylor <iant@google.com>
1529
1530 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1531 NATIVE_LINKER.
1532 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1533 * options.cc (General_options::finalize): Use library search path
1534 from configure script if specified. If not native and no sysroot,
1535 only search TOOLLIBDIR.
1536 * options.h (Search_directory::Search_directory): Change name to
1537 const std::string&.
1538 (General_options::add_to_library_path_with_sysroot): Change arg to
1539 const std::string&.
1540 * configure, Makefile.in, config.in: Rebuild.
1541
a8e2273b
ILT
15422011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1543
1544 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1545 we are working around the ARM1176 Erratum.
1546 * options.h (General_options::fix_arm1176): Add option.
1547 * testsuite/Makefile.am: Add testcases, and keep current ones
1548 working.
1549 * testsuite/Makefile.in: Regenerate.
1550 * testsuite/arm_fix_1176.s: New file.
1551 * testsuite/arm_fix_1176.sh: Likewise.
1552
cd6eab1c
ILT
15532011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1554
1555 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1556 may_use_blx_.
1557 (Target_arm::may_use_blx): Remove method.
1558 (Target_arm::set_may_use_blx): Likewise.
1559 (Target_arm::may_use_v4t_interworking): New method.
1560 (Target_arm::may_use_v5t_interworking): Likewise.
1561 (Target_arm::may_use_blx_): Remove member variable.
1562 (Arm_relocate_functions::arm_branch_common): Check for v5T
1563 interworking.
1564 (Arm_relocate_functions::thumb_branch_common): Likewise.
1565 (Reloc_stub::stub_type_for_reloc): Likewise.
1566 (Target_arm::do_finalize_sections): Correct interworking checks.
1567 * testsuite/Makefile.am: Add new tests.
1568 * testsuite/Makefile.in: Regenerate.
1569 * testsuite/arm_farcall_arm_arm.s: New test.
1570 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1571 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1572 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1573 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1574 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1575 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1576 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1577
286adcf4
CC
15782011-10-31 Cary Coutant <ccoutant@google.com>
1579
1580 PR gold/13023
1581 * expression.cc (Expression::eval_with_dot): Add
1582 is_section_dot_assignment parameter.
1583 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1584 absolute and assigning to dot within a section.
1585 * script-sections.cc
1586 (Output_section_element_assignment::set_section_addresses): Pass
1587 dot_section to set_if_absolute.
1588 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1589 as is_section_dot_assignment flag to eval_with_dot.
1590 (Output_section_element_dot_assignment::set_section_addresses):
1591 Likewise.
1592 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1593 parameter. Also set value if relative to dot_section; set the
1594 symbol's output_section.
1595 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1596 parameter. Adjust all callers.
1597 (Expression::eval_maybe_dot): Likewise.
1598 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1599 Adjust all callers.
1600 * testsuite/script_test_2.t: Test assignment of an absolute value
1601 to dot within an output section element.
1602
9634ed06
CC
16032011-10-31 Cary Coutant <ccoutant@google.com>
1604
1605 * options.h (class General_options): Add --[no-]gnu-unique options.
1606 * symtab.cc (Symbol_table::sized_write_globals): Convert
1607 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1608
de4101c7
CC
16092011-10-31 Cary Coutant <ccoutant@google.com>
1610
1611 PR gold/13359
1612 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1613 unnecessary assertion.
1614 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1615
7257cc92
ST
16162011-10-31 Sriraman Tallam <tmsriram@google.com>
1617
1618 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1619 gc_mark_symbol.
1620 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1621 gc_mark_symbol.
1622 Change to just keep the section associated with symbol.
1623 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1624 they are externally visible and --export-dynamic is turned on.
1625 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1626
bfc34b3f
ILT
16272011-10-19 Ian Lance Taylor <iant@google.com>
1628
1629 PR gold/13163
1630 * script-sections.cc
1631 (Output_section_element_dot_assignment::needs_output_section): New
1632 function.
1633
ea0d8c47
ILT
16342011-10-19 Ian Lance Taylor <iant@google.com>
1635
1636 PR gold/13204
1637 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1638 --section-start option was seen.
1639 * options.h (General_options::any_section_start): New function.
1640
abd242a9
DM
16412011-10-18 David S. Miller <davem@davemloft.net>
1642
1643 PR binutils/13301
1644 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1645 member to track relocation locations that have moved during TLS
1646 reloc optimizations.
1647 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1648 (Target_sparc::Relocate::relocate): Adjust view down by 4
1649 bytes if it matches reloc_adjust_addr_.
1650 (Target_sparc::Relocate::relocate_tls): Always move the
1651 __tls_get_addr call delay slot instruction forward 4 bytes when
1652 performing relaxation.
1653
bab9090f
CC
16542011-10-18 Cary Coutant <ccoutant@google.com>
1655
1656 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1657 (Output_file::map_no_anonymous): Check for non-zero
1658 return code from posix_fallocate.
1659
f7c5b166
CC
16602011-10-17 Cary Coutant <ccoutant@google.com>
1661
1662 PR gold/13245
1663 * plugin.cc (is_visible_from_outside): Check for symbols
1664 referenced from dynamic objects.
1665 * resolve.cc (Symbol_table::resolve): Don't count references
1666 from dynamic objects as references from real ELF files.
1667 * testsuite/plugin_test_2.sh: Adjust expected result.
1668
b490c0bb
CC
16692011-10-17 Cary Coutant <ccoutant@google.com>
1670
1671 * gold.cc: Include timer.h.
1672 (queue_middle_tasks): Stamp time.
1673 (queue_final_tasks): Likewise.
1674 * main.cc (main): Store timer in parameters. Print timers
1675 for each pass.
1676 * parameters.cc (Parameters::Parameters): Initialize timer_.
1677 (Parameters::set_timer): New function.
1678 (set_parameters_timer): New function.
1679 * parameters.h (Parameters::set_timer): New function.
1680 (Parameters::timer): New function.
1681 (Parameters::timer_): New data member.
1682 (set_parameters_timer): New function.
1683 * timer.cc (Timer::stamp): New function.
1684 (Timer::get_pass_time): New function.
1685 * timer.h (Timer::stamp): New function.
1686 (Timer::get_pass_time): New function.
1687 (Timer::pass_times_): New data member.
1688
f475cf7b
CC
16892011-10-17 Cary Coutant <ccoutant@google.com>
1690
1691 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1692 task for members of lib groups.
1693
cdd7e244
CC
16942011-10-17 Cary Coutant <ccoutant@google.com>
1695
1696 PR gold/13288
4f95c8b4 1697 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1698 (File_read::make_view): Move bounds check (replace with assert)...
1699 (File_read::find_or_make_view): ... to here.
1700
dfb45471
CC
17012011-10-12 Cary Coutant <ccoutant@google.com>
1702
4f95c8b4 1703 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1704 ::read returns less than requested size.
1705
53bbcc1b
CC
17062011-10-10 Cary Coutant <ccoutant@google.com>
1707
4f95c8b4 1708 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1709 Initialize defined_count_.
1710 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1711 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1712 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1713 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1714 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1715 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1716 member.
1717 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1718 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1719 Return zeroes instead of internal error.
1720
397b129b
CC
17212011-10-10 Cary Coutant <ccoutant@google.com>
1722
1723 PR gold/13249
4f95c8b4 1724 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1725 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1726 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1727 (Output_reloc::type_): Adjust size of bit field.
1728 (Output_reloc::use_plt_offset_): New bit field.
1729 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1730 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1731 flag. Adjust all callers.
4f95c8b4 1732 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1733 creating RELATIVE relocations.
1734
d5698657
NC
17352011-10-10 Nick Clifton <nickc@redhat.com>
1736
1737 * po/es.po: Updated Spanish translation.
1738 * po/fi.po: Updated Finnish translation.
1739
6a59a5c2
DN
17402011-10-03 Diego Novillo <dnovillo@google.com>
1741
1742 * options.cc (parse_uint): Fix dereference of RETVAL.
1743
f0558624
ST
17442011-09-29 Sriraman Tallam <tmsriram@google.com>
1745
1746 * layout.h (section_order_map_): New member.
1747 (get_section_order_map): New member function.
1748 * output.cc (Output_section::add_input_section): Check for patterns
1749 only when --section-ordering-file is specified.
1750 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1751 output_sections have been formed.
1752 * layout.cc (Layout_Layout): Initialize section_order_map_.
1753 * plugin.cc (update_section_order): Store order in order_map. Do not
1754 update the order.
1755 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1756 * testsuite/Makefile.in: Regenerate.
1757 * testsuite/plugin_section_order.c: New file.
1758 * testsuite/plugin_final_layout.cc: New file.
1759 * testsuite/plugin_final_layout.sh: New file.
1760
a7dac153
CC
17612011-09-29 Cary Coutant <ccoutant@google.com>
1762
4f95c8b4 1763 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1764 Check for NULL.
4f95c8b4 1765 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1766 symbols during incremental update.
1767 (Symbol_table::add_from_dynobj): Likewise.
1768
eebd87a5
ILT
17692011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1770 Ian Lance Taylor <iant@google.com>
1771
1772 * symtab.cc (Symbol_table::define_special_symbol): Always
1773 canonicalize version string.
1774
403a3331
CC
17752011-09-26 Cary Coutant <ccoutant@google.com>
1776
4f95c8b4
CC
1777 * gold.cc (queue_initial_tasks): Move option checks ...
1778 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1779 some options; make others fatal.
1780
235061c2
CC
17812011-09-26 Cary Coutant <ccoutant@google.com>
1782
1783 gcc PR lto/47247
1784 * plugin.cc (get_symbols_v2): New function.
1785 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1786 (is_referenced_from_outside): New function.
1787 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1788 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1789 (get_symbols): Pass version parameter.
1790 (get_symbols_v2): New function.
1791 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1792 parameter.
1793 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1794 (onload): Add LDPT_GET_SYMBOLS_V2.
1795 (all_symbols_read_hook): Use get_symbols_v2; check for
1796 LDPR_PREVAILING_DEF_IRONLY_EXP.
1797 * testsuite/plugin_test_3.sh: Update expected results.
1798
dc87f620
ILT
17992011-09-23 Simon Baldwin <simonb@google.com>
1800
1801 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1802 configuration options.
1803 * configure: Regenerate.
1804 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1805 * Makefile.in: Regenerate.
1806 * testsuite/Makefile.in: Regenerate.
1807
a8279f82
ST
18082011-09-19 Sriraman Tallam <tmsriram@google.com>
1809
1810 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1811
0c9350c8
CC
18122011-09-19 Cary Coutant <ccoutant@google.com>
1813
1814 * incremental.cc (can_incremental_update): Fix typo in comment.
1815 * incremental.h (can_incremental_update): Likewise.
1816
aa06ae28
CC
18172011-09-18 Cary Coutant <ccoutant@google.com>
1818
1819 * incremental.cc (can_incremental_update): New function.
1820 * incremental.h (can_incremental_update): New function.
1821 * layout.cc (Layout::init_fixed_output_section): Call it.
1822 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1823 * object.cc (Sized_relobj_file::do_layout): Call
1824 can_incremental_update.
1825
ebb300b2
CC
18262011-09-13 Cary Coutant <ccoutant@google.com>
1827
1828 * configure.ac: Check for glibc support for gnu_indirect_function
1829 support with static linking, setting automake conditional
1830 IFUNC_STATIC.
1831 * Makefile.in: Regenerate.
1832 * configure: Regenerate.
1833
1834 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1835 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1836 for IFUNC_STATIC.
1837 * testsuite/Makefile.in: Regenerate.
1838
1206d0d5
CC
18392011-09-13 Cary Coutant <ccoutant@google.com>
1840
1841 * incremental.cc (Sized_relobj_incr::do_layout): Call
1842 report_comdat_group for kept comdat sections.
1843 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1844 * testsuite/Makefile.in: Regenerate.
1845 * testsuite/incr_comdat_test_1.cc: New source file.
1846 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1847 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1848 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1849
40b29874
ILT
18502011-09-13 Ian Lance Taylor <iant@google.com>
1851
1852 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1853 variable external_symbols_offset.
1854
1b045aac
ILT
18552011-09-12 Ian Lance Taylor <iant@google.com>
1856
1857 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1858 triggered if object has no symbols.
1859
24c6c55a
DM
18602011-09-09 David S. Miller <davem@davemloft.net>
1861
1862 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1863 (Output_fill_debug_line::do_write): Likewise.
1864
66570254
CC
18652011-08-29 Cary Coutant <ccoutant@google.com>
1866
1867 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1868 casts to match formatting specs.
1869 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1870
8ea8cd50
CC
18712011-08-26 Cary Coutant <ccoutant@google.com>
1872
1873 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1874 remaining hole size when allocating.
1875 (Layout::make_output_section): Set fill methods for debug sections.
1876 * layout.h (Free_list::Free_list_node): Move from private to
1877 public.
1878 (Free_list::set_min_hole_size): New function.
1879 (Free_list::begin, Free_list::end): New functions.
1880 (Free_list::min_hole_): New data member.
1881 * output.cc: Include dwarf.h.
1882 (Output_fill_debug_info::do_minimum_hole_size): New function.
1883 (Output_fill_debug_info::do_write): New function.
1884 (Output_fill_debug_line::do_minimum_hole_size): New function.
1885 (Output_fill_debug_line::do_write): New function.
1886 (Output_section::Output_section): Initialize new data member.
1887 (Output_section::set_final_data_size): Ensure patch space is larger
1888 than minimum hole size.
1889 (Output_section::do_write): Fill holes in debug sections.
1890 * output.h (Output_fill): New class.
1891 (Output_fill_debug_info): New class.
1892 (Output_fill_debug_line): New class.
1893 (Output_section::set_free_space_fill): New function.
1894 (Output_section::free_space_fill_): New data member.
1895 * testsuite/Makefile.am (incremental_test_3): Add
1896 --incremental-patch option.
1897 (incremental_test_4): Likewise.
1898 (incremental_test_5): Likewise.
1899 (incremental_test_6): Likewise.
1900 (incremental_copy_test): Likewise.
1901 (incremental_common_test_1): Likewise.
1902 * testsuite/Makefile.in: Regenerate.
1903
7cf80422
NC
19042011-08-26 Nick Clifton <nickc@redhat.com>
1905
1906 * po/es.po: Updated Spanish translation.
1907
c3f7b0e5
CC
19082011-08-01 Cary Coutant <ccoutant@google.com>
1909
1910 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1911 * gold/testsuite/Makefile.in: Regenerate.
1912 * gold/testsuite/justsyms_exec.c: New source file.
1913 * gold/testsuite/justsyms_lib.c: New source file.
1914
9590bf25
CC
19152011-08-01 Cary Coutant <ccoutant@google.com>
1916
1917 * layout.cc (Layout::set_segment_offsets): Don't realign text
1918 segment if -Ttext was specified.
1919 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1920 file type.
1921 * object.h (Sized_relobj_file::e_type): New function.
1922 (Sized_relobj_file::e_type_): New data member.
1923 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1924 base address for ET_EXEC files.
1925 * target.cc (Target::do_make_elf_object_implementation): Allow
1926 ET_EXEC files with --just-symbols option.
1927
dcd8d12e
CC
19282011-07-28 Cary Coutant <ccoutant@google.com>
1929
1930 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1931 Add thread_number parameter.
1932 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1933 * workqueue-threads.cc
1934 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1935 current thread if its thread number is greater than desired thread
1936 count.
1937 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1938 Add thread_number parameter.
1939 (Workqueue::should_cancel_thread): Likewise.
1940 (Workqueue::find_runnable_or_wait): Pass thread_number to
1941 should_cancel_thread.
1942 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1943 parameter.
1944
804eb480
ST
19452011-07-22 Sriraman Tallam <tmsriram@google.com>
1946
1947 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1948 only after checking if it cannot be forced local.
1949 * symtab.h (is_externally_visible): Check if the symbol is not forced
1950 local.
1951
f1ddb600
ILT
19522011-07-15 Ian Lance Taylor <iant@google.com>
1953
1954 * options.h (class General_options): Add --print-output-format.
1955 Move -EL next to -EB, for better --help output.
1956 * target-select.cc: Include <cstdio>, "options.h", and
1957 "parameters.h".
1958 (Target_selector::do_target_bfd_name): New function.
1959 (print_output_format): New function.
1960 * target-select.h (class Target_selector): Update declarations.
1961 (Target_selector::target_bfd_name): New function.
1962 (print_output_format): Declare.
1963 * main.cc: Include "target-select.h".
1964 (main): Handle --print-output-format.
1965 * gold.cc: Include "target-select.h".
1966 (queue_initial_tasks): Handle --print-output-format when there are
1967 no input files.
1968 * parameters.cc (parameters_force_valid_target): Give a better
1969 error message if -EB/-EL does not match target.
1970 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1971 function.
1972
7d172687
ILT
19732011-07-15 Ian Lance Taylor <iant@google.com>
1974
1975 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1976 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1977 (Output_data_plt_i386::do_write): Write address of .dynamic
1978 section to first entry in .got.plt section.
1979 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1980 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1981 Initialize layout_.
1982 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1983 section to first entry in .got.plt section.
1984 * layout.h (Layout::dynamic_section): New function.
1985
e9552f7e
ST
19862011-07-13 Sriraman Tallam <tmsriram@google.com>
1987
1988 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1989 to claim_file call.
1990 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1991 input_section_position_, and input_section_glob_.
1992 (read_layout_from_file): Call function section_ordering_specified.
1993 * layout.h (is_section_ordering_specified): New function.
1994 (section_ordering_specified): New function.
1995 (section_ordering_specified_): New boolean member.
1996 * main.cc(main): Call load_plugins after layout object is defined.
1997 * output.cc (Output_section::add_input_section): Use
1998 function section_ordering_specified to check if section ordering is
1999 needed.
2000 * output.cc (Output_section::add_relaxed_input_section): Use
2001 function section_ordering_specified to check if section ordering is
2002 needed.
2003 (Output_section::update_section_layout): New function.
2004 (Output_section::sort_attached_input_sections): Check if input section
2005 must be reordered.
2006 * output.h (Output_section::update_section_layout): New function.
2007 * plugin.cc (get_section_count): New function.
2008 (get_section_type): New function.
2009 (get_section_name): New function.
2010 (get_section_contents): New function.
2011 (update_section_order): New function.
58797674 2012 (allow_section_ordering): New function.
e9552f7e
ST
2013 (Plugin::load): Add the new interfaces to the transfer vector.
2014 (Plugin_manager::load_plugins): New parameter.
2015 (Plugin_manager::all_symbols_read): New parameter.
2016 (Plugin_manager::claim_file): New parameter. Save the elf object for
2017 unclaimed objects.
2018 (Plugin_manager::get_elf_object): New function.
2019 (Plugin_manager::get_view): Change to directly use the bool to check
2020 if get_view is called from claim_file_hook.
2021 * plugin.h (input_objects): New function
2022 (Plugin__manager::load_plugins): New parameter.
2023 (Plugin_manager::claim_file): New parameter.
2024 (Plugin_manager::get_elf_object): New function.
2025 (Plugin_manager::in_claim_file_handler): New function.
2026 (Plugin_manager::in_claim_file_handler_): New member.
2027 (layout): New function.
2028 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
2029 handler with an extra parameter. Make the elf object before calling
2030 claim_file handler.
2031 * testsuite/plugin_test.c (get_section_count): New function pointer.
2032 (get_section_type): New function pointer.
2033 (get_section_name): New function pointer.
2034 (get_section_contents): New function pointer.
2035 (update_section_order): New function pointer.
2036 (allow_section_ordering): New function pointer.
2037 (onload): Check if the new interfaces exist.
2038
9446efde
ILT
20392011-07-13 Ian Lance Taylor <iant@google.com>
2040
2041 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
2042 relro section.
2043 * x86_64.cc (Target_x86_64::got_section): Likewise.
2044 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
2045 (relro_now_test_SOURCES): New variable.
2046 (relro_now_test_DEPENDENCIES): New variable.
2047 (relro_now_test_LDFLAGS): New variable.
2048 (relro_now_test_LDADD): New variable.
2049 (relro_now_test.so): New target.
2050 * testsuite/Makefile.in: Rebuild.
2051
07aa62f2
ILT
20522011-07-12 Ian Lance Taylor <iant@google.com>
2053
2054 PR gold/12980
2055 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
2056 GLOB_DAT relocation rather than a RELATIVE relocation for a
2057 protected symbol when creating a shared library.
2058 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2059 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
2060 * testsuite/protected_main_1.cc (main): Test that protected
2061 function has same address.
2062
e2153196
ILT
20632011-07-11 Ian Lance Taylor <iant@google.com>
2064
2065 PR gold/12979
2066 * options.h (class General_options): Add -Bgroup.
2067 * options.cc (General_options::finalize): If -Bgroup is set,
2068 default to --unresolved-symbols=report-all.
2069 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
2070 * target-reloc.h (issue_undefined_symbol_error): Handle
2071 --unresolved-symbols=report-all.
2072
6daf5215
ILT
20732011-07-08 Ian Lance Taylor <iant@google.com>
2074
2075 PR gold/11985
2076 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
2077 if linker script discards key sections.
2078 (Layout::create_dynamic_symtab): Likewise.
2079 (Layout::assign_local_dynsym_offsets): Likewise.
2080 (Layout::sized_create_version_sections): Likewise.
2081 (Layout::create_interp): Likewise.
2082 (Layout::finish_dynamic_section): Likewise.
2083 (Layout::set_dynamic_symbol_size): Likewise.
2084
beabb2c6
ILT
20852011-07-08 Ian Lance Taylor <iant@google.com>
2086
2087 PR gold/12386
2088 * options.h (class General_options): Add --unresolved-symbols.
2089 * target-reloc.h (issue_undefined_symbol_error): Check
2090 --unresolved-symbols. Add comments.
2091
9c16daf1
ILT
20922011-07-08 Ian Lance Taylor <iant@google.com>
2093
2094 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2095 expression more complex.
2096
191f1a2d
ILT
20972011-07-08 Ian Lance Taylor <iant@google.com>
2098
2099 PR gold/11317
2100 * target-reloc.h (issue_undefined_symbol_error): New inline
2101 function, broken out of relocate_section.
2102 (relocate_section): Call issue_undefined_symbol_error.
2103 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2104 there is no TLS segment if we are about to issue an undefined
2105 symbol error.
2106 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2107
62855347
ILT
21082011-07-08 Ian Lance Taylor <iant@google.com>
2109
2110 PR gold/12279
2111 * resolve.cc (Symbol_table::should_override): Add fromtype
2112 parameter. Change all callers. Give error when linking together
2113 TLS and non-TLS symbol.
2114 (Symbol_table::should_override_with_special): Add fromtype
2115 parameter. Change all callers.
2116 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2117 there is no TLS segment if we have reported some errors.
2118 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2119
67181c72
ILT
21202011-07-08 Ian Lance Taylor <iant@google.com>
2121
2122 PR gold/12372
2123 * target.h (Target::plt_address_for_global): New function.
2124 (Target::plt_address_for_local): New function.
2125 (Target::plt_section_for_global): Remove.
2126 (Target::plt_section_for_local): Remove.
2127 (Target::do_plt_address_for_global): New virtual function.
2128 (Target::do_plt_address_for_local): New virtual function.
2129 (Target::do_plt_section_for_global): Remove.
2130 (Target::do_plt_section_for_local): Remove.
2131 (Target::register_global_plt_entry): Add Symbol_table and Layout
2132 parameters.
2133 * output.cc (Output_data_got::Got_entry::write): Use
2134 plt_address_for_global and plt_address_for_local.
2135 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2136 address of output section.
2137 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2138 got_irelative_, and irelative_count_ fields. Update
2139 declarations.
2140 (Output_data_plt_i386::has_irelative_section): New function.
2141 (Output_data_plt_i386::entry_count): Add irelative_count_.
2142 (Output_data_plt_i386::set_final_data_size): Likewise.
2143 (class Target_i386): Add got_irelative_ and rel_irelative_
2144 fields. Update declarations.
2145 (Target_i386::Target_i386): Initialize new fields.
2146 (Target_i386::do_plt_address_for_global): New function replacing
2147 do_plt_section_for_global.
2148 (Target_i386::do_plt_address_for_local): New function replacing
2149 do_plt_section_for_local.
2150 (Target_i386::got_section): Create got_irelative_.
2151 (Target_i386::rel_irelative_section): New function.
2152 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2153 fields. Don't define __rel_iplt_{start,end}.
2154 (Output_data_plt_i386::add_entry): Add symtab and layout
2155 parameters. Change all callers. Use different PLT and GOT for
2156 IFUNC symbols.
2157 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2158 layout parameters. Change all callers. Use different PLT and
2159 GOT.
2160 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2161 (Output_data_plt_i386::rel_irelative): New function.
2162 (Output_data_plt_i386::address_for_global): New function.
2163 (Output_data_plt_i386::address_for_local): New function.
2164 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2165 IRELATIVE GOT when changing IFUNC GOT entries.
2166 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2167 reloc.
2168 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2169 if we didn't create an IRELATIVE GOT.
2170 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2171 plt_address_for_local.
2172 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2173 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2174 got_irelative_, and irelative_count_ fields. Update
2175 declarations.
2176 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2177 Initialize new fields. Remove symtab parameter. Change all
2178 callers.
2179 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2180 irelative_count_.
2181 (Output_data_plt_x86_64::has_irelative_section): New function.
2182 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2183 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2184 fields. Update declarations.
2185 (Target_x86_64::Target_x86_64): Initialize new fields.
2186 (Target_x86_64::do_plt_address_for_global): New function replacing
2187 do_plt_section_for_global.
2188 (Target_x86_64::do_plt_address_for_local): New function replacing
2189 do_plt_section_for_local.
2190 (Target_x86_64::got_section): Create got_irelative_.
2191 (Target_x86_64::rela_irelative_section): New function.
2192 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2193 all callers. Don't create __rel_iplt_{start,end}.
2194 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2195 parameters. Change all callers. Use different PLT and GOT for
2196 IFUNC symbols.
2197 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2198 layout parameters. Change all callers. Use different PLT and
2199 GOT.
2200 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2201 parameters. Change all callers. Use different PLT and GOT for
2202 IFUNC symbols.
2203 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2204 (Output_data_plt_x86_64::rela_irelative): New function.
2205 (Output_data_plt_x86_64::address_for_global): New function.
2206 (Output_data_plt_x86_64::address_for_local): New function.
2207 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2208 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2209 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2210 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2211 parameters.
2212 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2213 reloc.
2214 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2215 symbols if we didn't create an IRELATIVE GOT.
2216 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2217 plt_address_for_local.
2218 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2219 * testsuite/ifuncvar1.c: New test file.
2220 * testsuite/ifuncvar2.c: New test file.
2221 * testsuite/ifuncvar3.c: New test file.
2222 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2223 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2224 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2225 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2226 * testsuite/Makefile.in: Rebuild.
2227
33c15b45
CC
22282011-07-07 Cary Coutant <ccoutant@google.com>
2229
2230 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2231 (two_file_test_1_ndebug.o): Likewise.
2232 (two_file_test_1b_ndebug.o): Likewise.
2233 (two_file_test_2_ndebug.o): Likewise.
2234 (two_file_test_main_ndebug.o): Likewise.
2235 (incremental_test_2): Link with no-debug versions.
2236
f48b5fb7
CC
22372011-07-06 Cary Coutant <ccoutant@google.com>
2238
2239 * gold/incremental.cc
2240 (Output_section_incremental_inputs::write_info_blocks): Check for
2241 hidden and internal symbols.
2242
221597a5
CC
22432011-07-06 Cary Coutant <ccoutant@google.com>
2244
2245 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2246 Check disposition for startup file.
2247 (Incremental_inputs::report_command_line): Ignore
2248 --incremental-startup-unchanged option.
2249 * options.cc (General_options::parse_incremental_startup_unchanged):
2250 New function.
2251 (General_options::General_options): Initialize new data member.
2252 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2253 (General_options): Add --incremental-startup-unchanged option.
2254 (General_options::incremental_startup_disposition): New function.
2255 (General_options::incremental_startup_disposition_): New data member.
2256
e24719f6
CC
22572011-07-06 Cary Coutant <ccoutant@google.com>
2258
2259 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2260 input file index to Script_info ctor.
2261 (Sized_incremental_binary::do_file_has_changed): Find the
2262 command-line argument for files named in scripts.
2263 * incremental.h (Script_info::Script_info): New ctor
2264 with input file index.
2265 (Script_info::input_file_index): New function.
2266 (Script_info::input_file_index_): New data member.
2267 (Incremental_binary::get_library): Add const.
2268 (Incremental_binary::get_script_info): Add const.
2269 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2270 * testsuite/Makefile.am (incremental_test_5): New test case.
2271 (incremental_test_6): New test case.
2272 * testsuite/Makefile.in: Regenerate.
2273
8f7c81e8
CC
22742011-07-06 Cary Coutant <ccoutant@google.com>
2275
2276 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2277 debug output when command lines differ.
2278
9fbd3822
CC
22792011-07-06 Cary Coutant <ccoutant@google.com>
2280
2281 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2282 --incremental-patch option.
2283 * layout.cc (Free_list::allocate): Extend allocation beyond original
2284 end if enabled.
2285 (Layout::make_output_section): Mark sections that should get
2286 patch space.
2287 * options.cc (parse_percent): New function.
2288 * options.h (parse_percent): New function.
2289 (DEFINE_percent): New macro.
2290 (General_options): Add --incremental-patch option.
2291 * output.cc (Output_section::Output_section): Initialize new data
2292 members.
2293 (Output_section::add_input_section): Print section name when out
2294 of patch space.
2295 (Output_section::add_output_section_data): Likewise.
2296 (Output_section::set_final_data_size): Add patch space when
2297 doing --incremental-full.
2298 (Output_section::do_reset_address_and_file_offset): Remove patch
2299 space.
2300 (Output_segment::set_section_list_addresses): Print debug output
2301 only if --incremental-update.
2302 * output.h (Output_section::set_is_patch_space_allowed): New function.
2303 (Output_section::is_patch_space_allowed_): New data member.
2304 (Output_section::patch_space_): New data member.
2305 * parameters.cc (Parameters::incremental_full): New function.
2306 * parameters.h (Parameters::incremental_full): New function
2307 * testsuite/Makefile.am (incremental_test_2): Add test for
2308 --incremental-patch option.
2309 * testsuite/Makefile.in: Regenerate.
2310 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2311 (t18): Remove function body.
2312
f6cccc2c
DK
23132011-07-05 Doug Kwan <dougkwan@google.com>
2314
2315 PR gold/12771
2316 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2317 Arm_Address type for relocation result.
2318 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2319 overflow check.
2320 (Arm_relocate_functions::abs32): Use unaligned access.
2321 (Arm_relocate_functions::rel32): Ditto.
2322 (Arm_relocate_functions::prel31): Ditto.
2323 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2324 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2325 static data relocations.
2326 * testsuite/Makefile.in: Regnerate.
2327 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2328
28a13fec
ILT
23292011-07-05 Ian Lance Taylor <iant@google.com>
2330
2331 PR gold/12392
2332 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2333 symbols if necessary.
2334 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2335
24d47b34
ILT
23362011-07-05 Ian Lance Taylor <iant@google.com>
2337
2338 PR gold/12952
2339 * resolve.cc (Symbol::override_base_with_special): Simply override
2340 version with special symbol version, ignoring previous version.
2341
41f9cbbe
ILT
23422011-07-05 Ian Lance Taylor <iant@google.com>
2343
2344 * object.cc (Sized_relobj_file::include_section_group): Add
2345 information to comment about signature location.
2346
886288f1
ILT
23472011-07-02 Ian Lance Taylor <iant@google.com>
2348
2349 PR gold/12957
2350 * options.h (class General_options): Add -f and -F.
2351 * options.cc (General_options::finalize): Fatal error if -f/-F
2352 are used without -shared.
2353 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2354
ae3a6d4f
ILT
23552011-07-02 Ian Lance Taylor <iant@google.com>
2356
2357 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2358
21131061
ILT
23592011-07-01 Ian Lance Taylor <iant@google.com>
2360
2361 PR gold/12525
2362 PR gold/12952
2363 * resolve.cc (Symbol::override_base_with_special): Don't override
2364 the version if the overriding symbol has a different name.
2365 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2366 all callers. If we give an error about an undefined version,
2367 define the base version if necessary.
2368 * dynobj.h (class Versions): Update declaration.
2369 * testsuite/weak_alias_test_5.cc: New file.
2370 * testsuite/weak_alias_test.script: New file.
2371 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2372 and versioned_alias have the right value, and call t2.
2373 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2374 weak_alias_test_5.so.
2375 (weak_alias_test_LDADD): Likewise.
2376 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2377 * testsuite/Makefile.in: Rebuild.
2378
611062c0
ILT
23792011-07-01 Ian Lance Taylor <iant@google.com>
2380
2381 PR gold/12525
2382 * options.h (class General_options): Support -z notext.
2383 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2384 -Wl,-z,notext.
2385 (two_file_shared_nonpic.so): Likewise.
2386 (two_file_shared_mixed.so): Likewise.
2387 (two_file_shared_mixed_1.so): Likewise.
2388 (weak_undef_lib_nonpic.so): Likewise.
2389 (alt/weak_undef_lib_nonpic.so): Likewise.
2390 (tls_test_shared_nonpic.so): Likewise.
2391 * testsuite/Makefile.in: Rebuild.
2392
328c7c2f
ILT
23932011-07-01 Ian Lance Taylor <iant@google.com>
2394
2395 PR gold/12525
2396 * configure.ac: Test whether static linking works, setting
2397 the automake conditional HAVE_STATIC.
2398 * testsuite/Makefile.am: Disable tests using -static if
2399 HAVE_STATIC is not true.
2400 * configure, testsuite/Makefile.in: Rebuild.
2401
02d7cd44
ILT
24022011-07-01 Ian Lance Taylor <iant@google.com>
2403
2404 PR gold/12525
2405 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2406 Assert if we see DW_EH_PE_indirect.
2407 * target.h (Target::ehframe_datarel_base): New function.
2408 (Target::do_ehframe_datarel_base): New target function.
2409 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2410 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2411 function.
2412
07a60597
ILT
24132011-07-01 Ian Lance Taylor <iant@google.com>
2414
2415 PR gold/12571
2416 * options.h (class General_options): Add
2417 --ld-generated-unwind-info.
2418 * ehframe.cc (Fde::write): Add address parameter. Change all
2419 callers. If associated with PLT, fill in address and size.
2420 (Cie::set_output_offset): Only add merge mapping if there is an
2421 object.
2422 (Cie::write): Add address parameter. Change all callers.
2423 (Eh_frame::add_ehframe_for_plt): New function.
2424 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2425 input_offset_ fields into union u_, with new plt field.
2426 (Fde::Fde): Adjust for new union field.
2427 (Fde::Fde) [Output_data version]: New constructor.
2428 (Fde::add_mapping): Only add merge mapping if there is an object.
2429 (class Cie): Update declarations.
2430 (class Eh_frame): Declare add_ehframe_for_plt.
2431 * layout.cc (Layout::layout_eh_frame): Break out code into
2432 make_eh_frame_section, and call it.
2433 (Layout::make_eh_frame_section): New function.
2434 (Layout::add_eh_frame_for_plt): New function.
2435 * layout.h (class Layout): Update declarations.
2436 * merge.cc (Merge_map::add_mapping): Add assertion.
2437 * i386.cc: Include "dwarf.h".
2438 (class Output_data_plt_i386): Make first_plt_entry,
2439 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2440 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2441 and plt_eh_frame_fde.
2442 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2443 boundary. Call add_eh_frame_for_plt if appropriate.
2444 * x86_64.cc: Include "dwarf.h".
2445 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2446 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2447 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2448 and plt_eh_frame_fde.
2449 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2450 appropriate.
2451
14788a3f
ILT
24522011-06-29 Ian Lance Taylor <iant@google.com>
2453
2454 PR gold/12629
2455 * object.cc (Sized_relobj_file::layout_section): Change shdr
2456 parameter to be const.
2457 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2458 out of do_layout.
2459 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2460 appropriate. Call layout_eh_frame_section.
2461 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2462 sections.
2463 * object.h (class Sized_relobj_file): Update declarations.
2464
6c21fce1
ILT
24652011-06-29 Ian Lance Taylor <iant@google.com>
2466
37e41b03 2467 PR gold/12652
6c21fce1
ILT
2468 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2469 modifier.
2470 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2471
4d5e4e62
ILT
24722011-06-29 Ian Lance Taylor <iant@google.com>
2473
2474 PR gold/12675
2475 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2476 SHT_X86_64_UNWIND.
2477 * layout.cc (Layout::layout_eh_frame): Likewise.
2478
886f533a
ILT
24792011-06-29 Ian Lance Taylor <iant@google.com>
2480
2481 PR gold/12695
2482 * layout.cc (Layout::symtab_section_shndx): New function.
2483 * layout.h (class Layout): Declare symtab_section_shndx.
2484 * output.cc (Output_section::write_header): Call it.
2485
f3ae1b28
ILT
24862011-06-29 Ian Lance Taylor <iant@google.com>
2487
2488 PR gold/12818
2489 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2490 symbols which are not used in a relocation.
2491
aecf301f
ILT
24922011-06-28 Ian Lance Taylor <iant@google.com>
2493
2494 PR gold/12898
2495 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2496 script create indistinguishable segments.
2497 (Layout::set_segment_offsets): Use stable_sort when sorting
2498 segments. Pass this to Compare_segments constructor.
2499 * layout.h (class Layout): Make segment_precedes non-static.
2500 (class Compare_segments): Change from struct to class. Add
2501 layout_ field. Add constructor.
2502 * script-sections.cc
2503 (Script_sections::attach_sections_using_phdrs_clause): Rename
2504 local orphan to is_orphan. Don't report failure to put empty
2505 section in segment. On attachment failure, report name of
2506 section, and attach to first PT_LOAD segment.
2507
03ef7571
ILT
25082011-06-28 Ian Lance Taylor <iant@google.com>
2509
2510 PR gold/12934
2511 * target-select.cc (Target_selector::Target_selector): Add
2512 emulation parameter. Change all callers.
2513 (select_target_by_bfd_name): Rename from select_target_by_name.
2514 Change all callers.
2515 (select_target_by_emulation): New function.
2516 (supported_emulation_names): New function.
2517 * target-select.h (class Target_selector): Add emulation_ field.
2518 Update declarations.
2519 (Target_selector::recognize_by_bfd_name): Rename from
2520 recognize_by_name. Change all callers.
2521 (Target_selector::supported_bfd_names): Rename from
2522 supported_names. Change all callers.
2523 (Target_selector::recognize_by_emulation): New function.
2524 (Target_selector::supported_emulations): New function.
2525 (Target_selector::emulation): New function.
2526 (Target_selector::do_recognize_by_bfd_name): Rename from
2527 do_recognize_by_name. Change all callers.
2528 (Target_selector::do_supported_bfd_names): Rename from
2529 do_supported_names. Change all callers.
2530 (Target_selector::do_recognize_by_emulation): New function.
2531 (Target_selector::do_supported_emulations): New function.
2532 (select_target_by_bfd_name): Change name in declaration.
2533 (select_target_by_emulation): Declare.
2534 (supported_emulation_names): Declare.
2535 * parameters.cc (parameters_force_valid_target): Try to find
2536 target based on emulation from -m option.
2537 * options.h (class General_options): Change doc string for -m.
2538 * options.cc (help): Print emulations.
2539 (General_options::parse_V): Likewise.
2540 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2541 Add emulation parameter. Change all callers.
2542
200b2bb9
ILT
25432011-06-28 Ian Lance Taylor <iant@google.com>
2544
2545 * target.h (class Target): Add osabi_ field.
2546 (Target::osabi): New function.
2547 (Target::set_osabi): New function.
2548 (Target::Target): Initialize osabi_.
2549 (Target::do_adjust_elf_header): Make pure virtual.
2550 (Sized_target::do_adjust_elf_header): Declare.
2551 * target.cc (Sized_target::do_adjust_elf_header): New function.
2552 (class Sized_target): Instantiate all versions.
2553 * freebsd.h (class Target_freebsd): Remove.
2554 (Target_selector_freebsd::do_recognize): Call set_osabi on
2555 Target.
2556 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2557 (Target_selector_freebsd::set_osabi): Remove.
2558 * i386.cc (class Target_i386): Inherit from Sized_target rather
2559 than Target_freebsd.
2560 * x86_64.cc (class Target_x86_64): Likewise.
2561
b3ce541e
ILT
25622011-06-28 Ian Lance Taylor <iant@google.com>
2563
2564 * target.h (Target::can_check_for_function_pointers): Rewrite.
2565 Make non-virtual.
2566 (Target::can_icf_inline_merge_sections): Likewise.
2567 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2568 (Target::Target_info): Add can_icf_inline_merge_sections field.
2569 (Target::do_can_check_for_function_pointers): New virtual
2570 function.
2571 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2572 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2573 from can_check_for_function_pointers, move in file.
2574 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2575 section_may_have_icf_unsafe_poineters, move in file.
2576 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2577 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2578 Rename from can_check_for_function_pointers, move in file.
2579 (Target_i386::can_icf_inline_merge_sections): Remove.
2580 (Target_i386::i386_info): Initialize
2581 can_icf_inline_merge_sections.
2582 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2583 Initialize can_icf_inline_merge_sections.
2584 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2585 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2586 Rename from can_check_for_function_pointers, move in file.
2587 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2588 (Target_x86_64::x86_64_info): Initialize
2589 can_icf_inline_merge_sections.
2590 * testsuite/testfile.cc (Target_test::test_target_info):
2591 Likewise.
2592 * icf.cc (get_section_contents): Correct formatting.
2593
6d1c4efb
ILT
25942011-06-27 Ian Lance Taylor <iant@google.com>
2595
2596 * symtab.cc (Symbol::versioned_name): New function.
2597 (Symbol_table::add_to_final_symtab): Use versioned_name when
2598 appropriate.
2599 (Symbol_table::sized_write_symbol): Likewise.
2600 * symtab.h (class Symbol): Declare versioned_name.
2601 * stringpool.h (class Stringpool_template): Add variant of add
2602 which takes a std::basic_string.
2603 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2604 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2605 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2606 (ver_test_12.o): New target.
2607 * testsuite/Makefile.in: Rebuild.
2608
57eb9b50
DK
26092011-06-27 Doug Kwan <dougkwan@google.com>
2610
2611 * arm.cc (Arm_relocate_functions::thm_jump8,
2612 Arm_relocate_functions::thm_jump11): Use a wider signed
2613 type to compute offset.
2614 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2615 arm_thm_jump8.
2616 * testsuite/Makefile.in: Regenerate.
2617 * testsuite/arm_branch_in_range.sh: Check test results of
2618 arm_thm_jump11 and arm_thm_jump8.
2619 * testsuite/arm_thm_jump11.s: New test source file.
2620 * testsuite/arm_thm_jump11.t: New linker script.
2621 * testsuite/arm_thm_jump8.s: New test source file.
2622 * testsuite/arm_thm_jump8.t: New linker script.
2623
487b39df
ILT
26242011-06-24 Ian Lance Taylor <iant@google.com>
2625
2626 * layout.cc: Include "object.h".
2627 (ctors_sections_in_init_array): New static variable.
2628 (Layout::is_ctors_in_init_array): New function.
2629 (Layout::layout): Add entry to ctors_sections_in_init_array if
2630 appropriate.
2631 * layout.h (class Layout): Declare is_ctors_in_init_array.
2632 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2633 is_ctors_reverse_view is set.
2634 (Sized_relobj_file::write_sections): Add layout parameter. Change
2635 all callers. Set is_ctors_reverse_view field of View_size.
2636 (Sized_relobj_file::reverse_words): New function.
2637 * object.h (Sized_relobj_file::View_size): Add
2638 is_ctors_reverse_view field.
2639 (class Sized_relobj_file): Update declarations.
2640 * testsuite/initpri3.c: New test.
2641 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2642 initpri3b.
2643 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2644 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2645 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2646 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2647 * testsuite/Makefile.in: Rebuild.
2648
472076e4
CC
26492011-06-24 Cary Coutant <ccoutant@google.com>
2650
2651 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2652 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2653 (debug_msg_cdebug.err): New targets.
2654 * testsuite/Makefile.in: Regenerate.
2655 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2656 Fix checks for link with shared library.
2657
a60af0db
DK
26582011-06-24 Doug Kwan <dougkwan@google.com>
2659
2660 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2661 skip empty text sections.
2662 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2663
5393d741
ILT
26642011-06-22 Ian Lance Taylor <iant@google.com>
2665
2666 PR gold/12910
2667 * options.h (class General_options): Add --ctors-in-init-array.
2668 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2669 friends as SHT_PROGBITS for merging sections.
2670 (Layout::layout): Remove special handling of .init_array and
2671 friends. Don't sort if doing relocatable link. Sort for .ctors
2672 and .dtors if ctors_in_init_array.
2673 (Layout::make_output_section): Force correct section types for
2674 .init_array and friends. Don't sort if doing relocatable link,
2675 Don't sort .ctors and .dtors if ctors_in_init_array.
2676 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2677 (Layout::output_section_name): Add relobj parameter. Change all
2678 callers. Handle .ctors. and .dtors. in code rather than table.
2679 Handle .ctors and .dtors if ctors_in_init_array.
2680 (Layout::match_file_name): New function, moved from output.cc.
2681 * layout.h (class Layout): Update declarations.
2682 * output.cc: Include "layout.h".
2683 (Input_section_sort_entry::get_priority): New function.
2684 (Input_section_sort_entry::match_file_name): Just call
2685 Layout::match_file_name.
2686 (Output_section::Input_section_sort_init_fini_compare::operator()):
2687 Handle .ctors and .dtors. Sort by explicit priority rather than
2688 by name.
2689 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2690 * testsuite/initpri2.c: New test.
2691 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2692 (check_PROGRAMS): Add initpri2.
2693 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2694 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2695 * configure, testsuite/Makefile.in: Rebuild.
2696
e1f74f98
ILT
26972011-06-19 Ian Lance Taylor <iant@google.com>
2698
2699 PR gold/12880
2700 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2701 .interp section to a PT_INTERP segment even if we have seen a
2702 --dynamic-linker option. Don't do it if we have seen a PHDRS
2703 clause in a linker script.
2704 (Layout::finalize): Don't create a .interp section if we've
2705 already create a PT_INTERP segment.
2706 (Layout::create_interp): Always call choose_output_section (revert
2707 patch of 2011-06-17). Don't create PT_INTERP segment.
2708 * script-sections.cc
2709 (Script_sections::create_note_and_tls_segments): Add a .interp
2710 section to a PT_INTERP segment even if we have seen a
2711 --dynamic-linker option.
2712
766f91bb
ILT
27132011-06-18 Ian Lance Taylor <iant@google.com>
2714
2715 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2716 merely because a non-PT_LOAD segment has a dynamic reloc.
2717
0d212c3a
ILT
27182011-06-18 Ian Lance Taylor <iant@google.com>
2719
2720 * layout.cc (Layout::finish_dynamic_section): Don't create
2721 DT_FLAGS entry if not needed.
2722
911a5072
ILT
27232011-06-18 Ian Lance Taylor <iant@google.com>
2724
2725 PR gold/12745
2726 * layout.cc (Layout::layout_eh_frame): Correct handling of
2727 writable .eh_frame section.
2728
534b4e5f
ILT
27292011-06-17 Ian Lance Taylor <iant@google.com>
2730
2731 PR gold/12893
2732 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2733 symbol is redefined with the exact same object and value.
2734
10b4f102
ILT
27352011-06-17 Ian Lance Taylor <iant@google.com>
2736
2737 PR gold/12880
2738 * layout.h (class Layout): Add interp_segment_ field.
2739 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2740 (Layout::attach_allocated_section_to_segment): If making shared
2741 library, put .interp section in PT_INTERP segment.
2742 (Layout::finalize): Also call create_interp if -dynamic-linker
2743 option was used.
2744 (Layout::create_interp): Assert that there is no PT_INTERP
2745 segment. If not using a SECTIONS clause, use make_output_section.
2746 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2747 * script-sections.cc
2748 (Script_sections::create_note_and_tls_segments): If making shared
2749 library, put .interp section in PT_INTERP segment.
2750
a29b0dad
ILT
27512011-06-17 Ian Lance Taylor <iant@google.com>
2752
e588ea8d
ILT
2753 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2754 when making a shared library.
2755
27562011-06-17 Ian Lance Taylor <iant@google.com>
2757
2758 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2759 parameter. Change all callers. Don't issue warning about PC32
2760 against locally defined symbol.
a29b0dad 2761
9d3b0698
ILT
27622011-06-16 Ian Lance Taylor <iant@google.com>
2763
2764 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2765 occurs in same object.
2766
85b0f90c
AM
27672011-06-14 Alan Modra <amodra@gmail.com>
2768
2769 * po/POTFILES.in: Regenerate.
2770
a94907d9
ILT
27712011-06-09 Ian Lance Taylor <iant@google.com>
2772
2773 * script-sections.cc
2774 (Orphan_output_section::set_section_addresses): For a relocatable
2775 link set address to 0.
2776
4fb3a1c3
CC
27772011-06-09 Cary Coutant <ccoutant@google.com>
2778
2779 PR gold/12804
2780 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2781 used with --compress-debug-sections.
2782 * gold/object.cc (Sized_relobj_file::do_layout): Report
2783 uncompressed size of compressed input sections.
2784
61220854
CC
27852011-06-08 Cary Coutant <ccoutant@google.com>
2786
2787 PR gold/12804
2788 * testsuite/two_file_test_2_v1.cc: Change initialization of
2789 v2 to keep it in .data.
2790
e6455dfb
CC
27912011-06-07 Cary Coutant <ccoutant@google.com>
2792
2793 * common.cc (Symbol_table::do_allocate_commons_list): Call
2794 gold_fallback.
2795 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2796 (Errors::fallback): New function.
2797 (gold_fallback): New function.
2798 * errors.h (Errors::fallback): New function.
2799 * gold.cc (gold_exit): Change status parameter to enum; adjust
2800 all callers.
2801 (queue_initial_tasks): Call gold_fallback.
2802 * gold.h: Include cstdlib.
2803 (Exit_status): New enum type.
2804 (gold_exit): Change status parameter to enum.
2805 (gold_fallback): New function.
2806 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2807 (Layout::create_symtab_sections): Likewise.
2808 (Layout::create_shdrs): Likewise.
2809 * main.cc (main): Adjust call to gold_exit.
2810 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2811 (Output_data_got::add_got_entry_pair): Likewise.
2812 (Output_section::add_input_section): Likewise.
2813 (Output_section::add_output_section_data): Likewise.
2814 (Output_segment::set_section_list_addresses): Likewise.
2815 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2816
fb0e076f
CC
28172011-06-07 Cary Coutant <ccoutant@google.com>
2818
2819 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2820 for incremental links.
2821 * output.cc (Output_segment::set_section_list_addresses): Remove
2822 FIXME and test for TLS or BSS.
2823
a5ee4d5d
CC
28242011-06-07 Cary Coutant <ccoutant@google.com>
2825
2826 * testsuite/Makefile.am: Add incremental_copy_test,
2827 incremental_common_test_1.
2828 * testsuite/Makefile.in: Regenerate.
2829 * testsuite/common_test_1_v1.c: New source file.
2830 * testsuite/common_test_1_v2.c: New source file.
2831 * testsuite/copy_test_v1.cc: New source file.
2832
5146f448
CC
28332011-06-07 Cary Coutant <ccoutant@google.com>
2834
2835 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2836 update, allocate common from bss section's free list.
2837 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2838 linker-defined symbols.
2839 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2840 Skip GOT and PLT entries that are no longer referenced.
2841 (Output_section_incremental_inputs::write_info_blocks): Mark
2842 linker-defined symbols.
2843 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2844 * output.cc (Output_section::allocate): New function.
2845 * output.h (Output_section::allocate): New function.
2846 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2847 linker-defined symbols.
2848 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2849 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2850 (Symbol::init_base_output_data): Likewise.
2851 (Symbol::init_base_output_segment): Likewise.
2852 (Symbol::init_base_constant): Likewise.
2853 (Sized_symbol::init_output_data): Likewise.
2854 (Sized_symbol::init_output_segment): Likewise.
2855 (Sized_symbol::init_constant): Likewise.
2856 (Symbol_table::do_define_in_output_data): Likewise.
2857 (Symbol_table::do_define_in_output_segment): Likewise.
2858 (Symbol_table::do_define_as_constant): Likewise.
2859 * symtab.h (Symbol::is_predefined): New function.
2860 (Symbol::init_base_output_data): Add is_predefined parameter.
2861 (Symbol::init_base_output_segment): Likewise.
2862 (Symbol::init_base_constant): Likewise.
2863 (Symbol::is_predefined_): New data member.
2864 (Sized_symbol::init_output_data): Add is_predefined parameter.
2865 (Sized_symbol::init_output_segment): Likewise.
2866 (Sized_symbol::init_constant): Likewise.
2867 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2868
26d3c67d
CC
28692011-06-07 Cary Coutant <ccoutant@google.com>
2870
2871 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2872 instead of emit_copy_reloc.
2873 (Copy_relocs::emit_copy_reloc): Refactor.
2874 (Copy_relocs::make_copy_reloc): New function.
2875 (Copy_relocs::add_copy_reloc): Remove.
2876 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2877 section.
2878 (Copy_relocs::make_copy_reloc): New function.
2879 (Copy_relocs::add_copy_reloc): Remove.
2880 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2881 unchanged input files.
2882 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2883 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2884 Reserve BSS space for COPY relocations.
2885 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2886 (Output_section_incremental_inputs::write_info_blocks): Record
2887 whether a symbol is copied from a shared object.
2888 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2889 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2890 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2891 (Incremental_input_entry_reader::get_output_symbol_index): Add
2892 is_copy parameter.
2893 (Incremental_binary::emit_copy_relocs): New function.
2894 (Incremental_binary::do_emit_copy_relocs): New function.
2895 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2896 new data member.
2897 (Sized_incremental_binary::add_copy_reloc): New function.
2898 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2899 (Sized_incremental_binary::Copy_reloc): New struct.
2900 (Sized_incremental_binary::Copy_relocs): New typedef.
2901 (Sized_incremental_binary::copy_relocs_): New data member.
2902 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2903 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2904 * target.h (Sized_target::emit_copy_reloc): New function.
2905 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2906
7cdb37d9
CC
29072011-06-02 Cary Coutant <ccoutant@google.com>
2908
2909 PR gold/12163
2910 * gold/archive.cc (Archive::Archive): Initialize new data member.
2911 (Archive::include_all_members): Return if archive has already been
2912 included.
2913 * gold/archive.h (Archive::include_all_members_): New data member.
2914
cc643b88
NC
29152011-06-02 Nick Clifton <nickc@redhat.com>
2916
2917 * dynobj.h: Fix spelling mistake in comment.
2918 * output.cc: Likewise.
2919
f62a3ca7 29202011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2921 Asier Llano
f62a3ca7
DK
2922
2923 PR gold/12826
cc643b88 2924 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2925 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2926 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2927 redundant arm_exidx_test.so.
2928 * testsuite/Makefile.in: Regenerate.
2929 (check_SCRIPTS): Add pr12826.sh
2930 (check_DATA): Add pr12826.stdout
2931 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2932 * testsuite/pr12826.sh: New file.
2933 * testsuite/pr12826_1.s: Ditto.
2934 * testsuite/pr12826_1.s: Ditto.
2935
8dbe1edc
ILT
29362011-05-30 Ian Lance Taylor <iant@google.com>
2937
2938 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2939 sections.
2940
c49875be
ILT
29412011-05-29 Ian Lance Taylor <iant@google.com>
2942
2943 PR gold/12804
2944 * testsuite/Makefile.am: Use different file name for two_file_test
2945 temporary file for each incremental test.
2946 * testsuite/Makefile.in: Rebuild.
2947
69d53f7a
ILT
29482011-05-29 Ian Lance Taylor <iant@google.com>
2949
2950 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2951 binary input file is empty.
2952
41d0ab5f
ILT
29532011-05-27 Ian Lance Taylor <iant@google.com>
2954
2955 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2956 (ver_test_9.so): Likewise.
2957 * testsuite/Makefile.in: Rebuild.
2958
89d8a36b
CC
29592011-05-26 Cary Coutant <ccoutant@google.com>
2960
2961 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2962 * incremental.cc (Incremental_inputs::report_input_section): Fix
2963 comment, indentation.
2964 (Incremental_inputs::report_comdat_group): New function.
2965 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2966 of data for incremental input file entry.
2967 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2968 group count, COMDAT group signatures.
2969 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2970 an unchanged input file.
2971 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2972 Initialize new data member.
2973 (Incremental_object_entry::add_comdat_group): New function.
2974 (Incremental_object_entry::get_comdat_group_count): New function.
2975 (Incremental_object_entry::get_comdat_signature_key): New function.
2976 (Incremental_object_entry::groups_): New data member.
2977 (Incremental_inputs::report_comdat_group): New function.
2978 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2979 data for incremental input file entry.
2980 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2981 (Incremental_input_entry_reader::get_input_section): Adjust size of
2982 data for incremental input file entry.
2983 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2984 (Incremental_input_entry_reader::get_comdat_group_signature): New
2985 function.
2986 * object.cc (Sized_relobj::include_section_group): Report kept
2987 COMDAT groups for incremental links.
2988
1706a06f
ILT
29892011-05-24 David Meyer <pdox@google.com>
2990
2991 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2992 with name parameter. Add found_name parameter.
2993 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2994 * dirsearch.h (class Dirsearch): Update declaration.
2995
a10ae760
ILT
29962011-05-24 Ian Lance Taylor <iant@google.com>
2997
2998 * archive.cc (Library_base::should_include_member): Pull in object
2999 from archive if it defines the entry symbol.
3000 * parameters.cc (Parameters::entry): New function.
3001 * parameters.h (class Parameters): Declare entry.
3002 * output.h (class Output_file_header): Remove entry_ field.
3003 * output.cc (Output_file_header::Output_file_header): Remove entry
3004 parameter. Change all callers.
3005 (Output_file_header::entry): Use parameters->entry.
3006 * gold.cc (queue_middle_tasks): Likewise.
3007 * plugin.cc (Plugin_hook::run): Likewise.
3008
aa92d6ed
CC
30092011-05-24 Cary Coutant <ccoutant@google.com>
3010
3011 * gold.cc (queue_initial_tasks): Pass incremental base filename
3012 to Output_file::open_base_file; don't print error message.
3013 * incremental-dump.cc (main): Adjust call to
3014 Output_file::open_for_modification.
3015 * incremental-dump.cc (main): Likewise.
3016 * incremental.cc (Incremental_inputs::report_command_line):
3017 Ignore --incremental-base option when comparing command lines.
3018 Ignore parameter when given as separate argument.
3019 * options.h (class General_options): Add --incremental-base.
3020 * output.cc (Output_file::Output_file):
3021 (Output_file::open_base_file): Add base_name and writable parameters;
3022 read base file into new file; print error message here.
3023 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3024 callers.
3025 * output.h (Output_file::open_for_modification): Rename to...
3026 (Output_file::open_base_file): ...this; add base_name and
3027 writable parameters; adjust all callers.
3028 (Output_file::map_no_anonymous): Add writable parameter; adjust all
3029 callers.
3030 * testsuite/Makefile.am (incremental_test_4): Test
3031 --incremental-base.
3032 * testsuite/Makefile.in: Regenerate.
3033
2eedd706
CC
30342011-05-24 Cary Coutant <ccoutant@google.com>
3035
3036 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
3037 incremental_test_4.
3038 * testsuite/Makefile.in: Regenerate.
3039 * testsuite/two_file_test_1_v1.cc: New test source file.
3040 * testsuite/two_file_test_1b_v1.cc: New test source file.
3041 * testsuite/two_file_test_2_v1.cc: New test source file.
3042
0f1c85a6
CC
30432011-05-24 Cary Coutant <ccoutant@google.com>
3044
3045 * dynobj.h (Dynobj::do_dynobj): New function.
3046 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
3047 flag and soname for shared objects.
3048 * incremental.cc (Incremental_inputs::report_object): Make
3049 either Incremental_object_entry or Incremental_dynobj_entry; add
3050 soname to string table.
3051 (Incremental_inputs::report_input_section): Add assertion.
3052 (Output_section_incremental_inputs::set_final_data_size): Adjust
3053 type of input file entry for shared libraries; adjust size of
3054 shared library info entry.
3055 (Output_section_incremental_inputs::write_input_files): Write
3056 as_needed flag for shared libraries.
3057 (Output_section_incremental_inputs::write_info_blocks): Adjust type
3058 of input file entry for shared libraries; write soname.
3059 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
3060 soname from incremental info.
3061 * incremental.h (enum Incremental_input_flags): Add
3062 INCREMENTAL_INPUT_AS_NEEDED.
3063 (Incremental_input_entry::Incremental_input_entry): Initialize new
3064 data member.
3065 (Incremental_input_entry::set_as_needed): New function.
3066 (Incremental_input_entry::as_needed): New function.
3067 (Incremental_input_entry::do_dynobj_entry): New function.
3068 (Incremental_input_entry::as_needed_): New data member.
3069 (Incremental_object_entry::Incremental_object_entry): Don't check
3070 for shared library.
3071 (Incremental_object_entry::do_type): Likewise.
3072 (class Incremental_dynobj_entry): New class.
3073 (Incremental_input_entry_reader::as_needed): New function.
3074 (Incremental_input_entry_reader::get_soname): New function.
3075 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
3076 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
3077 size of shared library info entry.
58797674 3078 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
3079 incremental link when adding DT_NEEDED entries.
3080 * object.h (Object::Object): Initialize new data member.
3081 (Object::dynobj): New function.
3082 (Object::set_as_needed): New function.
3083 (Object::as_needed): New function.
3084 (Object::do_dynobj): New function.
3085 (Object::as_needed_): New data member.
3086
6fa2a40b
CC
30872011-05-24 Cary Coutant <ccoutant@google.com>
3088
3089 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3090 info; adjust display of GOT entries.
3091 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3092 vector of input objects; remove file_status_.
3093 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3094 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3095 got_plt reader; call target hooks to reserve GOT entries.
3096 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3097 of input file info header and GOT info entry.
3098 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3099 relocation info.
3100 (Got_plt_view_info::got_descriptor): Remove.
3101 (Got_plt_view_info::sym_index): New data member.
3102 (Got_plt_view_info::input_index): New data member.
3103 (Local_got_offset_visitor::visit): Write input file index.
3104 (Global_got_offset_visitor::visit): Write 0 for input file index.
3105 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3106 with sym_index and input_index.
3107 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3108 incremental info GOT entry; replace got_descriptor with input_index.
3109 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3110 map from input file index to object.
3111 (Sized_relobj_incr::do_layout): Replace direct data member reference
3112 with accessor function.
3113 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3114 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3115 Adjust size of input file info header.
3116 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3117 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3118 (Incremental_input_entry_reader::get_input_section): Adjust size of
3119 input file info header.
3120 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3121 of incremental info GOT entry.
3122 (Incremental_got_plt_reader::get_got_desc): Remove.
3123 (Incremental_got_plt_reader::get_got_symndx): New function.
3124 (Incremental_got_plt_reader::get_got_input_index): New function.
3125 (Sized_incremental_binary::Sized_incremental_binary): Remove
3126 file_status_; add input_objects_.
3127 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3128 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3129 (Sized_incremental_binary::file_is_unchanged): Remove.
3130 (Sized_incremental_binary::set_input_object): New function.
3131 (Sized_incremental_binary::input_object): New function.
3132 (Sized_incremental_binary::file_status_): Remove.
3133 (Sized_incremental_binary::input_objects_): New data member.
3134 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3135 references.
3136 (Sized_relobj_incr::invalid_address): Move to base class.
3137 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3138 class.
3139 (Sized_relobj_incr::do_output_section_offset): Likewise.
3140 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3141 (Sized_relobj_incr::section_offsets_): Likewise.
3142 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3143 function.
3144 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3145 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3146 with accessor function.
3147 (Sized_relobj_file::do_layout): Likewise.
3148 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3149 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3150 (Sized_relobj_file::compute_final_local_value): Replace refs to
3151 section_offsets_ with accessor function.
3152 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3153 * object.h (Relobj::Relobj): Initialize new data members.
3154 (Relobj::add_dyn_reloc): New function.
3155 (Relobj::first_dyn_reloc): New function.
3156 (Relobj::dyn_reloc_count): New function.
3157 (Relobj::first_dyn_reloc_): New data member.
3158 (Relobj::dyn_reloc_count_): New data member.
3159 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3160 references.
3161 (Sized_relobj::Address): New typedef.
3162 (Sized_relobj::invalid_address): Move here from child class.
3163 (Sized_relobj::Sized_relobj): Initialize new data members.
3164 (Sized_relobj::sized_relobj): New function.
3165 (Sized_relobj::is_output_section_offset_invalid): Move here from
3166 child class.
3167 (Sized_relobj::get_output_section_offset): Likewise.
3168 (Sized_relobj::local_has_got_offset): Likewise.
3169 (Sized_relobj::local_got_offset): Likewise.
3170 (Sized_relobj::set_local_got_offset): Likewise.
3171 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3172 (Sized_relobj::clear_got_offsets): New function.
3173 (Sized_relobj::section_offsets): Move here from child class.
3174 (Sized_relobj::do_output_section_offset): Likewise.
3175 (Sized_relobj::do_set_section_offset): Likewise.
3176 (Sized_relobj::Local_got_offsets): Likewise.
3177 (Sized_relobj::local_got_offsets_): Likewise.
3178 (Sized_relobj::section_offsets_): Likewise.
3179 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3180 references.
3181 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3182 class.
3183 (Sized_relobj_file::sized_relobj): New function
3184 (Sized_relobj_file::local_has_got_offset): Move to base class.
3185 (Sized_relobj_file::local_got_offset): Likewise.
3186 (Sized_relobj_file::set_local_got_offset): Likewise.
3187 (Sized_relobj_file::get_output_section_offset): Likewise.
3188 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3189 (Sized_relobj_file::do_output_section_offset): Likewise.
3190 (Sized_relobj_file::do_set_section_offset): Likewise.
3191 (Sized_relobj_file::Local_got_offsets): Likewise.
3192 (Sized_relobj_file::local_got_offsets_): Likewise.
3193 (Sized_relobj_file::section_offsets_): Likewise.
3194 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3195 (all constructors).
3196 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3197 (Output_reloc::get_symbol_index): Likewise.
3198 (Output_reloc::local_section_offset): Likewise.
3199 (Output_reloc::get_address): Likewise.
3200 (Output_reloc::symbol_value): Likewise.
3201 (Output_data_got::reserve_slot): Move to class definition.
3202 (Output_data_got::reserve_local): New function.
3203 (Output_data_got::reserve_slot_for_global): Remove.
3204 (Output_data_got::reserve_global): New function.
3205 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3206 (all constructors, two instantiations).
3207 (Output_reloc::get_relobj): New function (two instantiations).
3208 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3209 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3210 (Output_data_reloc::add_global): Adjust type of relobj.
3211 (Output_data_reloc::add_global_relative): Likewise.
3212 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3213 (Output_data_reloc::add_local): Likewise.
3214 (Output_data_reloc::add_local_relative): Likewise.
3215 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3216 (Output_data_reloc::add_local_section): Likewise.
3217 (Output_data_reloc::add_output_section): Likewise.
3218 (Output_data_reloc::add_absolute): Likewise.
3219 (Output_data_reloc::add_target_specific): Likewise.
3220 (Output_data_got::reserve_slot): Move definition here.
3221 (Output_data_got::reserve_local): New function.
3222 (Output_data_got::reserve_global): New function.
3223 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3224 section_offsets_ with accessor function.
3225 (Sized_relobj_file::write_sections): Likewise.
3226 (Sized_relobj_file::do_relocate_sections): Likewise.
3227 * target.h (Sized_target::reserve_local_got_entry): New function.
3228 (Sized_target::reserve_global_got_entry): New function.
3229 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3230 (Target_x86_64::reserve_global_got_entry): New function.
3231 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3232
4829d394
CC
32332011-05-23 Cary Coutant <ccoutant@google.com>
3234
3235 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3236 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3237 bit when checking got_type.
3238 * incremental.cc (Sized_incremental_binary::setup_readers):
3239 Store symbol table and string table locations; initialize bit vector
3240 of file status flags.
3241 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3242 unchanged files.
3243 (Sized_incremental_binary::do_process_got_plt): New function.
3244 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3245 (Output_section_incremental_inputs::set_final_data_size): Record
3246 file index for each input file.
3247 (Output_section_incremental_inputs::write_got_plt): Store file index
3248 instead of input entry offset for each GOT entry.
3249 * incremental.h
3250 (Incremental_input_entry::Incremental_input_entry): Initialize new
3251 data member.
3252 (Incremental_input_entry::set_offset): Store file index.
3253 (Incremental_input_entry::get_file_index): New function.
3254 (Incremental_input_entry::file_index_): New data member.
3255 (Incremental_binary::process_got_plt): New function.
3256 (Incremental_binary::do_process_got_plt): New function.
3257 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3258 data members.
3259 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3260 (Sized_incremental_binary::set_file_is_unchanged): New function.
3261 (Sized_incremental_binary::file_is_unchanged): New function.
3262 (Sized_incremental_binary::do_process_got_plt): New function.
3263 (Sized_incremental_binary::file_status_): New data member.
3264 (Sized_incremental_binary::main_symtab_loc_): New data member.
3265 (Sized_incremental_binary::main_strtab_loc_): New data member.
3266 * output.cc (Output_data_got::Got_entry::write): Add case
3267 RESERVED_CODE.
3268 (Output_data_got::add_global): Call add_got_entry.
3269 (Output_data_got::add_global_plt): Likewise.
3270 (Output_data_got::add_global_with_rel): Likewise.
3271 (Output_data_got::add_global_with_rela): Likewise.
3272 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3273 (Output_data_got::add_global_pair_with_rela): Likewise.
3274 (Output_data_got::add_local): Call add_got_entry.
3275 (Output_data_got::add_local_plt): Likewise.
3276 (Output_data_got::add_local_with_rel): Likewise.
3277 (Output_data_got::add_local_with_rela): Likewise.
3278 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3279 (Output_data_got::add_local_pair_with_rela): Likewise.
3280 (Output_data_got::reserve_slot): New function.
3281 (Output_data_got::reserve_slot_for_global): New function.
3282 (Output_data_got::add_got_entry): New function.
3283 (Output_data_got::add_got_entry_pair): New function.
3284 (Output_section::add_output_section_data): Edit FIXME.
3285 * output.h
3286 (Output_section_data_build::Output_section_data_build): New
3287 constructor with size parameter.
3288 (Output_data_space::Output_data_space): Likewise.
3289 (Output_data_got::Output_data_got): Initialize new data member; new
3290 constructor with size parameter.
3291 (Output_data_got::add_constant): Call add_got_entry.
3292 (Output_data_got::reserve_slot): New function.
3293 (Output_data_got::reserve_slot_for_global): New function.
3294 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3295 (Output_data_got::add_got_entry): New function.
3296 (Output_data_got::add_got_entry_pair): New function.
3297 (Output_data_got::free_list_): New data member.
3298 * target.h (Sized_target::init_got_plt_for_update): New function.
3299 (Sized_target::register_global_plt_entry): New function.
3300 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3301 Initialize new data member; call init; add constructor with PLT count.
3302 (Output_data_plt_x86_64::init): New function.
3303 (Output_data_plt_x86_64::add_relocation): New function.
3304 (Output_data_plt_x86_64::reserve_slot): New function.
3305 (Output_data_plt_x86_64::free_list_): New data member.
3306 (Target_x86_64::init_got_plt_for_update): New function.
3307 (Target_x86_64::register_global_plt_entry): New function.
3308 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3309 incremental updates.
3310 (Output_data_plt_x86_64::add_relocation): New function.
3311 * testsuite/object_unittest.cc (Object_test): Set default options.
3312
ec69d6da
ILT
33132011-05-16 Ian Lance Taylor <iant@google.com>
3314
3315 * options.h (class General_options): Make -i a synonym for -r.
3316
732e31de
ILT
33172011-05-16 Ian Lance Taylor <iant@google.com>
3318
3319 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3320
403676b5
CC
33212011-05-10 Cary Coutant <ccoutant@google.com>
3322
3323 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3324 strip_all (-s).
3325
5b7b7d6e
ILT
33262011-05-06 Ian Lance Taylor <iant@google.com>
3327
3328 * layout.cc (Layout::layout): If the output section flags change,
3329 update the ordering.
3330
f0f9babf
CC
33312011-04-25 Cary Coutant <ccoutant@google.com>
3332
3333 * incremental-dump.cc (dump_incremental_inputs): Print local
3334 symbol info for each input file.
3335 * incremental.cc
3336 (Output_section_incremental_inputs::set_final_data_size): Add local
3337 symbol info to input file entries in incremental info.
3338 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3339 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3340 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3341 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3342 implementation.
3343 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3344 (Sized_incr_relobj::do_relocate): Write the local symbols.
3345 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3346 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3347 Adjust size of input file header.
3348 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3349 (Incremental_inputs_reader::get_local_symbol_count): New function.
3350 (Incremental_inputs_reader::get_input_section): Adjust size of input
3351 file header.
3352 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3353 (Sized_incr_relobj::This): New typedef.
3354 (Sized_incr_relobj::sym_size): New const data member.
3355 (Sized_incr_relobj::Local_symbol): New struct.
3356 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3357 (Sized_incr_relobj::do_local_symbol_offset): New function.
3358 (Sized_incr_relobj::local_symbol_count_): New data member.
3359 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3360 (Sized_incr_relobj::local_symbol_index_): New data member.
3361 (Sized_incr_relobj::local_symbol_offset_): New data member.
3362 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3363 (Sized_incr_relobj::local_symbols_): New data member.
3364 * object.h (Relobj::output_local_symbol_count): New function.
3365 (Relobj::local_symbol_offset): New function.
3366 (Relobj::do_output_local_symbol_count): New function.
3367 (Relobj::do_local_symbol_offset): New function.
3368 (Sized_relobj::do_output_local_symbol_count): New function.
3369 (Sized_relobj::do_local_symbol_offset): New function.
3370
d0a9ace3
ILT
33712011-04-22 Vladimir Simonov <sv@sw.ru>
3372
3373 * descriptors.cc (set_close_on_exec): New function.
3374 (Descriptors::open): Use set_close_on_exec.
3375 * output.cc (S_ISLNK): Define if not defined.
3376
94a3fc8b
CC
33772011-04-22 Cary Coutant <ccoutant@google.com>
3378
3379 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3380 global symbol map.
3381 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3382 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3383 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3384 relocations.
3385 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3386 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3387 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3388 * incremental.h
3389 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3390 function.
3391 (Incremental_binary::apply_incremental_relocs): New function.
3392 (Incremental_binary::do_apply_incremental_relocs): New function.
3393 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3394 data member.
3395 (Sized_incremental_binary::add_global_symbol): New function.
3396 (Sized_incremental_binary::global_symbol): New function.
3397 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3398 (Sized_incremental_binary::symbol_map_): New data member.
3399 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3400 * target.h (Sized_target::apply_relocation): New function.
3401 * target-reloc.h (apply_relocation): New function.
3402 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3403
c87e4302
DK
34042011-04-22 Doug Kwan <dougkwan@google.com>
3405
3406 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3407 flag of a SHT_ARM_EXIDX section.
2e702c99 3408 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3409 * testsuite/Makefile.in: Regenerate.
3410 * testsuite/arm_exidx_test.s: New file.
3411 * testsuite/arm_exidx_test.sh: Same.
3412
e7782cf6
CC
34132011-04-20 Cary Coutant <ccoutant@google.com>
3414
3415 PR gold/12689
3416 * archive.h (Incremental_archive_entry::Archive_member):
3417 Initialize arg_serial_ (second constructor).
3418
308ecdc7
ILT
34192011-04-17 Ian Lance Taylor <iant@google.com>
3420
3421 * object.cc (Relocate_info::location): Simplify location string.
3422 * errors.cc (Errors::error_at_location): Don't print program
3423 name.
3424 (Errors::warning_at_location): Likewise.
3425 (Errors::undefined_symbol): Likewise.
3426 * testsuite/debug_msg.sh: Update accordingly.
3427
bec5b579
CC
34282011-04-14 Cary Coutant <ccoutant@google.com>
3429
3430 * gold/layout.cc (Layout::symtab_section_offset): New function.
3431 * gold/layout.h (Layout::symtab_section_offset): New function.
3432 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3433
88597d34
ILT
34342011-04-12 Ian Lance Taylor <iant@google.com>
3435
3436 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3437 with MREMAP_MAYMOVE.
3438 * output.h (class Output_file): Add map_is_allocated_ field.
3439 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3440 not available, provide stubs. If mremap is not available, #define
3441 it to gold_mremap.
3442 (MREMAP_MAYMOVE): Define if not defined.
3443 (Output_file::Output_file): Initialize map_is_allocated_.
3444 (Output_file::resize): Check map_is_allocated_.
3445 (Output_file::map_anonymous): If mmap fails, use malloc.
3446 (Output_file::unmap): Don't do anything for an anonymous map.
3447 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3448 is not available, provide stubs.
3449 (File_read::View::~View): Use free rather than delete[].
3450 (File_read::make_view): Use malloc rather than new[]. If mmap
3451 fails, use malloc.
3452 (File_read::find_or_make_view): Use malloc rather than new[].
3453 * gold.h: Remove HAVE_REMAP code.
3454 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3455 exists. Rename mremap to gold_mremap. If mmap is not available
3456 don't do anything.
3457 * configure, config.in: Rebuild.
3458
11e361bc
ILT
34592011-04-11 Ian Lance Taylor <iant@google.com>
3460
3461 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3462 initialize local variable v.
3463
cdc29364
CC
34642011-04-11 Cary Coutant <ccoutant@google.com>
3465
3466 * archive.cc (Archive::include_member): Adjust call to
3467 report_object.
3468 (Add_archive_symbols::run): Track argument serial numbers.
3469 (Lib_group::include_member): Likewise.
3470 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3471 * archive.h (Incremental_archive_entry::Archive_member):
3472 Initialize arg_serial_.
3473 (Archive_member::arg_serial_): New data member.
3474 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3475 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3476 incremental link.
3477 (Sized_dynobj::do_for_all_local_got_entries): New function.
3478 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3479 function.
3480 * fileread.cc (get_mtime): New function.
3481 * fileread.h (get_mtime): New function.
3482 * gold.cc (queue_initial_tasks): Check for incremental update.
3483 (process_incremental_input): New function.
3484 (queue_middle_tasks): Don't force valid target for incremental
3485 update.
3486 * incremental-dump.cc (find_input_containing_global): Adjust
3487 size of symbol info entry.
3488 (dump_incremental_inputs): Dump argument serial number and
3489 in_system_directory flag; bias shndx by 1; print symbol names
3490 when dumping per-file symbol lists; use new symbol info readers.
3491 * incremental.cc
3492 (Output_section_incremental_inputs:update_data_size): New function.
3493 (Sized_incremental_binary::setup_readers): Setup input readers
3494 for each input file; build maps for files added from libraries
3495 and scripts.
3496 (Sized_incremental_binary::check_input_args): New function.
3497 (Sized_incremental_binary::do_check_inputs): Build map of argument
3498 serial numbers to input arguments.
3499 (Sized_incremental_binary::do_file_has_changed): Rename
3500 do_file_is_unchanged to this; compare file modification times.
3501 (Sized_incremental_binary::do_init_layout): New function.
3502 (Sized_incremental_binary::do_reserve_layout): New function.
3503 (Sized_incremental_binary::do_get_input_reader): Remove.
3504 (Sized_incremental_binary::get_symtab_view): New function.
3505 (Incremental_checker::can_incrementally_link_output_file): Remove.
3506 (Incremental_inputs::report_command_line): Exclude --debug options.
3507 (Incremental_inputs::report_archive_begin): Add parameter; track
3508 argument serial numbers; don't put input file entry for archive
3509 before archive members.
3510 (Incremental_inputs::report_archive_end): Put input file entry
3511 for archive after archive members.
3512 (Incremental_inputs::report_object): Add parameter; track argument
3513 serial numbers and in_system_directory flag.
3514 (Incremental_inputs::report_script): Add parameter; track argument
3515 serial numbers.
3516 (Output_section_incremental_inputs::set_final_data_size): Adjust
3517 size of symbol info entry; check for forwarding symbols.
3518 (Output_section_incremental_inputs::write_input_files): Write
3519 in_system_directory flag and argument serial number.
3520 (Output_section_incremental_inputs::write_info_blocks): Map section
3521 indices between incremental info and original input file; store
3522 input section index for each symbol.
3523 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3524 change operator() to visit().
3525 (class Global_got_offset_visitor): Likewise.
3526 (class Global_symbol_visitor_got_plt):
3527 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3528 classes.
3529 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3530 (Sized_incr_relobj::do_read_symbols): New function.
3531 (Sized_incr_relobj::do_layout): New function.
3532 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3533 (Sized_incr_relobj::do_add_symbols): New function.
3534 (Sized_incr_relobj::do_should_include_member): New function.
3535 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3536 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3537 (Sized_incr_relobj::do_section_size): New function.
3538 (Sized_incr_relobj::do_section_name): New function.
3539 (Sized_incr_relobj::do_section_contents): New function.
3540 (Sized_incr_relobj::do_section_flags): New function.
3541 (Sized_incr_relobj::do_section_entsize): New function.
3542 (Sized_incr_relobj::do_section_address): New function.
3543 (Sized_incr_relobj::do_section_type): New function.
3544 (Sized_incr_relobj::do_section_link): New function.
3545 (Sized_incr_relobj::do_section_info): New function.
3546 (Sized_incr_relobj::do_section_addralign): New function.
3547 (Sized_incr_relobj::do_initialize_xindex): New function.
3548 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3549 (Sized_incr_relobj::do_read_relocs): New function.
3550 (Sized_incr_relobj::do_gc_process_relocs): New function.
3551 (Sized_incr_relobj::do_scan_relocs): New function.
3552 (Sized_incr_relobj::do_count_local_symbols): New function.
3553 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3554 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3555 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3556 (Sized_incr_relobj::do_relocate): New function.
3557 (Sized_incr_relobj::do_set_section_offset): New function.
3558 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3559 (Sized_incr_dynobj::do_read_symbols): New function.
3560 (Sized_incr_dynobj::do_layout): New function.
3561 (Sized_incr_dynobj::do_add_symbols): New function.
3562 (Sized_incr_dynobj::do_should_include_member): New function.
3563 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3564 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3565 (Sized_incr_dynobj::do_section_size): New function.
3566 (Sized_incr_dynobj::do_section_name): New function.
3567 (Sized_incr_dynobj::do_section_contents): New function.
3568 (Sized_incr_dynobj::do_section_flags): New function.
3569 (Sized_incr_dynobj::do_section_entsize): New function.
3570 (Sized_incr_dynobj::do_section_address): New function.
3571 (Sized_incr_dynobj::do_section_type): New function.
3572 (Sized_incr_dynobj::do_section_link): New function.
3573 (Sized_incr_dynobj::do_section_info): New function.
3574 (Sized_incr_dynobj::do_section_addralign): New function.
3575 (Sized_incr_dynobj::do_initialize_xindex): New function.
3576 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3577 (make_sized_incremental_object): New function.
3578 (Incremental_library::copy_unused_symbols): New function.
3579 (Incremental_library::do_for_all_unused_symbols): New function.
3580 * incremental.h (enum Incremental_input_flags): New type.
3581 (class Incremental_checker): Remove.
3582 (Incremental_input_entry::Incremental_input_entry): Add argument
3583 serial number.
3584 (Incremental_input_entry::arg_serial): New function.
3585 (Incremental_input_entry::set_is_in_system_directory): New function.
3586 (Incremental_input_entry::is_in_system_directory): New function.
3587 (Incremental_input_entry::arg_serial_): New data member.
3588 (Incremental_input_entry::is_in_system_directory_): New data member.
3589 (class Script_info): Move here from script.h.
3590 (Script_info::Script_info): Add filename parameter.
3591 (Script_info::filename): New function.
3592 (Script_info::filename_): New data member.
3593 (Incremental_script_entry::Incremental_script_entry): Add argument
3594 serial number.
3595 (Incremental_object_entry::Incremental_object_entry): Likewise.
3596 (Incremental_object_entry::add_input_section): Build list of input
3597 sections with map to original shndx.
3598 (Incremental_object_entry::get_input_section_index): New function.
3599 (Incremental_object_entry::shndx_): New data member.
3600 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3601 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3602 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3603 serial number.
3604 (Incremental_inputs::report_archive_begin): Likewise.
3605 (Incremental_inputs::report_object): Likewise.
3606 (Incremental_inputs::report_script): Likewise.
3607 (class Incremental_global_symbol_reader): New class.
3608 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3609 and store flags and input file type.
3610 (Incremental_input_entry_reader::arg_serial): New function.
3611 (Incremental_input_entry_reader::type): Extract type from flags.
3612 (Incremental_input_entry_reader::is_in_system_directory): New function.
3613 (Incremental_input_entry_reader::get_input_section_count): Call
3614 accessor function for type.
3615 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3616 function for type; adjust size of global symbol entry.
3617 (Incremental_input_entry_reader::get_global_symbol_count): Call
3618 accessor function for type.
3619 (Incremental_input_entry_reader::get_object_count): Likewise.
3620 (Incremental_input_entry_reader::get_object_offset): Likewise.
3621 (Incremental_input_entry_reader::get_member_count): Likewise.
3622 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3623 (Incremental_input_entry_reader::get_member_offset): Likewise.
3624 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3625 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3626 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3627 (Incremental_input_entry_reader::get_global_symbol_reader): New
3628 function.
3629 (Incremental_input_entry_reader::get_output_symbol_index): New
3630 function.
3631 (Incremental_input_entry_reader::type_): Remove.
3632 (Incremental_input_entry_reader::flags_): New data member.
3633 (Incremental_inputs_reader::input_file_offset): New function.
3634 (Incremental_inputs_reader::input_file_index): New function.
3635 (Incremental_inputs_reader::input_file): Call input_file_offset.
3636 (Incremental_inputs_reader::input_file_at_offset): New function.
3637 (Incremental_relocs_reader::get_r_type): Reformat.
3638 (Incremental_relocs_reader::get_r_shndx): Reformat.
3639 (Incremental_relocs_reader::get_r_offset): Reformat.
3640 (Incremental_relocs_reader::data): New function.
3641 (Incremental_binary::Incremental_binary): Initialize new data members.
3642 (Incremental_binary::check_inputs): Add cmdline parameter.
3643 (Incremental_binary::file_is_unchanged): Remove.
3644 (Input_reader::arg_serial): New function.
3645 (Input_reader::get_unused_symbol_count): New function.
3646 (Input_reader::get_unused_symbol): New function.
3647 (Input_reader::do_arg_serial): New function.
3648 (Input_reader::do_get_unused_symbol_count): New function.
3649 (Input_reader::do_get_unused_symbol): New function.
3650 (Incremental_binary::input_file_count): New function.
3651 (Incremental_binary::get_input_reader): Change signature to use
3652 index instead of filename.
3653 (Incremental_binary::file_has_changed): New function.
3654 (Incremental_binary::get_input_argument): New function.
3655 (Incremental_binary::get_library): New function.
3656 (Incremental_binary::get_script_info): New function.
3657 (Incremental_binary::init_layout): New function.
3658 (Incremental_binary::reserve_layout): New function.
3659 (Incremental_binary::output_file): New function.
3660 (Incremental_binary::do_check_inputs): New function.
3661 (Incremental_binary::do_file_is_unchanged): Remove.
3662 (Incremental_binary::do_file_has_changed): New function.
3663 (Incremental_binary::do_init_layout): New function.
3664 (Incremental_binary::do_reserve_layout): New function.
3665 (Incremental_binary::do_input_file_count): New function.
3666 (Incremental_binary::do_get_input_reader): Change signature.
3667 (Incremental_binary::input_args_map_): New data member.
3668 (Incremental_binary::library_map_): New data member.
3669 (Incremental_binary::script_map_): New data member.
3670 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3671 new data members.
3672 (Sized_incremental_binary::output_section): New function.
3673 (Sized_incremental_binary::inputs_reader): Add const.
3674 (Sized_incremental_binary::symtab_reader): Add const.
3675 (Sized_incremental_binary::relocs_reader): Add const.
3676 (Sized_incremental_binary::got_plt_reader): Add const.
3677 (Sized_incremental_binary::get_symtab_view): New function.
3678 (Sized_incremental_binary::Inputs_reader): New typedef.
3679 (Sized_incremental_binary::Input_entry_reader): New typedef.
3680 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3681 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3682 (Sized_incremental_binary::do_file_has_changed): New function.
3683 (Sized_incremental_binary::do_init_layout): New function.
3684 (Sized_incremental_binary::do_reserve_layout): New function.
3685 (Sized_input_reader::Inputs_reader): Remove.
3686 (Sized_input_reader::Input_entry_reader): Remove.
3687 (Sized_input_reader::do_arg_serial): New function.
3688 (Sized_input_reader::do_get_unused_symbol_count): New function.
3689 (Sized_input_reader::do_get_unused_symbol): New function.
3690 (Sized_incremental_binary::do_input_file_count): New function.
3691 (Sized_incremental_binary::do_get_input_reader): Change signature;
3692 use index instead of filename.
3693 (Sized_incremental_binary::section_map_): New data member.
3694 (Sized_incremental_binary::input_entry_readers_): New data member.
3695 (class Sized_incr_relobj): New class.
3696 (class Sized_incr_dynobj): New class.
3697 (make_sized_incremental_object): New function.
3698 (class Incremental_library): New class.
3699 * layout.cc (Free_list::num_lists): New static data member.
3700 (Free_list::num_nodes): New static data member.
3701 (Free_list::num_removes): New static data member.
3702 (Free_list::num_remove_visits): New static data member.
3703 (Free_list::num_allocates): New static data member.
3704 (Free_list::num_allocate_visits): New static data member.
3705 (Free_list::init): New function.
3706 (Free_list::remove): New function.
3707 (Free_list::allocate): New function.
3708 (Free_list::dump): New function.
3709 (Free_list::print_stats): New function.
3710 (Layout_task_runner::run): Resize output file for incremental updates.
3711 (Layout::Layout): Initialize new data members.
3712 (Layout::set_incremental_base): New function.
3713 (Layout::init_fixed_output_section): New function.
3714 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3715 incremental updates.
3716 (Layout::create_gold_note): Do not create gold note section for
3717 incremental updates.
3718 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3719 for incremental updates.
3720 (Layout::set_section_offsets): For incremental updates, allocate space
3721 from free list.
3722 (Layout::create_symtab_sections): Layout with offsets relative to
3723 start of section; for incremental updates, allocate space from free
3724 list.
3725 (Layout::create_shdrs): For incremental updates, allocate space from
3726 free list.
3727 (Layout::finish_dynamic_section): For incremental updates, do not
3728 check --as-needed (fixed in subsequent patch).
3729 * layout.h (class Free_list): New class.
3730 (Layout::set_incremental_base): New function.
3731 (Layout::incremental_base): New function.
3732 (Layout::init_fixed_output_section): New function.
3733 (Layout::allocate): New function.
3734 (Layout::incremental_base_): New data member.
3735 (Layout::free_list_): New data member.
3736 * main.cc (main): Print Free_list statistics.
3737 * object.cc (Relobj::finalize_incremental_relocs): Add
3738 clear_counts parameter; clear counts only when clear_counts is set.
3739 (Sized_relobj::Sized_relobj): Initialize new base class.
3740 (Sized_relobj::do_layout): Don't report special sections.
3741 (Sized_relobj::do_for_all_local_got_entries): New function.
3742 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3743 symtab_off to all symbol table offsets.
3744 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3745 * object.h (class Got_offset_list): Move to top of file.
3746 (Object::Object): Allow case where input_file == NULL.
3747 (Object::~Object): Likewise.
3748 (Object::input_file): Assert that input_file != NULL.
3749 (Object::lock): Allow case where input_file == NULL.
3750 (Object::unlock): Likewise.
3751 (Object::is_locked): Likewise.
3752 (Object::token): Likewise.
3753 (Object::release): Likewise.
3754 (Object::is_incremental): New function.
3755 (Object::get_mtime): New function.
3756 (Object::for_all_local_got_entries): New function.
3757 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3758 (Object::set_is_in_system_directory): New function.
3759 (Object::is_in_system_directory): New function.
3760 (Object::do_is_incremental): New function.
3761 (Object::do_get_mtime): New function.
3762 (Object::do_for_all_local_got_entries): New function.
3763 (Object::is_in_system_directory_): New data member.
3764 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3765 (class Sized_relobj_base): New class.
3766 (class Sized_relobj): Derive from Sized_relobj_base.
3767 (class Sized_relobj::Symbols): Redeclare from base class.
3768 (class Sized_relobj::local_got_offset_list): Remove.
3769 (class Sized_relobj::Output_sections): Redeclare from base class.
3770 (class Sized_relobj::do_for_all_local_got_entries): New function.
3771 (class Sized_relobj::write_local_symbols): Add offset parameter.
3772 (class Sized_relobj::local_symbol_offset_): Update comment.
3773 (class Sized_relobj::local_dynsym_offset_): Update comment.
3774 * options.cc (Input_arguments::add_file): Remove const.
3775 * options.h (Input_file_argument::Input_file_argument):
3776 Initialize arg_serial_ (all constructors).
3777 (Input_file_argument::set_arg_serial): New function.
3778 (Input_file_argument::arg_serial): New function.
3779 (Input_file_argument::arg_serial_): New data member.
3780 (Input_arguments::Input_arguments): Initialize file_count_.
3781 (Input_arguments::add_file): Remove const.
3782 (Input_arguments::number_of_input_files): New function.
3783 (Input_arguments::file_count_): New data member.
3784 (Command_line::number_of_input_files): Call
3785 Input_arguments::number_of_input_files.
3786 * output.cc (Output_segment_headers::Output_segment_headers):
3787 Set current size.
3788 (Output_section::Input_section::current_data_size): New function.
3789 (Output_section::Output_section): Initialize new data members.
3790 (Output_section::add_input_section): Don't do merge sections for
3791 an incremental link; allocate space from free list for an
3792 incremental update.
3793 (Output_section::add_output_section_data): Allocate space from
3794 free list for an incremental update.
3795 (Output_section::update_data_size): New function.
3796 (Output_section::set_fixed_layout): New function.
3797 (Output_section::reserve): New function.
3798 (Output_segment::set_section_addresses): Remove const.
3799 (Output_segment::set_section_list_addresses): Remove const; allocate
3800 space from free list for an incremental update.
3801 (Output_segment::set_offset): Adjust size of RELRO segment for an
3802 incremental update.
3803 * output.h (Output_data::current_data_size): Move here from
3804 child classes.
3805 (Output_data::pre_finalize_data_size): New function.
3806 (Output_data::update_data_size): New function.
3807 (Output_section_headers::update_data_size): new function.
3808 (Output_section_data_build::current_data_size): Move to Output_data.
3809 (Output_data_strtab::update_data_size): New function.
3810 (Output_section::current_data_size): Move to Output_data.
3811 (Output_section::set_fixed_layout): New function.
3812 (Output_section::has_fixed_layout): New function.
3813 (Output_section::reserve): New function.
3814 (Output_section::update_data_size): New function.
3815 (Output_section::has_fixed_layout_): New data member.
3816 (Output_section::free_list_): New data member.
3817 (Output_segment::set_section_addresses): Remove const.
3818 (Output_segment::set_section_list_addresses): Remove const.
3819 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3820 New function.
3821 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3822 New function.
3823 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3824 parameter when calling Add_symbols constructor; store argument
3825 serial number for members of a lib group.
3826 (Add_symbols::locks): Allow case where token == NULL.
3827 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3828 (Read_member::~Read_member): New function.
3829 (Read_member::is_runnable): New function.
3830 (Read_member::locks): New function.
3831 (Read_member::run): New function.
3832 (Check_script::~Check_script): New function.
3833 (Check_script::is_runnable): New function.
3834 (Check_script::locks): New function.
3835 (Check_script::run): New function.
3836 (Check_library::~Check_library): New function.
3837 (Check_library::is_runnable): New function.
3838 (Check_library::locks): New function.
3839 (Check_library::run): New function.
3840 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3841 (Add_symbols::library_): New data member.
3842 (class Read_member): New class.
3843 (class Check_script): New class.
3844 (class Check_library): New class.
3845 * reloc.cc (Read_relocs::is_runnable): Allow case where
3846 token == NULL.
3847 (Read_relocs::locks): Likewise.
3848 (Scan_relocs::locks): Likewise.
3849 (Relocate_task::locks): Likewise.
3850 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3851 to clear counters.
3852 (Sized_relobj::incremental_relocs_scan): Fix comment.
3853 (Sized_relobj::do_relocate): Pass output file offset to
3854 write_local_symbols.
3855 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3856 from class declaration.
3857 * script.cc (read_input_script): Allocate Script_info; pass
3858 argument serial number to report_script.
3859 * script.h (class Script_info): Move to incremental.h.
3860 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3861 * symtab.h (Symbol_table::add_from_incrobj): New function.
3862 (Symbol_table::set_file_offset): New function.
3863
b961d0d7
CC
38642011-04-05 Cary Coutant <ccoutant@google.com>
3865
3866 * incremental-dump.cc (dump_incremental_inputs): Change signature
3867 to take a Sized_incremental_binary; change caller. Use readers
3868 in Sized_incremental_binary.
3869 * incremental.cc
3870 (Sized_incremental_binary::find_incremental_inputs_sections):
3871 Rename do_find_incremental_inputs_sections to this.
3872 (Sized_incremental_binary::setup_readers): New function.
3873 (Sized_incremental_binary::do_check_inputs): Check
3874 has_incremental_info_ flag; move setup code to setup_readers;
3875 use input readers.
3876 (Sized_incremental_binary::do_file_is_unchanged): New function.
3877 (Sized_incremental_binary::do_get_input_reader): New function.
3878 * incremental.h (class Incremental_binary): Move to end of file.
3879 (Incremental_binary::file_is_unchanged): New function.
3880 (Incremental_binary::do_file_is_unchanged): New function.
3881 (Incremental_binary::Input_reader): New class.
3882 (Incremental_binary::get_input_reader): New function.
3883 (class Sized_incremental_binary): Move to end of file.
3884 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3885 input section reader classes.
3886 (Sized_incremental_binary::has_incremental_info): New function.
3887 (Sized_incremental_binary::inputs_reader): New function.
3888 (Sized_incremental_binary::symtab_reader): New function.
3889 (Sized_incremental_binary::relocs_reader): New function.
3890 (Sized_incremental_binary::got_plt_reader): New function.
3891 (Sized_incremental_binary::do_file_is_unchanged): New function.
3892 (Sized_incremental_binary::Sized_input_reader): New class.
3893 (Sized_incremental_binary::get_input_reader): New function.
3894 (Sized_incremental_binary::find_incremental_inputs_sections):
3895 Rename do_find_incremental_inputs_sections to this.
3896 (Sized_incremental_binary::setup_readers): New function.
3897 (Sized_incremental_binary::has_incremental_info_): New data member.
3898 (Sized_incremental_binary::inputs_reader_): New data member.
3899 (Sized_incremental_binary::symtab_reader_): New data member.
3900 (Sized_incremental_binary::relocs_reader_): New data member.
3901 (Sized_incremental_binary::got_plt_reader_): New data member.
3902 (Sized_incremental_binary::current_input_file_): New data member.
3903
a869183f
PP
39042011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3905
3906 PR gold/12640
3907 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3908 violation.
3909
39102011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3911
3912 * archive.cc (Archive::include_member): Adjust call to report_object.
3913 (Add_archive_symbols::run): Add script_info to call to
3914 report_archive_begin.
3915 (Lib_group::include_member): Adjust call to report_object.
3916 (Add_lib_group_symbols::run): Adjust call to report_object.
3917 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3918 blocks. Add object count for script input files.
3919 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3920 script_info parameter; change all callers.
3921 (Incremental_inputs::report_object): Add script_info parameter;
3922 change all callers.
3923 (Incremental_inputs::report_script): Store backpointer to
3924 incremental info entry.
3925 (Output_section_incremental_inputs::set_final_data_size): Record
3926 additional information for scripts.
3927 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3928 * incremental.h (Incremental_script_entry::add_object): New function.
3929 (Incremental_script_entry::get_object_count): New function.
3930 (Incremental_script_entry::get_object): New function.
3931 (Incremental_script_entry::objects_): New data member; adjust
3932 constructor.
3933 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3934 (Incremental_inputs::report_object): Add script_info parameter.
3935 (Incremental_inputs_reader::get_object_count): New function.
3936 (Incremental_inputs_reader::get_object_offset): New function.
3937 * options.cc (Input_arguments::add_file): Return reference to
3938 new input argument.
3939 * options.h (Input_argument::set_script_info): New function.
3940 (Input_argument::script_info): New function.
3941 (Input_argument::script_info_): New data member; adjust all
3942 constructors.
3943 (Input_file_group::add_file): Return reference to new input argument.
3944 (Input_file_lib::add_file): Likewise.
3945 (Input_arguments::add_file): Likewise.
3946 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3947 * script.cc (Parser_closure::Parser_closure): Add script_info
3948 parameter; adjust all callers.
3949 (Parser_closure::script_info): New function.
3950 (Parser_closure::script_info_): New data member.
3951 (read_input_script): Report scripts earlier to incremental info.
3952 (script_add_file): Set script_info in Input_argument.
3953 (script_add_library): Likewise.
3954 * script.h (Script_options::Script_info): Rewrite class.
3955
a869183f 39562011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3957
3958 * archive.cc (Library_base::should_include_member): Move
3959 method here from class Archive.
3960 (Archive::Archive): Initialize base class.
3961 (Archive::should_include_member): Move to base class.
3962 (Archive::do_for_all_unused_symbols): New function.
3963 (Add_archive_symbols::run): Remove redundant access to
3964 incremental_inputs.
3965 (Lib_group::Lib_group): Initialize base class.
3966 (Lib_group::do_filename): New function.
3967 (Lib_group::include_member): Pass pointer to Lib_group to
3968 report_object.
3969 (Lib_group::do_for_all_unused_symbols): New function.
3970 (Add_lib_group_symbols::run): Report archive information for
3971 incremental links.
3972 * archive.h (class Library_base): New base class.
3973 (class Archive): Derive from Library_base.
3974 (Archive::filename): Move to base class.
3975 (Archive::set_incremental_info): Likewise.
3976 (Archive::incremental_info): Likewise.
3977 (Archive::Should_include): Likewise.
3978 (Archive::should_include_member): Likewise.
3979 (Archive::Armap_entry): Remove.
3980 (Archive::Unused_symbol_iterator): Remove.
3981 (Archive::unused_symbols_begin): Remove.
3982 (Archive::unused_symbols_end): Remove.
3983 (Archive::do_filename): New function.
3984 (Archive::do_get_mtime): New function.
3985 (Archive::do_for_all_unused_symbols): New function.
3986 (Archive::task_): Move to base class.
3987 (Archive::incremental_info_): Likewise.
3988 (class Lib_group): Derive from Library_base.
3989 (Lib_group::do_filename): New function.
3990 (Lib_group::do_get_mtime): New function.
3991 (Lib_group::do_for_all_unused_symbols): New function.
3992 (Lib_group::task_): Move to base class.
3993 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3994 function.
3995 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3996 function.
3997 * incremental.cc (Incremental_inputs::report_archive_begin):
3998 Use Library_base; call library's get_mtime; add incremental inputs
3999 entry before members.
4000 (class Unused_symbol_visitor): New class.
4001 (Incremental_inputs::report_archive_end): Use Library_base; use
4002 visitor class to record unused symbols; don't add incremental inputs
4003 entry after members.
4004 (Incremental_inputs::report_object): Use Library_base.
4005 * incremental.h
4006 (Incremental_archive_entry::Incremental_archive_entry): Remove
4007 unused Archive parameter.
4008 (Incremental_inputs::report_archive_begin): Use Library_base.
4009 (Incremental_inputs::report_archive_end): Likewise.
4010 (Incremental_inputs::report_object): Likewise.
4011 * object.cc (Sized_relobj::do_for_all_global_symbols): New
4012 function.
4013 * object.h (Object::for_all_global_symbols): New function.
4014 (Object::do_for_all_global_symbols): New function.
4015 (Sized_relobj::do_for_all_global_symbols): New function.
4016 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
4017 function.
4018 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
4019 function.
4020
61ab3e40
ILT
40212011-03-27 Ian Lance Taylor <iant@google.com>
4022
4023 * archive.cc (Archive::interpret_header): Return -1 if something
4024 goes wrong. Change callers accordingly.
4025
30e1f9e6
CC
40262011-03-25 Cary Coutant <ccoutant@google.com>
4027
4028 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
4029 * testsuite/Makefile.in: Regenerate.
4030
9370ce59 40312011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
4032
4033 * plugin.cc (get_view): New.
4034 (Plugin::load): Pass get_view to the plugin.
4035 (Plugin_manager::get_view): New.
4036
9312bb0a
ILT
40372011-03-21 Ian Lance Taylor <iant@google.com>
4038
4039 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 4040 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 4041
7e12ba9e
ST
40422011-03-21 Sriraman Tallam <tmsriram@google.com>
4043
4044 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
4045 Change == to -eq.
4046 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
4047 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
4048 Change == to -eq.
4049 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
4050 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
4051
fd7a005d
ILT
40522011-03-14 Ian Lance Taylor <iant@google.com>
4053
4054 * script-sections.cc (Sort_output_sections::script_compare):
4055 Rename from is_before, change return type.
4056 (Sort_output_sections::operator()): Adjust accordingly.
4057
ed16fd1b
ILT
40582011-03-11 Jeffrey Yasskin <jyasskin@google.com>
4059
4060 PR gold/12572
4061 * testsuite/odr_violation2.cc: Add comment to make all error line
4062 numbers double digits.
4063 * testsuite/debug_msg.sh: Adjust expected errors.
4064
71ff8986
ILT
40652011-03-09 Jeffrey Yasskin <jyasskin@google.com>
4066
4067 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4068 but mark earlier ones as non-canonical
4069 (offset_to_iterator): Update search target and example
4070 (do_addr2line): Return extra lines in a vector*
4071 (format_file_lineno): Extract from do_addr2line
4072 (one_addr2line): Add vector* out-param
4073 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
4074 when a lineno entry appeared last for its instruction
4075 (Dwarf_line_info): Add vector* out-param
4076 * object.cc (Relocate_info): Pass NULL for the vector* out-param
4077 * symtab.cc (Odr_violation_compare): Include the lineno in the
4078 comparison again.
4079 (linenos_from_loc): New. Combine the canonical line for an
4080 address with its other lines.
4081 (True_if_intersect): New. Helper functor to make
4082 std::set_intersection a query.
4083 (detect_odr_violations): Compare sets of lines instead of just
4084 one line for each function. This became less deterministic, but
4085 has fewer false positives.
4086 * symtab.h: Declarations.
4087 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4088 mix an optimized and non-optimized object in the same binary
4089 (odr_violation2.so): Same.
4090 * testsuite/Makefile.in: Regenerate from Makefile.am.
4091 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4092 * testsuite/debug_msg.sh: Update line numbers and add
4093 assertions.
4094 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4095 non-optimized context.
4096 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4097 isn't inlined, and use OdrDerived in an optimized context.
4098 * testsuite/odr_header1.h: Defines OdrDerived, where
4099 optimization will change the
4100 first-instruction-in-the-destructor's file and line number.
4101 * testsuite/odr_header2.h: Defines OdrBase.
4102
a19fefdc
ILT
41032011-03-09 Ian Lance Taylor <iant@google.com>
4104
4105 * fileread.cc (File_read::clear_views): Don't delete the whole
4106 file view.
4107
ecb351e9
ILT
41082011-03-08 Ian Lance Taylor <iant@google.com>
4109
4110 PR gold/12525
4111 * fileread.cc: #include <climits>.
4112 (GOLD_IOV_MAX): Define.
4113 (File_read::read_multiple): Limit number of entries by iov_max.
4114 * fileread.h (class File_read): Always set max_readv_entries to
4115 128.
4116
b821d13c
ILT
41172011-03-07 Ian Lance Taylor <iant@google.com>
4118
4119 PR gold/12525
4120 * options.h (class General_options): Add -dy and -dn.
4121
89243142
CC
41222011-03-02 Cary Coutant <ccoutant@google.com>
4123
4124 * testsuite/script_test_9.t: Add TLS segment.
4125
d0773f31
ILT
41262011-03-02 Simon Baldwin <simonb@google.com>
4127
4128 * configure.ac: Add check for gnu_indirect_function support in
4129 the toolchain building binutils.
4130 * configure: Rebuild.
4131
9370ce59 41322011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4133
4134 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4135 plugin only symbols.
4136 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4137 in plugin files as not needed in the symbol table.
4138
4cf7a849
ST
41392011-02-11 Sriraman Tallam <tmsriram@google.com>
4140
4141 * output.cc (Output_section::add_input_section): Delay fill
4142 generation for section ordering.
4143
b578bd7d
ILT
41442011-02-09 Ian Lance Taylor <iant@google.com>
4145
4146 PR gold/12316
4147 * object.h (class Sized_relobj): Remove clear_local_symbols.
4148 * reloc.cc (Sized_relobj::do_relocate): Don't call
4149 clear_local_symbols.
4150
9370ce59 41512011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4152
4153 * plugin.cc (is_visible_from_outside): Return true for symbols
4154 in the -u option.
4155
55382fb7
ILT
41562011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4157
4158 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4159 filename.
4160
4e271fff
ST
41612011-02-02 Sriraman Tallam <tmsriram@google.com>
4162
4163 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4164 to std::string.
4e271fff 4165 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4166 section_name to be std::string.
4e271fff
ST
4167 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4168
d433c3ac
ILT
41692011-01-25 Ian Lance Taylor <iant@google.com>
4170
4171 * script.cc (script_add_extern): Rewrite to use
4172 add_symbol_reference.
4173
880473a6
DK
41742011-01-25 Doug Kwan <dougkwan@google.com>
4175
d433c3ac 4176 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4177
f30f86fa
ILT
41782011-01-24 Ian Lance Taylor <iant@google.com>
4179
4180 * options.h (class General_options): Accept
4181 --no-detect-odr-violations.
4182
8e51a0b9
ILT
41832011-01-24 Ian Lance Taylor <iant@google.com>
4184
4185 * version.cc (version_string): Bump to 1.11.
4186
0f3b89d8
ILT
41872011-01-24 Ian Lance Taylor <iant@google.com>
4188
4189 * plugin.cc (class Plugin_rescan): Define new class.
4190 (Plugin_manager::claim_file): Set any_claimed_.
4191 (Plugin_manager::save_archive): New function.
4192 (Plugin_manager::save_input_group): New function.
4193 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4194 necessary.
4195 (Plugin_manager::new_undefined_symbol): New function.
4196 (Plugin_manager::rescan): New function.
4197 (Plugin_manager::rescannable_defines): New function.
4198 (Plugin_manager::add_input_file): Set any_added_.
4199 * plugin.h (class Plugin_manager): define new fields rescannable_,
4200 undefined_symbols_, any_claimed_, and any_added_. Declare
4201 Plugin_rescan as friend. Declare new functions.
4202 (Plugin_manager::Rescannable): Define type.
4203 (Plugin_manager::Rescannable_list): Define type.
4204 (Plugin_manager::Undefined_symbol_list): Define type.
4205 (Plugin_manager::Plugin_manager): Initialize new fields.
4206 * archive.cc (Archive::defines_symbol): New function.
4207 (Add_archive_symbols::run): Pass archive to plugins if any.
4208 * archive.h (class Archive): Declare defines_symbol.
4209 * readsyms.cc (Input_group::~Input_group): New function.
4210 (Finish_group::run): Pass input_group to plugins if any.
4211 * readsyms.h (class Input_group): Declare destructor.
4212 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4213 any.
4214
3bb951e5
ILT
42152011-01-10 Ian Lance Taylor <iant@google.com>
4216
4217 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4218 section as relro.
4219 (Layout::set_segment_offsets): Reset increase_relro before calling
4220 set_section_addresses a second time.
4221
0aa45fac
CC
42222011-01-04 Cary Coutant <ccoutant@google.com>
4223
4224 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4225 sections before NOBITS sections.
4226
0db46eb4
L
42272011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4228
4229 * version.cc (print_version): Update copyright to 2011.
4230
829c9745
CC
42312010-12-23 Cary Coutant <ccoutant@google.com>
4232
4233 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4234 of OS to this->add. Add OD parameter to second form of the function.
4235
7500420b
ILT
42362010-12-20 Ian Lance Taylor <iant@google.com>
4237
4238 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4239 second of two consecutive entries with same offset.
4240
f8e9a930
RW
42412010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4242
4243 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4244 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4245 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4246 to avoid unneeded links against $(LDADD).
4247 * testsuite/Makefile.in: Regenerate.
4248
2fbb4320
ILT
42492010-12-15 Ian Lance Taylor <iant@google.com>
4250
4251 PR gold/12324
4252 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4253 for R_X86_64_32 and R_X86_64_PC32.
4254 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4255 ver_matching_def_pic.o.
4256 (ver_matching_def_pic.o): New target.
4257
fedb228d
RW
42582010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4259
4260 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4261 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4262 Move definition before File_read::View member definitions.
4263 (File_read::View::~View): Initialize and hold lock before
4264 updating current_mapped_bytes.
4265
9b547ce6
RW
42662010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4267
4268 * dwarf_reader.cc: Remove outdated comment.
4269 * gold-threads.cc: Fix typo in error message.
4270 * archive.cc: Fix typos in comments.
4271 * archive.h: Likewise.
4272 * arm-reloc-property.cc: Likewise.
4273 * arm-reloc-property.h: Likewise.
4274 * arm-reloc.def: Likewise.
4275 * arm.cc: Likewise.
4276 * attributes.h: Likewise.
4277 * cref.cc: Likewise.
4278 * ehframe.cc: Likewise.
4279 * fileread.h: Likewise.
4280 * gold.h: Likewise.
4281 * i386.cc: Likewise.
4282 * icf.cc: Likewise.
4283 * incremental.h: Likewise.
4284 * int_encoding.cc: Likewise.
4285 * layout.h: Likewise.
4286 * main.cc: Likewise.
4287 * merge.h: Likewise.
4288 * object.cc: Likewise.
4289 * object.h: Likewise.
4290 * options.cc: Likewise.
4291 * readsyms.cc: Likewise.
4292 * reduced_debug_output.cc: Likewise.
4293 * reloc.cc: Likewise.
4294 * script-sections.cc: Likewise.
4295 * sparc.cc: Likewise.
4296 * symtab.h: Likewise.
4297 * target-reloc.h: Likewise.
4298 * target.cc: Likewise.
4299 * target.h: Likewise.
4300 * timer.cc: Likewise.
4301 * timer.h: Likewise.
4302 * x86_64.cc: Likewise.
4303
83e17bd5
CC
43042010-12-09 Cary Coutant <ccoutant@google.com>
4305
4306 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4307 stack.
4308 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4309 parameter; change all callers.
4310 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4311 * options.h (warn_execstack): New option.
4312
017257f8
DK
43132010-12-07 Doug Kwan <dougkwan@google.com>
4314
4315 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4316 like function call relocations.
4317
c20cbc06
ILT
43182010-12-07 Ian Lance Taylor <iant@google.com>
4319
4320 * archive.cc (Archive::get_elf_object_for_member): Permit
4321 punconfigured to be NULL.
4322 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4323 (Archive::include_member): Pass NULL to get_elf_object_for_member
4324 if we searched for the archive and this is the first included
4325 object.
4326
4dbfafcc
ILT
43272010-12-01 Ian Lance Taylor <iant@google.com>
4328
4329 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4330 track_relocs_type_ field.
4331 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4332 Set track_relocs_type_.
4333 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4334 contents when using RELA relocs.
4335 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4336 reloc_map_.
4337 * reloc.cc (Track_relocs::next_addend): New function.
4338 * reloc.h (class Track_relocs): Declare next_addend.
4339
e5e19edd
ILT
43402010-12-01 Ian Lance Taylor <iant@google.com>
4341
4342 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4343 virtual destructor.
4344
9a5ce24c
ILT
43452010-12-01 Ian Lance Taylor <iant@google.com>
4346
4347 * README: Update compilers known to work and fail.
4348
c7791212
NC
43492010-11-23 Matthias Klose <doko@ubuntu.com>
4350
4351 * configure.in: For --enable-gold, handle value `default' instead of
4352 `both*'. Always install ld as ld.bfd, install as ld if gold is
4353 not the default.
4354 * configure: Regenerate.
4355
0ad220c9
DK
43562010-11-18 Doug Kwan <dougkwan@google.com>
4357
4358 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4359 and right_alignment to be zero. Store result alignment only if it is
4360 greater than existing alignment.
4361
ab8056e0
CC
43622010-11-16 Cary Coutant <ccoutant@google.com>
4363
4364 PR gold/12220
4365 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4366 Check for ".zdebug_line".
4367
fd064a5b
CC
43682010-11-16 Doug Kwan <dougkwan@google.com>
4369 Cary Coutant <ccoutant@google.com>
4370
4371 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4372 by reference; adjust all callers.
4373 * output.cc (Output_segment::set_section_addresses): Adjust references
4374 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4375 list is empty.
4376 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4377 end at page boundary.
4378
6fc6ea19
CC
43792010-11-16 Cary Coutant <ccoutant@google.com>
4380
4381 PR gold/12220
4382 * layout.cc (Layout::choose_output_section): Transform names of
4383 compressed sections even when using a script with a SECTIONS clause.
4384 (Layout::output_section_name): Remove code to transform
4385 compressed debug section names.
4386 * output.cc (Output_section::add_input_section): Use uncompressed
4387 section size when tracking input sections.
4388
95a2c8d6
RS
43892010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4390
4391 * symtab.h (Symbol::NON_PIC_REF): Remove.
4392 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4393 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4394 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4395 (Symbol::use_plt_offset): Take a flags argument and pass it
4396 directly to needs_dynamic_reloc. Restrict check for undefined
4397 weak symbols to function calls.
4398 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4399 (Target_arm::Scan::global): Use it.
4400 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4401 (Target_arm::Relocate::relocate): Likewise.
4402 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4403 parameter with an r_type parameter. Use get_reference_flags
4404 to get the flags.
4405 (Target_arm::Relocate::relocate): Update accordingly.
4406 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4407 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4408 (Target_i386::Scan::global): Likewise.
4409 (Target_i386::Relocate::relocate): Likewise.
4410 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4411 parameter with an r_type parameter. Use get_reference_flags
4412 to get the flags.
4413 (Target_i386::Relocate::relocate): Update accordingly.
4414 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4415 (Target_powerpc::Scan::global): Use it.
4416 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4417 (Target_powerpc::Relocate::relocate): Likewise.
4418 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4419 (Target_sparc::Scan::global): Use it.
4420 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4421 (Target_sparc::Relocate::relocate): Likewise.
4422 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4423 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4424 (Target_x86_64::Scan::global): Likewise.
4425 (Target_x86_64::Relocate::relocate): Likewise.
4426
f625ae50
DK
44272010-11-08 Doug Kwan <dougkwan@google.com>
4428 Cary Coutant <ccoutant@google.com>
4429
4430 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4431 (Arm_exidx_merge_section::section_contents_): New data member.
4432 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4433 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4434 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4435 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4436 in parameters instead of calling Object::section_contents without
4437 locking.
4438 (Arm_output_section::group_section): New parameter TASK. Pass it
4439 to callees that need locking objects.
4440 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4441 to lock EXIDX input sections. Fix a formatting issue. Call
4442 Arm_exidx_merged_section::build_contents to create merged section
4443 contents.
4444 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4445 to lock object of stub table owner.
4446 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4447 TEXT_SIZE to initialize data member TEXT_SIZE_.
4448 (Arm_exidx_input_section::addralign): Fix typo in comment.
4449 (Arm_exidx_input_section::text_size): New method.
4450 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4451 that require locking objects. Lock objects before scanning for stubs
4452 and updating local symbols.
4453 (Arm_input_section<big_endian>::init): Copy contents of original
4454 input section.
2e702c99 4455 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4456 original input section instead of calling Object::section_contents
4457 without locking.
4458 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4459 size without calling Object::section_size().
4460 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4461 for size. Allocate a buffer for merged EXIDX entries.
4462 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4463 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4464 building code to Arm_exidx_merged_section::build_contetns. Write
4465 out contetns in buffer instead of building it on the fly.
4466 (Arm_relobj::make_exidx_input_section): Also pass text section size
4467 to Arm_exidx_input_section constructor.
4468 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4469 (Arm_dynobj::do_read_symbols): Fix memory leak.
4470 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4471 * target.h: (class Task): Add forward declaration.
4472 (Target::relax): Add new parameter TASK and pass it to
4473 Target::do_relax().
4474 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4475
5f9bcf58
CC
44762010-11-05 Cary Coutant <ccoutant@google.com>
4477
4478 PR gold/10708
4479 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4480 object when reading from the file.
4481 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4482 second layout pass.
4483 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4484 when reading section contents.
4485 (get_section_contents): Likewise.
4486 (icf::find_identical_sections): Likewise.
4487 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4488 object when reading from the file.
4489 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4490 the object when doing deferred section layout.
4491
e597fa08
NC
44922010-11-03 Nick Clifton <nickc@redhat.com>
4493
4494 PR gold/12001
4495 * script.h (class Symbol_assignment: name): New member. Returns
4496 the name of the symbol.
4497 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4498 Returns true if the given symbol name is on the list of
4499 assignments wating to be processed.
4500 * archive.cc (should_incldue_member): If the symbol is undefined,
4501 check to see if it is on the list of symbols pending assignment.
4502
3f9a3278
ILT
45032010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4504
4505 * script-sections.cc (Script_sections::find_memory_region): Check
4506 for a NULL output section pointer.
4507
d06fb4d1
DK
45082010-10-29 Doug Kwan <dougkwan@google.com>
4509
4510 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4511 Output_section::add_relaxed_input_section.
4512 * output.cc (Output_section::add_relaxed_input_section): Add new
4513 arguments LAYOUT and NAME. Set section order index.
4514 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4515 Copy section order index.
4516 * output.h (Output_section::add_relaxed_input_section): Add new
4517 arguments LAYOUT and NAME.
4518
90e24de5
ILT
45192010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4520
4521 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4522 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4523 * testsuite/Makefile.in: Regenerate.
4524
c9484ea5
DK
45252010-10-20 Doug Kwan <dougkwan@google.com>
4526
4527 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4528 without SHF_LINK_ORDER flags.
4529 * layout.cc (Layout::choose_output_section): Do not filter
4530 SHF_LINK_ORDER flag in a relocatable link.
4531
5bc2f5be
CC
45322010-10-17 Cary Coutant <ccoutant@google.com>
4533
4534 * output.h (Output_segment::set_section_addresses): Change function
4535 signature. Update all callers.
4536 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4537 sections.
4538 (Output_segment::set_section_addresses): Align after last TLS
4539 section. Add padding before last relro section instead of after.
4540
0c91cf04
DK
45412010-10-17 Doug Kwan <dougkwan@google.com>
4542
4543 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4544 GOT output section to be writable.
4545
8c21d9d3
CC
45462010-10-14 Cary Coutant <ccoutant@google.com>
4547
4548 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4549 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4550 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4551 mode.
4552 * incremental.cc (report_command_line): Ignore all forms of
4553 --incremental.
4554 * layout.cc (Layout::Layout): Check parameters for incremental link
4555 mode.
4556 * options.cc (General_options::parse_incremental): New function.
4557 (General_options::parse_no_incremental): New function.
4558 (General_options::parse_incremental_full): New function.
4559 (General_options::parse_incremental_update): New function.
4560 (General_options::incremental_mode_): New data member.
4561 (General_options::finalize): Check incremental_mode_.
4562 * options.h (General_options): Update help text for --incremental.
4563 Add --no-incremental, --incremental-full, --incremental-update.
4564 (General_options::Incremental_mode): New enum type.
4565 (General_options::incremental_mode): New function.
4566 (General_options::incremental_mode_): New data member.
4567 * parameters.cc (Parameters::incremental_mode_): New data member.
4568 (Parameters::set_options): Set incremental_mode_.
4569 (Parameters::set_incremental_full): New function.
4570 (Parameters::incremental): New function.
4571 (Parameters::incremental_update): New function.
4572 (set_parameters_incremental_full): New function.
4573 * parameters.h (Parameters::set_incremental_full): New function.
4574 (Parameters::incremental): New function.
4575 (Parameters::incremental_update): New function.
4576 (Parameters::incremental_mode_): New data member.
4577 (set_parameters_incremental_full): New function.
4578 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4579 incremental link mode.
4580 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4581 (Sized_relobj::do_relocate_sections): Likewise.
4582 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4583 option.
4584 * testsuite/Makefile.in: Regenerate.
4585 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4586
bb32aa18 45872010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4588
4589 * script-sections.h (class Script_sections): Make
4590 Sections_elements typedef public.
4591 * script-sections.cc (class Sort_output_sections): Add elements_
4592 field. Add constructor which sets it; change all callers.
4593 (Sort_output_sections::is_before): New function.
4594 (Sort_output_sections::operator()): Call is_before.
4595 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4596 conditional.
4597 * testsuite/script_test_10.sh: New test. Test script section
4598 order.
4599 * testsuite/script_test_10.t: Likewise.
4600 * testsuite/script_test_10.s: Likewise.
4601 * testsuite/Makefile.am: Wrap the cross linker tests and the
4602 common tests into NATIVE_OR_CROSS_LINKER.
4603 (check_SCRIPTS): Add script_test_10.sh.
4604 (check_DATA): Add script_test_10.stdout.
4605 (script_test_10.o, script_test_10): New targets.
4606 (script_test_10.stdout): New target.
4607 * configure, testsuite/Makefile.in: Regenerate.
4608
3cef7179
ILT
46092010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4610
4611 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4612 error for the deprecated relocations.
4613 (Target_arm::Scan::global): Likewise.
4614 (Target_arm::Relocate::relocate): Likewise.
4615
7411e9a8
RS
46162010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4617
4618 * fileread.cc (Input_file::find_file): Initialize *found_name
4619 and *namep when using the fallback search for case 4.
4620
6a9da32a
CC
46212010-10-11 Cary Coutant <ccoutant@google.com>
4622
4623 * options.h (class General_options): Redefine -z lazy as an alias for
4624 the negation of -z now.
4625
ac897c20
ILT
46262010-10-11 Ian Lance Taylor <iant@google.com>
4627
4628 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4629 binding.
4630
ea5cae92
NC
46312010-10-06 Nick Clifton <nickc@redhat.com>
4632
4633 * script-sections.cc(class Memory_region): Remove
4634 current_lma_offset_ field. Rename current_vma_offset_ to
4635 current_offset_. Add last_section_ field.
4636 (Memory_region::get_current_vma_address): Rename to
4637 get_current_address.
4638 (Memory_region::get_current_lma_address): Delete.
4639 (Memory_region::increment_vma_offset): Rename to
4640 increment_offset.
4641 (Memory_region::increment_lma_offset): Delete.
4642 (Memory_region::attributes_compatible): New method. Returns
4643 true if the provided section is compatible with the region.
4644 (Memory_region::get_last_section): New method. Returns the last
4645 section to use the region.
4646 (Memory_region::set_last_section): New method. Stores the last
4647 section to use the region.
4648 (Script_sections::block_in_region): New method. Returns true if
4649 a block of memory is contained within a region.
4650 (Script_sections::find_memory_region): New method. Locates a
4651 memory region to be used to set a VMA or LMA address.
4652 (Output_section_definition::set_section_addresses): Add code to
4653 check for addresses set by memory regions.
4654 (Output_segment::set_section_addresses): Remove memory region
4655 walking code.
4656 (Script_sections::create_segment): Add a warning if a header
4657 segment is created outside of any region.
4658 * script-sections.h (class Script_sections): Add prototypes for
4659 find_memory_region and block_in_region methods.
4660 * testsuite/memory_test.s: Use .long instead of .word.
4661 * testsuite/memory_test.t: Add some more output sections.
4662 * testsuite/memory_test.sh: Update expected output.
4663
a9bfd952
DK
46642010-10-02 Doug Kwan <dougkwan@google.com>
4665
4666 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4667 defintion to symtab.h
4668 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4669 declaration to defintion.
4670
bacff3ab
NC
46712010-10-01 Nick Clifton <nickc@redhat.com>
4672
4673 * expression.cc (eval): Replace dummy argument with NULL.
4674 (eval_maybe_dot): Check for a NULL result section pointer.
4675 (Symbol_expression::value): Likewise.
4676 (Dot_expression::value): Likewise.
4677 (BINARY_EXPRESSION): Likewise.
4678 (Max_expression::value): Likewise.
4679 (Min_expression::value): Likewise.
4680 (Absolute_expression::value): Likewise.
4681 (Addr_expression::value_from_output_section): Likewise.
4682 (Loaddddr_expression::value_from_output_section): Likewise.
4683 (Segment_start_expression::value): Likewise.
4684 * script-sections.cc
4685 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4686 argument with NULL.
4687 (Sections_elememt_dot_assignment::set_section_addresses):
4688 Likewise.
4689 (Output_data_expression::do_write_to_buffer): Likewise.
4690 (Output_section_definition::finalize_symbols): Likewise.
4691 (Output_section_definition::set_section_addresses): Likewise.
4692
f81bc8b5
DK
46932010-09-30 Doug Kwan <dougkwan@google.com>
4694
4695 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4696
c95e9f27
ST
46972010-09-28 Sriraman Tallam <tmsriram@google.com>
4698
4699 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4700 function.
c95e9f27
ST
4701 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4702 virtual function.
4703 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4704 virtual function.
4705 * icf.cc (get_section_contents): Inline merge sections only when
4706 target allows it.
4707
3cac54d2
RW
47082010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4709
4710 * configure: Regenerate.
4711
2904037a
ILT
47122010-09-17 Ian Lance Taylor <iant@google.com>
4713
4714 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4715 * testsuite/Makefile.am (memory_test.o): New target.
4716 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4717 memory_test.t.
4718 * testsuite/Makefile.in: Rebuild.
2904037a 4719
bca7fb63
DK
47202010-09-17 Doug Kwan <dougkwan@google.com>
4721
4722 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4723 defintion if relocation uses GOT entries of the symbol.
4724 * testsuite/icf_safe_test.sh: Fix test.
4725 * testsuite/icf_safe_so_test.sh: Fix test.
4726
4ef28648
CC
47272010-09-16 Cary Coutant <ccoutant@google.com>
4728
4729 * script_sections.cc (class Memory_region): Remove "NULL" from
4730 vector initializations.
4731
793990de
CC
47322010-09-15 Cary Coutant <ccoutant@google.com>
4733
4734 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4735 Resolve forwarding symbols.
4736
81e015e2
DK
47372010-09-15 Doug Kwan <dougkwan@google.com>
4738
4739 * gold/testsuite/script_test_3.t: Add ARM special sections.
4740 * gold/testsuite/script_test_4.t: Same.
4741 * gold/testsuite/script_test_5.t: Same.
4742 * gold/testsuite/script_test_6.t: Same.
4743 * gold/testsuite/script_test_7.t: Same.
4744 * gold/testsuite/script_test_7.t: Same.
4745 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4746
36171d64
CC
47472010-09-14 Cary Coutant <ccoutant@google.com>
4748
4749 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4750 (Target_x86_64::Relocate::relocate_tls): Replace check for
4751 saw_tls_block_reloc_ with test for executable section.
4752
d89051bd
CC
47532010-09-12 Cary Coutant <ccoutant@google.com>
4754
4755 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4756 position-independent executables to shared libraries need dynamic
4757 relocations.
4758 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4759 position-independent executables.
4760 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4761 * testsuite/Makefile.in: Regenerate.
4762
fca41f0f
NC
47632010-09-10 Nick Clifton <nickc@redhat.com>
4764
4765 PR gold/11997
4766 * testsuite/memory_test.t: Discard any sections that are not
4767 needed.
4768
6695e4b3
L
47692010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4770
4771 PR gold/11996
4772 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4773 "This::" to work around a bug in gcc 4.2.
4774
4775 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4776
0f72bf6f
RÁE
47772010-09-09 Rafael Espindola <espindola@google.com>
4778
4779 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4780 sections with different PF_X flags in the same segment.
4781 (Layout::find_first_load_seg): Search all segments to find the first
4782 one.
4783 * options.h (rosegment): New.
4784
47852010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4786
05a79166 4787 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4788
aa98ff75
DK
47892010-09-08 Doug Kwan <dougkwan@google.com>
4790
4791 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4792 (Arm_relobj::do_relocate_sections): Add new parameter for output
4793 file to match the parent.
4794 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4795 of local symbols instead of input values. Update code to track
4796 changes in gold::relocate_section.
4797 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4798 (Sized_relobj::compute_final_local_value_internal): New methods.
4799 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4800 body into private version of Sized_relobj::compute_final_local_value.
4801 Call the inline method.
4802 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4803 merged symbol value if there is one.
4804 (Symbol_value::has_output_value): New method defintiion.
4805 (Sized_relobj::Compute_final_local_value_status): New enum type.
4806 (Sized_relobj::compute_final_local_value): New methods.
4807 (Sized_relobj::compute_final_local_value_internal): New methods.
4808 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4809 and arm_cortex_a8.sh.
4810 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4811 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4812 New tests.
4813 * Makefile.in: Regenerate.
4814 * testsuite/arm_bl_out_of_range.s: Update test.
4815 * testsuite/thumb_bl_out_of_range.s: Ditto.
4816 * testsuite/thumb_blx_out_of_range.s: Ditto.
4817 * testsuite/arm_branch_out_of_range.sh: New file.
4818 * testsuite/arm_cortex_a8.sh: Ditto.
4819 * testsuite/arm_cortex_a8_b.s: Ditto.
4820 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4821 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4822 * testsuite/arm_cortex_a8_bl.s: Ditto.
4823 * testsuite/arm_cortex_a8_blx.s: Ditto.
4824 * testsuite/arm_cortex_a8_local.s: Ditto.
4825 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4826 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4827
05a79166
L
48282010-09-08 Rafael Espindola <espindola@google.com>
4829
4830 * Makefile.am (memory_test.stdout): Run readelf with -W.
4831 * Makefile.in: Regenerate.
4832 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4833 64 bit output.
4834
33dbc701
RÁE
48352010-09-08 Rafael Espindola <espindola@google.com>
4836
4837 * script-sections.cc (Script_sections::add_memory_region): Convert
4838 field precision to int.
4839 * script.cc (script_set_section_region, script_set_section_region):
4840 Convert field precision to int.
4841
731ca54a
RÁE
48422010-09-08 Rafael Espindola <espindola@google.com>
4843
4844 * arm.cc (do_finalize_sections): Create the __exidx_start and
4845 __exdix_end symbols even when the section is missing.
4846
7f8cd844
NC
48472010-09-08 Nick Clifton <nickc@redhat.com>
4848
4849 * README: Remove claim that MEMORY is not supported.
4850 * expression.cc (script_exp_function_origin)
4851 (script_exp_function_length): Move from here to ...
4852 * script.cc: ... here.
4853 (script_set_section_region, script_add_memory)
4854 (script_parse_memory_attr, script_include_directive): New
4855 functions.
4856 * script-sections.cc
4857 (class Memory_region): New class.
4858 (class Output_section_definition): Add set_memory_region,
4859 set_section_vma, set_section_lma and get_section_name methods.
4860 (class Script_Sections): Add add_memory_region,
4861 find_memory_region, find_memory_region_origin,
4862 find_memory_region_length and set_memory_region methods.
4863 Have set_section_addresses method walk the list of set memory
4864 regions.
4865 Extend the print methos to display memory regions.
4866 * script-sections.h: Add prototypes for new methods.
4867 Add enum for MEMORY region attributes.
4868 * yyscript.y: Add support for parsing MEMORY regions.
4869 * script-c.h: Add prototypes for new functions.
4870 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4871 * testsuite/Makefile.in: Regenerate.
4872 * testsuite/memory_test.sh: New script.
4873 * testsuite/memory_test.s: New assembler source file.
4874 * testsuite/memory_test.t: New linker script.
4875
a4649286
DK
48762010-08-27 Doug Kwan <dougkwan@google.com>
4877
4878 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4879 reference override an existing dynamic weak reference.
4880 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4881 * testsuite/Makefile.in: Regenerate.
4882 * testsuite/dyn_weak_ref.sh: New file.
4883 * testsuite/dyn_weak_ref_1.c: Ditto.
4884 * testsuite/dyn_weak_ref_2.c: Ditto.
4885
b56648ad
ILT
48862010-08-27 Ian Lance Taylor <iant@google.com>
4887
4888 * incremental.h (class Incremental_input_entry): Add virtual
4889 destructor.
4890
809313cb
ILT
48912010-08-27 Ian Lance Taylor <iant@google.com>
4892
4893 * testsuite/start_lib_test_3.c: Mark t3 as used.
4894
11e32464
NC
48952010-08-27 Nick Clifton <nickc@redhat.com>
4896
4897 * options.cc (version_script): Fix small typo in previous
4898 whitespace tidyup.
4899
ca09d69a
NC
49002010-08-25 Nick Clifton <nickc@redhat.com>
4901
4902 * archive.cc: Formatting fixes: Remove whitespace between
4903 typename and following asterisk. Remove whitespace between
4904 function name and opening parenthesis.
4905 * archive.h: Likewise.
4906 * arm.cc: Likewise.
4907 * attributes.cc: Likewise.
4908 * attributes.h: Likewise.
4909 * common.cc: Likewise.
4910 * copy-relocs.cc: Likewise.
4911 * dirsearch.h: Likewise.
4912 * dynobj.cc: Likewise.
4913 * ehframe.cc: Likewise.
4914 * ehframe.h: Likewise.
4915 * expression.cc: Likewise.
4916 * fileread.cc: Likewise.
4917 * fileread.h: Likewise.
4918 * gc.h: Likewise.
4919 * gold-threads.cc: Likewise.
4920 * gold.cc: Likewise.
4921 * i386.cc: Likewise.
4922 * icf.h: Likewise.
4923 * incremental-dump.cc: Likewise.
4924 * incremental.cc: Likewise.
4925 * layout.cc: Likewise.
4926 * layout.h: Likewise.
4927 * main.cc: Likewise.
4928 * merge.cc: Likewise.
4929 * merge.h: Likewise.
4930 * object.cc: Likewise.
4931 * object.h: Likewise.
4932 * options.cc: Likewise.
4933 * options.h: Likewise.
4934 * output.cc: Likewise.
4935 * output.h: Likewise.
4936 * plugin.cc: Likewise.
4937 * plugin.h: Likewise.
4938 * powerpc.cc: Likewise.
4939 * reloc.cc: Likewise.
4940 * script-c.h: Likewise.
4941 * script-sections.cc: Likewise.
4942 * script.cc: Likewise.
4943 * stringpool.cc: Likewise.
4944 * symtab.cc: Likewise.
4945 * symtab.h: Likewise.
4946 * target.cc: Likewise.
4947 * timer.cc: Likewise.
4948 * timer.h: Likewise.
4949 * version.cc: Likewise.
4950 * x86_64.cc: Likewise.
4951
b8fa8750
NC
49522010-08-24 Nick Clifton <nickc@redhat.com>
4953
4954 PR 11899
4955 * layout.cc (segment_precedes): Sort segments by their physical
4956 addresses, if they have been set.
4957
9919d93b
CC
49582010-08-23 Cary Coutant <ccoutant@google.com>
4959
4960 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4961 symbols data.
4962 (Lib_group::include_member): Unlock object after deleting its
4963 symbols data.
4964 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4965 the bug fixed here.
4966
97b4be1c
CC
49672010-08-19 Neil Vachharajani <nvachhar@google.com>
4968 Cary Coutant <ccoutant@google.com>
4969
4970 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4971 constructor, and set_blocker.
4972 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4973 readsyms_blocker_.
4974 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4975 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4976 * testsuite/Makefile.am (start_lib_test): New test case.
4977 * testsuite/Makefile.in: Regenerate.
4978 * testsuite/start_lib_test_main.c: New file.
4979 * testsuite/start_lib_test_1.c: New file.
4980 * testsuite/start_lib_test_2.c: New file.
4981 * testsuite/start_lib_test_3.c: New file.
4982
dd0b1884
ILT
49832010-08-19 Ian Lance Taylor <iant@google.com>
4984
4985 * Makefile.in: Rebuild with automake 1.11.1.
4986 * aclocal.m4: Likewise.
4987 * testsuite/Makefile.in: Likewise.
4988
7223e9ca
ILT
49892010-08-19 Ian Lance Taylor <iant@google.com>
4990
4991 PR 10893
4992 * i386.cc (class Output_data_plt_i386): Update declarations.
4993 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4994 local_ifuncs_ fields.
4995 (Target_i386::do_plt_section_for_global): New function.
4996 (Target_i386::do_plt_section_for_local): New function.
4997 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4998 parameter; change all callers. Initialize global_ifuncs_ and
4999 local_ifuncs_. If doing a static link define __rel_iplt_start and
5000 __rel_iplt_end.
5001 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
5002 (Output_data_plt_i386::add_local_ifunc_entry): New function.
5003 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
5004 symbols.
5005 (Target_i386::make_plt_section): New function, broken out of
5006 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
5007 (Target_i386::make_plt_entry): Call make_plt_section.
5008 (Target_i386::make_local_ifunc_plt_entry): New function.
5009 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
5010 (Target_i386::Scan::local): Handle IFUNC symbols. Add
5011 R_386_IRELATIVE to switch.
5012 (Target_i386::Scan::global): Likewise.
5013 (Target_i386::Relocate::relocate): Likewise.
5014 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
5015 switch.
5016 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
5017 (Target_x86_64::do_plt_section_for_global): New function.
5018 (Target_x86_64::do_plt_section_for_local): New function.
5019 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
5020 parameter; change all callers. If doing a static link define
5021 __rela_iplt_start and __rela_iplt_end.
5022 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
5023 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
5024 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
5025 to point to .plt.
5026 (Target_x86_64::make_local_ifunc_plt_entry): New function.
5027 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
5028 switch.
5029 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
5030 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
5031 R_X86_64_IRELATIVE to switch.
5032 (Target_x86_64::Scan::global): Likewise.
5033 (Target_x86_64::Relocate::relocate): Likewise.
5034 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
5035 switch.
5036 * target.h (class Target): Add plt_section_for_global and
5037 plt_section_for_local functions. Add do_plt_section_for_global
5038 and do_plt_section_for_local virtual functions.
5039 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
5040 clarifying comments.
5041 (Symbol::use_plt_offset): Handle IFUNC symbol.
5042 * object.cc (Sized_relobj::Sized_relobj): Initialize
5043 local_plt_offsets_.
5044 (Sized_relobj::local_has_plt_offset): New function.
5045 (Sized_relobj::local_plt_offset): New function.
5046 (Sized_relobj::set_local_plt_offset): New function.
5047 (Sized_relobj::do_count): Handle IFUNC symbol.
5048 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
5049 a bit away from input_shndx_ field. Add set_is_func_symbol and
5050 is_ifunc_symbol functions.
5051 (class Sized_relobj): Update declarations. Remove Tls_got_entry
5052 and Local_tls_got_offsets. Define Local_plt_offsets. Add
5053 local_plt_offsets_ field.
5054 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
5055 * output.h (class Output_section_data): Add non-const
5056 output_section function.
5057 (class Output_data_got): Update declarations.
5058 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
5059 Add use_plt_offset parameter to global and local constructors.
5060 Change all callers. Change local_sym_index_ field to 31 bits.
5061 Change GSYM_CODE and CONSTANT_CODE accordingly.
5062 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
5063 doing a static link don't set sh_link field.
5064 (Output_data_got::Got_entry::write): Use PLT offset if
5065 appropriate.
5066 (Output_data_got::add_global_plt): New function.
5067 (Output_data_got::add_local_plt): New function.
5068 * target-reloc.h (relocate_section): Handle IFUNC symbol.
5069 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
5070 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
5071 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
5072 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
5073 IFUNC conditional.
5074 * testsuite/ifunc-sel.h: New file.
5075 * testsuite/ifuncmain1.c: New file.
5076 * testsuite/ifuncmain1vis.c: New file.
5077 * testsuite/ifuncmod1.c: New file.
5078 * testsuite/ifuncdep2.c: New file.
5079 * testsuite/ifuncmain2.c: New file.
5080 * testsuite/ifuncmain3.c: New file.
5081 * testsuite/ifuncmod3.c: New file.
5082 * testsuite/ifuncmain4.c: New file.
5083 * testsuite/ifuncmain5.c: New file.
5084 * testsuite/ifuncmod5.c: New file.
5085 * testsuite/ifuncmain6pie.c: New file.
5086 * testsuite/ifuncmod6.c: New file.
5087 * testsuite/ifuncmain7.c: New file.
5088 * configure, testsuite/Makefile.in: Rebuild.
5089
56f75c03
ILT
50902010-08-18 Ian Lance Taylor <iant@google.com>
5091
5092 * incremental.cc
5093 (Output_section_incremental_inputs::write_input_files): Add cast
5094 to avoid signed/unsigned comparison warning.
5095 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5096
55455f89
CC
50972010-08-12 Cary Coutant <ccoutant@google.com>
5098
5099 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5100
e2054bcb
ILT
51012010-08-13 Ian Lance Taylor <iant@google.com>
5102
5103 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5104
74f67560
DK
51052010-08-12 Cary Coutant <ccoutant@google.com>
5106 Doug Kwan <dougkwan@google.com>
5107
5108 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5109 defintion overrides non-weak undef, remember that the original undef
5110 is not weak.
5111 * symtab.cc (Symbol_table::sized_write_global): For undef without
5112 an original weak binding, set binding to global in output.
5113 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5114 * testsuite/Makefile.in: Regenerate.
5115 * testsuite/strong_ref_weak_def.sh: New file.
5116 * testsuite/strong_ref_weak_def_1.c: Ditto.
5117 * testsuite/strong_ref_weak_def_2.c: Ditto.
5118
d1238d12
CC
51192010-08-12 Cary Coutant <ccoutant@google.com>
5120
5121 * testsuite/incremental_test.sh: Rewrite.
5122 * testsuite/incremental_test_1.c: Rewrite.
5123 * testsuite/incremental_test_2.c: Rewrite.
5124
0e70b911
CC
51252010-08-12 Cary Coutant <ccoutant@google.com>
5126
5127 * arm.cc (Target_arm::got_size): Add const.
5128 (Target_arm::got_entry_count): New function.
5129 (Target_arm::plt_entry_count): New function.
5130 (Target_arm::first_plt_entry_offset): New function.
5131 (Target_arm::plt_entry_size): New function.
5132 (Output_data_plt_arm::entry_count): New function.
5133 (Output_data_plt_arm::first_plt_entry_offset): New function.
5134 (Output_data_plt_arm::get_plt_entry_size): New function.
5135 * i386.cc (Target_i386::got_size): Add const.
5136 (Target_i386::got_entry_count): New function.
5137 (Target_i386::plt_entry_count): New function.
5138 (Target_i386::first_plt_entry_offset): New function.
5139 (Target_i386::plt_entry_size): New function.
5140 (Output_data_plt_i386::entry_count): New function.
5141 (Output_data_plt_i386::first_plt_entry_offset): New function.
5142 (Output_data_plt_i386::get_plt_entry_size): New function.
5143 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5144 find_incremental_inputs_sections. Dump incremental_got_plt section.
5145 * incremental.cc: Include target.h.
5146 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5147 parameter. Adjust all callers. Find incremental_got_plt section.
5148 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5149 section.
5150 (Output_section_incremental_inputs::set_final_data_size): Calculate
5151 size of incremental_got_plt section.
5152 (Output_section_incremental_inputs::do_write): Write the
5153 incremental_got_plt section.
5154 (Got_plt_view_info): New struct.
5155 (Local_got_offset_visitor): New class.
5156 (Global_got_offset_visitor): New class.
5157 (Global_symbol_visitor_got_plt): New class.
5158 (Output_section_incremental_inputs::write_got_plt): New function.
5159 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5160 Add parameter. Adjust all callers.
5161 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5162 (Incremental_inputs::got_plt_section): New function.
5163 (Incremental_inputs::got_plt_section_): New data member.
5164 (Incremental_got_plt_reader): New class.
5165 * layout.cc (Layout::create_incremental_info_sections): Add the
5166 incremental_got_plt section.
5167 * object.h (Got_offset_list::get_list): New function.
5168 (Got offset_list::for_all_got_offsets): New function.
5169 (Sized_relobj::local_got_offset_list): New function.
5170 * powerpc.cc (Target_powerpc::got_size): Add const.
5171 (Target_powerpc::got_entry_count): New function.
5172 (Target_powerpc::plt_entry_count): New function.
5173 (Target_powerpc::first_plt_entry_offset): New function.
5174 (Target_powerpc::plt_entry_size): New function.
5175 (Output_data_plt_powerpc::entry_count): New function.
5176 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5177 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5178 * sparc.cc (Target_sparc::got_size): Add const.
5179 (Target_sparc::got_entry_count): New function.
5180 (Target_sparc::plt_entry_count): New function.
5181 (Target_sparc::first_plt_entry_offset): New function.
5182 (Target_sparc::plt_entry_size): New function.
5183 (Output_data_plt_sparc::entry_count): New function.
5184 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5185 (Output_data_plt_sparc::get_plt_entry_size): New function.
5186 * symtab.h (Symbol::got_offset_list): New function.
5187 (Symbol_table::for_all_symbols): New function.
5188 * target.h (Sized_target::got_entry_count): New function.
5189 (Sized_target::plt_entry_count): New function.
5190 (Sized_target::plt_entry_size): New function.
5191 * x86_64.cc (Target_x86_64::got_size): Add const.
5192 (Target_x86_64::got_entry_count): New function.
5193 (Target_x86_64::plt_entry_count): New function.
5194 (Target_x86_64::first_plt_entry_offset): New function.
5195 (Target_x86_64::plt_entry_size): New function.
5196 (Output_data_plt_x86_64::entry_count): New function.
5197 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5198 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5199
09ec0418
CC
52002010-08-12 Cary Coutant <ccoutant@google.com>
5201
5202 * archive.cc: Include incremental.h.
5203 (Archive::Archive): Initialize incremental_info_.
5204 (Archive::include_member): Record archive members in incremental info.
5205 (Add_archive_symbols::run): Record begin and end of an archive in
5206 incremental info.
5207 (Lib_group::include_member): Record objects in incremental info.
5208 * archive.h (Incremental_archive_entry): Forward declaration.
5209 (Archive::set_incremental_info): New member function.
5210 (Archive::incremental_info): New member function.
5211 (Archive::Unused_symbol_iterator): New class.
5212 (Archive::unused_symbols_begin): New member function.
5213 (Archive::unused_symbols_end): New member function.
5214 (Archive::incremental_info_): New data member.
5215 * incremental-dump.cc (find_input_containing_global): New function.
5216 (dump_incremental_inputs): Dump new incremental info sections.
5217 * incremental.cc: Include symtab.h.
5218 (Output_section_incremental_inputs): New class.
5219 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5220 new incremental info sections.
5221 (Sized_incremental_binary::do_check_inputs): Likewise.
5222 (Incremental_inputs::report_archive): Remove.
5223 (Incremental_inputs::report_archive_begin): New function.
5224 (Incremental_inputs::report_archive_end): New function.
5225 (Incremental_inputs::report_object): New function.
5226 (Incremental_inputs::finalize_inputs): Remove.
5227 (Incremental_inputs::report_input_section): New function.
5228 (Incremental_inputs::report_script): Rewrite.
5229 (Incremental_inputs::finalize): Do nothing but finalize string table.
5230 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5231 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5232 (Incremental_inputs::create_data_sections): New function.
5233 (Incremental_inputs::relocs_entsize): New function.
5234 (Output_section_incremental_inputs::set_final_data_size): New function.
5235 (Output_section_incremental_inputs::do_write): New function.
5236 (Output_section_incremental_inputs::write_header): New function.
5237 (Output_section_incremental_inputs::write_input_files): New function.
5238 (Output_section_incremental_inputs::write_info_blocks): New function.
5239 (Output_section_incremental_inputs::write_symtab): New function.
5240 * incremental.h (Incremental_script_entry): Forward declaration.
5241 (Incremental_object_entry): Forward declaration.
5242 (Incremental_archive_entry): Forward declaration.
5243 (Incremental_inputs): Forward declaration.
5244 (Incremental_inputs_header_data): Remove.
5245 (Incremental_inputs_header): Remove.
5246 (Incremental_inputs_header_write): Remove.
5247 (Incremental_inputs_entry_data): Remove.
5248 (Incremental_inputs_entry): Remove.
5249 (Incremental_inputs_entry_write): Remove.
5250 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5251 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5252 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5253 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5254 Likewise.
5255 (Incremental_input_entry): New class.
5256 (Incremental_script_entry): New class.
5257 (Incremental_object_entry): New class.
5258 (Incremental_archive_entry): New class.
5259 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5260 (Incremental_inputs::report_inputs): Remove.
5261 (Incremental_inputs::report_archive): Remove.
5262 (Incremental_inputs::report_archive_begin): New function.
5263 (Incremental_inputs::report_archive_end): New function.
5264 (Incremental_inputs::report_object): Change prototype.
5265 (Incremental_inputs::report_input_section): New function.
5266 (Incremental_inputs::report_script): Change prototype.
5267 (Incremental_inputs::get_reloc_count): New function.
5268 (Incremental_inputs::set_reloc_count): New function.
5269 (Incremental_inputs::create_data_sections): New function.
5270 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5271 (Incremental_inputs::inputs_section): New function.
5272 (Incremental_inputs::symtab_section): New function.
5273 (Incremental_inputs::relocs_section): New function.
5274 (Incremental_inputs::get_stringpool): Add const.
5275 (Incremental_inputs::command_line): Add const.
5276 (Incremental_inputs::inputs): Remove.
5277 (Incremental_inputs::command_line_key): New function.
5278 (Incremental_inputs::input_file_count): New function.
5279 (Incremental_inputs::input_files): New function.
5280 (Incremental_inputs::relocs_entsize): New function.
5281 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5282 (Incremental_inputs::finalize_inputs): Remove.
5283 (Incremental_inputs::Input_info): Remove.
5284 (Incremental_inputs::lock_): Remove.
5285 (Incremental_inputs::inputs_): Change type.
5286 (Incremental_inputs::inputs_map_): Remove.
5287 (Incremental_inputs::current_object_entry_): New data member.
5288 (Incremental_inputs::inputs_section_): New data member.
5289 (Incremental_inputs::symtab_section_): New data member.
5290 (Incremental_inputs::relocs_section_): New data member.
5291 (Incremental_inputs::reloc_count_): New data member.
5292 (Incremental_inputs_reader): New class.
5293 (Incremental_symtab_reader): New class.
5294 (Incremental_relocs_reader): New class.
5295 * layout.cc (Layout::finalize): Move finalization of incremental info
5296 and creation of incremental info sections to follow finalization of
5297 symbol table. Set offsets for postprocessing sections.
5298 (Layout::create_incremental_info_sections): Call
5299 Incremental_inputs::create_data_sections. Add incremental symtab
5300 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5301 sections to layout after input sections.
5302 * layout.h (struct Timespec): Forward declaration.
5303 (Layout::incremental_inputs): Add const.
5304 (Layout::create_incremental_info_sections): Add parameter.
5305 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5306 * object.cc: Include incremental.h.
5307 (Relobj::finalize_incremental_relocs): New function.
5308 (Sized_relobj::do_layout): Record input sections in incremental info.
5309 * object.h (Object::output_section): New function.
5310 (Object::output_section_offset): Moved from Relobj.
5311 (Object::get_incremental_reloc_base): New function.
5312 (Object::get_incremental_reloc_count): New function.
5313 (Object::do_output_section): New function.
5314 (Object::do_output_section_offset): Moved from Relobj.
5315 (Object::do_get_incremental_reloc_base): New function.
5316 (Object::do_get_incremental_reloc_count): New function.
5317 (Object::Object): Initialize new data members.
5318 (Relobj::output_section): Renamed do_output_section and moved to
5319 protected.
5320 (Relobj::output_section_offset): Moved to Object.
5321 (Relobj::do_get_incremental_reloc_base): New function.
5322 (Relobj::do_get_incremental_reloc_count): New function.
5323 (Relobj::allocate_incremental_reloc_counts): New function.
5324 (Relobj::count_incremental_reloc): New function.
5325 (Relobj::finalize_incremental_relocs): New function.
5326 (Relobj::next_incremental_reloc_index): New function.
5327 (Relobj::reloc_counts_): New data member.
5328 (Relobj::reloc_bases_): New data member.
5329 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5330 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5331 (Sized_relobj::incremental_relocs_scan): New function.
5332 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5333 (Sized_relobj::incremental_relocs_write): New function.
5334 (Sized_relobj::incremental_relocs_write_reltype): New function.
5335 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5336 incremental link.
5337 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5338 archives and object files elsewhere.
5339 (Add_symbols::run): Report object files here.
5340 (Finish_group::run): Report end of archive at end of group.
5341 * reloc.cc: Include layout.h, incremental.h.
5342 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5343 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5344 (Sized_relobj::incremental_relocs_scan): New function.
5345 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5346 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5347 (Sized_relobj::incremental_relocs_write): New function.
5348 (Sized_relobj::incremental_relocs_write_reltype): New function.
5349 * script.cc (read_input_script): Rewrite test for incremental link.
5350 Change call to Incremental_inputs::report_script.
5351 * symtab.h (Symbol_table::first_global_index): New function.
5352 (Symbol_table::output_count): New function.
5353
ce0d1972
DK
53542010-08-12 Doug Kwan <dougkwan@google.com>
5355
5356 * arm.cc (Target_arm::merge_object_attributes): Check command line
5357 options --no-wchar-size-warning and --no-enum-size-warning.
5358 * options.h (General_options): Add ld-compatible options
5359 --no-enum-size-warning and --no-wchar-size-warning.
5360
6e5710ce
ILT
53612010-08-04 Ian Lance Taylor <iant@google.com>
5362
5363 * x86_64.cc (Target_x86_64::Scan::local): Use
5364 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5365 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5366 (Target_x86_64::Scan::global): Likewise.
5367 (Target_x86_64::Relocate::relocate): Likewise.
5368 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5369 Likewise.
5370
fef830db
CC
53712010-08-03 Cary Coutant <ccoutant@google.com>
5372
5373 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5374 to reserve space in merged_strings vector. Keep total input size
5375 for stats.
5376 (Output_merge_string::do_print_merge_stats): Print total input size.
5377 * merge.h (Output_merge_string): Add input_size_ field.
5378 * stringpool.cc (Stringpool_template::string_length): Move
5379 implementations out of Stringpool_template class and place in
5380 stringpool.h.
5381 * stringpool.h (string_length): Move out of Stringpool_template.
5382
1e3811b0
ILT
53832010-08-03 Ian Lance Taylor <iant@google.com>
5384
5385 PR 11712
5386 * layout.cc (relaxation_loop_body): If address of load segment is
5387 set, adjust address to include headers if possible.
5388
7af0c620
ILT
53892010-08-03 Ian Lance Taylor <iant@google.com>
5390
5391 * version.cc (version_string): Bump to 1.10.
5392
22f0da72
ILT
53932010-08-03 Ian Lance Taylor <iant@google.com>
5394
5395 PR 11805
5396 * layout.h (enum Output_section_order): Define.
5397 (class Layout): Update declarations.
5398 * layout.cc (Layout::get_output_section): Add order parameter.
5399 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5400 is_first_non_relro parameters. Change all callers.
5401 (Layout::choose_output_section): Likewise.
5402 (Layout::add_output_section_data): Likewise.
5403 (Layout::make_output_section): Likewise. Set order.
5404 (Layout::default_section_order): New function.
5405 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5406 * output.cc (Output_section::Output_section): Initialize order_.
5407 Don't initialize deleted fields.
5408 (Output_segment::Output_segment): Don't initialize deleted
5409 fields.
5410 (Output_segment::add_output_section_to_load): New function
5411 replacing add_output_section. Change all callers to call this or
5412 add_output_section_to_nonload.
5413 (Output_segment::add_output_section_to_nonload): New function.
5414 (Output_segment::remove_output_section): Rewrite.
5415 (Output_segment::add_initial_output_data): Likewise.
5416 (Output_segment::has_any_data_sections): Likewise.
5417 (Output_segment::is_first_section_relro): Likewise.
5418 (Output_segment::maximum_alignment): Likewise.
5419 (Output_segment::has_dynamic_reloc): New function replacing
5420 dynamic_reloc_count. Change all callers.
5421 (Output_segment::has_dynamic_reloc_list): New function replacing
5422 dynamic_reloc_count_list. Change all callers.
5423 (Output_segment::set_section_addresses): Rewrite.
5424 (Output_segment::set_offset): Rewrite.
5425 (Output_segment::find_first_and_last_list): Remove.
5426 (Output_segment::set_tls_offsets): Rewrite.
5427 (Output_segment::first_section_load_address): Likewise.
5428 (Output_segment::output_section_count): Likewise.
5429 (Output_segment::section_with_lowest_load_address): Likewise.
5430 (Output_segment::write_section_headers): Likewise.
5431 (Output_segment::print_sections_to_map): Likewise.
5432 * output.h (class Output_data): Remove dynamic_reloc_count_
5433 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5434 (Output_data::add_dynamic_reloc): Rewrite.
5435 (Output_data::has_dynamic_reloc): New function.
5436 (Output_data::dynamic_reloc_count): Remove.
5437 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5438 is_last_relro_, is_first_non_relro_, is_interp_,
5439 is_dynamic_linker_section_ fields. Add order and set_order
5440 functions. Remove is_relro_local, set_is_relro_local,
5441 is_last_relro, set_is_last_relro, is_first_non_relro,
5442 set_is_first_non_relro functions, is_interp, set_is_interp,
5443 is_dynamic_linker_section, and set_is_dynamic_linker_section
5444 functions.
5445 (class Output_segment): Change Output_data_list from std::list to
5446 std:;vector. Add output_lists_ field. Remove output_data_ and
5447 output_bss_ fields. Update declarations.
5448
3ff2ccb0
ILT
54492010-08-02 Ian Lance Taylor <iant@google.com>
5450
5451 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5452 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5453 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5454
88a4108b
ILT
54552010-08-02 Ian Lance Taylor <iant@google.com>
5456
5457 PR 11855
5458 * script.cc (Script_options::Script_options): Initialize
5459 symbol_definitions_ and symbol_references_.
5460 (Script_options::add_symbol_assignment): Update
5461 symbol_definitions_ and symbol_references_.
5462 (Script_options::add_symbol_reference): New function.
5463 (script_symbol): New function.
5464 * script.h (class Script_options): Add symbol_definitions_ and
5465 symbol_references_ fields.
5466 (Script_options::referenced_const_iterator): New type.
5467 (Script_options::referenced_begin): New function.
5468 (Script_options::referenced_end): New function.
5469 (Script_options::is_referenced): New function.
5470 (Script_options::any_unreferenced): New function.
5471 * script-c.h (script_symbol): Declare.
5472 * yyscript.y (exp): Call script_symbol.
5473 * symtab.cc: Include "script.h".
5474 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5475 Change all callers. Check symbols referenced by scripts.
5476 (Symbol_table::add_undefined_symbols_from_command_line): Add
5477 layout parameter. Change all callers.
5478 (Symbol_table::do_add_undefined_symbols_from_command_line):
5479 Likewise. Break out loop body. Check symbols referenced by
5480 scripts.
5481 (Symbol_table::add_undefined_symbol_from_command_line): New
5482 function broken out of
5483 do_add_undefined_symbols_from_command_line.
5484 * symtab.h (class Symbol_table): Update declarations.
5485 * archive.cc: Include "layout.h".
5486 (Archive::should_include_member): Add layout parameter. Change
5487 all callers. Check for symbol mentioned in expression.
5488 * archive.h (class Archive): Update declaration.
5489 * object.cc (Sized_relobj::do_should_include_member): Add layout
5490 parameter.
5491 * object.h (Object::should_include_member): Add layout parameter.
5492 Change all callers.
5493 (Object::do_should_include_member): Add layout parameter.
5494 (class Sized_relobj): Update declaration.
5495 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5496 parameter.
5497 * dynobj.h (class Sized_dynobj): Update declaration.
5498 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5499 layout parameter.
5500 * plugin.h (class Sized_pluginobj): Update declaration.
5501
5f1ab67a
ILT
55022010-08-02 Ian Lance Taylor <iant@google.com>
5503
5504 PR 11866
5505 * output.cc (Output_segment::set_offset): Search for the first and
5506 last sections rather than assuming that the list is in order.
5507 (Output_segment::find_first_and_last_list): New function.
5508 * output.h (class Output_segment): Update declarations.
5509 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5510 (relro_strip_test_SOURCES): New variable.
5511 (relro_strip_test_DEPENDENCIES): New variable.
5512 (relro_strip_test_LDFLAGS): New variable.
5513 (relro_strip_test_LDADD): New variable.
5514 (relro_strip_test.so): New target.
5515
a8df5856
ILT
55162010-08-02 Ian Lance Taylor <iant@google.com>
5517
5518 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5519 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5520 (Target_i386::got_tlsdesc_section): New function.
5521 (Target_i386::got_section): Create space for GOT entries for
5522 TLSDESC relocations.
5523 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5524 R_386_TLS_GOTDESC.
5525 (Target_i386::Scan::global): Likewise.
5526 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5527 using TLSDESC GOT.
5528 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5529 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5530 (Target_x86_64::got_tlsdesc_section): New function.
5531 (Target_x86_64::got_section): Create space for GOT entries for
5532 TLSDESC relocations.
5533 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5534 R_386_TLS_GOTDESC.
5535 (Target_x86_64::Scan::global): Likewise.
5536 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5537 using TLSDESC GOT.
5538
0c10a0a6
ILT
55392010-08-02 Ian Lance Taylor <iant@google.com>
5540
5541 * testsuite/final_layout.sh: Use dc to convert from hex to
5542 decimal.
5543
41cbeecc
ST
55442010-07-29 Sriraman Tallam <tmsriram@google.com>
5545
5546 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5547 paramter to the call to gold::gc_process_relocs.
5548 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5549 paramter to the call to gold::gc_process_relocs.
5550 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5551 parameter to the call to gold::gc_process_relocs.
5552 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5553 template parameter to the call to gold::gc_process_relocs.
5554 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5555 paramter to the call to gold::gc_process_relocs.
5556 * gc.h (get_embedded_addend_size): New function.
5557 (gc_process_relocs): Save the size of the reloc for use by ICF.
5558 * icf.cc (get_section_contents): Get the addend from the text section
5559 for SHT_REL relocation sections.
5560 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5561 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5562 * int_encoding.h (read_from_pointer): New overloaded function.
5563 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5564 * testsuite/icf_sht_rel_addend_test.sh: New file.
5565 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5566 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5567
6ea55b82
RW
55682010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5569
5570 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5571 * Makefile.in: Regenerate.
5572 * testsuite/Makefile.in: Regenerate.
5573
9691462b
ILT
55742010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5575
5576 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5577 * gold/testsuite/debug_msg.cc: Likewise.
5578 * gold/testsuite/odr_violation1.cc
5579 * gold/testsuite/odr_violation2.cc
5580
76897331
CC
55812010-07-21 Cary Coutant <ccoutant@google.com>
5582
5583 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5584 string, and length fields.
5585 (Output_merge_string::Merged_strings_list): New type.
5586 (Output_merge_string::Merged_strings_lists): New typedef.
5587 (Output_merge_string): Replace merged_strings_ with
5588 merged_strings_lists_.
5589 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5590 Merged_strings_list per input object and section. Don't store pointer
5591 to the string. Don't store length with each merged string entry.
5592 (Output_merge_string::finalize_merged_data): Loop over list of merged
5593 strings lists. Recompute length of each merged string.
5594
78384e8f
CC
55952010-07-15 Cary Coutant <ccoutant@google.com>
5596
5597 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5598 here.
5599
783659f9
ILT
56002010-07-14 Ian Lance Taylor <iant@google.com>
5601
5602 * descriptors.cc (Descriptors::open): Report correct name in error
5603 message.
5604
131687b4
DK
56052010-07-13 Doug Kwan <dougkwan@google.com>
5606
5607 * arm.cc (Arm_input_section::Arm_input_section): For a
5608 SHT_ARM_EXIDX section, always keeps the input sections.
5609 (Arm_input_section::set_exidx_section_link): New method.
5610 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5611 has_errors_ to false.
5612 (Arm_exidx_input_section::has_errors,
5613 Arm_exidx_input_section::set_has_errors): New methods.
5614 (Arm_exidx_input_section::has_errors_): New data member.
5615 (Arm_relobj::get_exidx_shndx_list): New method.
5616 (Arm_output_section::append_text_sections_to_list): Do not skip
5617 section without SHF_EXECINSTR.
5618 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5619 errors.
2e702c99 5620 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5621 section header. Make error messages more verbose. Check for
5622 a non-executable section linked to an EXIDX section.
5623 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5624 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5625 check that there is no deferred EXIDX section if we exit early.
5626 Instead of not making an EXIDX section in case of an error, make one
5627 and set the has_errors flag of it.
5628 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5629 in a relocatable link.
5630 (Target_arm::do_relax): Look for the EXIDX output section instead of
5631 assuming that it is called .ARM.exidx.
2e702c99 5632 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5633 section list. Do not check for SHF_EXECINSTR section flags but
5634 skip any input section with errors.
5635 * output.cc (Output_section::Output_section): Initialize
5636 always_keeps_input_sections_ to false.
5637 (Output_section::add_input_section): Check for
5638 always_keeps_input_sections_.
5639 * output.h (Output_section::always_keeps_input_sections,
5640 Output_section::set_always_keeps_input_sections): New methods.
5641 (Output_section::always_keeps_input_sections): New data member.
5642
69517287
RÁE
56432010-07-13 Rafael Espindola <espindola@google.com>
5644
5645 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5646 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5647
82742395
ILT
56482010-07-13 Philip Herron <herron.philip@googlemail.com>
5649 Ian Lance Taylor <iant@google.com>
5650
5651 * output.h (Output_section_lookup_maps::add_merge_section):
5652 Correct check of whether value was inserted.
5653 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5654 (Output_section_lookup_maps::add_relaxed_input_section):
5655 Likewise.
5656 * arm.cc (Target_arm::got_section): Remove used local os.
5657 * i386.cc (Target_i386::got_section): Likewise.
5658 * x86_64.cc (Target_x86_64::got_section): Likewise.
5659 * sparc.cc (Target_sparc::got_section): Likewise.
5660 (Target_sparc::relocate): Remove unused local have_got_offset.
5661 * powerpc.cc (Target_powerpc::relocate): Likewise.
5662
f2d707b5
ILT
56632010-07-13 Ian Lance Taylor <iant@google.com>
5664
241531d6
ILT
5665 * compressed_output.cc (zlib_decompress): Fix signature in
5666 !HAVE_ZLIB_H case.
5667
f2d707b5
ILT
5668 * archive.cc (Archive::include_member): Unlock an external member
5669 of a thin archive. Don't bother to delete an object we know is
5670 NULL.
5671
a2e47362
CC
56722010-07-12 Cary Coutant <ccoutant@google.com>
5673
5674 * compressed_output.cc (zlib_decompress): New function.
5675 (get_uncompressed_size): New function.
5676 (decompress_input_section): New function.
5677 * compressed_output.h (get_uncompressed_size): New function.
5678 (decompress_input_section): New function.
5679 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5680 Handle compressed debug sections.
5681 * layout.cc (is_compressed_debug_section): New function.
5682 (Layout::output_section_name): Map compressed section names to
5683 canonical names.
5684 * layout.h (is_compressed_debug_section): New function.
5685 (is_debug_info_section): Recognize compressed debug sections.
5686 * merge.cc: Include compressed_output.h.
5687 (Output_merge_data::do_add_input_section): Handle compressed
5688 debug sections.
5689 (Output_merge_string::do_add_input_section): Handle compressed
5690 debug sections.
5691 * object.cc: Include compressed_output.h.
5692 (Sized_relobj::Sized_relobj): Initialize new data members.
5693 (build_compressed_section_map): New function.
5694 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5695 * object.h (Object::section_is_compressed): New method.
5696 (Object::do_section_is_compressed): New method.
5697 (Sized_relobj::Compressed_section_map): New type.
5698 (Sized_relobj::do_section_is_compressed): New method.
5699 (Sized_relobj::compressed_sections_): New data member.
5700 * output.cc (Output_section::add_input_section): Handle compressed
5701 debug sections.
5702 * reloc.cc: Include compressed_output.h.
5703 (Sized_relobj::write_sections): Handle compressed debug sections.
5704
ce279a62
CC
57052010-07-08 Cary Coutant <ccoutant@google.com>
5706
5707 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5708 weak when resolving to a dynamic def.
5709 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5710 for weak undef/dynamic def cases. Adjust callers.
5711 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5712 undef_binding_weak_.
5713 (Symbol_table::sized_write_globals): Adjust symbol binding.
5714 (Symbol_table::sized_write_symbol): Add binding parameter.
5715 * symtab.h (Symbol::set_undef_binding): New method.
5716 (Symbol::is_undef_binding_weak): New method.
5717 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5718 (Symbol_table::should_override): Add new parameter.
5719 (Symbol_table::sized_write_symbol): Add new parameter.
5720
5721 * testsuite/weak_undef_file1.cc: Add new test case.
5722 * testsuite/weak_undef_file2.cc: Fix header comment.
5723 * testsuite/weak_undef_test.cc: Add new test case.
5724
b2286c10
DK
57252010-06-29 Doug Kwan <dougkwan@google.com>
5726
5727 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5728 Initialize USE_SYMBOL_.
5729 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5730 definition.
5731 (Arm_reloc_property::uses_symbol_): New data member declaration.
5732 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5733 uses symbol value and symbol is undefined but not weakly undefined.
5734
4802450a
RÁE
57352010-06-28 Rafael Espindola <espindola@google.com>
5736
5737 * plugin.cc (Plugin::load): Use dlerror.
5738
e5ca47ba
ILT
57392010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5740
5741 * symtab.cc (detect_odr_violations): When reporting an ODR
5742 violation, report an object where the symbol is defined.
5743
8a75a161
DK
57442010-06-25 Doug Kwan <dougkwan@google.com>
5745
5746 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5747 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5748 definition.
5749 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5750 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5751 target hook to detect function points.
5752 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5753 * icf.h (Icf::check_section_for_function_pointers): Change type of
5754 parameter SECTION_NAME to const reference to std::string. Use
5755 target hook to determine if section may have unsafe pointers.
5756 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5757 method definition.
5758
42218b9f
RÁE
57592010-06-21 Rafael Espindola <espindola@google.com>
5760
5761 * fileread.cc (Input_file::find_fie): New
5762 (Input_file::open): Use Input_file::find_fie.
5763 * fileread.h (Input_file::find_fie): New
5764 * plugin.cc (set_extra_library_path): New.
5765 (Plugin::load): Add set_extra_library_path to the transfer vector.
5766 (Plugin_manager::set_extra_library_path): New.
5767 (Plugin_manager::add_input_file): Use the extra search path if set.
5768 (set_extra_library_path(): New.
5769 * plugin.h (Plugin_manager): Add set_extra_library_path and
5770 extra_search_path_.
5771
a0506cca
CC
57722010-06-19 Cary Coutant <ccoutant@google.com>
5773
5774 * layout.cc (gdb_sections): Add .debug_types.
5775 (lines_only_debug_sections): Likewise.
5776
6508b958
RÁE
57772010-06-18 Rafael Espindola <espindola@google.com>
5778
5779 * plugin.cc (add_input_file,add_input_library)
5780 (Plugin_manager::add_input_file): Make filename arguments const.
5781 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5782 const.
5783
3e235302
DK
57842010-06-16 Doug Kwan <dougkwan@google.com>
5785
5786 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5787 .ARM.attributes section if we have not merged any input
5788 attributes sections.
5789
106e8a6c
DK
57902010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5791
5792 * arm.cc: Allow combining objects with no EABI version
5793 information.
5794
91ff43fe
RÁE
57952010-06-15 Rafael Espindola <espindola@google.com>
5796
5797 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5798
68ed838c
ILT
57992010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5800
5801 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5802 (struct iovec): Correct !HAVE_READV definition.
5803
f3a2388f
CC
58042010-06-10 Cary Coutant <ccoutant@google.com>
5805
5806 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5807 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5808 reloc sections.
5809 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5810
5811 PR 11683
5812 * symtab.h (Symbol::is_placeholder): New member function.
5813 * target-reloc.h (relocate_section): Check for placeholder symbols.
5814
5815 * testsuite/Makefile.am (plugin_test_8): New test.
5816 (plugin_test_9): New test.
5817 * testsuite/Makefile.in: Regenerate.
5818
e1df38aa
NC
58192010-06-09 Nick Clifton <nickc@redhat.com>
5820
5821 * yyscript.y (input_list_element): Allow strings prefixed with
5822 the '-' character. Treat these as libraries.
5823 * script.cc (script_add_library): New function. Adds a library
5824 specified by "-l<name>" found in an input script.
5825 * script-c.h: Add prototype for script_add_library.
5826
25bbe950
DK
58272010-06-07 Doug Kwan <dougkwan@google.com>
5828
5829 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5830 Restrict stub-group size to be within long conditional branch
5831 range when working around cortex-A8 erratum.
5832
0f32ea4c
ILT
58332010-06-07 Damien Diederen <dd@crosstwine.com>
5834
5835 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5836 #ifdef typo.
5837
8fe2a369
ST
58382010-06-03 Sriraman Tallam <tmsriram@google.com>
5839
5840 PR gold/11658
5841 * output.cc
5842 (Output_section::Input_section_sort_entry::compare_section_ordering):
5843 Change to return non-zero correctly.
5844 (Output_section::Input_section_sort_section_order_index_compare
5845 ::operator()): Change to fix ambiguity in comparisons.
5846
6e9ba2ca
ST
58472010-06-01 Sriraman Tallam <tmsriram@google.com>
5848
5849 * gold.h (is_wildcard_string): New function.
5850 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5851 (Layout::layout_eh_frame): Ditto.
5852 (Layout::find_section_order_index): New method.
5853 (Layout::read_layout_from_file): New method.
5854 * layout.h (Layout::find_section_order_index): New method.
5855 (Layout::read_layout_from_file): New method.
5856 (Layout::input_section_position_): New private member.
5857 (Layout::input_section_glob_): New private member.
5858 * main.cc (main): Call read_layout_from_file here.
5859 * options.h (--section-ordering-file): New option.
5860 * output.cc (Output_section::input_section_order_specified_): New
5861 member.
5862 (Output_section::Output_section): Initialize new member.
5863 (Output_section::add_input_section): Add new parameter.
5864 Keep input sections when --section-ordering-file is used.
5865 (Output_section::set_final_data_size): Sort input sections when
5866 section ordering file is specified.
5867 (Output_section::Input_section_sort_entry): Add new parameter.
5868 Check sorting type.
5869 (Output_section::Input_section_sort_entry::compare_section_ordering):
5870 New method.
5871 (Output_section::Input_section_sort_compare::operator()): Change to
5872 consider section_order_index.
5873 (Output_section::Input_section_sort_init_fini_compare::operator()):
5874 Change to consider section_order_index.
5875 (Output_section::Input_section_sort_section_order_index_compare
5876 ::operator()): New method.
5877 (Output_section::sort_attached_input_sections): Change to sort
5878 according to section order when specified.
e1df38aa
NC
5879 (Output_section::add_input_section<32, true>): Add new parameter.
5880 (Output_section::add_input_section<64, true>): Add new parameter.
5881 (Output_section::add_input_section<32, false>): Add new parameter.
5882 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5883 * output.h (Output_section::add_input_section): Add new parameter.
5884 (Output_section::input_section_order_specified): New
5885 method.
5886 (Output_section::set_input_section_order_specified): New method.
5887 (Input_section::Input_section): Initialize section_order_index_.
5888 (Input_section::section_order_index): New method.
5889 (Input_section::set_section_order_index): New method.
5890 (Input_section::section_order_index_): New member.
5891 (Input_section::Input_section_sort_section_order_index_compare): New
5892 struct.
5893 (Output_section::input_section_order_specified_): New member.
5894 * script-sections.cc (is_wildcard_string): Delete and move modified
5895 method to gold.h.
5896 (Output_section_element_input::Output_section_element_input): Modify
5897 call to is_wildcard_string.
5898 (Output_section_element_input::Input_section_pattern
5899 ::Input_section_pattern): Ditto.
5900 (Output_section_element_input::Output_section_element_input): Ditto.
5901 * testsuite/Makefile.am (final_layout): New test case.
5902 * testsuite/Makefile.in: Regenerate.
5903 * testsuite/final_layout.cc: New file.
5904 * testsuite/final_layout.sh: New file.
5905
3537c84b
RÁE
59062010-06-01 Rafael Espindola <espindola@google.com>
5907
5908 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5909
105b6afd
RÁE
59102010-06-01 Rafael Espindola <espindola@google.com>
5911
5912 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5913 visibility of symbols.
5914
29e11421
DK
59152010-05-27 Doug Kwan <dougkwan@google.com>
5916
5917 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5918 from start of output section instead of address for a local symbol
5919 in a merged or relaxed section when doing a relocatable link.
5920
5e0f337e
RÁE
59212010-05-26 Rafael Espindola <espindola@google.com>
5922
703d02da 5923 PR 11604
5e0f337e
RÁE
5924 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5925 adding sections the garbage collector removed.
5926 * gold/testsuite/Makefile.am: Add test.
5927 * gold/testsuite/Makefile.in: Regenerate.
5928 * gold/testsuite/plugin_test_7.sh: New.
5929 * gold/testsuite/plugin_test_7_1.c: New.
5930 * gold/testsuite/plugin_test_7_2.c: New.
5931
f4187277
RÁE
59322010-05-26 Rafael Espindola <espindola@google.com>
5933
5934 * script-sections.cc (Output_section_definition::set_section_addresses):
5935 Check for --section-start.
5936
5c388529
DK
59372010-05-26 Doug Kwan <dougkwan@google.com>
5938
5939 * arm.cc (Arm_scan_relocatable_relocs): New class.
5940 (Target_arm::relocate_special_relocatable): New method.
5941 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5942 (Arm_relocate_functions::thumb_branch_common): Same.
5943 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5944 instead of Default_scan_relocatable_relocs.
5945 * target-reloc.h (relocate_for_relocatable): Let target handle
5946 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5947 * target.h (Sized_target::relocate_special_relocatable): New method.
5948
bca1c3ae
ILT
59492010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5950
5951 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5952
0439c796
DK
59532010-05-23 Doug Kwan <dougkwan@google.com>
5954
5955 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5956 instead of a cast.
5957 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5958 with a direct branch, not a conditional branch, to a stub.
5959 * merge.cc (Output_merge_base::record_input_section): New method
5960 defintion.
5961 (Output_merge_data::do_add_input_section): Record input section if
5962 keeps-input-sections flag is set.
5963 (Output_merge_string::do_add_input_section): Ditto.
5964 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5965 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5966 INPUT_SECTIONS_.
5967 (Output_merge_base::keeps_input_sections,
5968 Output_merge_base::set_keeps_input_sections,
5969 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5970 method definitions.
5971 (Output_merge_base::Input_sections): New type declaration.
5972 (Output_merge_base::input_sections_begin,
5973 Output_merge_base::input_sections_end,
5974 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5975 (Output_merge_base::bool keeps_input_sections_,
5976 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5977 Output_merge_base::input_sections_): New data members.
5978 (Output_merge_data::do_set_keeps_input_sections): New method
5979 defintion.
5980 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5981 * output.cc (Output_section::Input_section::relobj): Move method
5982 defintion from class declaration to here and handle merge sections.
5983 (Output_section::Input_section::shndx): Ditto.
5984 (Output_section::Output_section): Remove initializations of removed
5985 data members and initialize new data member LOOKUP_MAPS_.
5986 (Output_section::add_input_section): Set keeps-input-sections flag
5987 for a newly created merge output section as appropriate. Adjust code
5988 to use Output_section_lookup_maps class.
5989 (Output_section::add_relaxed_input_section): Adjst code for lookup
5990 maps code refactoring.
2e702c99 5991 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5992 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5993 class. If adding input section to a newly created merge output
5994 section fails, remove the new merge section.
5995 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5996 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5997 (Output_section::find_merge_section): Ditto.
0439c796 5998 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5999 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
6000 Output_section_lookup_maps class.
6001 (Output_section::get_input_sections): Export merge sections. Adjust
6002 code to use Output_section_lookup_maps class.
6003 (Output_section:::add_script_input_section): Adjust code to use
6004 Output_section_lookup_maps class. Update lookup maps for merge
6005 sections also.
6006 (Output_section::discard_states): Use Output_section_lookup_maps.
6007 (Output_section::restore_states): Same.
6008 * output.h (Merge_section_properties): Move class defintion out of
6009 Output_section.
6010 (Output_section_lookup_maps): New class.
6011 (Output_section::Input_section::is_merge_section): New method
6012 defintion.
6013 (Output_section::Input_section::relobj): Move defintion out of class
6014 defintion. Declare method only.
6015 (Output_section::Input_section::shndx): Ditto.
6016 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 6017 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
6018 (Output_section::Merge_section_by_properties_map,
6019 Output_section::Output_section_data_by_input_section_map,
6020 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
6021 Remove types.
2e702c99 6022 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
6023 KEEPS_INPUT_SECTIONS.
6024 (Output_section::build_lookup_maps): New method declaration.
6025 (Output_section::merge_section_map_,
6026 Output_section::merge_section_by_properties_map_,
6027 Output_section::relaxed_input_section_map_,
6028 Output_section::is_relaxed_input_section_map_valid_): Remove data
6029 members.
6030 (Output_section::lookup_maps_): New data member.
6031
76295588
L
60322010-05-21 Doug Kwan <dougkwan@google.com>
6033
6034 PR gold/11619
6035 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
6036 avoid a compilation error.
6037
d103a984
RÁE
60382010-05-19 Rafael Espindola <espindola@google.com>
6039
6040 * script-sections.cc (Output_section_definition::allocate_to_segment):
6041 Update the phdrs_list even when the output section is NULL.
6042 * testsuite/Makefile.am: Add test.
6043 * testsuite/Makefile.in: Regenerate.
6044 * testsuite/script_test_9.cc: New.
6045 * testsuite/script_test_9.sh: New.
6046 * testsuite/script_test_9.t: New.
6047
6625d24e
DK
60482010-05-19 Doug Kwan <dougkwan@google.com>
6049
6050 * arm.cc (Arm_input_section::original_size): New method.
6051 (Arm_input_section::do_addralign): Add a cast.
6052 (Arm_input_section::do_output_offset): Remove static cast.
6053 (Arm_input_section::original_addralign,
6054 Arm_input_section::original_size_): Change type to uint32_t.
6055 (Arm_input_section::init): Add safe casts for section alignment
6056 and size.
6057 (Arm_input_section::set_final_data_size): Do not set address and
6058 offset of stub table.
6059 (Arm_output_section::fix_exidx_coverage): Change use of of
6060 Output_section::Simple_input_section to that of
6061 Output_section::Input_section.
6062 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
6063 except for the first pass.
6064 * output.cc (Output_section::get_input_sections): Change type of
6065 input_sections to std::list<Input_section>.
6066 (Output_section::add_script_input_section): Rename from
6067 Output_section::add_simple_input_section. Change type of SIS
6068 parameter from Simple_input_section to Input_section.
6069 * output.h (Output_section::Simple_input_section): Remove class.
6070 (Output_section::Input_section): Change class visibility to public.
6071 (Output_section::Input_section::addralign): Use stored alignments
6072 for special input sections if set.
6073 (Output_section::Input_section::set_addralign): New method.
6074 (Output_section::get_input_sections): Change parameter type from
6075 list of Simple_input_section to list of Input_section.
6076 (Output_section::add_script_input_section): Rename from
6077 Output_section::add_simple_input_section. Change first parameter's
6078 type from Simple_input_section to Input_section and remove the
6079 second and third parameters.
6080 * script-sections.cc (Input_section::Input_section_list): Change
6081 type to list of Output_section::Input_section/
6082 (Input_section_info::Input_section_info): Change parameter type of
6083 INPUT_SECTION to Output_section::Input_section.
6084 (Input_section_info::input_section): Change return type.
6085 (Input_section_info::input_section_): Change type to
6086 Output_section::Input_section.
6087 (Output_section_element_input::set_section_addresses): Adjust code
6088 to use Output_section::Input_section instead of
6089 Output_section::Simple_input_section. Adjust code for renaming
6090 of Output_section::add_simple_input_section.
6091 (Orphan_output_section::set_section_addresses): Ditto.
6092
e1e82ea4
RW
60932010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6094
6095 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6096 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6097
91e75c8a
RÁE
60982010-05-18 Rafael Espindola <espindola@google.com>
6099
6100 * options.cc (General_options::finalize): Handle -nostdlib.
6101 * options.h (nostdlib): New option.
6102 * script.cc (script_add_search_dir): Handle -nostdlib.
6103
da59ad79
DK
61042010-05-12 Doug Kwan <dougkwan@google.com>
6105
6106 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6107 attributes section only if there no attributes section after merging.
6108 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6109 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6110 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6111 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6112 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6113 and arm_attr_merge_7.stdout.
6114 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6115 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6116 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6117 arm_attr_merge_7b.o): New rules.
6118 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6119 arm_attr_merge_7
6120 * testsuite/Makefile.in: Regenerate.
6121 * testsuite/arm_attr_merge.sh: New file.
6122 * testsuite/arm_attr_merge_[67][ab].s: Same.
6123
3e01a7fd
NC
61242010-05-05 Nick Clifton <nickc@redhat.com>
6125
6126 * po/es.po: Updated Spanish translation.
6127
7ad2014a
L
61282010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6129
6130 * Makefile.am (install-exec-local): Properly install gold as
6131 default cross linker.
6132 * Makefile.in: Regenerated.
6133
4fda8867
NC
61342010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6135 Nick Clifton <nickc@redhat.com>
6136
6137 * configure.ac (install_as_default): Define and set to false
6138 unless --enable-gold or --enable-gold=both/gold has been
6139 specified.
6140 * configure: Regenerate.
6141
6142 * Makefile.am (install-exec-local): Install the executable as
6143 'ld.gold'. If install_as_default is true then also install it as
6144 'ld'.
6145 * Makefile.in: Regenerated.
6146
bd288ea2
ILT
61472010-04-24 Ian Lance Taylor <iant@google.com>
6148
6149 * layout.cc (Layout::layout_reloc): In relocatable link don't
6150 combine reloc sections for grouped sections.
6151
ef38fd8a
ST
61522010-04-23 Sriraman Tallam <tmsriram@google.com>
6153
6154 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6155 sections that are not ordinary to icf.
6156 * icf.cc (get_section_contents): Handle relocation pointing to section
6157 with no object or shndx information.
6158 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6159 * testsuite/Makefile.in: Regenerate.
6160 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6161 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6162
f6973bdc
ILT
61632010-04-22 Ian Lance Taylor <iant@google.com>
6164
6165 * expression.cc (Expression::Expression_eval_info): Add
6166 result_alignment_pointer field.
6167 (Expression::eval_with_dot): Add result_alignment_pointer
6168 parameter. Change all callers.
6169 (Expression::eval_maybe_dot): Likewise.
6170 (class Binary_expression): Add alignment_pointer parameter to
6171 left_value and right_value. Change all callers.
6172 (BINARY_EXPRESSION): Set result alignment.
6173 (class Trinary_expression): Add alignment_pointer parameter to
6174 arg2_value and arg3_value. Change all callers.
6175 (Trinary_cond::value): Set result alignment.
6176 (Max_expression::value, Min_expression::value): Likewise.
6177 (Align_expression::value): Likewise.
6178 * script-sections.cc (class Sections_element): Add dot_alignment
6179 parameter to set_section_addresses virtual function. Update
6180 instantiations.
6181 (class Output_section_element): Likewise.
6182 (Script_sections::create_segments): Add dot_alignment parameter.
6183 Change all callers.
6184 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6185 (Script_sections::set_phdrs_clause_addresses): Likewise.
6186 * script-sections.h: Update declarations.
6187 * script.h: Update declarations.
6188 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6189 min_p_align.
6190 * testsuite/script_test_3.t: Set large alignment.
6191 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6192 segment has expected alignment.
6193
9c9c98a5
NC
61942010-04-22 Nick Clifton <nickc@redhat.com>
6195
6196 * po/gold.pot: Updated by the Translation project.
6197 * po/vi.po: Updated Vietnamese translation.
6198
2253bfba
L
61992010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6200
6201 * testsuite/Makefile.am (check_PROGRAMS): Add
6202 icf_virtual_function_folding_test.
6203 * testsuite/Makefile.in: Regenerated.
6204
85fdf906
AH
62052010-04-15 Andrew Haley <aph@redhat.com>
6206
6207 * options.h (merge_exidx_entries): New option.
6208 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6209 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6210 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6211 (Target_arm::merge_exidx_entries): New function.
6212 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6213 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6214 to Arm_exidx_fixup constructor.
6215 Add new arg, merge_exidx_entries.
6216 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6217 Arm_output_section::fix_exidx_coverage.
6218
ce97fa81
ST
62192010-04-18 Sriraman Tallam <tmsriram@google.com>
6220
6221 * icf.cc (get_section_contents): Check for preemptible functions.
6222 Ignore addend when appropriate.
6223 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6224 section folded.
6225 (add_from_relobj): Check for section folded.
6226 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6227 * symtab.h (should_add_dynsym_entry): Add new parameter.
6228 * target-reloc.h (scan_relocs): Check for section folded.
6229 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6230 Check reloc types for function pointers in shared objects.
6231 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6232 case.
6233 (icf_preemptible_functions_test): New test case.
6234 (icf_string_merge_test): New test case.
6235 * testsuite.Makefile.in: Regenerate.
6236 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6237 bar_glob. Refactor code.
6238 * testsuite/icf_preemptible_functions_test.cc: New file.
6239 * testsuite/icf_preemptible_functions_test.sh: New file.
6240 * testsuite/icf_string_merge_test.cc: New file.
6241 * testsuite/icf_string_merge_test.sh: New file.
6242 * testsuite/icf_virtual_function_folding_test.cc: New file.
6243 * testsuite/icf_virtual_function_folding_test.sh: New file.
6244
04ceb17c
DK
62452010-04-14 Doug Kwan <dougkwan@google.com>
6246
6247 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6248 for local symbol recounting if we remove a section due to ICF.
6249 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6250 there are no regular objects in input.
6251
153e7da4
DK
62522010-04-13 Doug Kwan <dougkwan@google.com>
6253
6254 * arm.cc (Arm_input_section::set_final_data_size): Compute
6255 accurate final data size instead of using current data size.
6256
4dbd9faf
DK
62572010-04-09 Doug Kwan <dougkwan@google.com>
6258
6259 * layout.cc (Layout::choose_output_section): Handle script section
6260 types.
6261 (Layout::make_output_section_for_script): Add section type parameter.
6262 Handle script section types.
6263 * layout.h (Layout::make_output_section_for_script): Add section
6264 type parameter.
6265 * output.cc (Output_section::Output_section): Initialize data member
6266 is_noload_.
6267 (Output_section::do_reset_address_and_file_offset): Do not set address
6268 to 0 if section is a NOLOAD section.
6269 * output.h (Output_section::is_noload): New method.
6270 (Output_section::set_is_noload): Ditto.
6271 (Output_section::is_noload_): New data member.
6272 * script-c.h (Script_section_type): New enum type.
6273 (struct Parser_output_section_header): Add new file section_type.
6274 * script-sections.cc (Sections_element::output_section_name): Add
6275 parameter for returning script section type.
6276 (Output_section_definition::output_section_name): Ditto.
6277 (Output_section_definition::section_type)P; New method.
6278 (Output_section_definiton::script_section_type_name): Ditto.
6279 (Output_section_definition::script_section_type_): New data member.
6280 (Output_section_definition::Output_section_definition): Initialize
6281 data member Output_section_definition::script_section_type_.
6282 (Output_section_definition::create_sections): Pass script section type
6283 to Layout::make_output_section_for_script.
6284 (Output_section_definition::output_section_name): Return script
6285 section type to caller.
6286 (Output_section_definition::set_section_address): Do not advance
6287 dot value and load address if section type is NOLOAD. Set address
6288 of NOLOAD sections regardless of section flags.
6289 (Output_section_definition::print): Print section type if it is
6290 not SCRIPT_SECTION_TYPE_NONE.
6291 (Output_section_definition::section_type): New method.
6292 (Output_section_definition::script_section_type_name): Ditto.
6293 (Script_sections::output_section_name): Add new parameter
6294 PSECTION_TYPE for returning script section type. Pass it to
6295 section elements. Handle discard sections.
6296 (Sort_output_sections::operator()): Handle NOLOAD sections.
6297 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6298 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6299 returning script section type.
6300 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6301 INFO and NOLOAD.
6302 * yyscript.y (union): Add new field SECTION_TYPE.
6303 (COPY, DSECT, INFO, NOLOAD): New tokens.
6304 (opt_address_and_section_type): Change type to output_section_header.
6305 (section_type): New non-terminal
6306 (section_header): Handle section type.
2253bfba 6307 (opt_address_and_section_type): Return section type value.
4dbd9faf 6308
721ea635
L
63092010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6310
6311 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6312 * testsuite/plugin_common_test_2.c (foo): Likewise.
6313
6bf924b0
DK
63142010-04-08 Doug Kwan <dougkwan@google.com>
6315
6316 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6317 Output_merge_data.
6318 * output.cc (Output_section::add_merge_input_section): Simplify
6319 code and return status of Output_merge_base::add_input_section.
e1df38aa 6320 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6321 returns true.
6322
24af6f92
DK
63232010-04-07 Doug Kwan <dougkwan@google.com>
6324
6325 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6326 if section is marked as containing instructions but has no mapping
6327 symbols.
6328 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6329 correct section index.
6330 (Arm_relobj::find_linked_text_section): Ditto.
6331
00698fc5
CC
63322010-04-07 Cary Coutant <ccoutant@google.com>
6333
6334 * archive.cc (include_member): Destroy Read_symbols_data object before
6335 releasing file.
6336 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6337 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6338 (Read_symbols_data::~Read_symbols_data) New destructor.
6339 (Section_relocs::Section_relocs) New constructor.
6340 (Section_relocs::~Section_relocs) New destructor.
6341 (Read_relocs_data::Read_relocs_data) New constructor.
6342 (Read_relocs_data::~Read_relocs_data) New destructor.
6343 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6344 pointers to NULL after deleting.
6345
7296d933
DK
63462010-04-07 Doug Kwan <dougkwan@google.com>
6347
6348 * arm.cc: Replace "endianity" with "endianness" in comments.
6349 (Arm_exidx_cantunwind): Ditto.
6350 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6351 (Arm_relobj::merge_flags_and_attributes): New method.
6352 (Arm_relobj::merge_flags_and_attributes_): New data member.
6353 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6354 (Arm_relobj::scan_sections_for_stubs): Ditto.
6355 (Arm_relobj::do_read_symbols): Check to see if we really want to
6356 merge processor-specific flags and attributes. Exit early if
6357 an object is empty except for section names and the undefined symbol.
6358 (Target_arm::do_finalize_sections): Move check for ELF format to
6359 Arm_relobj::do_read_symbols. Merge processor specific flags and
6360 attributes from a regular object only when we have determined that
6361 it is aapropriate. Do not create an .ARM.attributes section in
6362 output if there is no regular input object.
6363 (Target_arm::merge_processor_specific_flags): Check
6364 --warn-mismatch before printing any error.
6365 (Target_arm::merge_object_attributes): Ditto.
6366 * gold.cc (queue_middle_tasks): Handle the case in which there is
6367 no regular object in input.
6368 * options.cc (General_options::parse_EB): New method.
6369 (General_options::parse_EL): Same.
6370 (General_options::General_options): Initialize endianness_.
6371 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6372 New options.
6373 (General_options::Endianness): New enum.
6374 (General_options::endianness): New method.
6375 (General_options::endianness_): New data member.
6376 * parameters.cc (Parameters::set_options): Check target endianness.
6377 (Parameters::set_target_once): Ditto.
6378 (Parameters::check_target_endianness): New method.
6379 (parameters_force_valid_target): If either -EL or -EB is specified,
6380 use it to define endianness of default target.
6381 * parameters.h (Parameters::check_target_endianness): New method
6382 declaration.
6383 * target.h (class Target): Change "endianity" to "endianness"
6384 in comments.
6385
efc8d4f2
RW
63862010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6387
6388 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6389 * configure: Regenerate.
6390 * Makefile.in: Regenerate.
6391 * testsuite/Makefile.in: Regenerate.
6392
be234d88
CC
63932010-04-06 Cary Coutant <ccoutant@google.com>
6394
6395 gcc PR lto/42757
6396 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6397 prevailing definitions of common symbols.
6398 * testsuite/plugin_test_6.sh: New test case.
6399 * testsuite/plugin_common_test_1.c: New test case.
6400 * testsuite/plugin_common_test_2.c: New test case.
6401 * testsuite/Makefile.am (plugin_test_6): New test case.
6402 * testsuite/Makefile.in: Regenerate.
6403
bd32c6bd
NC
64042010-04-06 Nick Clifton <nickc@redhat.com>
6405
6406 * po/vi.po: New Vietnamese translation.
6407
323c532f
DK
64082010-03-30 Doug Kwan <dougkwan@google.com>
6409
6410 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6411
4fcd97eb
DK
64122010-03-25 Doug Kwan <dougkwan@google.com>
6413
6414 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6415 to avoid a conversion warning on a 32-bit host.
6416
4ebf39db
ILT
64172010-03-24 Ian Lance Taylor <iant@google.com>
6418
6419 * testsuite/script_test_3.t: Add a TLS segment.
6420 * testsuite/Makefile.am (check_PROGRAMS): Add
6421 tls_phdrs_script_test.
6422 (tls_phdrs_script_test_SOURCES): Define.
6423 (tls_phdrs_script_test_DEPENDENCIES): Define.
6424 (tls_phdrs_script_test_LDFLAGS): Define.
6425 (tls_phdrs_script_test_LDADD): Define.
6426 * testsuite/Makefile.in: Rebuild.
6427
4a599bdd
CC
64282010-03-23 Cary Coutant <ccoutant@google.com>
6429
6430 * fileread.cc (find_or_make_view): Fix comment.
6431
6c93b22c
ILT
64322010-03-23 Ian Lance Taylor <iant@google.com>
6433
6434 * script-sections.cc (class Orphan_section_placement): Define
6435 PLACE_TLS and PLACE_TLS_BSS.
6436 (Orphan_section_placement::Orphan_section_placement): Initialize
6437 new places.
6438 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6439 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6440 (tls_script_test_SOURCES): Define.
6441 (tls_script_test_DEPENDENCIES): Define.
6442 (tls_script_test_LDFLAGS): Define.
6443 (tls_script_test_LDADD): Define.
6444 * testsuite/Makefile.in: Rebuild.
6445
a2c7281b
DK
64462010-03-22 Doug Kwan <dougkwan@google.com>
6447
6448 * arm.cc (Arm_relocate_functions::abs8,
6449 Arm_relocate_functions::abs16): Use correct check for overflow
6450 specified in the ARM ELF specs.
6451 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6452 target of a BLX instruction specially.
6453 (Reloc_stub::stub_type_for_reloc): Ditto.
6454 (Relocate::relocate): Use symbolic names instead of numeric relocation
6455 codes to report error.
6456 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6457 workaround.
6458 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6459 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6460 thumb2_blx_out_of_range.stdout
6461 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6462 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6463 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6464 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6465 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6466 thumb2_blx_in_range, thumb2_blx_in_range.o,
6467 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6468 thumb2_blx_out_of_range.o): New rules.
2e702c99 6469 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6470 thumb2_blx_in_range and thumb2_blx_out_of_range.
6471 * testsuite/Makefile.in: Regenerate.
6472 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6473 * testsuite/thumb_blx_in_range.s: New file.
6474 * testsuite/thumb_blx_out_of_range.s: New file.
6475
b0193076
RÁE
64762010-03-22 Rafael Espindola <espindola@google.com>
6477
6478 * archive.cc (Should_include): Move to archive.h.
6479 (should_include_member): Make it a member of Archive.
6480 (Lib_group): New.
6481 (Add_lib_group_symbols): New.
6482 * archive.h: Include options.h.
6483 (Archive_member): Moved from Archive.
6484 (Should_include): Moved from archive.cc.
6485 (Lib_group): New.
6486 (Add_lib_group_symbols): New.
6487 * dynobj.cc (do_should_include_member): New.
6488 * dynobj.h (do_should_include_member): New.
6489 * gold.cc (queue_initial_tasks): Update call to queue.
6490 * main.cc (main): Print lib group stats.
6491 * object.cc (do_should_include_member): New.
6492 * object.h: Include archive.h.
6493 (Object::should_include_member): New.
6494 (Object::do_should_include_member): New.
6495 (Sized_relobj::do_should_include_member): New.
6496 * options.cc (General_options::parse_start_lib): New.
6497 (General_options::parse_end_lib): New.
6498 (Input_arguments::add_file): Handle lib groups.
6499 (Input_arguments::start_group): Check we are not in a lib.
6500 (Input_arguments::start_lib): New.
6501 (Input_arguments::end_lib): New.
6502 * options.h (General_options): Add start_lib and end_lib.
6503 (Input_argument::lib_): New.
6504 (Input_argument::lib): New.
6505 (Input_argument::is_lib): New.
6506 (Input_file_lib): New.
6507 (Input_arguments::in_lib_): New.
6508 (Input_arguments::in_lib): New.
6509 (Input_arguments::start_lib): New.
6510 (Input_arguments::end_lib_): New.
6511 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6512 in unused members as preempted.
6513 (Sized_pluginobj::do_should_include_member): New.
6514 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6515 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6516 return the blocker.
6517 (Read_symbols::do_whole_lib_group): New.
6518 (Read_symbols::do_lib_group): New.
6519 (Read_symbols::do_read_symbols): Handle lib groups.
6520 (Read_symbols::get_name): Handle lib groups.
6521 * readsyms.h (Read_symbols): Add an archive member pointer.
6522 (Read_symbols::do_whole_lib_group): New.
6523 (Read_symbols::do_lib_group): New.
6524 (Read_symbols::member_): New.
6525 * script.cc (read_input_script): Update call to queue_soon.
6526
d099120c
DK
65272010-03-19 Doug Kwan <dougkwan@google.com>
6528
6529 * arm.cc (Stub_table::Stub_table): Initialize new data members
6530 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6531 (Stub_table::add_reloc_stub): Assign stub offset and update
6532 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6533 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6534 New data members.
2e702c99 6535 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6536 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6537 instead of going over all reloc stubs.
2e702c99 6538 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6539 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6540 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6541 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6542 Stringpool_template::offset_.
6543 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6544 Stringpool_template::offset_ to zero.
6545
1aa37384
DK
65462010-03-15 Doug Kwan <dougkwan@google.com>
6547
6548 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6549 offset_.
6550 (Stringpool_template::new_key_offset): New method.
6551 (Stringpool_template::add_string): Assign offsets when adding new
6552 strings.
6553 (Stringpool_template::set_string_offsets): Do not set string offsets
6554 when not optimizing.
6555 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6556 member size_.
2e702c99
RM
6557 (Chunked_vector::clear): Clear size_.
6558 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6559 (Chunked_vector::size): Return size_.
6560 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6561 (Chunked_vector::size_): New data member.
1aa37384
DK
6562 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6563 (Stringpool_template::new_key_offset): New method declaration.
6564 (Stringpool_template::offset_): New data member.
6565
b672b057
RÁE
65662010-03-15 Rafael Espindola <espindola@google.com>
6567
6568 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6569 Add_symbols' constructor.
6570 * readsyms.h (Add_symbols): Remove the input_group member.
6571
b6848d3c
ILT
65722010-03-10 Ian Lance Taylor <iant@google.com>
6573
6574 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6575 target to ask whether a reference to a symbol requires a stack
6576 split.
6577 * target.h (Target::is_call_to_non_split): New function.
6578 (Target::do_is_call_to_non_split): Declare virtual function.
6579 * target.cc: Include "symtab.h".
6580 (Target::do_is_call_to_non_split): New function.
6581 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6582
a2a5469e
CC
65832010-03-10 Cary Coutant <ccoutant@google.com>
6584
6585 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6586 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6587 (File_read::open[2]): Add whole_file_view_ to list of views.
6588 (File_read::make_view): Remove test of whole_file_view_.
6589 (File_read::find_or_make_view): Create whole_file_view_ if
6590 necessary.
6591 (File_read::clear_views): Replace bool parameter with enum;
6592 adjust all callers. Don't delete views with permanent data;
6593 do delete cached views and views from archives if
6594 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6595 if clearing the corresponding view.
6596 * fileread.h (File_read::Clear_views_mode): New enum.
6597 (File_read::View::is_permanent_view): New method.
6598 (File_read::clear_views): Replace bool parameter
6599 with enum; adjust all callers.
6600 * options.h (General_options): Change keep_files_mapped option;
6601 add map_whole_files.
6602 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6603 releasing the file.
6604 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6605 the file.
6606
8861f32b
DM
66072010-03-10 David S. Miller <davem@davemloft.net>
6608
6609 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6610
d62d0f5f
ST
66112010-03-09 Sriraman Tallam <tmsriram@google.com>
6612
6613 * icf.cc (get_section_contents): Add '@' marker after processing the
6614 merge reloc.
6615
9177756d
DK
66162010-03-08 Doug Kwan <dougkwan@google.com>
6617
6618 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6619 due to a conversion warning.
6620 (Arm_relobj::update_output_local_symbol_count): Check for local
6621 symbol with unset output index.
6622
9e9e071b
ILT
66232010-03-05 Ian Lance Taylor <iant@google.com>
6624
6625 * options.h (class General_options): Add --spare-dynamic-tags.
6626 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6627 --spare-dynamic-tags.
6628
a81ee015
ILT
66292010-03-05 Ian Lance Taylor <iant@google.com>
6630
6631 * incremental.cc: Include "libiberty.h".
6632
44ec90b9
RO
66332010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6634
6635 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6636 function, is_info_ member.
6637 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6638 (Versions::Versions): Update caller.
6639 (Versions::define_base_version): Likewise.
6640 (Versions::add_def): Likewise.
6641
0897ed3b
ST
66422010-03-03 Sriraman Tallam <tmsriram@google.com>
6643
6644 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6645 (Scan::possible_function_pointer_reloc): New function.
6646 (Scan::local_reloc_may_be_function_pointer): Change to call
6647 possible_function_pointer_reloc.
6648 (Scan::global_reloc_may_be_function_pointer): Ditto.
6649 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6650 relocations in ".data.rel.ro._ZTV" section.
6651 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6652 * testsuite/icf_safe_so_test.cc: Ditto.
6653 * testsuite/icf_safe_test.cc: Ditto.
6654 * testsuite/icf_safe_test.sh: Ditto.
6655
d3bbad62
ILT
66562010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6657 Ian Lance Taylor <iant@google.com>
6658
6659 * target-reloc.h (relocate_section): Check the symbol table index
6660 for -1U before setting the local symbol index.
6661 (scan_relocatable_relocs): If copying the relocation, record that
6662 the local symbol is required.
6663 * object.h (Symbol_value::is_output_symtab_index_set): New
6664 function.
6665 (Symbol_value::may_be_discarded_from_output_symtab): New
6666 function.
6667 (Symbol_value::has_output_symtab_entry): New function.
6668 (Symbol_value::needs_output_symtab_entry): Remove.
6669 (Symbol_value::output_symtab_index): Make sure the symbol index is
6670 set.
6671 (Symbol_value::set_output_symtab_index): Make sure the symbol
6672 index is not set. Make sure the new index is valid.
6673 (Symbol_value::set_must_have_output_symtab_entry): New function.
6674 (Symbol_value::has_output_dynsym_entry): New function.
6675 (Symbol_value::set_output_dynsym_index): Make sure the new index
6676 is valid.
6677 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6678 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6679 local symbol if permitted.
6680 (Sized_relobj::do_finalize_local_symbols): Call
6681 is_output_symtab_index_set rather than needs_output_symtab_entry.
6682 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6683 rather than needs_output_symtab_entry. Call
6684 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6685 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6686 is_output_symtab_index_set rather than needs_output_symtab_entry.
6687 * testsuite/discard_locals_relocatable_test.c: New file.
6688 * testsuite/discard_locals_test.sh: Test -r.
6689 * testsuite/Makefile.am (check_DATA): Add
6690 discard_locals_relocatable_test1.syms,
6691 discard_local_relocatable_test2.syms.
6692 (MOSTLYCLEANFILES): Likewise. Also add
6693 discard_locals_relocatable_test1.lout and
6694 discard_locals_relocatable_test2.out.
6695 (discard_locals_relocatable_test1.syms): New target.
6696 (discard_locals_relocatable_test.o): New target.
6697 (discard_locals_relocatable_test1.out): New target.
6698 (discard_locals_relocatable_test2.syms): New target.
6699 (discard_locals_relocatable_test2.out): New target.
6700 (various): Add missing ../ld-new dependencies.
6701 * testsuite/Makefile.in: Rebuild.
6702
7e8ccf26
NC
67032010-03-03 Nick Clifton <nickc@redhat.com>
6704
6705 * po/fi.po: New Finnish translation.
6706
2a0ff005
DK
67072010-03-01 Doug Kwan <dougkwan@google.com>
6708
6709 * layout.cc (Layout::Layout): Force section types of .init_array*,
6710 .preinit_array* and .fini_array* sections.
6711 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6712 Fix check of return value of std::string::find.().
6713 (Output_section::Input_section_sort_compare::operator()): Remove
6714 comment about .init_array.
6715 (Output_section::Input_section_sort_init_fini_compare::operator()):
6716 New method.
6717 (Output_section::sort_attached_input_sections): Handle .init_array
6718 and .fini_array specially.
6719 * output.h (Output_section::Inut_section_sort_compare): Update
6720 comment.
6721 (Output_section::Input_section_sort_init_fini_compare): New struct.
6722
c3e4ae29
DK
67232010-02-26 Doug Kwan <dougkwan@google.com>
6724
6725 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6726 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6727 * testsuite/debug_msg.sh: Avoid matching source line number for
6728 use of global variable undef_int.
6729
2fd9ae7a
DK
67302010-02-26 Doug Kwan <dougkwan@google.com>
6731
6732 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6733 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6734 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6735 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6736 * options.cc (General_options::General_options): Initialize member
6737 fix_v4bx_.
6738 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6739 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6740 and rm_no_fix_v4bx.stdout
6741 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6742 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6743 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6744 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6745 and arm_no_fix_v4bx.
6746 * Makefile.in: Regenerate.
6747 * testsuite/arm_fix_v4bx.s: New file.
6748 * testsuite/arm_fix_v4bx.sh: Ditto.
6749
67ec7d0b
DK
67502010-02-24 Doug Kwan <dougkwan@google.com>
6751
6752 * arm.cc (Target_arm::got_section): Make the .got section the first
6753 non RELRO section in the data segment.
6754 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6755 suffixes of section names.
6756
10165461
DK
67572010-02-24 Doug Kwan <dougkwan@google.com>
6758
6759 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6760 flags and attributes merging if an input file is a binary file.
6761 * fileread.cc (Input_file::open): Record format of original file.
6762 * fileread.h (Input_file::Format): New enum type.
2e702c99 6763 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6764 (Input_file::format): New method definition.
6765 (Input_file::format_):: New data member.
6766
4a54abbb
DK
67672010-02-24 Doug Kwan <dougkwan@google.com>
6768
6769 * arm.cc (Arm_output_data_got): New class.
6770 (ARM_TCB_SIZE): New constant
6771 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6772 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6773 If user uses a script with a SECTIONS clause, issue only a warning
6774 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6775 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6776 garbage collection.
6777 (Target_arm::got_mode_index_entry): Handle static linking.
6778 (Target_arm::Scan::local): Ditto.
6779 (Target_arm::Scan::global): Ditto.
6780 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6781 all incorrectly implemented relocations.
e1df38aa 6782 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6783 Arm_output_section::fix_exidx_coverage.
6784 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6785 from ".ARM.exidx." and ".ARM.extab.".
6786
ca419a6f
ILT
67872010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6788
6789 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6790 section if it does not already exist.
6791 * attributes.cc (Attributes_section_data::Attributes_section_data):
6792 Don't crash if size is zero.
6793
135b9c78
ILT
67942010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6795 Ian Lance Taylor <iant@google.com>
6796
6797 * gold.cc (queue_middle_tasks): If no input files were opened,
6798 exit.
6799 * workqueue.h (Task_function::Task_function): Assert that there is
6800 a blocker.
6801
bb0bfe4f
DK
68022010-02-22 Doug Kwan <dougkwan@google.com>
6803
6804 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6805 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6806 types to avoid warnings due to different uint64_t implementations
6807 on different hosts.
6808
2a2b6d42
DK
68092010-02-21 Doug Kwan <dougkwan@google.com>
6810
6811 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6812 handling of the maximum backward branch offset.
2e702c99 6813 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6814 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6815 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6816 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6817 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6818 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6819 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6820 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6821 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6822 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6823 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6824 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6825 thumb2_bl_out_of_range.o): New rules.
6826 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6827 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6828 thumb2_bl_out_of_range
6829 * testsuite/Makefile.in: Regenerate.
6830 * testsuite/arm_bl_in_range.s: New file.
6831 * testsuite/arm_bl_out_of_range.s: Ditto.
6832 * testsuite/arm_branch_in_range.sh: Ditto.
6833 * testsuite/arm_branch_range.t: Ditto.
6834 * testsuite/thumb2_branch_range.t: Ditto.
6835 * testsuite/thumb_bl_in_range.s: Ditto.
6836 * testsuite/thumb_bl_out_of_range.s: Ditto.
6837 * testsuite/thumb_branch_range.t: Ditto.
6838
b487ad64
ST
68392010-02-20 Sriraman Tallam <tmsriram@google.com>
6840
6841 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6842 Add reloc offset information.
6843 * icf.cc (get_section_contents): Change iterators to point to the new
6844 vectors. Add reloc offset information to the contents.
6845 * icf.h (Icf::Sections_reachable_info): New typedef.
6846 (Icf::Sections_reachable_list): New typedef.
6847 (Icf::Offset_info): New typedef.
6848 (Icf::Reloc_info): New struct typedef.
6849 (Icf::Reloc_info_list): New typedef.
6850 (Icf::symbol_reloc_list): Delete method.
6851 (Icf::addend_reloc_list): Delete method.
6852 (Icf::section_reloc_list): Delete method.
6853 (Icf::reloc_info_list): New method.
6854 (Icf::reloc_info_list_): New member.
6855
f96accdf
DK
68562010-02-19 Doug Kwan <dougkwan@google.com>
6857
6858 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6859 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6860 * arm.cc (Arm_relocation_functions): New forward declaration.
6861 (Target_arm::Target_arm): Initialize new data members
6862 got_mod_index_offset_ and tls_base_symbol_defined_.
6863 (Target_arm::Relocate::relocate_tls): New method.
6864 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6865 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6866 New methods.
2e702c99 6867 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6868 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6869 (Target_arm::got_mod_index_offset_,
6870 Target_arm::tls_base_symbol_defined_): New data members.
6871 (Target_arm::Scan::local, Target::Scan::global,
6872 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6873 relocations.
6874
c8761b9a
DK
68752010-02-18 Doug Kwan <dougkwan@google.com>
6876
6877 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6878 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6879 text section as a parameter becuase some broken tools may not set
6880 the link in section header.
6881 (Target_arm::has_got_section): New method.
6882 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6883 without any mapping symbol as data only. Remove warning.
6884 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6885 link in its section header, try to discover the link by inspecting the
6886 REL31 relocation at the beginning of the section.
6887 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6888 in error message.
6889 (Target_arm::Scan::global): Treat any reference to the symbol
6890 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6891
21bb3914
ST
68922010-02-12 Sriraman Tallam <tmsriram@google.com>
6893
6894 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6895 (Scan::global_reloc_may_be_function_pointer): New function.
6896 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6897 (Scan::global_reloc_may_be_function_pointer): New function.
6898 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6899 (Scan::global_reloc_may_be_function_pointer): New function.
6900 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6901 (Scan::global_reloc_may_be_function_pointer): New function.
6902 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6903 (Scan::global_reloc_may_be_function_pointer): New function.
6904 (Scan::possible_function_pointer_reloc): New function.
6905 (Target_x86_64::can_check_for_function_pointers): New function.
6906 * gc.h (gc_process_relocs): Scan relocation types to determine if
6907 function pointers were taken for targets that support it.
6908 * icf.cc (Icf::find_identical_sections): Include functions for
6909 folding in safe ICF whose pointer is not taken.
6910 * icf.h (Secn_fptr_taken_set): New typedef.
6911 (fptr_section_id_): New member.
6912 (section_has_function_pointers): New function.
6913 (set_section_has_function_pointers): New function.
6914 (check_section_for_function_pointers): New function.
6915 * options.h: Fix comment for safe ICF option.
6916 * target.h (can_check_for_function_pointers): New function.
6917 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6918 Modify icf_safe_test for X86-64.
6919 * testsuite/Makefile.in: Regenerate.
6920 * testsuite/icf_safe_so_test.cc: New file.
6921 * testsuite/icf_safe_so_test.sh: New file.
6922 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6923 (main): Change to take pointer to function kept_func_3.
6924 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6925 folding is done correctly for X86-64.
6926
0da6fa6c
DM
69272010-02-12 David S. Miller <davem@davemloft.net>
6928
6929 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6930 is_symbolless parameter.
6931 (Output_reloc<SHT_REL>::is_symbolless): New.
6932 (Output_reloc<SHT_REL>::is_symbolless_): New.
6933 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6934 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6935 (Output_reloc<SHT_RELA>::is_symbolless): New.
6936 (Output_data_reloc::add_global): Handle is_symbolless.
6937 (Output_data_reloc::add_global_relative): Likewise.
6938 (Output_data_reloc::add_local): Likewise.
6939 (Output_data_reloc::add_local_relative): Likewise.
6940 (Output_data_reloc::add_symbolless_global_addend): New.
6941 (Output_data_reloc::add_symbolless_local_addend): New.
6942 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6943 is_symbolless.
6944 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6945 instead of ->is_relative_
6946 (Output_reloc::write): Likewise.
6947 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6948 (Output_reloc::write_rel): Simplify.
6949
6950 * sparc.cc (Target_sparc::Scan::local): Use
6951 ->add_symbolless_local_addend as needed.
6952 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6953 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6954 based upon relocation offset.
6955
e4782e83
DK
69562010-02-11 Doug Kwan <dougkwan@google.com>
6957
6958 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6959 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6960 beginning of function.
6961 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6962 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6963 parameter is_32bit in calls to should_apply_static_reloc.
6964 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6965 (check_DATA): Add arm_abs_global.stdout.
6966 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6967 arm_abs_global.stdout): New rules.
6968 (MOSTLLYCLEANFILES): Add arm_abs_global
6969 * Makefile.in: Regenerate.
6970 * testsuite/arm_abs_global.s: New file.
6971 * testsuite/arm_abs_global.sh: Ditto.
6972 * testsuite/arm_abs_lib.s: Ditto.
6973
93ceb764
ILT
69742010-02-11 Ian Lance Taylor <iant@google.com>
6975
6976 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6977 Read_relocs task.
6978 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6979 Allocate_commons_task first.
6980 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6981 task, rather than symtab_lock_.
6982 (Gc_process_relocs::~Gc_process_relocs): New function.
6983 (Gc_process_relocs::is_runnable): Check this_blocker_.
6984 (Gc_process_relocs::locks): Use next_blocker_ rather than
6985 blocker_.
6986 (Scan_relocs::~Scan_relocs): New function.
6987 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6988 symtab_lock_.
6989 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6990 next_blocker_.
6991 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6992 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6993 constructor accordingly.
6994 (class Gc_process_relocs): Likewise.
6995 (class Scan_relocs): Likewise.
6996 * common.h (class Allocate_commons_task): Remove symtab_lock_
6997 field, and corresponding constructor parameter.
6998 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6999 symtab_lock_.
7000 (Allocate_commons_task::locks): Likewise.
7001
114dfbe1
ILT
70022010-02-11 Ian Lance Taylor <iant@google.com>
7003
7004 * gold-threads.h (class Once): Define.
7005 (class Initialize_lock): Rewrite as child of Once.
7006 * gold-threads.cc (class Once_initialize): Define.
7007 (once_pointer_control): New static variable.
7008 (once_pointer, once_arg): New static variables.
7009 (c_run_once): New static function.
7010 (Once::Once, Once::run_once, Once::internal_run): New functions.
7011 (class Initialize_lock_once): Remove.
7012 (initialize_lock_control): Remove.
7013 (initialize_lock_pointer): Remove.
7014 (initialize_lock_once): Remove.
7015 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
7016 (Initialize_lock::initialize): Rewrite.
7017 (Initialize_lock::do_run_once): New function.
7018 * archive.cc (Archive::interpret_header): Only clear name if it is
7019 not already empty.
7020 * fileread.cc: Include "gold-threads.h"
7021 (file_counts_lock): New static variable.
7022 (file_counts_initialize_lock): Likewise.
7023 (File_read::release): Only increment counts when using --stats.
7024 Use a lock around the increment.
7025 * parameters.cc (class Set_parameters_target_once): Define.
7026 (set_parameters_target_once): New static variable.
7027 (Parameters::Parameters): Move here from parameters.h.
7028 (Parameters::set_target): Rewrite.
7029 (Parameters::set_target_once): New function.
7030 (Parameters::clear_target): Move here and rewrite.
7031 * parameters.h (class Parameters): Update declarations. Add
7032 set_parameters_target_once_ field.
7033 (Parameters::Parameters): Move to parameters.cc.
7034 (Parameters::clear_target): Likewise.
7035 * readsyms.cc (Read_symbols::do_group): Create a Start_group
7036 task.
7037 (Start_group::~Start_group): New function.
7038 (Start_group::is_runnable): New function.
7039 (Start_group::locks, Start_group::run): New functions.
7040 (Finish_group::run): Change saw_undefined to size_t.
7041 * readsyms.h (class Start_group): Define.
7042 (class Finish_group): Change saw_undefined_ field to size_t.
7043 (Finish_group::Finish_group): Remove saw_undefined and
7044 this_blocker parameters. Change all callers.
7045 (Finish_group::set_saw_undefined): New function.
7046 (Finish_group::set_blocker): New function.
7047 * symtab.h (class Symbol_table): Change saw_undefined to return
7048 size_t. Change saw_undefined_ field to size_t.
7049 * target-select.cc (Set_target_once::do_run_once): New function.
7050 (Target_selector::Target_selector): Initialize set_target_once_
7051 field. Don't initialize lock_ and initialize_lock_ fields.
7052 (Target_selector::instantiate_target): Rewrite.
7053 (Target_selector::set_target): New function.
7054 * target-select.h (class Set_target_once): Define.
7055 (class Target_selector): Update declarations. Make
7056 Set_target_once a friend. Remove lock_ and initialize_lock_
7057 fields. Add set_target_once_ field.
7058
fa17a3f4
ILT
70592010-02-10 Ian Lance Taylor <iant@google.com>
7060
7061 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
7062 queueing any tasks.
7063 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
7064 (queue_middle_tasks): Add all blockers before queueing any tasks.
7065 (queue_final_tasks): Likewise.
7066 * token.h (Task_token::add_blockers): New function.
7067 * object.h (Input_objects::number_of_relobjs): New function.
7068
c7177d31
ILT
70692010-02-10 Ian Lance Taylor <iant@google.com>
7070
5de0e392
ILT
7071 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
7072 shared, not if not position independent.
7073 * x86_64.cc (Relocate::relocate_tls): Likewise.
7074 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
7075 (tls_pie_pic_test): New target.
7076 * testsuite/Makefile.in: Rebuild.
7077
c7177d31
ILT
7078 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
7079 (tls_test_main_pie.o, tls_test_pie.o): New targets.
7080 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
7081 * testsuite/Makefile.in: Rebuild.
7082
684b268a
DM
70832010-02-09 David S. Miller <davem@davemloft.net>
7084
7085 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7086 R_SPARC_RELATIVE using ->add_local_relative().
7087 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7088
612a8d3d
DM
7089 * output.h (Output_data_dynamic::add_section_size): New method
7090 that takes two Output_data objects.
7091 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7092 entry param. Handle it in initializers.
7093 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7094 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7095 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7096 arg.
7097 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7098 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7099 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7100 for dynrel_includes_plt.
7101 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7102 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7103 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7104 before .rela.plt
7105 (Target_sparc::do_finalize_sections): Update to pass true for
7106 dynrel_includes_plt.
7107 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7108 output before .rela.plt
7109 (Target_powerpc::do_finalize_sections): Update to pass true for
7110 dynrel_includes_plt when 32-bit.
7111
cb1be87e
DK
71122010-02-08 Doug Kwan <dougkwan@google.com>
7113
7114 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7115 method.
7116 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7117 Arm_relobj::scan_section_for_cortex_a8_stubs,
7118 Arm_relobj::do_relocation_section): Instead of calling
7119 Output_section::output_address, use faster
7120 Arm_relobj::simple_input_section_output_address.
7121
705b5121
DM
71222010-02-08 David S. Miller <davem@davemloft.net>
7123
7124 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7125 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7126 relocation helper function.
7127
024c4466
DM
7128 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7129 just like R_SPARC_GOT{10,13,22}.
7130 (Target_sparc::Scan::local): Likewise.
7131 (Target_sparc::Relocate:relocate): Likewise.
7132
9109c078
ILT
71332010-02-06 Ian Lance Taylor <iant@google.com>
7134
7135 * configure.ac: Rewrite targetobjs duplicate removal code to use
7136 only shell constructs.
7137 * configure: Rebuild.
7138
cf846138
DK
71392010-02-05 Doug Kwan <dougkwan@google.com>
7140
7141 PR 11247
7142 * arm.cc (Arm_relobj::section_is_scannable): New method.
7143 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7144 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7145
6cfaf60b
DK
71462010-02-04 Doug Kwan <dougkwan@google.com>
7147
7148 PR 11247
7149 * arm-reloc-property.cc (cstdio): Include.
7150 * configure.ac (targetobjs): Remove duplicates.
7151 * configure: Regenerate.
7152 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7153 big and little endian version for a given address size.
7154
5c57f1be
DK
71552010-02-03 Doug Kwan <dougkwan@google.com>
7156
7157 * arm-reloc-property.cc
7158 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7159 definition.
7160 * arm-reloc-property.h
7161 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7162 New method definition.
7163 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7164 declaration.
7165 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7166 overflow to N.
7167 (GOT_PREL): Change implemented to Y.
7168 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7169 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7170 (Arm_relocate_functions::movw_abs_nc): Remove method.
7171 (Arm_relocate_functions::movt_abs): Ditto.
7172 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7173 (Arm_relocate_functions::thm_movt_abs): Ditto.
7174 (Arm_relocate_functions::movw_rel_nc): Ditto.
7175 (Arm_relocate_functions::movw_rel): Ditto.
7176 (Arm_relocate_functions::movt_rel): Ditto.
7177 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7178 (Arm_relocate_functions:thm_movw_rel): Ditto.
7179 (Arm_relocate_functions:thm_movt_rel): Ditto.
7180 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7181 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7182 New method definitions.
7183 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7184 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7185 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7186 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7187 (Target_arm::Relocate::relocate): Check for non-static or
7188 unimplemented relocation code and exit early. Change calls to
7189 Target_arm::reloc_uses_thumb_bit and
7190 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7191 instead. Refactor code to handle similar relocations to increase
7192 code sharing. Remove check for unsupported relocation code in switch
7193 statement.
7194 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7195 relocation property table to find out size. Change error message to
7196 print out the name of a relocation code instead of the numeric value.
7197 (Target_arm::scan_reloc_for_stub): Use relocation property table
7198 instead of calling Target_arm::reloc_uses_thumb_bit().
7199
218c5831
DK
72002010-02-02 Doug Kwan <dougkwan@google.com>
7201
7202 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7203 types of relaxed input section.
7204
0d31c79d
DK
72052010-02-02 Doug Kwan <dougkwan@google.com>
7206
7207 * Makefile.am (HFILES): Add arm-reloc-property.h.
7208 (DEFFILES): New.
2e702c99
RM
7209 (TARGETSOURCES): Add arm-reloc-property.cc
7210 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7211 (libgold_a_SOURCES): $(DEFFILES)
7212 * Makefile.in: Regenerate.
7213 * arm-reloc-property.cc: New file.
7214 * arm-reloc-property.h: New file.
7215 * arm-reloc.def: New file.
7216 * arm.cc: Update comments.
7217 (arm-reloc-property.h): New included header.
7218 (arm_reloc_property_table): New global variable.
7219 (Target_arm::do_select_as_default_target): New method definition.
7220 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7221 arm-reloc-property to targ_extra_obj.
7222 * parameters.cc (set_parameters_target): Call
7223 Target::select_as_default_target().
7224 * target.h (Target::select_as_default_target): New method definition.
7225 (Target::do_select_as_default_target): Same.
7226
546c7457
DK
72272010-02-01 Doug Kwan <dougkwan@google.com>
7228
7229 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7230 first_output_text_section_.
7231 (Arm_exidx_fixup::first_output_text_section): New method definition.
7232 (Arm_exidx_fixup::first_output_text_section_): New data member.
7233 (Arm_exidx_fixup::process_exidx_section): Record the first text
7234 output section seen.
7235 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7236 and entsize in output section header.
7237
11b861d5
DK
72382010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7239
7240 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7241 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7242 (Arm_relocate_functions::thm_alu11): New Method.
7243 (Arm_relocate_functions::thm_pc8): New Method.
7244 (Arm_relocate_functions::thm_pc12): New Method.
7245 (Target_arm::Scan::local): Handle the relocations.
7246 (Target_arm::Scan::global): Likewise.
7247 (Target_arm::Relocate::relocate): Likewise.
7248 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7249
c9a2c125
DK
72502010-01-29 Doug Kwan <dougkwan@google.com>
7251
7252 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7253 of relocation types as ld.
7254
1521477a
DK
72552010-01-29 Doug Kwan <dougkwan@google.com>
7256
7257 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7258 to public.
7259 (Arm_relocate_functions::thumb_branch_common): Ditto.
7260 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7261 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7262 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7263 Arm_relocate_functions::jump24): Remove.
7264 (Target_arm::Relocate::relocate): Adjust code to call
7265 Arm_relocation_functions::arm_branch_common and
7266 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7267 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7268
e7eca48c
DK
72692010-01-29 Doug Kwan <dougkwan@google.com>
7270
7271 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7272 output_local_symbol_count_needs_update_.
7273 (Arm_relobj::output_local_symbol_count_needs_update,
7274 Arm_relobj::set_output_local_symbol_count_needs_update,
7275 Arm_relobj::update_output_local_symbol_count): New methods.
7276 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7277 member.
7278 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7279 of pointed function as in a R_ARM_PREL31 relocation.
7280 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7281 for output local symbol count updating.
7282 (Target_arm::do_relax): Update output local symbol counts in objects
7283 if necessary.
7284 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7285
02961d7e
ILT
72862010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7287
7288 * arm.cc: Added support for the ARM relocations:
7289 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7290 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7291 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7292 movw_prel_nc).
7293 (Arm_relocate_functions::movw_rel): New method.
7294 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7295 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7296 thm_movw_prel_nc).
7297 (Arm_relocate_functions::thm_movw_rel): New method.
7298 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7299 thm_movt_prel).
7300 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7301 relocations.
7302 (Target_arm::Scan::global): Likewise.
7303 (Target_arm::Relocate::relocate): Likewise.
7304 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7305 Likewise.
7306
b10d2873
ILT
73072010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7308
7309 * arm.cc: Added support for ARM group relocations.
7310 (Target_arm::reloc_needs_sym_origin): New method.
7311 (Arm_relocate_functions::calc_grp_kn): New method.
7312 (Arm_relocate_functions::calc_grp_residual): New method.
7313 (Arm_relocate_functions::calc_grp_gn): New method.
7314 (Arm_relocate_functions::arm_grp_alu): New Method.
7315 (Arm_relocate_functions::arm_grp_ldr): New Method.
7316 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7317 (Arm_relocate_functions::arm_grp_ldc): New Method.
7318 (Target_arm::Scan::local): Handle the ARM group relocations.
7319 (Target_arm::Scan::global): Likewise.
7320 (Target_arm::Relocate::relocate): Likewise.
7321 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7322 Likewise.
7323
2b328d4e
DK
73242010-01-26 Doug Kwan <dougkwan@google.com>
7325
7326 * arm.cc (set): Include.
7327 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7328 pointer type.
2e702c99 7329 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7330 (Arm_output_section::append_text_sections_to_list): New method.
7331 (Arm_output_section::fix_exidx_coverage): Ditto.
7332 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7333 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7334 Relobj::set_section_offset() instead of
7335 Sized_relobj::invalidate_section_offset().
2e702c99 7336 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7337 parameter for section headers. Ignore relocation sections for
7338 unallocated sections and EXIDX sections.
7339 (Target_arm::fix_exidx_coverage): New method.
7340 (Target_arm::output_section_address_less_than): New type.
7341 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7342 linked text section instead of the EXIDX section.
7343 (Arm_output_section::create_stub_group): Add an assertion to check
7344 that this is not an EXIDX output section.
7345 (Arm_output_section::append_text_sections_to_list): New method.
7346 (Arm_output_section::fix_exidx_coverage): Ditto.
7347 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7348 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7349 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7350 first pass.
7351 (Target_arm::fix_exidx_coverage): New method.
7352 * object.h (Relobj::set_output_section): New method.
7353 (Sized_relobj::invalidate_section_offset): Remove method.
7354 (Sized_relobj::do_invalidate_section_offset): Remove method.
7355 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7356
c7f3c371
DK
73572010-01-25 Doug Kwan <dougkwan@google.com>
7358
7359 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7360 Fix warning due to signed and unsigned comparison on a 32-bit host.
7361
8923b24c
DK
73622010-01-22 Doug Kwan <dougkwan@google.com>
7363
7364 * arm.cc (Target_arm::do_relax): Record an output section for section
7365 offset adjustment it contains any stub table that has changed.
7366 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7367 offsets in an output section if necessary.
7368 * output.cc (Output_section::Output_section): Initialize
7369 section_offsets_need_adjustments_.
7370 (Output_section::add_input_section_for_script): Renamed to
7371 Output_section::add_simple_input_section.
7372 (Output_section::save_states): Add a comment.
7373 (Output_section::discard_states): New method defintion.
7374 (Output_section::adjust_section_offsets): Same.
7375 * output.h (Output_section::add_input_section_for_script): Renamed to
7376 Output_section::add_simple_input_section.
7377 (Output_section::discard_states): New method declaration.
7378 (Output_section::adjust_section_offsets): Same.
7379 (Output_section::section_offsets_need_adjustment,
7380 Output_section::set_section_offsets_need_adjustment): New method
7381 definitions.
7382 (Output_section::section_offsets_need_adjustment_): New data member.
7383 * script-sections.cc
7384 (Output_section_element_input::set_section_address): Adjust code for
7385 renaming of Output_section::add_input_section_for_script.
7386 (Orphan_output_section::set_section_address): Same.
7387
9b2fd367
DK
73882010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7389
7390 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7391 Fix_v4bx enum values .
7392 * gold/options.h (General_options): New option definitions.
7393 (General_options::fix_v4bx): New method.
7394 (General_options::Fix_v4bx): New enum.
7395 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7396 (General_options::parse_fix_v4bx_interworking): New method.
7397
80d0d023
DK
73982010-01-22 Doug Kwan <dougkwan@google.com>
7399
7400 * arm.cc (Arm_exidx_fixup): New class.
7401
af2cdeae
DK
74022010-01-21 Doug Kwan <dougkwan@google.com>
7403
7404 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7405 classes.
7406 (Arm_exidx_section_offset_map): New type.
7407
993d07c1
DK
74082010-01-21 Doug Kwan <dougkwan@google.com>
7409
7410 * arm.cc (Arm_exidx_input_section): New class.
7411 (Arm_relobj::exidx_input_section_by_link,
7412 Arm_relobj::exidx_input_section_by_shndx,
7413 Arm_relobj::make_exidx_input_section): New methods.
7414 (read_arm_attributes_section): Remove.
7415 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7416 information about them.
7417 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7418 to here.
7419
5ac169d4
DK
74202010-01-20 Doug Kwan <dougkwan@google.com>
7421
7422 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7423 Input_section_specifier to Section_id.
7424 (Target_arm::new_arm_input_section: Adjust code for change of key
7425 type.
7426 (Target_arm::find_arm_input_section): Ditto.
7427 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7428 (Section_id): Remove.
7429 (Garbage_collection::Section_id_hash): Remove.
7430 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7431 (Section_id): Remove.
7432 (Icf::Section_id_hash): Remove.
7433 * object.h (Section_id, Const_section_id, Section_id_hash,
7434 Const_section_id_hash): New type definitions.
7435 * output.cc (Output_section::add_relaxed_input_section): Change to
7436 use Const_section_id instead of Input_section_specifier as key type.
7437 (Output_section::add_merge_input_section): Ditto.
7438 (Output_section::build_relaxation_map): Change to use Section_id
7439 instead of Input_section_specifier as key type.
2e702c99 7440 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7441 Ditto.
7442 (Output_section::convert_input_sections_to_relaxed_sections): Change
7443 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7444 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7445 (Output_section::find_relaxed_input_section): Ditto.
7446 * output.h (Input_section_specifier): Remove class.
7447 (Output_section::Output_section_data_by_input_section_map): Change
7448 key type to Const_section_id.
7449 (Output_section::Output_relaxed_input_section_by_input_section_map):
7450 Ditto.
7451 (Output_section::Relaxation_map): Change key type to Section_id.
7452
a2162063
ILT
74532010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7454
7455 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7456 (class Arm_v4bx_stub): New class.
7457 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7458 (Stub_factory::make_arm_v4bx_stub): New method.
7459 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7460 (Stub_table::empty): Handle v4bx stubs.
7461 (Stub_table::add_arm_v4bx_stub): New method.
7462 (Stub_table::find_arm_v4bx_stub): New method.
7463 (Arm_relocate_functions::v4bx): New method.
7464 (Target_arm::fix_v4bx): New method.
7465 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7466 (Stub_table::relocate_stubs): Likewise.
7467 (Stub_table::do_write): Likewise.
7468 (Stub_table::update_data_size_and_addralign): Likewise.
7469 (Stub_table::finalize_stubs): Likewise.
7470 (Target_arm::Scan::local): Likewise.
7471 (Target_arm::Scan::global): Likewise.
7472 (Target_arm::do_finalize_sections): Likewise.
7473 (Target_arm::Relocate::relocate): Likewise.
7474 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7475 Likewise.
7476 (Target_arm::scan_reloc_for_stub): Likewise.
7477 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7478
5696ab0b
ILT
74792010-01-19 Ian Lance Taylor <iant@google.com>
7480
7481 * output.cc (Output_section_headers::do_sized_write): Write large
7482 segment count to sh_info field.
7483 (Output_file_header::do_sized_write): For large segment count,
7484 write PN_XNUM to e_phnum field.
7485
800d0f56
ILT
74862010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7487
7488 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7489 (Arm_relocate_functions::thm_jump8): New function.
7490 (Arm_relocate_functions::thm_jump11): New function.
7491 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7492 R_ARM_THM_JUMP11.
7493 (Target_arm::Scan::global): Likewise.
7494 (Target_arm::Relocate::relocate): Likewise.
7495 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7496 Likewise.
7497
41263c05
DK
74982010-01-14 Doug Kwan <dougkwan@google.com>
7499
7500 * arm.cc (map, utility): Include headers.
7501 (Target_arm::apply_cortex_a8_workaround): New method.
7502 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7503 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7504 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7505 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7506 the --[no-]fix-cortex-a8 command line options.
7507 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7508 (Target_arm::relocate_stub): Use addend in instruction template.
7509 * options.h (DEFINE_bool): Set the user-set flag.
7510 (General_options): Add --[no-]-fix-cortex options.
7511 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7512 : Update fast look-up map after conversion.
41263c05 7513
459e9b03
ST
75142010-01-14 Sriraman Tallam <tmsriram@google.com>
7515
7516 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7517 in the first pass of do_layout.
7518
b521dfe4
DK
75192010-01-13 Doug Kwan <dougkwan@google.com>
7520
7521 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7522 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7523 apparent compiler problem of not folding static constant integral
7524 data members of elfcpp::Elf_sizes<32>.
7525
44272192
DK
75262010-01-13 Doug Kwan <dougkwan@google.com>
7527
7528 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7529 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7530 Arm_relobj::scan_section_for_cortex_a8_erratum,
7531 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7532 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7533 sections to scan for relocation stubs into a new method
7534 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7535 relocation and Cortex-A8 stub scanning.
7536 (Target_arm::do_relax): Force stubs to be after stubbed sections
7537 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7538 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7539 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7540
44b71ece
ILT
75412010-01-12 Ian Lance Taylor <iant@google.com>
7542
7543 * target-reloc.h (visibility_error): New inline function.
7544 (relocate_section): Call visibility_error.
7545 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7546 (MOSTLYCLEANFILES): Likewise.
7547 (protected_4_pic.o, protected_3.err): New targets.
7548 * testsuite/protected_4.cc: New file.
7549
a120bc7f
DK
75502010-01-12 Doug Kwan <dougkwan@google.com>
7551
7552 * arm.cc (Cortex_a8_reloc): New class.
7553 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7554 and cortex_a8_relocs_info_.
7555 (Target_arm::fix_cortex_a8): New method definition.
7556 (Target_arm::Cortex_a8_relocs_info): New type.
7557 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7558 New data member declarations.
7559 (Target_arm::scan_reloc_for_stub): Record information about
7560 relocations for THUMB branches that might be exempted from the
7561 Cortex-A8 workaround.
7562 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7563 at the beginning of a relaxation pass.
7564
20138696
DK
75652010-01-12 Doug Kwan <dougkwan@google.com>
7566
7567 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7568 (Arm_relobj::Mapping_symbol_position,
7569 Arm_reloj::Mapping_symbol_position_less,
7570 Arm_relobj::Mapping_symbols_info): New types.
7571 (Target_arm::is_mapping_symbol_name): New method definition.
7572 (Arm_relobj::do_count_local_symbols): Save information about mapping
7573 symbols.
7574
089d69dc
DK
75752010-01-11 Doug Kwan <dougkwan@google.com>
7576
7577 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7578 Arm_relocate_functions::thumb32_branch_upper,
7579 Arm_relocate_functions::thumb32_branch_lower,
7580 Arm_relocate_functions::thumb32_cond_branch_offset,
7581 Arm_relocate_functions::thumb32_cond_branch_upper,
7582 Arm_relocate_functions::thumb32_cond_branch_lower,
7583 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7584 branch offset encoding.
7585 (Arm_relocate_functions::thumb_branch_common): Use new branch
7586 offset encoding methods to avoid code duplication.
7587 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7588 (Stub_addend_reader::operator()): Use new branch encoding method
7589 to avoid code duplication.
7590
99e5bff2
DK
75912010-01-11 Doug Kwan <dougkwan@google.com>
7592
7593 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7594 (Target_arm::do_finalize_sections): Define special EXIDX section
7595 symbols only if referenced.
7596 * gc.h (Garbage_collection::add_reference): New method.
7597 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7598 code duplication.
7599
98e090bd
ILT
76002010-01-11 Ian Lance Taylor <iant@google.com>
7601
d0a91bd8
ILT
7602 * script.cc (Version_script_info::build_expression_list_lookup):
7603 Change complaing about duplicate wildcard match from error to
7604 warning.
7605
98e090bd
ILT
7606 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7607 of 2009-12-30.
7608 (Version_script_info::Version_script_info): Initialize globs_,
7609 default_version_, default_is_global_, and exact_. Don't
7610 initialize globals_ or locals_.
7611 (Version_script_info::build_lookup_tables): Build local symbols
7612 first.
7613 (Version_script_info::unquote): New function.
7614 (Version_script_info::add_exact_match): New function.
7615 (Version_script_info::build_expression_list_lookup): Remove lookup
7616 parameter. Add is_global parameter. Change all callers. Handle
7617 wildcard pattern specially. Unquote pattern. Call
7618 add_exact_match.
7619 (Version_script_info::get_name_to_match): New function.
7620 (Version_script_info::get_symbol_version): New function.
7621 (Version_script_info::get_symbol_version_helper): Remove.
7622 (Version_script_info::check_unmatched_names): Call unquote.
7623 * script.h (class Version_script_info): Change get_symbol_version
7624 to be non-inline and add is_global parameter; change all callers.
7625 Rewrite symbol_is_local. Update declarations. Define struct
7626 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7627 Remove globals_ and locals_ members. Add exact_, globs_,
7628 default_version_, is_global_.
7629 (Version_script_info::Glob): Remove pattern, add expression and
7630 is_global. Update constructor. Change all callers.
7631 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7632 default version.
7633 (Versions::symbol_section_contents): If a symbol is undefined, or
7634 defined in a dynamic object, set the version index to
7635 VER_NDX_LOCAL.
7636 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7637 symbol_is_local.
7638 (Symbol_table::add_from_pluginobj): Likewise.
7639 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7640
d56962d3
DK
76412010-01-11 Doug Kwan <dougkwan@google.com>
7642
7643 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7644 (incremental_dump_LDADD): Add linking option for libintl.
7645 * Makefile.in: Regenerate.
7646
94e6ee91
L
76472010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7648
7649 PR gold/11144
7650 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7651 instead of -Ds.
7652 * testsuite/Makefile.in: Regenerated.
7653
e96c574b
DK
76542010-01-10 Doug Kwan <dougkwan@google.com>
7655
7656 * options.h (DEFINE_var): Use parentheses around argument varname__
7657 in macro body to avoid any unintended subsequent substitutions.
7658
7198066b
ILT
76592010-01-10 Ian Lance Taylor <iant@google.com>
7660
ba4d53bf
ILT
7661 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7662 candidates before doing symbol resolution.
7663
7198066b
ILT
7664 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7665 ODR candidates if only one is weak.
7666
a2beed37
ILT
76672010-01-08 Ian Lance Taylor <iant@google.com>
7668
7669 * script.cc (Version_script_info::build_expression_list_lookup):
7670 Don't warn about ambiguous version, just record the ambiguity.
7671 (Version_script_info::get_symbol_version_helper): Give error if
7672 version is ambiguous.
7673
2fb7225c
DK
76742010-01-08 Doug Kwan <dougkwan@google.com>
7675
7676 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7677 prev_data_size_ and prev_addralign_. Remove initializer for
7678 deleted data member has_been_changed_.
7679 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7680 to determine if the table is empty.
7681 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7682 Remove.
7683 (Stub_table::add_reloc_stub): Define method in class definition
7684 instead of just declaring it there.
7685 (Stub_table::add_cortex_a8_stub): New method definition.
7686 (Stub_table::update_data_size_and_addralign): Ditto.
7687 (Stub_table::finalize_stubs): Ditto.
7688 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7689 (Stub_table::do_addralign_): Return address alignment in the
7690 (Stub_table::do_reset_address_and_file_offset): Define method in
7691 class definition instead of declaring it there. Set current data
7692 size to be the data size of the previous pass.
7693 (Stub_table::set_final_data_size): Use current data size as the
7694 final data size.
7695 (Stub_table::relocate_stub): Change parameter type of stub from
7696 Reloc_stub pointer to Stub pointer.
7697 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7698 (Stub_table::Cortex_a8_stub_list): New typedef.
7699 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7700 Stub_table::prev_addralign_): New data member.
7701 (Arm_relobj::Arm_relobj): Initialize data member
7702 section_has_cortex_a8_workaround_.
7703 (Arm_relobj::section_has_cortex_a8_workaround,
7704 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7705 definitions.
7706 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7707 declarations.
7708 (Target_arm::relocate_stub): Change parameter type of stub from
7709 Reloc_stub pointer to Stub pointer.
7710 (Insn_template::size, Insn_template::alignment): Handle
7711 THUMB16_SPECIAL_TYPE.
7712 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7713 Stub_table::update_data_size_and_addralign,
7714 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7715 definitions.
7716 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7717 (Stub_table::do_write): Ditto.
7718 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7719
880cd20d
ILT
77202010-01-08 Ian Lance Taylor <iant@google.com>
7721
7722 PR 11108
7723 * symtab.h (class Symbol): Remove fields is_target_special_ and
7724 has_plt_offset_. Add field is_defined_in_discarded_section_.
7725 (Symbol::is_defined_in_discarded_section): New function.
7726 (Symbol::set_is_defined_in_discarded_section): New function.
7727 (Symbol::has_plt_offset): Rewrite.
7728 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7729 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7730 Don't initialize is_target_special_ or has_plt_offset_.
7731 Initialize is_defined_in_discarded_section_.
7732 (Symbol_table::add_from_relobj): If appropriate, set
7733 is_defined_in_discarded_section.
7734 * resolve.cc (Symbol::override_base_with_special): Don't test
7735 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7736 * target-reloc.h (relocate_section): Do special handling for
7737 symbols defined in discarded sections for global symbols as well
7738 as local symbols.
7739
2703e3eb
ILT
77402010-01-08 Ian Lance Taylor <iant@google.com>
7741
7742 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7743 the SHT_SYMTAB case.
7744
339d40a3
ILT
77452010-01-08 Ian Lance Taylor <iant@google.com>
7746
7747 * object.cc (Sized_relobj::do_layout): Don't get confused if
7748 layout_eh_frame returns NULL.
7749
abecea76
ILT
77502010-01-08 Ian Lance Taylor <iant@google.com>
7751
7752 PR 11084
7753 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7754 dynamic symbol table, use the normal symbol table.
7755 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7756 symbol table.
7757
6b7dd3f3
ILT
77582010-01-08 Ian Lance Taylor <iant@google.com>
7759
7760 PR 11072
7761 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7762 sections.
7763
36c50e63
L
77642010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7765
7766 * version.cc (print_version): Change to "Copyright 2010".
7767
e291e7b9
ILT
77682010-01-08 Ian Lance Taylor <iant@google.com>
7769
7770 PR 10287
7771 PR 11063
7772 * i386.cc (class Target_i386): Change return type of plt_section
7773 to be non-const.
7774 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7775 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7776 tls_desc_rel_ field.
7777 (Output_data_plt_i386::rel_tls_desc): New function.
7778 (Target_i386::rel_tls_desc_section): New function.
7779 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7780 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7781 R_386_TLS_DESC reloc in rel_tls_desc_section.
7782 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7783 Define struct Tlsdesc_info.
7784 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7785 (Target_x86_64::do_reloc_symbol_index): New function.
7786 (Target_x86_64::add_tlsdesc_info): New function.
7787 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7788 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7789 tlsdesc_rel_ field.
7790 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7791 all callers.
7792 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7793 (Target_x86_64::rela_tlsdesc_section): New function.
7794 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7795 handling.
7796 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7797 (Target_x86_64::do_reloc_addend): New function.
7798 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7799 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7800 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7801 (Output_reloc::type): New function.
7802 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7803 (Output_reloc::is_target_specific): New function.
7804 (Output_reloc::target_arg): New function.
7805 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7806 absolute relocs and target specific relocs.
7807 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7808 add_target_specific.
7809 (class Output_data_reloc) [SHT_RELA]: Likewise.
7810 * output.cc (Output_reloc::Output_reloc): Add four new versions
7811 for absolute relocs and target specific relocs.
7812 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7813 (Output_reloc::get_symbol_index): Likewise.
7814 (Output_reloc::local_section_offset): Check that local_sym_index_
7815 is not TARGET_CODE or 0.
7816 (Output_reloc::symbol_value): Likewise.
7817 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7818 reloc.
7819 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7820 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7821 functions.
7822 * layout.cc (add_target_dynamic_tags): Use output section for
7823 DT_PLTRELSZ and DT_JMPREL.
7824
3a44184e
ILT
78252010-01-07 Ian Lance Taylor <iant@google.com>
7826
7827 PR 11061
7828 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7829 function.
7830 (class Output_data_reloc_generic): Define.
7831 (class Output_data_reloc_base): Change base class to
7832 Output_data_reloc_generic. Change add() method to call
7833 bump_relative_reloc_count for a relative reloc. Remove
7834 sort_relocs_ field.
7835 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7836 to sort_relocs().
7837 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7838 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7839 appropriate.
7840 * layout.h (class Layout): Update declaration.
7841
ea715a34
ILT
78422010-01-07 Ian Lance Taylor <iant@google.com>
7843
7844 * output.h (class Output_data): Add const version of
7845 output_section and do_output_section.
7846 (class Output_section_data): Add const version of
7847 do_output_section.
7848 (class Output_section): Likewise.
7849 * layout.cc (Layout::add_target_dynamic_tags): New function.
7850 * layout.h (class Layout): Update declarations.
7851 * arm.cc (Target_arm::do_finalize_sections): Use
7852 add_target_dynamic_tags.
7853 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7854 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7855 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7856 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7857
659948a4
ILT
78582010-01-07 Ian Lance Taylor <iant@google.com>
7859
7860 PR 11042
7861 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7862 object as needed.
7863
9d3b86f6
ILT
78642010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7865 Ian Lance Taylor <iant@google.com>
7866
7867 PR 11019
7868 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7869 Xindex::read_symtab_xindex.
7870
bb0d3eb0
DK
78712010-01-07 Doug Kwan <dougkwan@google.com>
7872
7873 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7874 (Insn_template::thumb16_bcond_insn): New method declaration.
7875 (Insn_template): Fix spelling.
7876 (Stub::thumb16_special): New method declaration.
7877 (Stub::do_write): Define virtual method which was previously pure
7878 virtual.
7879 (Stub::do_thumb16_special): New method declaration.
7880 (Stub::do_fixed_endian_write): New template member.
7881 (Reloc_stub::do_write): Remove.
7882 (Reloc_stub::do_fixed_endian_write): Remove.
7883 (Cortex_a8_stub): New class definition.
7884 (Stub_factory::make_cortex_a8_stub): New method definition.
7885 (Stub_factory::Stub_factory): Add missing static storage class
7886 qualifier for elf32_arm_stub_a8_veneer_blx.
7887
ffeef7df
ILT
78882010-01-07 Ian Lance Taylor <iant@google.com>
7889
dc3f80fe
ILT
7890 PR 10980
7891 * options.h (class General_options): Add --warn-unresolved-symbols
7892 and --error-unresolved-symbols.
7893 * errors.cc (Errors::undefined_symbol): Implement
7894 --warn-unresolved-symbols.
7895
ffeef7df
ILT
7896 * options.h (class General_options): Add -z text and -z textoff.
7897 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7898
f1ec9ded
ST
78992010-01-06 Sriraman Tallam <tmsriram@google.com>
7900
7901 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7902 (Garbage_collection::cident_sections): New function.
7903 (Garbage_collection::add_cident_section): New function.
7904 (Garbage_collection::cident_sections_): New member.
7905 (gc_process_relocs): Add references to sections whose names are C
7906 identifiers.
7907 * gold.h (cident_section_start_prefix): New constant.
7908 (cident_section_stop_prefix): New constant.
7909 (is_cident): New function.
7910 * layout.cc (Layout::define_section_symbols): Replace string constants
7911 with the newly defined constants.
7912 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7913 C identifiers.
7914 * testsuite/Makefile.am: Add gc_orphan_section_test.
7915 * testsuite/Makefile.in: Regenerate.
7916 * testsuite/gc_orphan_section_test.cc: New file.
7917 * testsuite/gc_orphan_section_test.sh: New file.
7918
6eda8c29
ILT
79192010-01-06 Ian Lance Taylor <iant@google.com>
7920
b9674e17
ILT
7921 PR 10980
7922 * options.h (class General_options): Add --warn-shared-textrel.
7923 * layout.cc (Layout::finish_dynamic_section): Implement
7924 --warn-shared-textrel.
7925
6eda8c29
ILT
7926 PR 10980
7927 * options.h (class General_options): Add --warn-multiple-gp.
7928
32dcd44e
ILT
79292010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7930
7931 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7932 $(THREADSLIB) and $(LIBDL).
7933 * Makefile.in: Rebuild.
7934
a192ba05
ILT
79352010-01-06 Ian Lance Taylor <iant@google.com>
7936
7937 PR 10980
7938 * options.cc (General_options::parse_section_start): New function.
7939 (General_options::section_start): New function.
7940 (General_options::General_options): Initialize all members.
7941 * options.h: Include <map>
7942 (class General_options): Add --section-start. Add section_starts_
7943 member.
7944 * layout.cc (Layout::attach_allocated_section_to_segment): If
7945 --section-start was used, set the address of the segment. Remove
7946 local sort_sections.
7947 (Layout::relaxation_loop_body): If the address of the load segment
7948 has been set by --section-start, don't use it.
7949 * output.h (Output_segment::update_flags_for_output_section): New
7950 function.
7951 * output.cc (Output_segment::add_output_section): Call
7952 update_flags_for_output_section.
7953
dde3f402
ILT
79542010-01-05 Ian Lance Taylor <iant@google.com>
7955
62dfdd4d
ILT
7956 PR 10980
7957 * options.h (class General_options): Add --undefined-version.
7958 * script.cc (struct Version_expression): Add was_matched_by_symbol
7959 field.
7960 (Version_script_info::matched_symbol): New function.
7961 (Version_script_info::get_symbol_version_helper): Call
7962 matched_symbol.
7963 (Version_script_info::check_unmatched_names): New function.
7964 * script.h (class Version_script_info): Update declarations.
7965 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7966
9c4ae156
ILT
7967 * options.h (class General_options): Use DEFINE_bool_alias for
7968 allow_multiple_definition.
7969 * resolve.cc (Symbol_table::should_override): Don't test
7970 allow_multiple_definition.
7971
dde3f402
ILT
7972 PR 10980
7973 * options.h (class General_options): Add --cref.
7974 * main.cc (main): Print cref table if --cref. Don't close mapfile
7975 until after printing cref table.
7976 * cref.cc: Include "symtab.h".
7977 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7978 (Cref_table_compare::operator()): New function.
7979 (Cref_inputs::gather_cref): New function.
7980 (filecol): New static const.
7981 (Cref_inputs::print_cref): New function.
7982 (Cref::print_cref): New function.
7983 * cref.h: Include <cstdio>.
7984 (class Cref): Update declarations.
7985 * mapfile.h (Mapfile::file): New function.
7986 * object.h (class Object): Define Symbols. Declare virtual
7987 do_get_global_symbols.
7988 (Object::get_global_symbols): New function.
7989 * object.cc (Input_objects::add_object): Pass object to cref_ if
7990 --cref.
7991 (Input_objects::archive_start): Likewise.
7992 (Input_objects::archive_stop): Likewise.
7993 (Input_objects::print_cref): New function.
7994 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7995 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7996 --cref.
7997 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7998 function.
7999 * plugin.h (class Sized_pluginobj): Update declarations.
8000
8781f709
ILT
80012010-01-05 Ian Lance Taylor <iant@google.com>
8002
8003 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
8004 to is_default_version. Rename insdef to insdefault.
8005 (Symbol_table::add_from_relobj): Rename def to is_default_version
8006 and local to is_forced_local.
8007 (Symbol_table::add_from_pluginobj): Likewise.
8008 (Symbol_table::add_from_dynobj): Likewise.
8009 (Symbol_table::define_special_symbol): Rename insdef to
8010 insdefault.
8011
fe35d28d
ILT
80122010-01-04 Ian Lance Taylor <iant@google.com>
8013
30bc8c46
ILT
8014 PR 10980
8015 * options.h (class General_options): Add
8016 --allow-multiple-definition and -z muldefs.
8017 * resolve.cc (Symbol_table::should_override): Don't warn about a
8018 multiple symbol definition if --allow-multiple-definition or -z
8019 muldefs.
8020
7eaea549
ILT
8021 PR 10980
8022 * options.h (class General_options): Add --add-needed and
8023 --copy-dt-needed-entries. Tweak --as-needed help entry.
8024 * object.cc (Input_objects::check_dynamic_dependencies): Give an
8025 error if --copy-dt-needed-entries aka --add-needed is used and
8026 would cause a change in behaviour.
8027
fe35d28d
ILT
8028 PR 10980
8029 * options.h (class General_options): Add -G as a short version of
8030 --shared. Add no-op options -assert, -g, and -i.
8031
55a2bb35
ST
80322010-01-04 Sriraman Tallam <tmsriram@google.com>
8033
8034 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
8035 check for .text or .gnu.linkonce.t sections.
8036 * icf.cc (Icf::find_identical_sections): Ditto.
8037 Change the detection for mangled function name within the section
8038 name.
8039 * icf.h (is_section_foldable_candidate): New function.
8040
719328e1
ILT
80412009-12-30 Ian Lance Taylor <iant@google.com>
8042
8043 PR 10980
8044 * options.h (class General_options): Permit two dashes with
8045 --retain-symbols-file.
8046
d7bb5745
ILT
80472009-12-30 Ian Lance Taylor <iant@google.com>
8048
403a15dd
ILT
8049 PR 10979
8050 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
8051 don't put the file header and segment headers in the text
8052 segment.
8053
eda294df
ILT
8054 PR 10979
8055 * common.cc (Sort_commons::operator()): Stabilize sort when both
8056 entries are NULL.
8057 (Symbol_table::do_allocate_commons_list): When allocating common
8058 symbols, skip a symbol which is no longer common.
8059 * symtab.h (Symbol::is_common): Test whether the symbol comes from
8060 an object before checking its type.
8061 * testsuite/common_test_2.c: New file.
8062 * testsuite/common_test_3.c: New file.
8063 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
8064 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
8065 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
8066 (common_test_2_pic.o, common_test_2.so): New targets.
8067 (common_test_3_pic.o, common_test_3.so): New targets.
8068 * testsuite/Makefile.in: Rebuild.
8069
d7bb5745
ILT
8070 PR 10979
8071 * script.cc (read_input_script): If we see a new SECTIONS clause,
8072 and we have added an input section, give an error.
8073 * layout.h (class Layout): Add have_added_input_section function.
8074 Add have_added_input_section_ field.
8075 * layout.cc (Layout::Layout): Initialize
8076 have_added_input_section_.
8077 (Layout::layout): Set have_added_input_section_.
8078 (Layout::layout_eh_frame): Likewise.
8079
fc59c572
ILT
80802009-12-30 Ian Lance Taylor <iant@google.com>
8081
8082 PR 10931
8083 * options.h (class General_options): Add --sort-common option.
8084 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8085 * common.cc (Sort_common): Add sort_order parameter to
8086 constructor. Add sort_order_ field.
8087 (Sort_commons::operator): Check sort_order_.
8088 (Symbol_table::allocate_commons): Determine the sort order.
8089 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8090 Change all callers.
8091 (Symbol_table::do_allocate_commons_list): Likewise.
8092
1c74fab0
ILT
80932009-12-30 Ian Lance Taylor <iant@google.com>
8094
8095 PR 10916
8096 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8097 symbols from this object, don't change the visibility of an
8098 undefined symbol.
8099 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8100
6affe781
ILT
81012009-12-30 Ian Lance Taylor <iant@google.com>
8102
8103 PR 10861
8104 * script.h (class Version_script_info): Define Language enum.
8105 Update declarations. Define Glob, Exact, and Lookup types. Add
8106 new fields globals_, locals_, and is_finalized_.
8107 * script.cc: Various formatting fixes.
8108 (class Parser_closure): Change language_stack_ from a vector of
8109 std::string to one of Version_script_info::Language. Adjust all
8110 uses accordingly.
8111 (class Lazy_demangler): Remove.
8112 (struct Version_expression): Change language from std::string to
8113 Version_script_info::Language.
8114 (Version_script_info::Version_script_info): New function.
8115 (Version_script_info::~Version_script_info): Don't call clear.
8116 (Version_script_info::finalize): New function.
8117 (Version_script_info::build_lookup_tables): New function.
8118 (Version_script_info::build_expression_list_lookup): New
8119 function.
8120 (Version_script_info::get_symbol_version_helper): Rewrite to use
8121 lookup tables.
8122 (Version_script_info::print_expression_list): Adjust to use
8123 Version_script_info::Language.
8124 (script_push_lex_into_version_mode): Check that the version script
8125 has not been finalized.
8126 (version_script_push_lang): Change language string to
8127 Version_script_info::Language.
8128 * options.cc (Command_line::version_script): New function.
8129 * options.h (class General_options): Add finalize_dynamic_list
8130 function. Change version_script from declaration to definition.
8131 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8132 * testsuite/version_script.map: Remove duplicate def of foo.
8133 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8134 version_script.map.
8135 * testsuite/Makefile.in: Rebuild.
8136
818bf354
ILT
81372009-12-30 Ian Lance Taylor <iant@google.com>
8138
8139 PR 10843
8140 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8141 if the input symbol index is 0, make the output symbol index 0.
8142
ebcc8304
ILT
81432009-12-30 Ian Lance Taylor <iant@google.com>
8144
8145 PR 10670
8146 * options.h (class General_options): Add -x/--discard-all.
8147 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8148 --discard-all. If the local symbol needs a dynamic entry, check
8149 that before handling --discard-locals.
8150
176fe33f
ILT
81512009-12-30 Ian Lance Taylor <iant@google.com>
8152
bb321bb1
ILT
8153 PR 10450
8154 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8155 flags to PF_R.
8156 (Output_segment::add_output_section): Don't change the flags if
8157 the type is PT_TLS.
8158
176fe33f
ILT
8159 PR 10450
8160 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8161 GNU hash table if they need a dynamic value. Otherwise, don't add
8162 them if they are defined in a dynamic object or are forced local.
8163
e8cd95c7
ILT
81642009-12-29 Ian Lance Taylor <iant@google.com>
8165
1b81fb71
ILT
8166 PR 10450
8167 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8168 .gnu.hash table for a 32-bit target.
8169
8d6d383d
ILT
8170 PR 10450
8171 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8172 regular and a dynamic object only needs a dynamic symbol table
8173 entry if it is externally visible.
8174
e785ec03
ILT
8175 PR 10450
8176 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8177 constructor. Add global_offset_table_ field.
8178 (Target_i386::got_section): Set global_offset_table_.
8179 (Target_i386::do_finalize_sections): Set global_offset_table_
8180 size.
8181 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8182 in constructor. Add global_offset_table_ field.
8183 (Target_x86_64::got_section): Set global_offset_table_.
8184 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8185 size.
8186
1a2dff53
ILT
8187 * layout.cc (Layout::Layout): Initialize increase_relro_.
8188 (Layout::get_output_section): Add is_relro, is_last_relro, and
8189 is_first_non_relro parameters. Change all callers.
8190 (Layout::choose_output_section): Likewise.
8191 (Layout::add_output_section_data): Likewise.
8192 (Layout::make_output_section): Likewise.
8193 (Layout::set_segment_offsets): Clear increase_relro when using a
8194 linker script.
8195 * layout.h (class Layout): Add increase_relro method. Add
8196 increase_relro_ field. Update declarations.
8197 * output.cc (Output_section::Output_section): Initialize
8198 is_last_relro_ and is_first_non_relro_.
8199 (Output_segment::add_output_section): Group relro sections is
8200 do_sort is true. Handle is_last_relro and is_first_non_relro.
8201 (Output_segment::maximum_alignment): Remove relro handling.
8202 (Output_segment::set_section_addresses): Add increase_relro
8203 parameter. Change all callers. Add initial alignment to align
8204 relro sections on separate page. Remove old relro handling.
8205 (Output_segment::set_section_list_addresses): Remove in_relro
8206 parameter. Change all callers.
8207 (Output_segment::set_offset): Add increase parameter. Change all
8208 callers. Remove old relro handling.
8209 * output.h (class Output_section): Add new methods: is_last_relro,
8210 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8211 Add is_last_relro_ and is_first_non_relro_ fields.
8212 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8213 Create separate .got.plt section. Call increase_relro.
8214 * x86_64.cc (Target_x86_64::got_section): Likewise.
8215 * testsuite/relro_script_test.t: Add .got.plt.
8216
f0ba79e2
ILT
8217 PR 10450
8218 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8219 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8220 (Layout::finalize): Call set_dynamic_symbol_size.
8221 (Layout::set_dynamic_symbol_size): New function.
8222 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8223 set_dynamic_symbol_size.
8224
e8cd95c7
ILT
8225 PR 10450
8226 * output.h (class Output_section): Add is_entsize_zero_ field.
8227 * output.cc (Output_section::Output_section): Initialize
8228 is_entsize_zero_.
8229 (Output_section::set_entsize): If two different entsizes are
8230 requested, force it to zero.
8231 (Output_section::add_input_section): Set flags for .debug_str
8232 before updating section flags. Set entsize.
8233 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8234 and SHF_STRING if all input sections have those flags.
8235
3e1b9a8a
RÁE
82362009-12-29 Rafael Espindola <espindola@google.com>
8237
8238 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8239 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8240 reporting.
3e1b9a8a 8241
3dcad376
ST
82422009-12-29 Sriraman Tallam <tmsriram@google.com>
8243
8244 * options.cc (General_options::parse_version): Allow -v to exit
8245 without an error if there is nothing to link.
8246
084e2665
ILT
82472009-12-29 Ian Lance Taylor <iant@google.com>
8248
8249 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8250 using a version of gcc before 4.1.
8251 * configure: Rebuild.
8252
250acde3
CD
82532009-12-28 Chris Demetriou <cgd@google.com>
8254
8255 * attributes.cc (Output_attributes_section_data::do_write): Use
8256 std::vector::front rather than std::vector::data.
8257
99fff23b
ILT
82582009-12-28 Ian Lance Taylor <iant@google.com>
8259
8260 * symtab.h (class Symbol_table): Add enum Defined.
8261 * resolve.cc (Symbol_table::should_override): Add defined
8262 parameter. Change all callers. Test whether object is NULL
8263 before calling a method on it.
8264 (Symbol_table::report_resolve_problem): Add defined parameter.
8265 Change all callers.
8266 (Symbol_table::should_override_with_special): Likewise.
8267 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8268 parameter. Change all callers.
8269 (Symbol_table::do_define_in_output_data): Likewise.
8270 (Symbol_table::define_in_output_segment): Likewise.
8271 (Symbol_table::do_define_in_output_segment): Likewise.
8272 (Symbol_table::define_as_constant): Likewise.
8273 (Symbol_table::do_define_as_constant): Likewise.
8274 * script.h (class Symbol_assignment): Add is_defsym parameter to
8275 constructor; change all callers.
8276 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8277 parameter. Change all callers. Add is_defsym_ field.
8278 (class Parser_closure): Add parsing_defsym parameter to
8279 constructor; change all callers. Add parsing_defsym accessor
8280 function. Add parsing_defsym_ field.
8281
556bd683
ILT
82822009-12-28 Ian Lance Taylor <iant@google.com>
8283
8284 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8285 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8286
1782c879
ILT
82872009-12-23 Ian Lance Taylor <iant@google.com>
8288
8289 * i386.cc (Target_i386::do_calls_non_split): Recognize
8290 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8291 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8292 -fsplit-stack prologue when using %r11.
1782c879 8293
329ca2b1
ST
82942009-12-21 Sriraman Tallam <tmsriram@google.com>
8295
8296 * options.cc (General_options::parse_version): Make -v continue and do
8297 the link like GNU ld does.
8298
d675ff46
RÁE
82992009-12-17 Rafael Avila de Espindola <espindola@google.com>
8300
8301 * Makefile.am (CCFILES): Add timer.cc.
8302 (HFILES): Add timer.h.
8303 * configure.ac: Check for sysconf and times.
8304 * main.cc: include timer.h.
8305 (main): Use Timer instead of get_run_time.
8306 * timer.cc: New.
8307 * timer.h: New.
8308 * workqueue.cc: include timer.h.
8309 (Workqueue::find_and_run_task):
8310 Report user, sys and wall time.
8311 * Makefile.in: Regenerate.
8312 * config.in: Regenerate.
8313 * configure: Regenerate.
8314
d6344fb5
DK
83152009-12-16 Doug Kwan <dougkwan@google.com>
8316
8317 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8318 sections.
8319 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8320 relaxed input sections.
8321 * output.cc (Output_section::find_relaxed_input_section): Change
8322 return type to Output_relaxed_input_section pointer. Adjust code
8323 for new type of relaxed_input_section_map_.
8324 * output.h (Output_section::find_relaxed_input_section): Change
8325 return type to Output_relaxed_input_section pointer.
8326 (Output_section::Output_relaxed_input_section_by_input_section_map):
8327 New type.
8328 (Output_section::relaxed_input_section_map_): Change type to
8329 Output_section::Output_relaxed_input_section_by_input_section_map.
8330 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8331 input section.
8332
0e0d5469
ILT
83332009-12-15 Ian Lance Taylor <iant@google.com>
8334
8335 * layout.cc (Layout::create_shstrtab): Only write out after input
8336 sections if we are compressing debug sections.
8337
0649a889
ILT
83382009-12-15 Ian Lance Taylor <iant@google.com>
8339
8340 * archive.cc (Archive::add_symbols): Only look up a symbol without
8341 a version if there is, in fact, a version.
8342
2ea97941
ILT
83432009-12-14 Ian Lance Taylor <iant@google.com>
8344
8345 Revert -Wshadow changes, all changes from:
8346 2009-12-11 Doug Kwan <dougkwan@google.com>
8347 2009-12-11 Nick Clifton <nickc@redhat.com>
8348 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8349
b0eec2cc
DK
83502009-12-11 Doug Kwan <dougkwan@google.com>
8351
8352 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8353 due to -Wshadow.
8354 * attributes.cc (Object_attribute::size): Ditto.
8355 (Attributes_section_data::size): Ditto.
8356 (Attributes_section_data::Attributes_section_data): Ditto.
8357 (Output_attributes_section_data::do_write): Ditto.
8358 * attributes.h (Object_attribute::set_type): Ditto.
8359 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8360
91d6fa6a
NC
83612009-12-11 Nick Clifton <nickc@redhat.com>
8362
8363 * archive.cc: Fix shadowed variable warnings.
8364 * arm.cc: Likewise.
8365 * compressed_output.cc: Likewise.
8366 * compressed_output.h: Likewise.
8367 * configure: Likewise.
8368 * dwarf_reader.cc: Likewise.
8369 * dynobj.cc: Likewise.
8370 * dynobj.h: Likewise.
8371 * ehframe.cc: Likewise.
8372 * ehframe.h: Likewise.
8373 * errors.cc: Likewise.
8374 * expression.cc: Likewise.
8375 * fileread.cc: Likewise.
8376 * fileread.h: Likewise.
8377 * freebsd.h: Likewise.
8378 * i386.cc: Likewise.
8379 * icf.cc: Likewise.
8380 * incremental.h: Likewise.
8381 * layout.cc: Likewise.
8382 * layout.h: Likewise.
8383 * mapfile.cc: Likewise.
8384 * merge.cc: Likewise.
8385 * merge.h: Likewise.
8386 * object.cc: Likewise.
8387 * object.h: Likewise.
8388 * options.h: Likewise.
8389 * output.cc: Likewise.
8390 * output.h: Likewise.
8391 * parameters.cc: Likewise.
8392 * plugin.cc: Likewise.
8393 * powerpc.cc: Likewise.
8394 * reduced_debug_output.cc: Likewise.
8395 * reduced_debug_output.h: Likewise.
8396 * reloc.cc: Likewise.
8397 * reloc.h: Likewise.
8398 * resolve.cc: Likewise.
8399 * script-sections.cc: Likewise.
8400 * script.cc: Likewise.
8401 * script.h: Likewise.
8402 * sparc.cc: Likewise.
8403 * symtab.cc: Likewise.
8404 * symtab.h: Likewise.
8405 * target-select.cc: Likewise.
8406 * target-select.h: Likewise.
8407 * token.h: Likewise.
8408 * workqueue.cc: Likewise.
8409 * workqueue.h: Likewise.
8410 * x86_64.cc: Likewise.
8411
a0351a69
DK
84122009-12-10 Doug Kwan <dougkwan@google.com>
8413
8414 * arm.cc (attributes.h): New include.
8415 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8416 (Arm_relobj::~Arm_relobj): Delete object pointed by
8417 attributes_section_data_.
8418 (Arm_relobj::attributes_section_data): New method definition.
8419 (Arm_relobj::attributes_section_data_): New data member declaration.
8420 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8421 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8422 attributes_section_data_.
8423 (Arm_dynobj::attributes_section_data): New method definition.
8424 (Arm_dynobj::attributes_section_data_): New data member declaration.
8425 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8426 initialization value of may_use_blx_ to false.
2e702c99 8427 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8428 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8429 object attributes to compute results instead of hard-coding.
8430 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8431 Target_arm::get_secondary_compatible_arch,
8432 Target_arm::set_secondary_compatible_arch
8433 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8434 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8435 New method declarations.
8436 (Target_arm::get_aeabi_object_attribute): New method definition.
8437 (Target_arm::attributes_section_data_): New data member declaration.
8438 (read_arm_attributes_section): New template definition.
8439 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8440 (Arm_dynobj::do_read_symbols): Ditto.
8441 (Target_arm::do_finalize_sections): Merge attributes sections from
8442 input. Check for BLX use after attributes section merging.
8443 Fix __exidx_start and __exidx_end visibility. Create an
8444 .ARM.attributes section if necessary.
8445 (Target_arm::get_secondary_compatible_arch,
8446 Target_arm::set_secondary_compatible_arch,
8447 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8448 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8449 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8450 New method definitions.
8451
b59befec
ILT
84522009-12-09 Ian Lance Taylor <iant@google.com>
8453
8454 * plugin.cc (Plugin::load): Don't cast from void* to a function
8455 pointer.
8456
1276bc89
ILT
84572009-12-09 Ian Lance Taylor <iant@google.com>
8458
8459 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8460 information fields.
8461
2f2de248
L
84622009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8463
8464 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8465 Replace two_file_shared_1.so with two_file_shared_2.so.
8466 * testsuite/Makefile.in: Regenerated.
8467
4f787271
DK
84682009-12-08 Doug Kwan <dougkwan@google.com>
8469
8470 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8471 (HFILES): Add attributes.h and int_encoding.h.
8472 * Makefile.in: Regenerate.
8473 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8474 function definitions to int_encoding.cc
8475 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8476 prototypes to int_encoding.h
8477 * reduced_debug_output.cc (int_encoding.h): New include.
8478 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8479 function definitions to int_encoding.cc
8480 (insert_into_vector, read_from_pointer): Move template definitions to
8481 int_encoding.h
8482 * attributes.cc: New file.
8483 * attributes.h: New file.
8484 * int_encoding.cc: New file.
8485 * int_encoding.h: New file.
8486
20b52f1a
RÁE
84872009-12-07 Rafael Avila de Espindola <espindola@google.com>
8488
8489 PR gold/11055
8490 * incremental-dump.cc (dump_incremental_inputs): New.
8491 (main): Use dump_incremental_inputs.
8492
53d7974c
L
84932009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8494
8495 PR gold/10893
8496 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8497 checking elfcpp::STT_FUNC.
8498 (Target_i386::Relocate::relocate): Likewise.
8499 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8500
8501 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8502 symbols from shared libraries into normal FUNC symbols.
8503
8504 * symtab.h (Symbol): Add is_func and use it.
8505
05a352e6
DK
85062009-12-05 Doug Kwan <dougkwan@google.com>
8507
8508 * arm.cc (Target_arm::arm_info): Initialize new fields
8509 attributes_section and attributes_vendor.
8510 * i386.cc (Target_i386::i386_info): Same.
8511 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8512 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8513 fields attributes_section and attributes_vendor.
53d7974c 8514 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8515 * target.h (Target::attributes_section, Target::attributes_vendor,
8516 Target::is_attributes_section, Target::attribute_arg_type,
8517 Target::attributes_order): New method definitions.
8518 (Target::Target_info::attributes_section,
8519 Target::Target_info::attributes_vendor): New fields.
8520 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8521 virtual method definitions.
8522 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8523 attributes_section and attributes_vendor.
8524 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8525
f4e5969c
DK
85262009-12-05 Doug Kwan <dougkwan@google.com>
8527
8528 * arm.cc: Update comments about interworking and stub generation.
8529 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8530 considered as non-PIC.
8531 (Arm_relocate_functions::base_abs): Fix formatting.
8532 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8533 of function to use GOT entry address instead of offset.
8534 (Target_arm::Scan::global): Issue an error if a symbol would need a
8535 PLT does not get one because it is untyped. Remove code to create
8536 dynamic symbols for relative branches.
8537 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8538 takes unsigned integer instead of boolean.
8539
1abce4a6
L
85402009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8541
8542 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8543 (two_file_test_LDADD): Likewise.
8544 (common_test_1_LDADD): Likewise.
8545 (exception_test_LDADD) Likewise.
8546 (weak_test_LDADD): Likewise.
8547 (many_sections_test_LDADD): Likewise.
8548 (initpri1_LDADD): Likewise.
8549 (script_test_1_LDADD): Likewise.
8550 (script_test_2_LDADD): Likewise.
8551 (justsyms_LDADD): Likewise.
8552 (binary_test_LDADD): Likewise.
8553 (large_LDADD): Likewise.
8554 * testsuite/Makefile.in: Regenerated.
8555
adcf2816 85562009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8557
adcf2816
L
8558 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8559 (Symbol_table::override_with_special): Likewise.
8560 (Symbol_table::add_from_object): Likewise.
8561
28e67f5d
RÁE
85622009-12-04 Rafael Avila de Espindola <espindola@google.com>
8563
8564 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8565 Don't set the data_offset twice.
8566
ae10a101
RÁE
85672009-12-04 Rafael Avila de Espindola <espindola@google.com>
8568
8569 * testsuite/Makefile.in: Regenerate.
8570
f59f41f3
DK
85712009-12-03 Doug Kwan <dougkwan@google.com>
8572
8573 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8574 (Target_arm::do_finalize_sections): Add parameter for symbol table
8575 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8576 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8577 parameter for symbol table pointer.
8578 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8579 an additional parameter for a pointer to symbol table.
8580 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8581 parameter for a symbol table pointer.
8582 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8583 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8584 Ditto.
8585 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8586 parameter for a symbol table pointer.
8587
ca55d848
RÁE
85882009-12-03 Rafael Avila de Espindola <espindola@google.com>
8589
8590 * incremental.cc (Incremental_inputs_header)
8591 (Incremental_inputs_header_write, Incremental_inputs_entry)
8592 (Incremental_inputs_entry_write): Move ...
8593 * incremental.h (Incremental_inputs_header)
8594 (Incremental_inputs_header_write, Incremental_inputs_entry)
8595 (Incremental_inputs_entry_write): here.
8596
3aec4f9c
RÁE
85972009-12-02 Rafael Avila de Espindola <espindola@google.com>
8598
8599 * incremental.cc (make_sized_incremental_binary): Set the target.
8600 Error if it is incompatible.
8601 * output.h (Output_file): Add filename method.
8602
9c0ae74d
RÁE
86032009-12-02 Rafael Avila de Espindola <espindola@google.com>
8604
8605 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8606 from the get_* methods.
8607
a45500ae
RÁE
86082009-12-02 Rafael Avila de Espindola <espindola@google.com>
8609
8610 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8611 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8612 Write 0 for the data_offset of scripts.
8613
325e6408
RÁE
86142009-12-02 Rafael Avila de Espindola <espindola@google.com>
8615
8616 * testsuite/Makefile.am: Add the incremental_test.sh test.
8617 * testsuite/incremental_test.sh: New.
8618 * testsuite/incremental_test_1.c: New.
8619 * testsuite/incremental_test_2.c: New.
8620
954c3e2e
RÁE
86212009-12-01 Rafael Avila de Espindola <espindola@google.com>
8622
703d02da 8623 * incremental-dump.cc (main): Fix typos.
954c3e2e 8624
f8086623
RÁE
86252009-11-27 Rafael Avila de Espindola <espindola@google.com>
8626
8627 PR gold/11025
8628 * incremental-dump.cc (main): Use llu to print 64 bit values.
8629
3b0dd6ac
L
86302009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8631 H.J. Lu <hongjiu.lu@intel.com>
8632
8633 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8634 $(LIBDL).
8635 (incremental_dump_LDADD): Likewise.
8636 * Makefile.in: Regenerated.
8637
a6d1ef57 86382009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8639
a6d1ef57
DK
8640 Revert:
8641
8642 2009-11-25 Doug Kwan <dougkwan@google.com>
8643
8644 * arm.cc (Target_arm::Target_arm): Move method definition
8645 outside of class definition. Add code to handle
8646 --target1-rel, --target1-abs and --target2= options.
8647 (Target_arm::get_reloc_reloc_type): Change method to be
8648 non-static and const.
8649 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8650 New data member declaration.
8651 (Target_arm::Scan::local, Target_arm::Scan::global,
8652 Target_arm::Relocate::relocate,
8653 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8654 Adjust call to Target_arm::get_real_reloc_type.
8655 (Target_arm::get_real_reloc_type): Use command line options
8656 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8657 * options.h (--target1-rel, --target1-abs, --target2): New
8658 ARM-only options.
8659
50aeb7d4
DK
86602009-11-25 Doug Kwan <dougkwan@google.com>
8661
8662 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8663 class definition. Add code to handle --target1-rel, --target1-abs
8664 and --target2= options.
8665 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8666 and const.
8667 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8668 member declaration.
8669 (Target_arm::Scan::local, Target_arm::Scan::global,
8670 Target_arm::Relocate::relocate,
8671 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8672 call to Target_arm::get_real_reloc_type.
8673 (Target_arm::get_real_reloc_type): Use command line options to
8674 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8675 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8676 options.
8677
51938283
DK
86782009-11-25 Doug Kwan <dougkwan@google.com>
8679
8680 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8681 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8682 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8683 formatting.
8684 (Arm_relocate_functions::thm_call): Replace body with a call to
8685 Arm_relocate_functions::thumb_branch_common.
8686 (Arm_relocate_functions::thm_jump24,
8687 Arm_relocate_functions::thm_xpc22): New method definitions.
8688 (Arm_relocate_functions::thumb_branch_common): New method definition.
8689 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8690 operator.
8691 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8692 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8693
e2b8f3c4
RÁE
86942009-11-24 Rafael Avila de Espindola <espindola@google.com>
8695
8696 * Makefile.am: Build incremental-dump
8697 * Makefile.in: Regenerate.
8698 * incremental-dump.cc: New.
8699 * incremental.cc (Incremental_inputs_header_data,
8700 Incremental_inputs_entry_data): Move to incremental.h
8701 * incremental.h: (Incremental_inputs_header_data,
8702 Incremental_inputs_entry_data): Move from incremental.cc
8703
bcba9aec
RÁE
87042009-11-24 Rafael Avila de Espindola <espindola@google.com>
8705
8706 * incremental.cc (Incremental_inputs_header,
8707 Incremental_inputs_header_write, Incremental_inputs_entry,
8708 Incremental_inputs_entry_write): Add a typedef with the data type.
8709
7c3afe08
RÁE
87102009-11-24 Rafael Avila de Espindola <espindola@google.com>
8711
8712 * incremental.cc (Incremental_inputs_header,
8713 Incremental_inputs_header_write, Incremental_inputs_entry,
8714 Incremental_inputs_entry_write): Update comment about which
8715 type has the filed descriptions.
8716
d204b6e9
DK
87172009-11-15 Doug Kwan <dougkwan@google.com>
8718
8719 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8720 (Arm_relocate_functions::arm_branch_common): Change method defintion
8721 in class definition to a method declaration and update list of formal
8722 parameters.
8723 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8724 Arm_relocation_functions::jump24): Adjust call to
8725 Arm_relocate_functions::arm_branch_common. Update list of formal
8726 parameters.
8727 (Arm_relocate_functions::xpc25): New method definition.
8728 (Arm_relocate_functions::arm_branch_common): Move method defintion
8729 out from class definition. Use stubs for mode-switching and extending
8730 branch ranges.
8731 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8732 specially. Change code to enable use of stubs in ARM branches.
8733
43d12afe
DK
87342009-11-10 Doug Kwan <dougkwan@google.com>
8735
8736 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8737 in method declaration.
8738 (Target_arm::relocate_stub): New method declaration.
8739 (Target_arm::default_target): Change to return a pointer instead of
8740 a const reference.
8741 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8742 Target_arm::default_target.
8743 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8744 method definition.
8745 (Target_arm::relocate_section): Adjust view.
8746 (Target_arm::relocate_stub): New method definition.
8747
ac33a407
DK
87482009-11-10 Doug Kwan <dougkwan@google.com>
8749
8750 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8751 a format warning.
8752 * incremental.cc (open_incremental_binary): Initialized local
8753 variables to avoid warnings.
8754 * object.cc (make_elf_object): Ditto.
8755 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8756 a format warning.
e1df38aa 8757
88ee28e9
L
8758009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8759
8760 PR gold/10930
8761 * testsuite/plugin_test.c: Include "config.h".
8762
2daedcd6
DK
87632009-11-09 Doug Kwan <dougkwan@google.com>
8764
8765 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8766 (arm_symbol_value): Remove.
8767 (Arm_relocate_functions::arm_branch_common,
8768 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8769 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8770 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8771 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8772 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8773 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8774 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8775 Arm_relocate_functions::thm_mobw_abs_nc,
8776 Arm_relocate_functions::thm_mov_abs,
8777 Arm_relocate_functions::movw_prel_nc,
8778 Arm_relocate_functions::thm_movt_abs,
8779 Arm_relocate_functions::movt_prel,
8780 Arm_relocate_functions::thm_movw_prel_nc,
8781 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8782 (Target_arm::Relocate::relocate): Only decompose address into two
8783 parts if relocation type uses the thumb-bit and pass the actual
8784 bit instead of a flag indicating that the thumb-bit is used. Adjust
8785 calls to methods in Arm_relocate_functions for this change.
8786
1276bc89 87872009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8788
8789 PR 10925
8790 * reloc.cc: Instantiate
8791 Sized_relobj::initialize_input_to_output_maps and
8792 Sized_relobj:free_input_to_output_maps.
8793
e53ad1b5
ILT
87942009-11-06 Ian Lance Taylor <iant@google.com>
8795
8796 PR 10876
8797 * defstd.cc (in_segment): Set only_if_ref true for "end".
8798
eb44217c
DK
87992009-11-06 Doug Kwan <dougkwan@google.com>
8800
8801 * arm.cc (class Reloc_stub): Correct a comment.
8802 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8803 (Target_arm::scan_section_for_stubs): New method declaration.
8804 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8805 Change methods from private to protected.
8806 (Target_arm::do_may_relax): New method definition.
8807 (Target_arm::do_relax, Target_arm::group_sections,
8808 Target_arm::scan_reloc_for_stub,
8809 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8810 (Target_arm::arm_input_section_map_): New data member declaration.
8811 (Target_arm::scan_reloc_for_stub,
8812 Target_arm::scan_reloc_section_for_stubs,
8813 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8814 Target_arm::do_relax): New method definitions.
8815
5d329b7d
ILT
88162009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8817
8818 * configure.ac: Check for (struct stat)::st_mtim
8819 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8820 * config.in: Regenerate.
8821 * configure: Regenerate.
8822
96a0d71b
ILT
88232009-11-05 Ian Lance Taylor <iant@google.com>
8824
8825 PR 10910
8826 * output.cc (Output_segment::add_output_section): Add missing
8827 return statement.
8828
594c8e5e
ILT
88292009-11-04 Ian Lance Taylor <iant@google.com>
8830
8831 PR 10880
8832 * object.h (class Object): Add is_needed and set_is_needed
8833 methods. Add is_needed_ field. Make bool fields into bitfields.
8834 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8835 defined in a dynamic object and referenced by a regular object,
8836 set is_needed for the dynamic object.
8837 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8838 if the file is marked with as_needed and it is not needed.
8839
22b127cc
ILT
88402009-11-04 Ian Lance Taylor <iant@google.com>
8841
8842 PR 10887
8843 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8844 tags if data is discarded by linker script.
8845 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8846 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8847 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8848 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8849
f5c870d2
ILT
88502009-11-04 Ian Lance Taylor <iant@google.com>
8851
8852 * layout.cc (Layout::get_output_section): Add is_interp and
8853 is_dynamic_linker_section parameters. Change all callers.
8854 (Layout::choose_output_section): Likewise.
8855 (Layout::make_output_section): Likewise.
8856 (Layout::add_output_section_data): Add is_dynamic_linker_section
8857 parameter. Change all callers.
8858 * layout.h (class Layout): Update declarations.
8859 * output.h (class Output_section): Add is_interp, set_is_interp,
8860 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8861 Add is_interp_, is_dynamic_linker_section_ fields. Change
8862 generate_code_fills_at_write_ to a bitfield.
8863 * output.cc (Output_section::Output_sections): Initialize new
8864 fields.
8865 (Output_segment::add_output_section): Add do_sort parameter.
8866 Change all callers.
8867
1ae4d23b
ILT
88682009-11-03 Ian Lance Taylor <iant@google.com>
8869
8870 PR 10860
8871 * options.h (class General_options): Add --warn-common.
8872 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8873 merging two common symbols.
8874 (Symbol_table::should_override): Handle --warn-common when merging
8875 a common symbol with a defined symbol. Use report_resolve_problem
8876 for multiple definitions.
8877 (Symbol_table::report_resolve_problem): New function.
8878 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8879
55da9579
DK
88802009-11-03 Doug Kwan <dougkwan@google.com>
8881
8882 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8883 stub_factory_.
8884 (Target_arm::stub_factory): New method definition.
8885 (Target_arm::new_arm_input_section,
8886 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8887 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8888 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8889 New type definitions.
8890 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8891 member declarations.
8892 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8893 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8894 New method definitions.
8895
37a9ac43
ILT
88962009-11-03 Ian Lance Taylor <iant@google.com>
8897
8898 * options.h (class General_options): Add --warn_constructors.
8899
b3d6a3d4
ILT
89002009-11-03 Ian Lance Taylor <iant@google.com>
8901
8902 PR 10893
8903 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8904 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8905
934b01dd
ILT
89062009-11-03 Ian Lance Taylor <iant@google.com>
8907
8908 PR 10895
8909 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8910 --msgid-bugs-address.
8911 (install-pdf): New target.
8912 (install-data_yes): Look up one directory to find mkinstalldirs.
8913
03c1939b
L
89142009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8915
8916 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8917 tree.
8918
ebd95253
DK
89192009-10-30 Doug Kwan <dougkwan@google.com>
8920
8921 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8922
e9bbb538
DK
89232009-10-30 Doug Kwan <dougkwan@google.com>
8924
8925 * arm.cc (Stub_addend_reader): New struct template definition
8926 and partial specializations.
8927 (Stub_addend_reader::operator()): New method definition for a
8928 partially specialized template.
8929
d5b40221
DK
89302009-10-30 Doug Kwan <dougkwan@google.com>
8931
8932 * arm.cc (Arm_relobj::processor_specific_flags): New method
8933 definition.
8934 (Arm_relobj::do_read_symbols): New method declaration.
8935 (Arm_relobj::processor_specific_flags_): New data member declaration.
8936 (Arm_dynobj): New class definition.
8937 (Target_arm::do_finalize_sections): Add input_objects parameter.
8938 (Target_arm::do_adjust_elf_header): New method declaration.
8939 (Target_arm::are_eabi_versions_compatible,
8940 (Target_arm::merge_processor_specific_flags): New method declaration.
8941 (Target_arm::do_make_elf_object): New overloaded method definitions
8942 and declaration.
8943 (Arm_relobj::do_read_symbols): New method definition.
8944 (Arm_dynobj::do_read_symbols): Ditto.
8945 (Target_arm::do_finalize_sections): Add input_objects parameters.
8946 Merge processor-specific flags from all input objects.
8947 (Target_arm::are_eabi_versions_compatible,
8948 Target_arm::merge_processor_specific_flags,
8949 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8950 New method definitions.
8951 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8952 Input_objects pointer type parameter.
8953 * layout.cc (Layout::finalize): Pass input objects to target's.
8954 finalize_sections function.
8955 * output.cc (Output_file_header::do_sized_write): Set ELF file
8956 header's processor-specific flags.
8957 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8958 Input_objects pointer type parameter.
8959 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8960 * target.h (Input_objects): New forward class declaration.
8961 (Target::processor_specific_flags,
8962 Target::are_processor_specific_flags_sect): New method definitions.
8963 (Target::finalize_sections): Add input_objects parameter.
8964 (Target::Target): Initialize processor_specific_flags_ and
8965 are_processor_specific_flags_set_.
8966 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8967 parameter.
8968 (Target::set_processor_specific_flags): New method definition.
8969 (Target::processor_specific_flags_,
8970 Target::are_processor_specific_flags_set_): New data member
8971 declarations.
8972 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8973 Input_objects pointer type parameter.
8974
ebabffbd
DK
89752009-10-30 Doug Kwan <dougkwan@google.com>
8976
8977 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8978
ad0f2072
ILT
89792009-10-28 Ian Lance Taylor <iant@google.com>
8980
8981 * object.h (class Relobj): Drop options parameter from
8982 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8983 do_scan_relocs, do_relocate. Change all callers.
8984 (class Sized_relobj): Drop options parameters from
8985 do_gc_process_relocs, do_scan_relocs, do_relocate,
8986 do_relocate_sections, relocate_sections, emit_relocs_scan,
8987 emit_relocs_scan_reltype. Change all callers.
8988 (struct Relocate_info): Remove options field and all references to
8989 it.
8990 * reloc.h (class Read_relocs): Remove options constructor
8991 parameter and options_ field. Change all callers.
8992 (class Gc_process_relocs, class Scan_relocs): Likewise.
8993 (class Relocate_task): Likewise.
8994 * target-reloc.h (scan_relocs): Remove options parameter. Change
8995 all callers.
8996 (scan_relocatable_relocs): Likewise.
8997 * target.h (class Sized_target): Remove options parameter from
8998 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8999 all callers.
9000 * gc.h (gc_process_relocs): Remove options parameter. Change all
9001 callers.
9002 * arm.cc: Update functions to remove options parameters.
9003 * i386.cc: Likewise.
9004 * powerpc.cc: Likewise.
9005 * sparc.cc: Likewise.
9006 * x86_64.cc: Likewise.
9007 * testsuite/testfile.cc: Likewise.
9008
8ffa3667
DK
90092009-10-28 Doug Kwan <dougkwan@google.com>
9010
9011 * arm.cc (Arm_relobj): New class definition.
e1df38aa 9012 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
9013 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
9014 New method definitions.
9015
40f36857
CC
90162009-10-28 Cary Coutant <ccoutant@google.com>
9017
9018 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
9019 (Plugin::cleanup_done_): New member.
9020 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
9021 (Plugin_manager::cleanup_done_): Remove.
9022 (Plugin_manager::add_input_file): Edit error message.
9023 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
9024 (Plugin_manager::cleanup): Remove use of cleanup_done_.
9025
2c849493
ILT
90262009-10-27 Mikolaj Zalewski <mikolajz@google.com>
9027
9028 * fileread.cc: (File_read::View::~View): Use the new
9029 data_ownership_ filed.
9030 (File_read::~File_read): Dispose the new whole_file_view_.
9031 (File_read::open): Mmap the whole file if needed.
9032 (File_read::open): Use whole_file_view_ instead of contents_.
9033 (File_read::find_view): Use whole_file_view_ if applicable.
9034 (File_read::do_read): Use whole_file_view_ instead of contents_.
9035 (File_read::make_view): Use whole_file_view_ instead of contents_,
9036 update File_read::View::View call.
9037 (File_read::find_or_make_view): Update File_read::View::View
9038 call.
9039 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
9040 remove contents_
9041 (File_read::View::Data_ownership): New enum.
9042 (File_read::View::View): Replace bool mapped_ with Data_ownership
9043 argument.
9044 (File_read::View::mapped_): Remove (replaced by data_ownership_).
9045 (File_read::View::data_ownership_): New field.
9046 (File_read::contents_): Remove (replaced by whole_file_view_).
9047 (File_read::whole_file_view_): New field.
9048 * options.h (class General_options): Add --keep-files-mapped.
9049
24998053
CC
90502009-10-27 Cary Coutant <ccoutant@google.com>
9051
9052 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
9053 * testsuite/Makefile.am (plugin_test_5): New test case.
9054 * testsuite/Makefile.in: Regenerate.
9055
72adc4fa
DK
90562009-10-25 Doug Kwan <dougkwan@google.com>
9057
9058 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
9059 from private to protected to allow access by child class.
9060 (Sized_relobj::do_relocate_sections): New method declaration.
9061 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 9062 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
9063 Sized_relobj::relocate_sections. Instantiate template explicitly
9064 for different target sizes and endianity.
9065
07f508a2
DK
90662009-10-24 Doug Kwan <dougkwan@google.com>
9067
9068 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
9069 (Arm_input_section::as_arm_input_section): New method.
9070 (Arm_output_section): New class definition.
9071 (Arm_output_section::create_stub_group,
9072 Arm_output_section::group_sections): New method definitions.
9073
10ad9fe5
DK
90742009-10-22 Doug Kwan <dougkwan@google.com>
9075
9076 * arm.cc (Arm_input_section): New class definition.
9077 (Arm_input_section::init, Arm_input_section:do_write,
9078 Arm_input_section::set_final_data_size,
9079 Arm_input_section::do_reset_address_and_file_offset): New method
9080 definitions.
9081
56ee5e00
DK
90822009-10-21 Doug Kwan <dougkwan@google.com>
9083
9084 * arm.cc (Stub_table, Arm_input_section): New forward class
9085 declarations.
9086 (Stub_table): New class defintion.
9087 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9088 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9089 New method definition.
9090
b569affa
DK
90912009-10-21 Doug Kwan <dougkwan@google.com>
9092
9093 * arm.cc: Update copyright comments.
9094 (Target_arm): New forward class template declaration.
9095 (Arm_address): New type.
9096 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9097 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9098 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9099 constants.
9100 (Insn_template): Same.
9101 (DEF_STUBS): New macro.
9102 (Stub_type): New enum type.
9103 (Stub_template): New class definition.
9104 (Stub): Same.
9105 (Reloc_stub): Same.
9106 (Stub_factory): Same.
9107 (Target_arm::Target_arm): Initialize may_use_blx_ and
9108 should_force_pic_veneer_.
9109 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9110 Target_arm::should_force_pic_veneer,
9111 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9112 Target_arm::using_thumb_only, Target_arm:;default_target): New
9113 method defintions.
9114 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9115 New data member declarations.
9116 (Insn_template::size, Insn_template::alignment): New method defintions.
9117 (Stub_template::Stub_template): New method definition.
9118 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9119 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9120 (Stub_factory::Stub_factory): New method definition.
9121 * gold.h (string_hash): New template.
9122 * output.h (Input_section_specifier::hash_value): Use
9123 gold::string_hash.
9124 (Input_section_specifier::string_hash): Remove.
9125 * stringpool.cc (Stringpool_template::string_hash): Use
9126 gold::string_hash.
9127
6c172549
DK
91282009-10-20 Doug Kwan <dougkwan@google.com>
9129
9130 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9131 symbols of relaxed input sections.
9132 * output.h (Output_section::find_relaxed_input_section): Make
9133 method public.
9134
c5617f2f
DK
91352009-10-16 Doug Kwan <dougkwan@google.com>
9136
9137 * dynobj.cc (Versions::Versions): Initialize version_script_.
9138 Only insert base version symbol definition for a shared object
9139 if version script defines any version versions.
9140 (Versions::define_base_version): New method definition.
9141 (Versions::add_def): Check that base version is not needed.
9142 (Versions::add_need): Define base version lazily.
9143 * dynobj.h (Versions::define_base_version): New method declaration.
9144 (Versions::needs_base_version_): New data member declaration.
9145 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9146 (check_DATA): Add no_version_test.stdout.
9147 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9148 New make rules.
9149 * testsuite/Makefile.in: Regenerate.
9150 * testsuite/no_version_test.c: New file.
9151 * testsuite/no_version_test.sh: Ditto.
9152
3c12dcdb
DK
91532009-10-16 Doug Kwan <dougkwan@google.com>
9154
9155 * expression.cc (class Segment_start_expression): New class definition.
9156 (Segment_start_expression::value): New method definition.
9157 (script_exp_function_segment_start): Return a new
9158 Segment_start_expression.
9159 * gold/script-c.h (script_saw_segment_start_expression): New function
9160 prototype.
9161 * script-sections.cc (Script_sections::Script_sections): Initialize
9162 SAW_SEGMENT_START_EXPRESSION_ to false.
9163 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9164 and -Tbbs options to specify section addresses if given in
9165 command line and no SEGMENT_START expression is seen in a script.
9166 * script-sections.h (Script_sections::saw_segment_start_expression,
9167 Script_sections::set_saw_segment_start_expression): New method
9168 definition.
9169 (Script_sections::saw_segment_start_expression_): New data member
9170 declaration.
9171 * script.cc (script_saw_segment_start_expression): New function.
9172 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9173 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9174 script_test_7.sh and script_test_8.sh.
9175 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9176 script_test_8.stdout.
9177 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9178 (script_test_6, script_test_6.stdout, script_test_7,
9179 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9180 * Makefile.in: Regenerate.
9181 * testsuite/script_test_6.sh: New file.
9182 * testsuite/script_test_6.t: Same.
9183 * testsuite/script_test_7.sh: Same.
9184 * testsuite/script_test_7.t: Same.
9185 * testsuite/script_test_8.sh: Same.
9186
64b1ae37
DK
91872009-10-16 Doug Kwan <dougkwan@google.com>
9188
9189 * output.cc (Output_segment::set_section_list_address): Cast
9190 expressions to unsigned long long type to avoid format warnings.
9191
661be1e2
ILT
91922009-10-15 Ian Lance Taylor <iant@google.com>
9193
12edd763 9194 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9195 dot assignment to script_sections_.
12edd763
ILT
9196 * script-sections.cc (Script_sections::add_dot_assignment):
9197 Initialize if necessary.
9198
68b6574b
ILT
9199 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9200 program headers with no load segment if there is a linker script.
9201
661be1e2
ILT
9202 * layout.cc (Layout::set_segment_offsets): Align the file offset
9203 to the segment aligment for -N or -n with no load segment.
9204 * output.cc (Output_segment::add_output_section): Don't crash if
9205 the first section is a TLS section.
9206 (Output_segment::set_section_list_addresses): Print an error
9207 message if the address moves backward in a linker script.
9208 * script-sections.cc
9209 (Output_section_element_input::set_section_addresses): Don't
9210 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9211 (Orphan_output_section::set_section_addresses): Likewise.
9212
f15f61a7
DK
92132009-10-15 Doug Kwan <dougkwan@google.com>
9214
9215 * layout.cc (Layout::finish_dynamic_section): Generate tags
9216 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9217 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9218 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9219
82bb573a
ILT
92202009-10-14 Ian Lance Taylor <iant@google.com>
9221
9222 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9223 fields.
9224 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9225 data_shdr fields of relinfo.
9226 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9227 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9228 R_386_TLS_LDO_32, adjust based on section flags.
9229 (Target_i386::Relocate::fix_up_ldo): Remove.
9230
374ad285
ILT
92312009-10-13 Ian Lance Taylor <iant@google.com>
9232
9233 Add support for -pie.
9234 * options.h (class General_options): Add -pie and
9235 --pic-executable.
9236 (General_options::output_is_position_independent): Test -pie.
9237 (General_options::output_is_executable): Return true if not shared
9238 and not relocatable.
9239 (General_options::output_is_pie): Remove.
9240 * options.cc (General_options::finalize): Reject incompatible uses
9241 of -pie.
9242 * gold.cc (queue_middle_tasks): A -pie link is not static.
9243 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9244 * symtab.cc (Symbol::final_value_is_known): Return false if
9245 output_is_position_independent.
9246 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9247 output_is_position_independent.
9248 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9249 output_is_position_independent.
9250 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9251 output_is_position_independent.
9252 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9253 two_file_pie_test.
9254 (basic_pie_test.o, basic_pie_test): New targets.
9255 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9256 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9257 (two_file_pie_test): New target.
9258 * testsuite/Makefile.in: Rebuild.
9259 * README: Remove note saying that -pie is not supported.
9260
c6585162
ILT
92612009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9262
9263 * options.h (class General_options): Add -init and -fini.
9264 * layout.cc (Layout::finish_dynamic_section): Emit
9265 given init and fini functions.
9266
032ce4e9
ST
92672009-10-13 Sriraman Tallam <tmsriram@google.com>
9268
9269 * gc.h (gc_process_relocs): Check if icf is enabled using new
9270 function.
9271 * gold.cc (queue_initial_tasks): Likewise.
9272 (queue_middle_tasks): Likewise.
9273 * object.cc (do_layout): Likewise.
9274 * symtab.cc (is_section_folded): Likewise.
9275 * main.cc (main): Likewise.
9276 * reloc.cc (Read_relocs::run): Likewise.
9277 (Sized_relobj::do_scan_relocs): Likewise.
9278 * icf.cc (is_function_ctor_or_dtor): New function.
9279 (Icf::find_identical_sections): Check if function is ctor or dtor when
9280 safe icf is chosen.
9281 * options.h (General_options::icf): Change option to be an enum.
9282 (Icf_status): New enum.
9283 (icf_enabled): New method.
9284 (icf_safe_folding): New method.
9285 (set_icf_status): New method.
9286 (icf_status_): New variable.
9287 * (options.cc) (General_options::finalize): Set icf_status_.
9288 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9289 icf_test and icf_keep_unique_test to use the --icf enum flag.
9290 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9291 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9292
f345227a
ST
92932009-10-12 Sriraman Tallam <tmsriram@google.com>
9294
9295 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9296 includes to gc.h and icf.h.
9297 * arm.cc: Include gc.h.
9298 * gold.cc: Likewise.
9299 * i386.cc: Likewise.
9300 * powerpc.cc: Likewise.
9301 * sparc.cc: Likewise.
9302 * x86_64.cc: Likewise.
9303 * gc.h: Include icf.h.
9304
1c7814ed
ILT
93052009-10-11 Ian Lance Taylor <iant@google.com>
9306
9307 * plugin.cc: Include "gold.h" before other header files.
9308
ae3b5189
CD
93092009-10-10 Chris Demetriou <cgd@google.com>
9310
9311 * options.h (Input_file_argument::Input_file_type): New enum.
9312 (Input_file_argument::is_lib_): Replace with...
9313 (Input_file_argument::type_): New member.
9314 (Input_file_argument::Input_file_argument): Take Input_file_type
9315 'type' rather than boolean 'is_lib' as second argument.
9316 (Input_file_argument::is_lib): Use type_.
9317 (Input_file_argument::is_searched_file): New function.
9318 (Input_file_argument::may_need_search): Handle is_searched_file.
9319 * options.cc (General_options::parse_library): Support -l:filename.
9320 (General_options::parse_just_symbols): Update for Input_file_argument
9321 changes.
9322 (Command_line::process): Likewise.
9323 * archive.cc (Archive::get_file_and_offset): Likewise.
9324 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9325 * script.cc (read_script_file, script_add_file): Likewise.
9326 * fileread.cc (Input_file::Input_file): Likewise.
9327 (Input_file::will_search_for): Handle is_searched_file.
9328 (Input_file::open): Likewise.
9329 * readsyms.cc (Read_symbols::get_name): Likewise.
9330 * testsuite/Makefile.am (searched_file_test): New test.
9331 * testsuite/Makefile.in: Regenerate.
9332 * testsuite/searched_file_test.cc: New file.
9333 * testsuite/searched_file_test_lib.cc: New file.
9334
f3048a1d
ILT
93352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9336 Ian Lance Taylor <iant@google.com>
9337
9338 * descriptor.cc: Include <cstdio> and "binary-io.h".
9339 (Descriptors::open): Open the files in binary mode always.
9340 * script.cc (Lex::get_token): Treat \r as whitespace.
9341
d4780e57
ILT
93422009-10-09 Ian Lance Taylor <iant@google.com>
9343
9344 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9345
d9a893b8
ILT
93462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9347 Ian Lance Taylor <iant@google.com>
9348
9349 * configure.ac: Check for readv function also.
9350 * fileread.cc (readv): Define if not HAVE_READV.
9351 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9352 does not exist.
9353 * config.in: Regenerate.
9354 * configure: Regenerate.
9355
c0a62865
DK
93562009-10-09 Doug Kwan <dougkwan@google.com>
9357
9358 * layout.cc (Layout::make_output_section): Call target hook to make
9359 ordinary output section.
9360 (Layout::finalize): Adjust parameter list of call the
9361 Target::may_relax().
9362 * layout.h (class Layout::section_list): New method.
9363 * merge.h (Output_merge_base::entsize): Change visibility to public.
9364 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9365 New methods.
9366 (Output_merge_string::do_is_string): New method.
9367 * object.cc (Sized_relobj::do_setup): renamed from
9368 Sized_relobj::set_up.
9369 * object.h (Sized_relobj::adjust_shndx,
9370 Sized_relobj::initializ_input_to_output_maps,
9371 Sized_relobj::free_input_to_output_maps): Change visibilities to
9372 protected.
9373 (Sized_relobj::setup): Virtualize.
9374 (Sized_relobj::do_setup): New method declaration.
9375 (Sized_relobj::invalidate_section_offset,
9376 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9377 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9378 * options.cc (parse_int): New function.
9379 * options.h (parse_int): New declaration.
9380 (DEFINE_int): New macro.
9381 (stub_group_size): New option.
9382 * output.cc (Output_section::Output_section): Initialize memebers
9383 merge_section_map_, merge_section_by_properties_map_,
9384 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9385 (Output_section::add_input_section): Handled deferred code-fill
9386 generation and remove an old comment.
9387 (Output_section::add_relaxed_input_section): New method definition.
9388 (Output_section::add_merge_input_section): Use merge section by
9389 properties map to speed to search. Update merge section maps
9390 as appropriate.
9391 (Output_section::build_relaxation_map): New method definition.
9392 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9393 Same.
9394 (Output_section::relax_input_section): Renamed to
9395 Output_section::convert_input_sections_to_relaxed_sections and change
9396 interface to take a vector of pointers to relaxed sections.
9397 (Output_section::find_merge_section,
9398 Output_section::find_relaxed_input_section): New method definitions.
9399 (Output_section::is_input_address_mapped,
9400 Output_section::output_offset, Output_section::output_address):
9401 Use output section data maps to speed up searching.
9402 (Output_section::find_starting_output_address): Add comments.
9403 (Output_section::do_write,
9404 Output_section::write_to_postprocessing_buffer): Do code-fill
9405 generation as appropriate.
9406 (Output_section::get_input_sections): Invalidate relaxed input section
9407 map.
9408 (Output_section::restore_states): Adjust type of checkpoint .
9409 Invalidate relaxed input section map.
9410 * output.h (Output_merge_base): New class declaration.
9411 (Input_section_specifier): New class defintion.
9412 (class Output_relaxed_input_section) Change base class to
9413 Output_section_data_build.
9414 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9415 base class initializer.
9416 (Output_section::add_relaxed_input_section): New method declaration.
9417 (Output_section::Input_section): Change visibility to protected.
2e702c99 9418 (Output_section::Input_section::relobj,
c0a62865
DK
9419 Output_section::Input_section::shndx): Handle relaxed input sections.
9420 Output_section::input_sections) Change visibility to protected. Also
9421 define overload to return a non-const pointer.
9422 (Output_section::Merge_section_properties): New class defintion.
9423 (Output_section::Merge_section_by_properties_map,
9424 Output_section::Output_section_data_by_input_section_map,
9425 Output_section::Relaxation_map): New types.
9426 (Output_section::relax_input_section): Rename method to
9427 Output_section::convert_input_sections_to_relaxed_sections and change
9428 interface to take a vector of relaxed section pointers.
9429 (Output_section::find_merge_section,
9430 Output_section::find_relaxed_input_section,
9431 Output_section::build_relaxation_map,
9432 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9433 New method declarations.
9434 (Output_section::merge_section_map_
9435 Output_section::merge_section_by_properties_map_,
9436 Output_section::relaxed_input_section_map_,
9437 Output_section::is_relaxed_input_section_map_valid_,
9438 Output_section::generate_code_fills_at_write_): New data members.
9439 * script-sections.cc
9440 (Output_section_element_input::set_section_addresses): Call
9441 current_data_size and addralign methods of relaxed input sections.
9442 (Orphan_output_section::set_section_addresses): Call current_data_size
9443 and addralign methods of relaxed input sections.
9444 * symtab.cc (Symbol_table::compute_final_value): Extract template
9445 from the body of Symbol_table::sized_finalize_symbol.
9446 (Symbol_table::sized_finalized_symbol): Call
9447 Symbol_table::compute_final_value.
9448 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9449 (Symbol_table::compute_final_value): New templated method declaration.
9450 * target.cc (Target::do_make_output_section): New method defintion.
9451 * target.h (Target::make_output_section): New method declaration.
9452 (Target::relax): Add more parameters for input objects, symbol table
9453 and layout. Adjust call to do_relax.
9454 (Target::do_make_output_section): New method declaration.
9455 (Target::do_relax): Add parameters for input objects, symbol table
9456 and layout.
9457
d446d6c4
ILT
94582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9459
9460 * pread.c: Include stdio.h.
9461
bc06c745
ILT
94622009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9463
9464 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9465 defined.
9466
75aea3d0
ILT
94672009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9468
9469 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9470 Change read_shndx type to unsigned int.
9471 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9472 int.
9473 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9474 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9475 Change read_shndx type to unsigned int.
9476 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9477 int.
9478 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9479 * layout.cc (Layout::create_symtab_sections): Cast the result of
9480 local_symcount * symsize to off_t in the gold_assert.
9481
be8fcb75
ILT
94822009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9483
9484 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9485 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9486 R_ARM_BASE_ABS.
9487 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9488 (Arm_relocate_functions::thm_abs5): New function.
9489 (Arm_relocate_functions::abs12): New function.
9490 (Arm_relocate_functions::abs16): New function.
9491 (Arm_relocate_functions::base_abs): New function.
9492 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9493 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9494 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9495 R_ARM_BASE_ABS.
9496 (Scan::global): Likewise.
9497 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9498 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9499 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9500 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9501 R_ARM_BASE_ABS.
9502
c2a122b6
ILT
95032009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9504
9505 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9506 (Arm_relocate_functions::movt_prel): New function.
9507 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9508 (Arm_relocate_functions::thm_movt_prel): New function.
9509 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9510 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9511 (Scan::global, Relocate::relocate): Likewise.
9512 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9513
c4aa1e2d
ILT
95142009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9515
9516 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9517 Incremental_checker.
9518 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9519 unsigned int.
9520 (class Incremental_inputs_header): New class.
9521 (Incremental_inputs_header_writer): Edit comment.
9522 (Incremental_inputs_entry): New class.
9523 (Incremental_inputs_entry_writer): Edit comment.
9524 (Sized_incremental_binary::do_find_incremental_inputs_section):
9525 Add *strtab_shndx parameter, fill it.
9526 (Sized_incremental_binary::do_check_inputs): New method.
9527 (Incremental_checker::can_incrementally_link_output_file): Use
9528 Sized_incremental_binary::check_inputs.
9529 (Incremental_inputs::report_command_line): Save command line in
9530 command_line_.
9531 * incremental.h:
9532 (Incremental_binary::find_incremental_inputs_section): New
9533 method.
9534 (Incremental_binary::do_find_incremental_inputs_section): Add
9535 strtab_shndx parameter.
9536 (Incremental_binary::do_check_inputs): New pure virtual method.
9537 (Sized_incremental_binary::do_check_inputs): Declare.
9538 (Incremental_checker::Incremental_checker): Add incremental_inputs
9539 parameter, use it to initialize incremental_inputs_.
9540 (Incremental_checker::incremental_inputs_): New field.
9541 (Incremental_checker::command_line): New method.
9542 (Incremental_checker::inputs): New method.
9543 (Incremental_checker::command_line_): New field.
9544
c549a694
ILT
95452009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9546
9547 * incremental.cc: Include <cstdarg> and "target-select.h".
9548 (vexplain_no_incremental): New function.
9549 (explain_no_incremental): New function.
9550 (Incremental_binary::error): New method.
9551 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9552 method.
9553 (make_sized_incremental_binary): New function.
9554 (open_incremental_binary): New function.
9555 (can_incrementally_link_file): Add checks if output is ELF and has
9556 inputs section.
9557 * incremental.h: Include "elfcpp_file.h" and "output.h".
9558 (Incremental_binary): New class.
9559 (Sized_incremental_binary): New class.
9560 (open_incremental_binary): Declare.
9561 * object.cc (is_elf_object): Use
9562 elfcpp::Elf_recognizer::is_elf_file.
9563 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9564 * output.h (Output_file::filesize): New method.
9565
fd3c5f0b
ILT
95662009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9567
9568 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9569 New function.
9570 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9571 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9572 function.
9573 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9574 function.
9575 (Arm_relocate_functions::movw_abs_nc): New function.
9576 (Arm_relocate_functions::movt_abs): New function.
9577 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9578 (Arm_relocate_functions::thm_movt_abs): New function.
9579 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9580 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9581 (Scan::global): Likewise.
9582 (Relocate::relocate): Likewise.
9583 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9584
7f5309a5
ILT
95852009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9586
9587 * arm.cc (Arm_relocate_functions::got_prel) New function.
9588 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9589 (Relocate::relocate): Likewise.
9590 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9591
364c7fa5
ILT
95922009-10-06 Ian Lance Taylor <iant@google.com>
9593
9594 * options.h (class General_options): Define
9595 split_stack_adjust_size parameter.
9596 * object.h (class Object): Add uses_split_stack_ and
9597 has_no_split_stack_ fields. Add uses_split_stack and
9598 has_no_split_stack accessor functions. Declare
9599 handle_split_stack_section.
9600 (class Reloc_symbol_changes): Define.
9601 (class Sized_relobj): Define Function_offsets. Declare
9602 split_stack_adjust, split_stack_adjust_reltype, and
9603 find_functions.
9604 * object.cc (Object::handle_split_stack_section): New function.
9605 (Sized_relobj::do_layout): Call handle_split_stack_section.
9606 * dynobj.cc (Sized_dynobj::do_layout): Call
9607 handle_split_stack_section.
9608 * reloc.cc (Sized_relobj::relocate_sections): Call
9609 split_stack_adjust for executable sections in split_stack
9610 objects. Pass reloc_map to relocate_section.
9611 (Sized_relobj::split_stack_adjust): New function.
9612 (Sized_relobj::split_stack_adjust_reltype): New function.
9613 (Sized_relobj::find_functions): New function.
9614 * target-reloc.h: Include "object.h".
9615 (relocate_section): Add reloc_symbol_changes parameter. Change
9616 all callers.
9617 * target.h (class Target): Add calls_non_split method. Declare
9618 do_calls_non_split virtual method. Declare match_view and
9619 set_view_to_nop.
9620 * target.cc: Include "elfcpp.h".
9621 (Target::do_calls_non_split): New function.
9622 (Target::match_view): New function.
9623 (Target::set_view_to_nop): New function.
9624 * gold.cc (queue_middle_tasks): Give an error if mixing
9625 split-stack and non-split-stack objects with -r.
9626 * i386.cc (Target_i386::relocate_section): Add
9627 reloc_symbol_changes parameter.
9628 (Target_i386::do_calls_non_split): New function.
9629 * x86_64.cc (Target_x86_64::relocate_section): Add
9630 reloc_symbol_changes parameter.
9631 (Target_x86_64::do_calls_non_split): New function.
9632 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9633 parameter.
9634 * powerpc.cc (Target_powerpc::relocate_section): Add
9635 reloc_symbol_changes parameter.
9636 * sparc.cc (Target_sparc::relocate_section): Add
9637 reloc_symbol_changes parameter.
9638 * configure.ac: Call AM_CONDITIONAL for the default target.
9639 * configure: Rebuild.
9640 * testsuite/Makefile.am (TEST_AS): New variable.
9641 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9642 (check_DATA): Add split_i386 and split_x86_64 files.
9643 (SPLIT_DEFSYMS): Define.
9644 (split_i386_[1234n].o): New targets.
9645 (split_i386_[124]): New targets.
9646 (split_i386_[1234r].stdout): New targets.
9647 (split_x86_64_[1234n].o): New targets.
9648 (split_x86_64_[124]): New targets.
9649 (split_x86_64_[1234r].stdout): New targets.
9650 (MOSTLYCLEANFILES): Add new executables.
9651 * testsuite/split_i386.sh: New file.
9652 * testsuite/split_x86_64.sh: New file.
9653 * testsuite/split_i386_1.s: New file.
9654 * testsuite/split_i386_2.s: New file.
9655 * testsuite/split_i386_3.s: New file.
9656 * testsuite/split_i386_4.s: New file.
9657 * testsuite/split_i386_n.s: New file.
9658 * testsuite/split_x86_64_1.s: New file.
9659 * testsuite/split_x86_64_2.s: New file.
9660 * testsuite/split_x86_64_3.s: New file.
9661 * testsuite/split_x86_64_4.s: New file.
9662 * testsuite/split_x86_64_n.s: New file.
9663 * testsuite/testfile.cc (Target_test): Update relocation_section
9664 function.
9665 * testsuite/Makefile.in: Rebuild.
9666
e8a9fcda
ILT
96672009-10-06 Ian Lance Taylor <iant@google.com>
9668
9669 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9670 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9671 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9672 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9673 the address on ldo_addrs_.
9674 (Target_i386::Relocate::fix_up_ldo): New function.
9675
e99daf92
ILT
96762009-10-06 Rafael Espindola <espindola@google.com>
9677
9678 * plugin.cc (add_input_library): New.
9679 (Plugin::load): Add add_input_library to tv.
9680 (Plugin_manager::add_input_file): Add the is_lib argument.
9681 (add_input_file): Update call to Plugin_manager::add_input_file.
9682 (add_input_library): New.
9683 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9684
966d4097
DK
96852009-09-30 Doug Kwan <dougkwan@google.com>
9686
9687 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9688 symbol and call Symbol::may_need_copy_reloc to determine if
9689 a copy reloc is needed.
9690 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9691 nocopyreloc is given in command line.
9692 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9693 given in command line.
9694 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9695 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9696 of the removed Target_i386::may_need_copy_reloc.
9697 * options.h (copyreloc): New option with default value false.
9698 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9699 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9700 instead of the removed Target_powerpc::may_need_copy_reloc.
9701 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9702 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9703 instead of the removed Target_sparc::may_need_copy_reloc.
9704 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9705 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9706 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9707 instead of the removed Target_x86_64::may_need_copy_reloc.
9708
029ba973
ILT
97092009-09-30 Ian Lance Taylor <iant@google.com>
9710
9711 * object.h (class Object): Remove target_ field, and target,
9712 sized_target, and set_target methods.
9713 (Object::sized_target): Remove.
9714 (class Sized_relobj): Update declarations. Remove sized_target.
9715 * object.cc (Sized_relobj::setup): Remove target parameter.
9716 Change all callers.
9717 (Input_objects::add_object): Don't do anything with the target.
9718 (make_elf_sized_object): Add punconfigured parameter. Change all
9719 callers. Set or test parameter target.
9720 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9721 Change all callers.
9722 * parameters.cc (Parameters::set_target): Change parameter type to
9723 be non-const.
9724 (Parameters::default_target): Remove.
9725 (set_parameters_target): Change parameter type to be non-const.
9726 (parameters_force_valid_target): New function.
9727 (parameters_clear_target): New function.
9728 * parameters.h (class Parameters): Update declarations. Remove
9729 default_target method. Add sized_target and clear_target
9730 methods. Change target_ to be non-const.
9731 (set_parameters_target): Update declaration.
9732 (parameters_force_valid_target): Declare.
9733 (parameters_clear_target): Declare.
9734 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9735 as NULL if we aren't searching.
9736 (Add_symbols::run): Don't check for compatible target.
9737 * fileread.cc (Input_file::open_binary): Call
9738 parameters_force_valid_target.
9739 * gold.cc (queue_middle_tasks): Likewise.
9740 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9741 set_target on object.
9742 * dynobj.h (class Sized_dynobj): Update declarations.
9743 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9744 make_elf_object returns NULL.
9745 (Archive::include_member): Don't check whether object target is
9746 compatible.
9747 * output.cc (Output_section::add_input_section): Get target from
9748 parameters.
9749 (Output_section::relax_input_section): Likewise.
9750 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9751 parameters.
9752 (Sized_relobj::do_scan_relocs): Likewise.
9753 (Sized_relobj::relocate_sections): Likewise.
9754 * resolve.cc (Symbol_table::resolve): Likewise.
9755 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9756 parameter. Change all callers.
9757 (Symbol_table::add_from_object): Get target from parameters.
9758 (Symbol_table::add_from_relobj): Don't check object target.
9759 (Symbol_table::add_from_dynobj): Likewise.
9760 (Symbol_table::define_special_symbol): Get target from
9761 parameters.
9762 * symtab.h (class Symbol_table): Update declaration.
9763 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9764 parameter. Change all callers. Clear parameter target.
9765 (Binary_test): Test target here.
9766 * testsuite/object_unittest.cc (gold_testsuite): Remove
9767 target_test_pointer parameter. Change all callers.
9768 (Object_test): Test target here.
9769
a6a22b83
ILT
97702009-09-26 Ian Lance Taylor <iant@google.com>
9771
9772 * testsuite/initpri1.c: Don't try to use constructor priorities if
9773 compiling with gcc before 4.3.
9774
6a8f49fe
ILT
97752009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9776
9777 * testsuite/retain_symbols_file_test.sh (check_present): Change
9778 output file name to retain_symbols_file_test.stdout.
9779 (check_absent): Likewise.
9780
8c604651
CS
97812009-09-18 Craig Silverstein <csilvers@google.com>
9782
9783 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9784 * options.cc: Include <cerrno> and <fstream>.
9785 (General_options::finalize): Parse -retain-symbols-file tag.
9786 * options.h: New flag.
9787 (General_options): New method should_retain_symbol, new
9788 variable symbols_to_retain.
9789 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9790 should_retain_symbol map.
9791 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9792 * testsuite/Makefile.in: Regenerate.
9793 * testsuite/retain_symbols_file_test.sh: New file.
9794
ca58b19f
NC
97952009-09-18 Nick Clifton <nickc@redhat.com>
9796
9797 * po/es.po: Updated Spanish translation.
9798
20e6d0d6
DK
97992009-09-17 Doug Kwan <dougkwan@google.com>
9800
9801 * debug.h (DEBUG_RELAXATION): New constant.
9802 (DEBUG_ALL): Add DEBUG_RELAXATION.
9803 (debug_string_to_enum): Add relaxation debug option.
9804 * layout.cc
9805 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9806 Layout::Relaxation_debug_check::read_sections,
9807 Layout::Relaxation_debug_check::read_sections): New method definitions.
9808 (Layout::Layout): Initialize data members
9809 record_output_section_data_from_scrips_,
9810 script_output_section_data_list_ and relaxation_debug_check_.
9811 (Layout::save_segments, Layout::restore_segments,
9812 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9813 Layout::relaxation_loop_body): New method definitions.
9814 (Layout::finalize): Support relaxation. Move section layout code to
9815 Layout::relaxation_loop_body.
9816 (Layout::set_asection_address_from_script): Move code for orphan
9817 section placement out.
9818 (Layout::place_orphan_sections_in_script): New method definition.
9819 * layout.h (Output_segment_headers, Output_file_header):
9820 New forward class declarations.
9821 (Layout::~Layout): Define.
9822 (Layout::new_output_section_data_from_script): New method definition.
9823 (Layout::place_orphan_sections_in_script): New method declaration.
9824 (Layout::Segment_states): New type declaration.
9825 (Layout::save_segments, Layout::restore_segments,
9826 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9827 Layout::relaxation_loop_body): New method declarations.
9828 (Layout::Output_section_data_list): New type declaration.
9829 (Layout::Relaxation_debug_check): New class definition.
9830 (Layout::record_output_section_data_from_script_,
9831 Layout::script_output_section_data_list_, Layout::segment_states_,
9832 Layout::relaxation_debug_check_): New data members.
9833 * output.cc: (Output_section_headers::do_size): New method definition.
9834 (Output_section_headers::Output_section_headers): Move size
9835 computation to Output_section_headers::do_size.
9836 (Output_segment_headers::do_size): New method definition.
e1df38aa 9837 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9838 Output_file_header::do_size and call it.
9839 (Output_file_header::do_size): New method definition.
9840 (Output_data_group::Output_data_group): Adjust call to
9841 Output_section_data.
9842 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9843 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9844 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9845 RELAXED_INPUT_SECTION_CODE.
9846 (Output_section::Output_section): Initialize data member checkpoint_.
9847 (Output_section::~Output_section): Delete checkpoint object pointed
9848 by checkpoint_.
9849 (Output_section::add_input_section): Always add an Input_section if
9850 relaxing.
9851 (Output_section::add_merge_input_section): Add assert.
9852 (Output_section::relax_input_section): New method definition.
9853 (Output_section::set_final_data_size): Set load address to zero for
9854 an unallocated section.
9855 (Output_section::do_address_and_file_offset_have_reset_values):
9856 New method definition.
9857 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9858 Handle relaxed input section.
9859 (Output_section::sort_attached_input_sections): Checkpoint input
9860 section list lazily.
9861 (Output_section::get_input_sections): Change type of input_sections to
9862 list of Simple_input_section pointers. Checkpoint input section list
9863 lazily. Also handle relaxed input sections.
9864 (Output_section::add_input_section_for_script): Take a reference to
9865 a Simple_input_section object instead of Relobj pointer and section
9866 index as parameter. Handle relaxed input sections.
9867 (Output_section::save_states, Output_section::restore_states): New
9868 method definitions.
9869 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9870 (Output_data::is_data_size_fixed): New method definition.
9871 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9872 if it is fixed.
9873 (Output_data::address_and_file_offset_have_reset_values): New method
9874 definition.
9875 (Output_data::do_address_and_file_offset_have_reset_values): New method
9876 definition.
9877 (Output_data::set_data_size): Check that data size is not fixed.
9878 (Output_data::fix_data_size): New method definition.
9879 (Output_data::is_data_size_fixed_): New data member.
9880 (Output_section_headers::set_final_data_size): New method definition.
9881 (Output_section_headers::do_size): New method declaration.
9882 (Output_segment_headers::set_final_data_size): New method definition.
9883 (Output_segment_headers::do_size): New method declaration.
9884 (Output_file_header::set_final_data_size)::New method definition.
9885 (Output_file_header::do_size)::New method declaration.
9886 (Output_section_data::Output_section_data): Add new parameter
9887 is_data_size_fixed and use it to fix data size.
9888 (Output_data_const::Output_data_const): Adjust call to base class
9889 constructor and fix data size.
9890 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9891 base class constructor and fix data size.
9892 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9893 base class constructor and fix data size.
9894 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9895 class constructor and fix data size.
9896 (Output_data_group::set_final_data_size): New method definition.
9897 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9898 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9899 class constructor and fix data size.
9900 (Output_relaxed_input_section): New class definition.
9901 (Output_section::Simple_input_section): New class definition.
9902 (Output_section::get_input_sections): Adjust parameter list.
9903 (Output_section::add_input_section_for_script): Same.
9904 (Output_section::save_states, Output_section::restore_states,
9905 Output_section::do_address_and_file_offset_have_reset_values,
9906 (Output_section::Input_section::Input_section): Handle
9907 RELAXED_INPUT_SECTION_CODE. Add new overload for
9908 Output_relaxed_input_section.
9909 (Output_section::Input_section::is_input_section,
9910 Output_section::Input_section::set_output_section): Handle relaxed
9911 input section.
9912 (Output_section::Input_section::is_relaxed_input_section,
9913 Output_section::Input_section::output_section_data,
9914 Output_section::Input_section::relaxed_input_section): New method
9915 definitions.
9916 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9917 value.
9918 (Output_section::Input_section::u1_): Update comments.
9919 (Output_section::Input_section::u2_): Add new union member poris.
9920 (Output_section::Checkpoint_output_section): New classs definition.
9921 (Output_section::relax_input_section): New method declaration.
9922 (Output_section::checkpoint_): New data member.
9923 (Output_segment): Update comments.
9924 (Output_segment::Output_segment): Un-privatize copy constructor.
9925 (Output_segment::operator=): Un-privatize.
9926 * script-sections.cc (Output_section_element::Input_section_list):
9927 Change element type to Output_section::Simple_input_section.
9928 (Output_section_element_dot_assignment::set_section_addresses):
9929 Register output section data for relaxation clean up.
9930 (Output_data_exression::Output_data_expression): Adjust call to base
9931 constructor to fix data size.
9932 (Output_section_element_data::set_section_addresses): Register
9933 Output_data_expression object for relaxation clean up.
9934 (struct Input_section_info): Replace Relobj pointer and section index
9935 pair with Output_section::Simple_input_section and Convert struct to a
9936 class.
9937 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9938 Input_section_info data member to use accessors.
20e6d0d6
DK
9939 (Output_section_element_input::set_section_addresses): Use layout
9940 parameter. Adjust code to use Output_section::Simple_input_section
9941 and Input_secction_info classes. Register filler for relaxation
9942 clean up.
9943 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9944 and section index pair with Output_section::Simple_input_section
9945 class. Adjust code accordingly.
9946 (Phdrs_element::release_segment): New method definition.
9947 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9948 segment list.
9949 (Script_sections::release_segments): New method definition.
9950 * gold/script-sections.h (Script_sections::release_segments): New
9951 method declaration.
9952 * gold/target.h (Target::may_relax, Target::relax,
9953 Target::do_may_relax, Target::do_relax): New method definitions.
9954
5e445df6
ILT
99552009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9956
9957 * arm.cc (has_signed_unsigned_overflow): New function.
9958 (Arm_relocate_functions::abs8): New function.
9959 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9960 (Target_arm::Scan::global): Likewise.
9961 (Target_arm::relocate::relocate): Likewise.
9962 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9963 Likewise.
9964
8c604651 99652009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9966
9967 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9968 * testsuite/Makefile.in: Regenerate.
9969
1e9cc1c2
NC
99702009-09-11 Nick Clifton <nickc@redhat.com>
9971
9972 * po/gold.pot: Updated by the Translation project.
9973
6a89f575
CC
99742009-09-08 Cary Coutant <ccoutant@google.com>
9975
9976 * output.cc (Output_file::open): Add execute permission to empty file.
9977 * testsuite/Makefile.am (permission_test): New test.
9978 * testsuite/Makefile.in: Regenerate.
9979
fdcac5af
ILT
99802009-09-02 Ian Lance Taylor <iant@google.com>
9981
9982 * output.cc (Output_file::resize): Call map_no_anonymous rather
9983 than map.
9984
44453f85
ILT
99852009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9986
9987 * gold.cc: Include "incremental.h".
9988 (queue_initial_tasks): Call Incremental_checker methods.
9989 * incremental.cc: Include "output.h".
9990 (Incremental_checker::can_incrementally_link_output_file): New
9991 method.
9992 * incremental.h (Incremental_checker): New class.
9993
9994 * output.cc (Output_file::open_for_modification): New method.
9995 (Output_file::map_anonymous): Changed return type to bool. Record
9996 map in base_ field.
9997 (Output_file::map_no_anonymous): New method, broken out of map.
9998 (Output_file::map): Use map_no_anonymous and map_anonymous.
9999 * output.h (class Output_file): Update declarations.
10000
293c1386
CC
100012009-08-24 Cary Coutant <ccoutant@google.com>
10002
10003 * options.h (Command_line::Pre_options): New class.
10004 (Command_line::pre_options): New member.
10005 * options.cc (gold::options::ready_to_register): New variable.
10006 (One_option::register_option): Do nothing if not registering options.
10007 Assert if same short option registered twice.
10008 (General_options::General_options): Turn off option registration when
10009 done constructing.
10010 (Command_line::Pre_options::Pre_options): New constructor.
10011
f773f3d2
CC
100122009-08-24 Cary Coutant <ccoutant@google.com>
10013
06a73cfe
CC
10014 * options.h (General_options::no_keep_memory): Remove incorrect
10015 short option.
f773f3d2 10016
a15af8e2
RW
100172009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10018
10019 * Makefile.am (am__skiplex, am__skipyacc): New.
10020 * Makefile.in: Regenerate.
10021
c462b41b
RW
100222009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10023
14ec8efd
RW
10024 * Makefile.am (AM_CPPFLAGS): Renamed from ...
10025 (INCLUDES): ... this.
10026 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
10027 (AM_CPPFLAGS): Renamed from ...
10028 (INCLUDE): ... this.
10029 * Makefile.in, testsuite/Makefile.in: Regenerate.
10030
81ecdfbb
RW
10031 * Makefile.in: Regenerate.
10032 * aclocal.m4: Likewise.
10033 * config.in: Likewise.
10034 * configure: Likewise.
10035 * testsuite/Makefile.in: Likewise.
10036
c462b41b
RW
10037 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10038 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
10039 * Makefile.in: Regenerate.
10040 * testsuite/Makefile.in: Regenerate.
10041
2da73f13
CC
100422009-08-19 Cary Coutant <ccoutant@google.com>
10043
10044 * resolve.cc (Symbol_table::resolve): Don't complain about defined
10045 symbols in shared libraries overridden by hidden or internal symbols
10046 in the main program.
10047
2db70501
CD
100482009-08-19 Chris Demetriou <cgd@google.com>
10049
10050 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
10051 checking source file names in error messages.
10052
f733487b
DK
100532009-08-18 Doug Kwan <dougkwan@google.com>
10054
10055 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
10056 an elcpp::Ehdr as parameter. Adjust call to set_target.
10057 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
10058 an elfcpp::Ehdr as parameter.
10059 * object.cc (Object::set_target): Remove the version that looks up
10060 a target and sets it.
10061 (Sized_relobj::setup): Take a Target object instead of
10062 an elfcpp::Ehdr as parameter. Adjust call to set_target.
10063 (make_elf_sized_object): Find target and ask target to
10064 make an ELF object.
10065 * object.h: (Object::set_target): Remove the version that looks up
10066 a target and sets it.
10067 (Sized_relobj::setup): Take a Target object instead of
10068 an elfcpp:Ehdr as parameter.
10069 * target.cc: Include dynobj.h.
10070 (Target::do_make_elf_object_implementation): New.
2e702c99 10071 (Target::do_make_elf_object): New.
f733487b
DK
10072 * target.h (Target::make_elf_object): New template declaration.
10073 (Target::do_make_elf_object): New method declarations.
10074 (Target::do_make_elf_object_implementation): New template declaration.
10075
cc70f101
ILT
100762009-08-14 Ian Lance Taylor <iant@google.com>
10077
10078 * gold.h (FUNCTION_NAME): Define.
10079 (gold_unreachable): Use FUNCTION_NAME.
10080
ef5e0cb1
ST
100812009-08-12 Sriraman Tallam <tmsriram@google.com>
10082
10083 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10084 symbol in the --keep-unique list is not found.
10085
48c187ce
ST
100862009-08-12 Sriraman Tallam <tmsriram@google.com>
10087
10088 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10089 been maked as --keep-unique.
10090 (Icf::unfold_section): New function.
10091 * icf.h (Icf::unfold_section): New function.
10092 * options.h (General_options::keep_unique): New option.
10093 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10094 * testsuite/Makefile.in: Regenerate.
10095 * testsuite/icf_keep_unique_test.sh: New file.
10096 * testsuite/icf_keep_unique_test.cc: New file.
10097
645afe0c
CC
100982009-08-12 Cary Coutant <ccoutant@google.com>
10099
10100 PR 10471
10101 * resolve.cc (Symbol_table::resolve): Check for references from
10102 dynamic objects to hidden and internal symbols.
10103 * testsuite/Makefile.am (hidden_test.sh): New test.
10104 * testsuite/Makefile.in: Regenerate.
10105 * testsuite/hidden_test.sh: New script.
10106 * testsuite/hidden_test_1.c: New test source.
10107 * testsuite/hidden_test_main.c: New test source.
10108
11af873f
DK
101092009-08-11 Doug Kwan <dougkwan@google.com>
10110
10111 * arm.cc: Update comments.
10112 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10113 segment to locate the .ARM.exidx section if present.
10114
b9f7d72d
DK
101152009-08-09 Doug Kwan <dougkwan@google.com>
10116
10117 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10118 patch.
10119
ddd3c53c
ST
101202009-08-07 Sriraman Tallam <tmsriram@google.com>
10121 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10122 compiler warnings.
10123
27721062
ST
101242009-08-06 Sriraman Tallam <tmsriram@google.com>
10125
10126 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10127 valid tls_segment only for non-debug-section relocations.
10128 * testsuite/Makefile.am: Add gc_tls_test.
10129 * testsuite/Makefile.in: Regenerate.
10130 * testsuite/gc_tls_test.cc: New file.
10131 * testsuite/gc_tls_test.sh: New file.
10132
ef15dade 101332009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10134
ef15dade
ST
10135 * icf.cc: New file.
10136 * icf.h: New file.
10137 * Makefile.am (CCFILES): Add icf.cc.
10138 (HFILES): Add icf.h
10139 * Makefile.in: Regenerate.
10140 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10141 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10142 section, symbol and addend information for the relocs.
10143 * gold.cc (queue_middle_tasks): Call identical code folding.
10144 * gold.h: Add defines for multimap.
10145 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10146 to the call of finalize_local_symbols.
10147 * main.cc (main): Create object of class Icf.
10148 * object.cc (Sized_relobj::do_layout): Allow this function to be
10149 called twice during icf.
10150 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10151 to sections marked as identical by icf.
10152 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10153 when available.
10154 (Sized_relobj::do_section_entsize): New function.
10155 * object.h (Object::section_entsize): New function.
10156 (Object::do_section_entsize): New pure virtual function.
10157 (Relobj::finalize_local_symbols): Add new parameter.
10158 (Relobj::do_section_entsize): New function.
10159 * options.h (General_options::icf): New option.
10160 (General_options::icf_iterations): New option.
10161 (General_options::print_icf_sections): New option.
10162 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10163 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10164 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10165 icf.
10166 * symtab.cc (Symbol_table::is_section_folded): New function.
10167 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10168 to sections marked as identical by icf.
10169 * symtab.h (Symbol_table::set_icf): New function.
10170 (Symbol_table::icf): New function.
10171 (Symbol_table::is_section_folded): New function.
10172 (Symbol_table::icf_): New data member.
10173 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10174 * testsuite/Makefile.am: Add commands to build icf_test.
10175 * testsuite/Makefile.in: Regenerate.
10176 * testsuite/icf_test.sh: New file.
10177 * testsuite/icf_test.cc: New file.
10178
c3b65ac4
CD
101792009-07-24 Chris Demetriou <cgd@google.com>
10180
10181 * layout.cc (is_compressible_debug_section): Fix incorrect
10182 comment about compressed section names.
10183
1caf2c51
ILT
101842009-07-20 Ian Lance Taylor <ian@airs.com>
10185
10186 PR 10419
10187 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10188
1ef4d87f
ILT
101892009-07-16 Ian Lance Taylor <iant@google.com>
10190
10191 PR 10400
10192 * layout.h: #include <map>.
10193 (class Kept_section): Change from struct to class. Add accessors
10194 and setters. Add section size to Comdat_group mapping. Change
10195 Comdat_group to std::map. Add is_comdat_ field. Add
10196 linkonce_size field in union.
10197 (class Layout): Update declaration of find_or_add_kept_section.
10198 Don't declare find_kept_object.
10199 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10200 parameter. Add object, shndx, is_comdat, and is_group_name
10201 parameters. Change all callers. Adjust for new Kept_section.
10202 (Layout::find_kept_object): Remove.
10203 * object.cc (Sized_relobj::include_section_group): Update use of
10204 Kept_section. Rename secnum to shndx. Only record
10205 Kept_comdat_section if sections are the same size.
10206 (Sized_relobj::include_linkonce_section): Update use of
10207 Kept_section. Only record Kept_comdat_section if sections are the
10208 same size. Set size of linkonce section.
10209 (Sized_relobj::map_to_kept_section): Update call to
10210 get_kept_comdat_section.
10211 * object.h (class Sized_relobj): Rename fields in
10212 Kept_comdat_section to drop trailing underscores; change object
10213 field to Relobj*. Change Kept_comdat_section_table to store
10214 struct rather than pointer.
10215 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10216 Add kept_object and kept_shndx parameters. Change all callers.
10217 (Sized_relobj::get_kept_comdat_section): Change return type to
10218 bool. Add kept_object and kept_shndx parameters. Change all
10219 callers.
10220 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10221 Layout::find_or_add_kept_section.
10222
37c3b7b0
ILT
102232009-07-09 Ian Lance Taylor <iant@google.com>
10224
10225 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10226 Reserve space in the hash table.
10227
98fa85cb
ILT
102282009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10229
10230 * fileread.cc (File_read::get_mtime): New method.
10231 * fileread.h (Timespec): New structure.
10232 (File_read::get_mtime): New method.
10233 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10234 Renamed from timestamp_nsec.
10235 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10236 Elf_Xword.
e1df38aa 10237 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10238 timestamp_nsec.
e1df38aa 10239 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10240 (Incremental_inputs::report_obejct): Save mtime; style fix.
10241 (Incremental_inputs::report_script): Save mtime; style fix.
10242 (Incremental_inputs::finalize_inputs): Style fix.
10243 (Incremental_inputs::finalize): Style fix.
10244 (Incremental_inputs::create_input_section_data): Store inputs
10245 mtime.
10246 * incremental.h (Incremental_inputs::report_script): Add mtime
10247 argument.
10248 (Incremental_inputs::Input_info::Input_info): Intialize only one
10249 union member.
10250 (Incremental_inputs::Input_info::archive): Move to nameless
10251 union.
10252 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10253 (Incremental_inputs::Input_info::script): Move to nameless union.
10254 (Incremental_inputs::mtime): New field.
10255 * script.cc (read_input_script): Pass file mtime to
10256 Incremental_input.
10257 * script.h (Script_info::inputs): Style fix.
10258
c9d70757
ILT
102592009-07-01 Ian Lance Taylor <ian@airs.com>
10260
10261 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10262 instead of 32.
10263
9c547ec3
ILT
102642009-06-24 Ian Lance Taylor <iant@google.com>
10265
10266 PR 10156
10267 * layout.cc (Layout::choose_output_section): If we find an
10268 existing section, update the flags.
10269 (Layout::create_notes): New function, broken out of
10270 Layout::finalize.
10271 (Layout::finalize): Don't create note sections.
10272 (Layout::create_note): Don't crash if linker script discards
10273 section.
10274 (Layout::create_gold_note): Likewise.
10275 (Layout::create_build_id): Likewise. Don't set
10276 after_input_sections on the section.
10277 (Layout::create_executable_stack_info): Remove target parameter.
10278 Change caller.
10279 * layout.h (class Layout): Declare create_notes. Update
10280 declaration of create_executable_stack_info.
10281 * gold.cc (queue_middle_tasks): Call create_notes.
10282 * output.cc (Output_section::update_flags_for_input_section): Move
10283 here from output.h. If SHF_ALLOC flag is newly set, mark address
10284 invalid.
10285 * output.h (Output_data::mark_address_invalid): New function.
10286 (class Output_section): Only declare, not define,
10287 update_flags_for_input_section. Remove set_flags.
10288
55458500
ILT
102892009-06-24 Ian Lance Taylor <iant@google.com>
10290
10291 * script-sections.cc (Output_section_definition::
10292 set_section_addresses): Rename shadowing local load_address to
10293 laddr.
10294
1307d6cd
ILT
102952009-06-24 Ian Lance Taylor <iant@google.com>
10296
10297 PR 10244
10298 * reloc.cc (relocate_sections): Skip empty relocation sections.
10299
ec3f783e
ILT
103002009-06-23 Ian Lance Taylor <iant@google.com>
10301
10302 PR 10156
10303 * layout.cc (Layout::create_note): Use choose_output_section
10304 rather than make_output_section.
10305
459c9f1c
ILT
103062009-06-23 Ian Lance Taylor <iant@google.com>
10307
10308 PR 10237
10309 * options.cc (General_options::parse_V): Set printed_version_.
10310 (General_options::General_options): Initialize printed_version_.
10311 * options.h (class General_options): Add printed_version_ field.
10312 * gold.cc (queue_initial_tasks): If there are no input files,
10313 don't give a fatal error if we printed the version information.
10314 (queue_middle_tasks): If using -r with a shared object, give a
10315 fatal error rather than an ordinary error.
10316
1518dc8f
ILT
103172009-06-23 Ian Lance Taylor <iant@google.com>
10318
10319 PR 10219
10320 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10321 (Layout::make_output_section): Set have_stabstr_section_ if we see
10322 a .stab*str section.
10323 (Layout::finalize): Call link_stabs_sections.
10324 (Layout::link_stabs_sections): New file.
10325 * layout.h (class Layout): Add have_stabstr_section_ field.
10326 Declare link_stabs_sections.
10327
3d857b98
DK
103282009-06-23 Doug Kwan <dougkwan@google.com>
10329
10330 * Makefile.am (libgold_a_LIBADD): New.
10331 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10332 * Makefile.in: Regenerate.
3d857b98
DK
10333 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10334 * configure: Regenerate.
10335 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10336 * fileread.cc: Include sys/state.h
10337 * gold.h: Declare memmem and strndup if found missing.
10338 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10339
0639a6f6
ILT
103402009-06-23 Ian Lance Taylor <iant@google.com>
10341
10342 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10343 * configure: Rebuild.
10344
8d63875c
ILT
103452009-06-23 Ian Lance Taylor <iant@google.com>
10346
10347 PR 10147
10348 * object.cc (Object::section_contents): Don't try to get a view if
10349 the section has length zero.
10350 (Object::handle_gnu_warning_section): If the section is empty, use
10351 the name of the section as the warning.
10352
f7c8a183
ILT
103532009-06-23 Ian Lance Taylor <iant@google.com>
10354
10355 PR 10133
10356 * stringpool.h (class Stringpool_template): Add optimize_ field.
10357 (Stringpool_template::set_optimize): New function.
10358 * stringpool.cc (Stringpool_template::Stringpool_template):
10359 Initialize optimize_ field.
10360 (Stringpool_template::set_string_offsets): Test local optimize
10361 fild rather than parameter.
10362 * layout.cc (Layout::Layout): Call set_optimize on the section
10363 name stringpool.
10364
e6a307ba
ILT
103652009-06-22 Ian Lance Taylor <iant@google.com>
10366
10367 PR 10030
10368 * yyscript.y: Parse TARGET.
10369 * script.cc (script_set_target): New function.
10370 * script-c.h (script_set_target): Declare.
10371 * options.cc (General_options::string_to_object_format): Rename
10372 from string_to_object_format in anonymous namespace. Change
10373 callers.
10374 * options.h (class General_options): Declare
10375 string_to_object_format.
10376
3ee173de
ILT
103772009-06-22 Ian Lance Taylor <iant@google.com>
10378
10379 * script-sections.cc (Script_sections::create_segments): Don't put
10380 program headers in a PT_LOAD segment if -n or -N.
10381
103822009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10383
10384 PR 10141
10385 * options.h (class General_options): Add -z lazy and -z now. Sort
10386 -z options into alphabetical order.
10387 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10388
cd6739a1 103892009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10390
10391 * layout.cc (Layout::make_output_section): Call
10392 Target::new_output_section.
10393 (Layout::attach_allocated_section_to_segment): Put large section
10394 sections in a separate load segment with the large segment flag
10395 set.
10396 (Layout::segment_precedes): Sort large data segments after other
10397 load segments.
10398 (align_file_offset): New static function.
10399 (Layout::set_segment_offsets): Use align_file_offset.
10400 * output.h (class Output_section): Add is_small_section_ and
10401 is_large_section_ fields.
10402 (Output_section::is_small_section): New function.
10403 (Output_section::set_is_small_section): New function.
10404 (Output_section::is_large_section): New function.
10405 (Output_section::set_is_large_section): New function.
10406 (Output_section::is_large_data_section): New function.
10407 (class Output_segment): Add is_large_data_segment_ field.
10408 (Output_segment::is_large_data_segment): New function.
10409 (Output_segment::set_is_large_data_segment): New function.
10410 * output.cc (Output_section::Output_section): Initialize new
10411 fields.
10412 (Output_segment::Output_segment): Likewise.
10413 (Output_segment::add_output_section): Add assertion that large
10414 data sections always go in large data segments. Force small data
10415 sections to the end of the list of data sections. Force small BSS
10416 sections to the start of the list of BSS sections. For large BSS
10417 sections to the end of the list of BSS sections.
10418 * symtab.h (class Symbol): Declare is_common_shndx.
10419 (Symbol::is_defined): Check Symbol::is_common_shndx.
10420 (Symbol::is_common): Likewise.
10421 (class Symbol_table): Define enum Commons_section_type. Update
10422 declarations. Add small_commons_ and large_commons_ fields.
10423 * symtab.cc (Symbol::is_common_shndx): New function.
10424 (Symbol_table::Symbol_table): Initialize new fields.
10425 (Symbol_table::add_from_object): Put small and large common
10426 symbols in the right list.
10427 (Symbol_table::sized_finalized_symbol): Check
10428 Symbol::is_common_shndx.
10429 (Symbol_table::sized_write_globals): Likewise.
10430 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10431 common symbol lists. Don't call do_allocate_commons_list if the
10432 list is empty.
10433 (Symbol_table::do_allocate_commons_list): Remove is_tls
10434 parameter. Add comons_section_type parameter. Change all
10435 callers. Handle small and large common symbols.
10436 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10437 Symbol::is_common_shndx.
10438 * resolve.cc (symbol_to_bits): Likewise.
10439 * target.h (Target::small_common_shndx): New function.
10440 (Target::small_common_section_flags): New function.
10441 (Target::large_common_shndx): New function.
10442 (Target::large_common_section_flags): New function.
10443 (Target::new_output_section): New function.
10444 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10445 small_common_section_flags, and large_common_section_flags
10446 fields.
10447 (Target::do_new_output_section): New virtual function.
10448 * arm.cc (Target_arm::arm_info): Initialize new fields.
10449 * i386.cc (Target_i386::i386_info): Likewise.
10450 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10451 Likewise.
10452 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10453 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10454 (Target_x86_64::do_new_output_section): New function.
10455 * configure.ac: Define conditional MCMODEL_MEDIUM.
10456 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10457 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10458 (large_LDFLAGS): Define.
10459 * testsuite/large.c: New file.
10460 * testsuite/testfile.cc (Target_test::test_target_info):
10461 Initialize new fields.
10462 * configure, testsuite/Makefile.in: Rebuild.
10463
bb04269c
DK
104642009-06-05 Doug Kwan <dougkwan@google.com>
10465
10466 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10467 * Makefile.in: Regenerate.
bb04269c
DK
10468 * i386.cc (class Target_i386): Define new virtual method to
10469 override do_is_local_label_name in parent.
10470 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10471 local symbols if --discard-locals or -X is given.
10472 * options.h (class General_options): Declare new options
10473 '--discard-locals' and '-X' for discarding locals.
10474 * target.h (class Target): Define new methods is_local_label_name.
10475 Declare new virtual method do_is_local_label_name.
10476 * target.cc: New file.
10477 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10478 (check_SCRIPTS): Add discard_locals_test.sh.
10479 (check_DATA): Add discard_local_tests.syms.
10480 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10481 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10482 * testsuite/Makefile.in: Regenerate.
10483 * testsuite/discard_locals_test.c: New file.
10484 * testsuite/discard_locals_test.sh: Same.
10485
805bb01c
DK
104862009-06-05 Doug Kwan <dougkwan@google.com>
10487
10488 * object.cc (Sized_relobj::Sized_relobj): Initialize
10489 discarded_eh_frame_shndx_ to -1U.
10490 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10491 section.
10492 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10493 a discarded .eh_frame section.
10494 (Sized_relobj::do_finalize_local_symbols): Ditto.
10495 * object.h (class Sized_relobj): Declare new member
10496 discarded_eh_frame_shndx_.
10497 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10498 (local_labels_test.o, local_labels_test): New rules.
10499 * testsuite/Makefile.in: Regenerate.
10500
1dcd334d
DK
105012009-06-04 Doug Kwan <dougkwan@google.com>
10502
10503 * layout.cc (Layout::section_name_mapping): Add mapping for
10504 special ARM sections.
10505
96d49306
DK
105062009-06-03 Doug Kwan <dougkwan@google.com>
10507
10508 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10509 (utils::has_overflow): Same.
10510
dff16297
ILT
105112009-06-03 Ian Lance Taylor <iant@google.com>
10512
10513 * layout.cc (Layout::section_name_mapping): New array, replacing
10514 Layout::linkonce_mapping.
10515 (Layout::section_name_mapping_count): New variable, replacing
10516 Layout::linkonce_mapping_count.
10517 (Layout::linkonce_output_name): Remove.
10518 (Layout::output_section_name): Rewrite.
10519 * layout.h (class Layout): Rename Linkonce_mapping to
10520 Section_name_mapping, linkonce_mapping to section_name_mapping,
10521 linkonce_mapping_count to section_name_mapping_count. Don't
10522 declare linkonce_output_name.
10523
c121c671
DK
105242009-06-03 Doug Kwan <dougkwan@google.com>
10525
10526 * gold/arm.cc (namespace utils): New.
10527 (Target_arm::reloc_is_non_pic): Define new method.
10528 (class Arm_relocate_functions): New.
10529 (Target_arm::Relocate::relocate): Handle relocation types used by
10530 Android.
10531
07800fab
ILT
105322009-06-03 Ian Lance Taylor <iant@google.com>
10533
10534 * arm.cc (Target_arm::scan::global): Use || instead of |.
10535
c121c671
DK
105362009-06-02 Doug Kwan <dougkwan@google.com>
10537
10538 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10539 issued_non_pic_error_.
10540 (class Target_arm::Scan): Declare new method check_non_pic.
10541 Define new method symbol_needs_plt_entry.
10542 Declare new data member issued_non_pic_error_.
10543 (class Target_arm::Relocate): Declare new method
10544 should_apply_static_reloc.
10545 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10546 (Target_arm::Scan::check_non_pic): Define new method.
10547 (Target_arm::Scan::local): Handle a small subset of reloc types used
10548 by Android.
10549 (Target_arm::Scan::local): Same.
10550 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10551
b19b0c6d
ILT
105522009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10553
10554 * incremental.cc (Incremental_inputs::report_command_line): Filter
10555 out --incremental-* options.
10556
94cdfcff
DK
105572009-05-29 Doug Kwan <dougkwan@google.com>
10558
10559 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10560 template class.
10561 (class Target_arm): Update comment.
10562 (Target_arm::Target_arm): Initialize new data members GOT_,
10563 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10564 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10565 and Target_arm::rel_dyn_section.
10566 Declare new_enum Target_arm::Got_type.
10567 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10568 and DYNBSS_.
10569 Update commments for member do_dynsym_value.
10570 (Target_arm::got_size, Target_arm::plt_section,
10571 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10572 new methods inside class defintion.
10573 (Target_arm::got_section): Define new method.
10574 (Target_arm::rel_dyn_section): Same.
10575 (Output_data_plt_arm): New template class.
10576 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10577 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10578 (Output_data_plt_arm::add_entry): Same.
10579 (Output_data_plt_arm::first_plt_entry): Define new
10580 static data member for PLT instruction template.
10581 (Output_data_plt_arm::plt_entry): Same.
10582 (Output_data_plt_arm::do_write): Define new method.
10583 (Target_arm::make_plt_entry): Same.
10584 (Target_arm::do_finalize_sections): Same.
10585 (Target_arm::do_dynsym_value): Same.
10586
4a657b0d
DK
105872009-05-28 Doug Kwan <dougkwan@google.com>
10588
10589 * Makefile.am (TARGETSOURCES): Add arm.cc.
10590 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10591 * Makefile.in: Regenerate.
10592 * arm.cc: New file.
10593 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10594
e7ae8c36
DK
105952009-05-26 Doug Kwan <dougkwan@google.com>
10596
10597 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10598 (General_options::check_excluded_libs): Strip off directories in
10599 archive name before matching like GNU ld does.
10600 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10601 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10602 (exclude_libs_test_LDFLAGS): Add linker option
10603 -Wl,--exclude-libs,libexclude_libs_test_3
10604 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10605 an explicit archive without using -l.
10606 (alt/libexclude_libs_test_3.a): New make rule.
10607 * testsuite/Makefile.in: Regenerate.
10608 * testsuite/exclude_libs_test.c : Declare lib3_default().
10609 (main): Call it.
10610 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10611 * exclude_libs_test_3.c: New file.
10612
f12e7348
NC
106132009-05-26 Nick Clifton <nickc@redhat.com>
10614
10615 * po/id.po: New Indonesian translation.
10616 * po/gold.pot: Updated template file.
10617
4daadc0d
ST
106182009-05-22 Sriraman Tallam <tmsriram@google.com>
10619
e1df38aa 10620 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10621 gc_comdat_test files. Add -Wl,--gc-sections to build
10622 gc_comdat_test.
10623 * testsuite/Makefile.in: Regenerate.
10624 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10625
531813ad
ST
106262009-05-21 Sriraman Tallam <tmsriram@google.com>
10627
10628 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10629 kept comdat section was garbage collected.
10630 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10631 * testsuite/Makefile.in: Regenerate.
10632 * testsuite/gc_comdat_test.sh: New file.
10633 * testsuite/gc_comdat_test_1.cc: New file.
10634 * testsuite/gc_comdat_test_2.cc: New file.
10635
65514900
CC
106362009-05-19 Doug Kwan <dougkwan@google.com>
10637
10638 * archive.cc (Archive::Archive): Move constructor from archive.h
10639 to here. Initialize no_export_.
10640 (Archive::get_elf_object_for_member): Set no_export flag of object.
10641 * archive.h (Archive::Archive): Move constructor body to
10642 archive.cc.
10643 (Archive::no_export): New method.
10644 (Archive::no_export_): New field.
10645 * object.h (Object::Object): Initialize no_export_ to false.
10646 (Object::no_export, Object::set_no_export): New methods.
10647 (Object::no_export_): New field.
10648 * options.cc (General_options::parse_exclude_libs): New method.
10649 (General_options::check_excluded_libs) Same.
10650 * options.h (exclude_libs): New option.
10651 (General_options::check_excluded_libs): New method declaration.
10652 (General_options::excluded_libs_): New field.
10653 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10654 default or protected visibility if an object has no-export flag set.
10655 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10656 (check_SCRIPTS): Add exclude_libs_test.sh.
10657 (check_DATA): Add exclude_libs_test.syms.
10658 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10659 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10660 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10661 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10662 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10663 libexclude_libs_test_2.a): New rules.
10664 * testsuite/Makefile.in: Regenerate.
10665 * testsuite/exclude_libs_test.c: New file.
10666 * testsuite/exclude_libs_test.sh: Ditto.
10667 * testsuite/exclude_libs_test_1.c: Ditto.
10668 * testsuite/exclude_libs_test_2.c: Ditto.
10669
1b77ea50
ILT
106702009-05-15 Ian Lance Taylor <iant@google.com>
10671
10672 * configure.ac: Check for declarations for cases where libiberty.h
10673 checks HAVE_DECL_xxx.
10674 * configure, config.in: Rebuild.
10675
072fe7ce
ILT
106762009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10677
10678 * gold.h (Incremental_argument_list): Remove (invalid) forward
10679 declaration.
10680 * incremental.cc (Incremental_inputs::report_achive): New method.
10681 (Incremental_inputs::report_object): New method.
10682 (Incremental_inputs::report_script): New method.
10683 (Incremental_inputs::finalize_inputs): New method.
10684 (Incremental_inputs::finalize): Call finalize_inputs().
10685 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10686 Create inputs entries.
10687 * incremental.h (Incremental_input_type): New enum.
10688 (Incremental_inputs::Incremental_input): Initialize new fields.
10689 (Incremental_inputs::report_inputs): New method.
10690 (Incremental_inputs::report_achive): New method.
10691 (Incremental_inputs::report_object): New method.
10692 (Incremental_inputs::report_script): New method.
10693 (Incremental_inputs::finalize_inputs): New method.
10694 (Incremental_inputs::Input_info): New struct.
10695 (Incremental_inputs::Input_info_map): New typedef.
10696 (Incremental_inputs::lock_): New field.
10697 (Incremental_inputs::Inputs_): New field.
10698 (Incremental_inputs::Inputs_map): New field.
10699 * main.cc (main): Call Incremental_input::report_inputs.
10700 * options.h (Input_argument_list): Typedef moved from
10701 Input_arguments.
10702 (Input_file_group::Files): Remove, use ::Input_argument_list.
10703 (Input_file_group::Input_argument_list): Remove, use
10704 ::Input_argument_list.
10705 * plugin.cc (Plugin_manager::add_input_file): Add error in
10706 incremental build.
10707 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10708 functions.
10709 * script.cc (read_input_script): Call
10710 Incremental_input::report_script.
10711 * script.h (Script_info): New class.
10712
b0481b0b
ILT
107132009-04-27 Ian Lance Taylor <iant@google.com>
10714
10715 * x86_64.cc (do_adjust_output_section): Set entsize to
10716 plt_entry_size.
10717
b22a5a41 107182009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10719
10720 * output.cc (Output_file::close): After short writes, continue
10721 writing from the correct offset in the buffer being written.
10722
40fde488
CD
107232009-04-23 Chris Demetriou <cgd@google.com>
10724
10725 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10726 * configure: Regenerate.
10727 * config.in: Regenerate.
10728 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10729 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10730
3ce2c28e
ILT
107312009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10732
10733 * incremental.cc (Incremental_inputs_header_data): Renamed from
10734 Incremental_input_header_data.
10735 (Incremental_inputs_header_data::data_size): New field.
10736 (Incremental_inputs_header_data::put_input_file_count): Renamed
10737 from input_file_count.
10738 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10739 from command_line_offset.
10740 (Incremental_inputs_header_data::put_reserved): Renamed from
10741 put_reserved.
10742 (Incremental_inputs_entry_data): Renamed from
10743 Incremental_input_entry_data.
10744 (Incremental_inputs_entry_data::data_size): New field.
10745 (Incremental_inputs::report_command_line): New method.
10746 (Incremental_inputs::finalize): New method.
10747 (Incremental_inputs::create_incremental_inputs_data): New method.
10748 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10749 * incremental.h: New file.
10750 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10751 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10752 incremental builds.
703d02da 10753 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10754 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10755 (Layout::create_incremental_info_sections): New method.
10756 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10757 * main.cc (main): Notify Incremental_input of the command line.
10758
e55bde5e
ILT
107592009-04-01 Ian Lance Taylor <iant@google.com>
10760 Mikolaj Zalewski <mikolajz@google.com>
10761
10762 * gold.h (reserve_unordered_map): Define, three versions, one for
10763 each version of Unordered_map.
10764 * layout.cc (Layout::Layout): Remove options parameter. Add
10765 number_of_input_files parameter. Don't initialize options_.
10766 Initialize number_of_input_files_ and resized_signatures_. Move
10767 sections_are_attached_.
10768 (Layout::layout_group): Reserve space for group_signatures_.
10769 (Layout::find_or_add_kept_section): Change name parameter to be a
10770 reference. Resize signatures_ map when it gets large enough.
10771 (Layout::layout_eh_frame): Use parameters->options() instead of
10772 this->options_.
10773 (Layout::make_output_section): Likewise.
10774 (Layout::attach_allocated_section_to_segment): Likewise.
10775 (Layout::finalize, Layout::create_executable_stack): Likewise.
10776 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10777 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10778 * layout.h (class Layout): Update declarations. Remove options_
10779 field. Add number_of_input_files_ and resized_signatures_
10780 fields. Move sections_are_attached_ field.
10781 * main.cc (main): Pass number of input files to Layout
10782 constructor. Don't pass options.
10783
154b857c
ILT
107842009-03-30 Ian Lance Taylor <iant@google.com>
10785
10786 * ffsll.c (ffsll): Correct implementation.
10787
2f35ab9b
ILT
107882009-03-27 Ian Lance Taylor <iant@google.com>
10789
fd03461a
ILT
10790 * ffsll.c: New file.
10791 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10792 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10793 * ftruncate.c (ftruncate): Declare before definition.
10794 * mremap.c (mremap): Likewise.
10795 * pread.c (pread): Likewise.
10796 * configure, Makefile.in, config.in: Rebuild.
10797
2f35ab9b
ILT
10798 * mremap.c: New file.
10799 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10800 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10801 (mremap): Declare if HAVE_MREMAP is not defined.
10802 * configure, Makefile.in, config.in: Rebuild.
10803
33aea2fd
CC
108042009-03-27 Cary Coutant <ccoutant@google.com>
10805
10806 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10807 position independent.
10808 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10809 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10810
6d479619
CC
108112009-03-24 Cary Coutant <ccoutant@google.com>
10812
10813 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10814 an executable.
10815 (needs_dynamic_reloc): Likewise.
10816
afc06bb8
ILT
108172009-03-24 Ian Lance Taylor <iant@google.com>
10818
10819 * yyscript.y (file_cmd): Recognize EXTERN.
10820 (extern_name_list, extern_name_list_body): New nonterminals.
10821 * script.cc (script_add_extern): Define.
10822 * script-c.h (script_add_extern): Declare.
10823
f6060a4d
ILT
108242009-03-24 Rafael Avila de Espindola <espindola@google.com>
10825
10826 * object.cc (is_elf_object): Define.
10827 * object.h (is_elf_object): Declare.
10828 * archive.cc (Archive::get_elf_object_for_member): Call
10829 is_elf_object.
33aea2fd 10830 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10831
26736d8e
ILT
108322009-03-24 Elliott Hughes <enh@google.com>
10833
10834 * output.cc (Output_file::map_anonymous): Define.
10835 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10836 try an anonymous one. Report the size if the mmap fails.
10837 * output.h (class Output_file): Declare map_anonymous.
10838
22fd9730
ILT
108392009-03-24 Ian Lance Taylor <iant@google.com>
10840
10841 * target-select.cc (instantiate_target): Don't acquire the lock if
10842 the instantiated_target_ field has already been set.
10843
cb010894
ILT
108442009-03-23 Ian Lance Taylor <iant@google.com>
10845
7f055c20
ILT
10846 * gold-threads.h (class Initialize_lock): Define.
10847 * gold-threads.cc (class Initialize_lock_once): Define.
10848 (initialize_lock_control): New static variable.
10849 (initialize_lock_pointer): New static variable.
10850 (initialize_lock_once): New static function.
10851 (Initialize_lock::Initialize_lock): Define.
10852 (Initialize_lock::initialize): Define.
10853 * target-select.h: Include "gold-threads.h".
10854 (class Target_selector): Add lock_ and initialize_lock_ fields.
10855 Don't define instantiate_target, just declare it.
10856 * target-select.cc (Target_selector::Target_selector): Initialize
10857 new fields.
10858 (Target_selector::instantiate_target): Define.
10859 * descriptors.h: Include "gold-threads.h".
10860 (class Descriptors): Add initialize_lock_ field.
10861 * descriptors.cc (Descriptors::Descriptors): Initialize new
10862 field.
10863 (Descriptors::open): Use initialize_lock_ field
10864 * errors.h (class Errors): Add initialize_lock_ field.
10865 * errors.cc (Errors::Errors): Initialize new field.
10866 (Errors::initialize_lock): Use initialize_lock_ field.
10867 * powerpc.cc (class Target_selector_powerpc): Remove
10868 instantiated_target_ field. In do_recognize call
10869 instantiate_target rather than do_instantiate_target. In
10870 do_instantiate_target just allocate a new target.
10871 * sparc.cc (class Target_selector_sparc): Likewise.
10872
36959681
ILT
10873 * freebsd.h: New file.
10874 * i386.cc: Include "freebsd.h".
10875 (Target_i386): Derive from Target_freebsd rather than
10876 Sized_target.
10877 (Target_selector_i386): Derive from Target_selector_freebsd rather
10878 than Target_selector.
10879 * x86_64.cc: Include "freebsd.h".
10880 (Target_x86_64): Derive from Target_freebsd rather than
10881 Sized_target.
10882 (Target_selector_x86_64): Derive from Target_selector_freebsd
10883 rather than Target_selector.
10884 * target.h (class Target): Add adjust_elf_header and
10885 do_adjust_elf_header.
10886 * output.cc (Output_file_header:: do_sized_write): Call target
10887 adjust_elf_header routine.
10888 * configure.tgt: Set targ_osabi.
10889 * configure.ac: Define GOLD_DEFAULT_OSABI.
10890 * parameters.cc (Parameters::default_target): Pass
10891 GOLD_DEFAULT_OSABI to select_target.
10892 * target-select.h (class Target_selector): Make instantiate_target
10893 protected rather than private.
10894 * Makefile.am (HFILES): Add freebsd.h.
10895 * configure, Makefile.in, config.in: Rebuild.
10896
cb010894
ILT
10897 * merge.cc (do_add_input_section): Correct pend value. Change
10898 message about last entry not being null terminated from error to
10899 warning.
10900
0e879927
ILT
109012009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10902
10903 * incremental.cc: New file.
10904 * Makefile.am (CCFILES): Add incremental.cc.
10905 * Makefile.in: Rebuild.
10906
41105937
PP
109072009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10908
10909 * layout.cc (Layout::output_section_name): Preserve names
10910 of '.note.' sections.
e1df38aa 10911
60439920
ILT
109122009-03-19 Ian Lance Taylor <iant@google.com>
10913
10914 * descriptors.cc (Descriptors::open): Check that the options are
10915 valid before using them.
10916
0d371ad3
ILT
109172009-03-18 Ian Lance Taylor <iant@google.com>
10918
10919 * script-sections.h: Include <list>.
10920 (class Script_sections): Change Sections_elements from std::vector
10921 to std::list. Typedef public Elements_iterator. Add
10922 orphan_section_placement_, data_segment_align_start_, and
10923 saw_data_segment_align_ fields. Remove data_segment_align_index_
10924 field.
10925 * script-sections.cc (class Orphan_section_placement): New class.
10926 (class Sections_element): Add virtual functions is_relro and
10927 orphan_section_init. Remove virtual function place_orphan_here.
10928 (class Output_section_definition): Add is_relro and
10929 orphan_section_init. Remove place_orphan_here.
10930 (class Orphan_output_section): Likewise.
10931 (Script_sections::Script_sections): Update for field changes.
10932 (Script_sections::data_segment_align): Set saw_data_segment_align_
10933 and data_segment_align_start_, not data_segment_align_index.
10934 (Script_sections::data_segment_relro_end): Check
10935 saw_data_segment_align_. Use data_segment_align_start_ rather
10936 than data_segment_align_index_.
10937 (Script_sections::place_orphan): Rewrite to use
10938 Orphan_section_placement.
10939
9201d894
ILT
109402009-03-17 Ian Lance Taylor <iant@google.com>
10941
9c5b8369
ILT
10942 * archive.cc (Archive::add_symbols): Check for a version attached
10943 to the symbol name in the archive map.
10944 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10945 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10946 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10947 (ver_test_11.a): New target.
10948 * testsuite/Makefile.in: Rebuild.
10949
9201d894
ILT
10950 * configure.ac: Check for chsize and posix_fallocate. Replace
10951 ftruncate.
10952 * ftruncate.c: New file, from gnulib.
10953 * output.cc (posix_fallocate): Define dummy version if not
10954 HAVE_POSIX_FALLOCATE.
10955 (Output_file::map): Call posix_fallocate rather than lseek and
10956 write.
10957 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10958 * configure, Makefile.in, config.in: Rebuild.
10959
ef4ab7a8 109602009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10961
ef4ab7a8
PP
10962 * layout.h (Layout::create_note): Add section_name parameter.
10963 * layout.cc (Layout::create_note): Likewise.
10964 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10965
8c500701
ILT
109662009-03-17 Ian Lance Taylor <iant@google.com>
10967
e85b18e1
ILT
10968 * descriptors.cc: Include "options.h".
10969 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10970 (Descriptors::open): Always use O_CLOEXEC when opening a new
10971 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10972 then set FD_CLOEXEC.
10973
9efe6174
ILT
10974 * sparc.cc (class Target_sparc): Add has_got_section.
10975 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10976 make sure we have a GOT section.
10977
10978 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10979 (Target_sparc::Scan::local): Likewise.
10980 (Target_sparc::Scan::global): Likewise.
10981 (Target_sparc::Relocate::relocate): Likewise.
10982 (Target_sparc::Relocate::relocate_tls): Likewise.
10983
8c500701
ILT
10984 * symtab.cc (Symbol_table::define_default_version): New function,
10985 broken out of add_from_object.
10986 (Symbol_table::add_from_object): Call define_default_version.
10987 (Symbol_table::define_special_symbol): Add resolve_oldsym
10988 parameter. Change all callers. If the version for a symbol comes
10989 from a version script, resolve it with the symbol with the same
10990 name with no version. Also add the symbol without a version if
10991 appropriate.
10992 (do_define_in_output_data): If resolving with oldsym, don't delete
10993 sym.
10994 (do_define_in_output_segment): Likewise.
10995 (do_define_as_constant): Likewise.
10996 * symtab.h (class Symbol_table): Update declarations.
10997
f1ed28fb
ILT
109982009-03-13 Ian Lance Taylor <iant@google.com>
10999
15f8229b
ILT
11000 * readsyms.cc (Read_symbols::incompatible_warning): New function.
11001 (Read_symbols::requeue): New function.
11002 (Read_symbols::do_read_symbols): If make_elf_object fails because
11003 the target type is not configured, and the file was searched for,
11004 issue a warning and retry with the next directory.
11005 (Add_symbols::run): If the file has an incompatible format, and
11006 it was searched for, requeue the Read_symbols task. On error,
11007 release the object.
11008 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
11009 dirindex parameter to constructor. Change all callers. Declare
11010 incompatible_warning and requeue.
11011 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
11012 input_argument_ and input_group_ fields. Add them to
11013 constructor. Change all callers.
11014 (class Read_script): Add dirindex_ field. Add it to constructor.
11015 Change all callers.
11016 * archive.cc (Archive::setup): Remove input_objects parameter.
11017 Change all callers.
11018 (Archive::get_file_and_offset): Likewise.
11019 (Archive::read_all_symbols): Likewise.
11020 (Archive::read_symbols): Likewise.
11021 (Archive::get_elf_object_for_member): Remove input_objects
11022 parameter. Add punconfigured parameter. Change all callers.
11023 (Archive::add_symbols): Change return type to bool. Check return
11024 value of include_member.
11025 (Archive::include_all_members): Likewise.
11026 (Archive::include_member): Change return type to bool. Return
11027 false if first included object has incompatible target. Set
11028 included_member_ field.
11029 (Add_archive_symbols::run): If add_symbols returns false, requeue
11030 Read_symbols task.
11031 * archive.h (class Archive): Add included_member_ field.
11032 Initialize it in constructor. Add input_file and searched_for
11033 methods. Update declarations.
11034 (class Add_archive_symbols): Add dirpath_, dirindex_, and
11035 input_argument_ fields. Add them to constructor. Change all
11036 callers.
11037 * script.cc: Include "target-select.h".
11038 (class Parser_closure): Add skip_on_incompatible_target_ and
11039 found_incompatible_target_ fields. Add
11040 skip_on_incompatible_target parameter to constructor. Change all
11041 callers. Add methods skip_on_incompatible_target,
11042 clear_skip_on_incompatible_target, found_incompatible_target, and
11043 set_found_incompatible_target.
11044 (read_input_script): Add dirindex parameter. Change all callers.
11045 If parser finds an incompatible target, requeue Read_symbols
11046 task.
11047 (script_set_symbol): Clear skip_on_incompatible_target in
11048 closure.
11049 (script_add_assertion, script_parse_option): Likewise.
11050 (script_start_sections, script_add_phdr): Likewise.
11051 (script_check_output_format): New function.
11052 * script.h (read_input_script): Update declaration.
11053 * script-c.h (script_check_output_format): Declare.
11054 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
11055 (ignore_cmd): Remove OUTPUT_FORMAT.
11056 * fileread.cc (Input_file::Input_file): Add explicit this.
11057 (Input_file::will_search_for): New function.
11058 (Input_file::open): Add pindex parameter. Change all callers.
11059 * fileread.h (class Input_file): Add input_file_argument method.
11060 Declare will_search_for. Update declarations.
11061 * object.cc (make_elf_object): Add punconfigured parameter.
11062 Change all callers.
11063 * object.h (class Object): Make input_file public. Add
11064 searched_for method.
11065 (make_elf_object): Update declaration.
11066 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
11067 restart search.
11068 * dirsearch.h (class Dirsearch): Update declaration.
11069 * options.h (class General_options): Add --warn-search-mismatch.
11070 * parameters.cc (Parameters::is_compatible_target): New function.
11071 * parameters.h (class Parameters): Declare is_compatible_target.
11072 * workqueue.cc (Workqueue::add_blocker): New function.
11073 * workqueue.h (class Workqueue): Declare add_blocker.
11074
f1ed28fb
ILT
11075 * fileread.cc (Input_file::open): Remove options parameter.
11076 Change all callers.
11077 (Input_file::open_binary): Likewise.
11078 * script.cc (read_input_script): Likewise.
11079 * readsyms.h (class Read_symbols): Remove options_ field. Remove
11080 options parameter from constructor. Change all callers.
11081 (class Read_script): Likewise.
11082 * fileread.h (class Input_file): Update declarations.
11083 * script.h (read_input_script): Update declaration.
11084
34dd024a
NC
110852009-03-10 Nick Clifton <nickc@redhat.com>
11086
11087 * po/es.po: New Spanish translation.
11088
6d71b17c
CC
110892009-03-06 Cary Coutant <ccoutant@google.com>
11090
11091 * options.cc (parse_short_option): Keep dash_z from registering itself.
11092
031cdbed
ILT
110932009-03-03 Ian Lance Taylor <iant@google.com>
11094
11095 PR 9918
11096 * target-reloc.h (relocate_section): Pass output_section to
11097 relocate.
11098 * i386.cc (Target_i386::should_apply_static_reloc): Add
11099 output_section parameter. Change all callers.
11100 (Target_i386::Relocate::relocate): Add output_section parameter.
11101 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11102 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11103 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11104 * testsuite/two_file_shared.sh: New script.
11105 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11106 (check_DATA): Add two_file_shared.dbg.
11107 (two_file_shared.dbg): New target.
11108 * testsuite/Makefile.in: Rebuild.
11109
15d5fa16
ILT
111102009-03-01 Ian Lance Taylor <iant@google.com>
11111
11112 * configure.ac: Check for byteswap.h.
11113 * configure: Rebuild.
11114 * config.in: Rebuild.
11115
8a4c0b0d
ILT
111162009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11117
11118 * layout.cc (Layout::find_or_add_kept_section): New function.
11119 (Layout::add_comdat): Removed.
11120 * layout.h (struct Kept_section): Move out of class Layout.
11121 Remove trailing underscores from field names. Add group_sections
11122 field. Rename group_ field to is_group. Change all uses.
11123 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11124 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11125 comdat_groups_ field.
11126 (Sized_relobj::include_section_group): Use
11127 find_or_add_kept_section and Kept_section::group_sections.
11128 (Sized_relobj::include_linkonce_section): Likewise.
11129 * object.cc (class Sized_relobj): Don't define Comdat_group or
11130 Comdat_group_table. Remove find_comdat_group and
11131 add_comdat_group. Remove comdat_groups_ field.
11132 * plugin.cc (include_comdat_group): Use
11133 Layout::find_or_add_kept_section.
11134
b4ecf66b
ILT
111352009-02-28 Ian Lance Taylor <iant@google.com>
11136
14359ca0
ILT
11137 * README: --gc-sections and map files are now supported. Document
11138 some build requirements.
11139
b4ecf66b
ILT
11140 PR 6992
11141 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11142 relocatable link set the value of the section symbol to zero.
11143 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11144 relocatable link don't include the section address in the local
11145 symbol value.
11146
0602e05a
ILT
111472009-02-27 Ian Lance Taylor <iant@google.com>
11148
fd9d194f
ILT
11149 PR 6811
11150 * options.h (class Search_directory): Add is_system_directory.
11151 (class General_options): Declare is_in_system_directory.
11152 * options.cc (get_relative_sysroot): Make static.
11153 (get_default_sysroot): Make static.
11154 (General_optoins::is_in_system_directory): New function.
11155 * fileread.cc (Input_file::is_in_system_directory): New function.
11156 * fileread.h (class Input_file): Declare is_in_system_directory.
11157 * object.h (class Object): Add is_in_system_directory.
11158 (class Input_objects): Remove system_library_directory_ field.
11159 * object.cc (Input_objects::add_object): Don't set
11160 system_library_directory_.
11161 (input_objects::found_in_system_library_directory): Remove.
11162 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11163 parameter. Change all callers.
11164 (Symbol_table::sized_write_globals): Likewise.
11165 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11166 Call Object::is_in_system_directory.
11167 * symtab.h (class Symbol_table): Update declarations.
11168
61edd21f
ILT
11169 PR 5990
11170 * descriptors.h (Open_descriptor): Add is_on_stack field.
11171 * descriptors.cc (Descriptors::open): If the descriptor is on the
11172 top of the stack, remove it. Initialize is_on_stack field.
11173 (Descriptors::release): Only add pod to stack if it is not on the
11174 stack already.
11175 (Descriptors::close_some_descriptor): Clear stack_next and
11176 is_on_stack fields.
11177
e29e076a
ILT
11178 PR 7091
11179 * output.cc (Output_section::find_starting_output_address): Rename
11180 from starting_output_address; add PADDR parameter; change return
11181 type.
11182 * output.h (class Output_section): Declare
11183 find_starting_output_address instead of starting_output_address.
11184 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11185 section symbol for which we can't find a merge section.
11186
0602e05a
ILT
11187 PR 9836
11188 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11189 hidden or internal, force the symbol to be local.
11190 * resolve.cc (Symbol::override_visibility): Define.
11191 (Symbol::override_base): Use override_visibility.
11192 (Symbol_table::resolve): Likewise.
11193 (Symbol::override_base_with_special): Likewise.
11194 (Symbol_table::override_with_special): If the visibility is hidden
11195 or internal, force the symbol to be local.
11196 * symtab.h (class Symbol): Add set_visibility and
11197 override_visibility.
11198 * testsuite/ver_test_1.sh: New file.
11199 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11200 (check_DATA): Add ver_test_1.syms.
11201 (ver_test_1.syms): New target.
11202 * testsuite/Makefile.in: Rebuild.
11203
401a9a73
CC
112042009-02-25 Cary Coutant <ccoutant@google.com>
11205
11206 * layout.cc (Layout::choose_output_section): Don't rename sections
11207 when using a linker script that has a SECTIONS clause.
11208 * Makefile.in: Regenerate.
11209
11210 * testsuite/Makefile.am (script_test_5.sh): New test case.
11211 * testsuite/Makefile.in: Regenerate.
11212 * testsuite/script_test_5.cc: New file.
11213 * testsuite/script_test_5.sh: New file.
11214 * testsuite/script_test_5.t: New file.
11215
f488e4b0
CC
112162009-02-13 Rafael Avila de Espindola <espindola@google.com>
11217
11218 * archive.cc (Archive::include_member): Update calls to add_symbols.
11219 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11220 the Layout argument.
11221 * dynobj.h (do_add_symbols): Add the Layout argument.
11222 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11223 Layout argument.
11224 * object.h (Object::add_symbols): Add the Layout argument.
11225 (Object::do_add_symbols): Add the Layout argument.
11226 (Sized_relobj::do_add_symbols): Add the Layout argument.
11227 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11228 Unify the two versions.
11229 (Add_plugin_symbols): Remove.
11230 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11231 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11232 (Add_plugin_symbols): Remove.
11233 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11234 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11235 (Add_symbols::run): Make it work with Pulginobj.
11236
89dd1680
ILT
112372009-02-06 Ian Lance Taylor <iant@google.com>
11238
11239 * object.cc (Sized_relobj::do_layout): Make info message start
11240 with lower case letter.
11241
266d0a74
ILT
112422009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11243
602b464e
ILT
11244 * binary.cc: Fix file comment.
11245
266d0a74
ILT
11246 * options.h (enum Incremental_disposition): Define.
11247 (class General_options): Add new options: --incremental,
11248 --incremental_changed, --incremental_unchanged,
11249 --incremental_unknown. Add incremental_disposition_ and
11250 implicit_incremental_ fields.
11251 (General_options::incremental_disposition): New function.
11252 (class Position_dependent_options): Add incremental_disposition
11253 option.
11254 (Position_dependent_options::copy_from_options): Set incremental
11255 dispositions.
11256 * options.cc (General_options::parse_incremental_changed): New
11257 function.
2e702c99
RM
11258 (General_options::parse_incremental_unchanged): New function.
11259 (General_options::parse_incremental_unknown): New function.
11260 (General_options::General_options): Initialize new fields
266d0a74 11261 incremental_disposition_ and implicit_incremental_.
2e702c99 11262 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11263 without --incremental.
11264
f073bbf7
CD
112652009-02-06 Chris Demetriou <cgd@google.com>
11266
11267 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11268 pointer and to report location as the file name associated with
11269 the symbol.
11270 (gold_undefined_symbol_at_location): New function to replace the
11271 old gold_undefined_symbol functionality.
11272 * target-reloc.h (relocate_section): Update to use
11273 gold_undefined_symbol_at_location.
11274 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11275 Call gold_undefined_symbol function rather than gold_error.
11276 * errors.h (Errors::undefined_symbol): Take location as a
11277 string, rather than calculating it from a relocation.
11278 * errors.cc (Errors::fatal): Print "fatal error:" before the
11279 formatted message.
11280 (Errors::error, Errors::error_at_location): Print "error: "
11281 before the formatted message.
11282 (Errors::undefined_symbol): Take location as a string, rather
11283 than calculating it from a relocation.
11284 (gold_undefined_symbol_at_location): New function akin to
11285 old gold_undefined_symbol, calculates location from relocation.
11286 (gold_undefined_symbol): Change to take only a Symbol pointer
11287 and to report location as the file name associated with the symbol.
11288 * testsuite/debug_msg.sh: Update for changed error messages.
11289 * testsuite/undef_symbol.sh: Likewise.
11290
8e94a90c
ILT
112912009-02-04 Duncan Sands <baldrick@free.fr>
11292
11293 PR 9812
11294 * reduced_debug_output.h
11295 (Output_reduced_debug_abbrev_section::failed): Use format for
11296 gold_warning.
11297 (Output_reduced_debug_info_section::faild): Likewise.
11298
88a0e15b
ILT
112992009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11300
11301 * script.cc (Lazy_demangler): New class.
2e702c99 11302 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11303 symbol only once.
11304
5efc7cd2
CC
113052009-01-29 Cary Coutant <ccoutant@google.com>
11306
11307 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11308 to __tls_get_addr.
11309 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11310
e0ebcf42
ILT
113112009-01-28 Ian Lance Taylor <iant@google.com>
11312
5efc7cd2 11313 * version.cc (version_string): Bump to 1.9.
75fe7426 11314
e0ebcf42
ILT
11315 * gold.h: Include <cstring> and <stdint.h>.
11316 * version.cc: Include <cstdio>.
11317 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11318 warning.
11319 * reduced_debug_output.cc (insert_into_vector): Rename from
11320 Insert_into_vector; change all callers. Use Swap_unaligned to
11321 avoid aliasing issue; remove union since it is unnecessary.
11322
8e2813be 113232009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11324
11325 * Makefile.am (CCFILES): Add gc.cc.
11326 (HFILES): Add gc.h.
11327 * Makefile.in: Regenerate.
11328 * gold.cc (Gc_runner): New class.
11329 (queue_initial_tasks): Call garbage collection related tasks
11330 when corresponding options are invoked.
11331 (queue_middle_gc_tasks): New function.
11332 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11333 processed early before laying out sections during garbage collection.
11334 * gold.h (queue_middle_gc_tasks): New function.
11335 (is_prefix_of): Move from "layout.cc".
11336 * i386.cc (Target_i386::gc_process_relocs): New function.
11337 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11338 * main.cc (main): Create object of class "Garbage_collection".
11339 * object.cc (Relobj::copy_symbols_data): New function.
11340 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11341 (Sized_relobj::do_layout): Allow this function to be called twice
11342 during garbage collection and defer layout of section during the
6d03d481
ST
11343 first call.
11344 * object.h (Relobj::get_symbols_data): New function.
11345 (Relobj::is_section_name_included): New function.
11346 (Relobj::copy_symbols_data): New function.
11347 (Relobj::set_symbols_data): New function.
11348 (Relobj::get_relocs_data): New function.
11349 (Relobj::set_relocs_data): New function.
11350 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11351 (Relobj::gc_process_relocs): New function.
11352 (Relobj::do_gc_process_relocs): New pure virtual function.
11353 (Relobj::sd_): New data member.
11354 (Sized_relobj::is_output_section_offset_invalid): New function.
11355 (Sized_relobj::do_gc_process_relocs): New function.
11356 * options.h (General_options::gc_sections): Modify to not be a no-op.
11357 (General_options::print_gc_sections): New option.
11358 * plugin.cc (Plugin_finish::run): Remove function call to
11359 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11360 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11361 * reloc.cc (Read_relocs::run): Add task to process relocs and
11362 determine unreferenced sections when doing garbage collection.
11363 (Gc_process_relocs): New class.
11364 (Sized_relobj::do_gc_process_relocs): New function.
11365 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11366 sections that are garbage collected.
11367 * reloc.h (Gc_process_relocs): New class.
11368 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11369 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11370 symbols whose corresponding sections are garbage collected.
11371 (Symbol_table::Symbol_table): Add new parameter for the garbage
11372 collection object.
11373 (Symbol_table::gc_mark_undef_symbols): New function.
11374 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11375 (Symbol_table::gc_mark_dyn_syms): New function.
11376 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11377 as garbage.
11378 (Symbol_table::add_from_object): Likewise.
11379 (Symbol_table::add_from_relobj): When building shared objects, do not
11380 treat externally visible symbols as garbage.
11381 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11382 table information for static and relocatable links.
11383 * symtab.h (Symbol_table::set_gc): New function.
11384 (Symbol_table::gc): New function.
11385 (Symbol_table::gc_mark_undef_symbols): New function.
11386 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11387 (Symbol_table::gc_mark_dyn_syms): New function.
11388 (Symbol_table::gc_): New data member.
e1df38aa 11389 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11390 function.
11391 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11392 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11393
3b293544
CF
113942009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11395
11396 * options.h (General_options::gc_sections): Define as a no-op for now.
11397 (General_options::no_keep_memory): Ditto.
11398 (General_options::Bshareable): Define.
11399 * options.cc (General_options::finalize): Honor -Bshareable.
11400
83d22aa8
AS
114012009-01-20 Andreas Schwab <schwab@suse.de>
11402
11403 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11404 read the value in the contents, since we don't use it. Use the
11405 template endianness when writing.
11406 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11407
cd536b21
AS
114082009-01-19 Andreas Schwab <schwab@suse.de>
11409
11410 * configure.tgt (powerpc64-*): Fix targ_obj.
11411
99e9a495
ILT
114122009-01-15 Ian Lance Taylor <iant@google.com>
11413
11414 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11415 local symbols when stripping all symbols.
11416
bbbfea06
CC
114172009-01-14 Cary Coutant <ccoutant@google.com>
11418
99e9a495 11419 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11420
0f7c0701
CC
114212009-01-14 Cary Coutant <ccoutant@google.com>
11422
11423 * archive.cc (Archive::get_elf_object_for_member): Remove call
11424 to File_read::claim_for_plugin.
11425 * descriptors.cc (Descriptors::open): Remove reference to
11426 is_claimed.
11427 (Descriptors::claim_for_plugin): Remove.
11428 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11429 (Descriptors::is_claimed): Remove.
11430 (claim_descriptor_for_plugin): Remove.
11431 * fileread.cc (File_read::claim_for_plugin): Remove.
11432 * fileread.h (File_read::claim_for_plugin): Remove.
11433 (File_read::descriptor): Reopen descriptor if necessary.
11434 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11435 (Plugin_manager::all_symbols_read): Add task parameter. Change
11436 all callers.
11437 (Plugin_manager::get_input_file): New function.
11438 (Plugin_manager::release_input_file): New function.
11439 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11440 corresponding data member.
11441 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11442 and pass to base constructor. Change all callers.
11443 (get_input_file, release_input_file): New functions.
11444 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11445 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11446 (Plugin_manager::all_symbols_read): Add task parameter.
11447 (Plugin_manager::get_input_file): New function.
11448 (Plugin_manager::release_input_file): New function.
11449 (Plugin_manager::task_): New data member.
11450 (Pluginobj::Pluginobj): Add filesize parameter.
11451 (Pluginobj::filename): New function.
11452 (Pluginobj::descriptor): New function.
11453 (Pluginobj::filesize): New function.
11454 (Pluginobj::filesize_): New data member.
11455 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11456 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11457 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11458
11459 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11460 with archive libraries.
11461 * testsuite/Makefile.in: Regenerate.
11462 * testsuite/plugin_test.c (struct sym_info): New type.
11463 (get_input_file, release_input_file): New static variables.
11464 (onload): Capture new transfer vector entries.
11465 (claim_file_hook): Stop reading at end of file according to filesize.
11466 Factor out parsing of readelf output into separate function.
11467 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11468 APIs and get the source file name from the symbol table. Convert
11469 source file name to corresponding object file name. Print info
11470 message when adding new input files.
11471 (parse_readelf_line): New function.
11472 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11473 * testsuite/plugin_test_2.sh: Likewise.
11474 * testsuite/plugin_test_3.sh: Likewise.
11475 * testsuite/plugin_test_4.sh: New test case.
11476
62a6d109
ILT
114772009-01-07 Ian Lance Taylor <iant@google.com>
11478
11479 * version.cc (version_string): Bump to 1.8.
11480
483620e8
CC
114812008-12-23 Cary Coutant <ccoutant@google.com>
11482
11483 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11484 * plugin.cc (Plugin_manager::finish): Rename as
11485 layout_deferred_objects. Move cleanup to separate function.
11486 (Plugin_manager::cleanup): New function.
11487 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11488 separately.
11489 * plugin.h (Plugin_manager::finish): Rename as
11490 layout_deferred_objects.
11491 (Plugin_manager::cleanup): New function.
11492 (Plugin_manager::cleanup_done): New field.
11493
d66a9eb3
CC
114942008-12-23 Cary Coutant <ccoutant@google.com>
11495
11496 * plugin.cc (is_visible_from_outside): New function.
11497 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11498 so we don't return "IR only" status for exported symbols or -r links.
11499
11500 * testsuite/Makefile.am (plugin_test_3): New test case.
11501 * testsuite/Makefile.in: Regenerate.
11502 * testsuite/plugin_test_3.sh: New file.
11503
5995b570
CC
115042008-12-22 Cary Coutant <ccoutant@google.com>
11505
11506 * object.cc (Sized_relobj::layout_section): New function.
11507 (Sized_relobj::do_layout): Defer layout of input sections until after
11508 plugin has provided replacement files.
11509 (Sized_relobj::do_layout_deferred_sections): New function.
11510 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11511 (Relobj::layout_deferred_sections): New function.
11512 (Relobj::do_layout_deferred_sections): New function.
11513 (Sized_relobj::do_layout_deferred_sections): New function.
11514 (Sized_relobj::layout_section): New function.
11515 (Sized_relobj::Deferred_layout): New structure.
11516 (Sized_relobj::deferred_layout_): New field.
11517 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11518 Change all callers. Layout deferred sections.
11519 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11520 references.
11521 (Plugin_hook::run): Move code from do_plugin_hook inline.
11522 (Plugin_hook::do_plugin_hook): Remove.
11523 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11524 (Plugin_manager::finish): Renamed, was cleanup.
11525 (Plugin_manager::should_defer_layout): New function.
11526 (Plugin_manager::add_deferred_layout_object): New function.
11527 (Plugin_manager::Deferred_layout_list): New type.
11528 (Plugin_manager::deferred_layout_objects_): New field.
11529 (Plugin_hook::do_plugin_hook): Remove.
11530
ee769c88
ILT
115312008-12-17 Ian Lance Taylor <iant@google.com>
11532
11533 * options.h (class General_options): Add --no case for
11534 --export-dynamic.
11535
abc8dcba
CC
115362008-12-16 Cary Coutant <ccoutant@google.com>
11537
11538 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11539 vector.
11540 (Plugin_manager::claim_file): Create plugin object even if
11541 plugin did not call the add_symbols callback.
11542 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11543 asking for more symbols than were added.
11544 * testsuite/Makefile.am (plugin_test_1): Add test case with
11545 no global symbols.
11546 (empty.syms): New target.
11547 * testsuite/Makefile.in: Regenerate.
11548 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11549 message. Don't call add_symbols if no globals.
11550 (all_symbols_read_hook): Don't provide replacement for empty
11551 claimed file.
11552
b0074644
ILT
115532008-12-12 Ian Lance Taylor <iant@google.com>
11554
68943102
ILT
11555 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11556 r_type == 0 for a local symbol with r_sym == 0.
11557 (scan_relocatable_relocs): Pass r_sym to
11558 local_non_section_strategy.
11559 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11560 r_sym parameter.
11561
b0074644
ILT
11562 * configure.ac: Update test for TLS descriptors: they are
11563 supported as of glibc 2.9.
11564 * configure: Rebuild.
11565
c2508178
ILT
115662008-12-11 Ian Lance Taylor <iant@google.com>
11567
11568 PR 7091
11569 * target-reloc.h (Default_scan_relocatable_relocs): For each
11570 function, map r_type == 0 to RELOC_DISCARD.
11571
2756a258
CC
115722008-12-10 Cary Coutant <ccoutant@google.com>
11573
11574 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11575 object to override a kept COMDAT group from a plugin object.
11576
bb6f53d3
ILT
115772008-12-09 Ian Lance Taylor <iant@google.com>
11578
fbc558e1
ILT
11579 PR 7088
11580 * yyscript.y (file_cmd): Handle INPUT.
11581
bb6f53d3
ILT
11582 * testsuite/initpri1.c: Change all declarations to be full
11583 prototypes by adding void, to avoid compiler warnings.
11584
4674ecfc
CC
115852008-12-05 Rafael Avila de Espindola <espindola@google.com>
11586
11587 * options.cc (General_options::parse_plugin_opt): New.
11588 (General_options::add_plugin): The argument now is just the filename.
11589 (General_options::add_plugin_option): New.
11590 * options.h (plugin_opt): New.
11591 (add_plugin): Change argument name.
11592 (add_plugin_option): New.
11593 * plugin.cc (Plugin::load): Don't parse the plugin option.
11594 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11595 (Plugin::add_option): New.
11596 (Plugin::args_): Change type.
11597 (Plugin::filename_): New.
11598 (Plugin_manager::add_plugin_option): New.
11599 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11600 * testsuite/Makefile.in: Regenerate.
11601
fd06b4aa
CC
116022008-12-05 Cary Coutant <ccoutant@google.com>
11603
11604 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11605 Handle --strip-lto-sections option.
11606 * options.h (strip_lto_sections): New option.
11607
6c52134c
CC
116082008-12-01 Cary Coutant <ccoutant@google.com>
11609
11610 * plugin.cc (ld_plugin_message): Change format parameter to const.
11611 Fix mismatch between new[] and delete.
11612
a45248e0
CC
116132008-11-14 Cary Coutant <ccoutant@google.com>
11614
11615 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11616 instead of -1U.
11617
c82fbeee
CS
116182008-11-05 Craig Silverstein <csilvers@google.com>
11619
11620 * options.cc (General_options::parse_dynamic_list): New function.
11621 * options.h (General_options): New flags dynamic_list,
11622 dynamic_list_data, dynamic_list_cpp_new, and
11623 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11624 (General_options::in_dynamic_list): New function.
11625 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11626 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11627 (Lex::can_continue_name): Likewise.
11628 (yylex): Likewise.
11629 (read_script_file): New parameter script_options.
11630 (read_dynamic_list): New function.
11631 (Script_options::define_dynamic_list): New function.
11632 (dynamic_list_keyword_parsecodes): New variable.
11633 (dynamic_list_keywords): New variable.
11634 * script.h (Script_options::define_dynamic_list): New function
11635 prototype.
11636 (read_dynamic_list): New function prototype.
11637 * symtab.cc (strprefix): New macro.
11638 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11639 dynamic_list_data, dynamic_list_cpp_new, and
11640 dynamic_list_cpp_typeinfo.
11641 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11642 (dynamic_list_expr): New rule.
11643 (dynamic_list_nodes): Likewise.
11644 (dynamic_list_node): Likewise.
11645 * testsuite/Makefile.am (dynamic_list): New test.
11646 * testsuite/Makefile.in: Regenerated.
11647 * testsuite/dynamic_list.t: New file.
11648 * testsuite/dynamic_list.sh: New file.
11649
e0bb29a5
CS
116502008-11-05 Craig Silverstein <csilvers@google.com>
11651
11652 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11653 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11654 (t11_last): Likewise.
11655 * testsuite/ver_test_6.c (main): Likewise.
11656
4e1e25e0
CC
116572008-10-07 Cary Coutant <ccoutant@google.com>
11658
11659 * options.c (General_options::finalize): Add check for -static and
11660 -shared.
11661 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11662 is not empty.
11663
92f03fcb
CC
116642008-10-02 Cary Coutant <ccoutant@google.com>
11665
11666 * plugin.cc (make_sized_plugin_object): Fix conditional
11667 compilation to work when not all targets are enabled.
11668
fbd8a257
CC
116692008-09-29 Cary Coutant <ccoutant@google.com>
11670
11671 * archive.cc (Archive::get_file_and_offset): Use filename instead
11672 of name to get library path.
11673 (Archive::include_member): Unlock external member of a thin archive.
11674
11675 * testsuite/Makefile.am (TEST_AR): New variable.
11676 (thin_archive_test_1): New test.
11677 (thin_archive_test_2): New test.
81636b3f
CC
11678 * testsuite/Makefile.in: Regenerate.
11679 * testsuite/thin_archive_main.cc: New file.
11680 * testsuite/thin_archive_test_1.cc: New file.
11681 * testsuite/thin_archive_test_2.cc: New file.
11682 * testsuite/thin_archive_test_3.cc: New file.
11683 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11684
eff45813
CC
116852008-09-29 Cary Coutant <ccoutant@google.com>
11686
11687 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11688 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11689 instead of -1U.
11690 (Sized_relobj::do_finalize_local_symbols): Likewise.
11691 (Sized_relobj::map_to_kept_section): Likewise.
11692 * object.h (Sized_relobj::invalid_address): New constant.
11693 (Sized_relobj::do_output_section_offset): Check for invalid_address
11694 and return -1ULL.
11695 * output.cc (Output_reloc::local_section_offset): Use constant
11696 invalid_address instead of -1U.
11697 (Output_reloc::get_address): Likewise.
11698 (Output_section::output_address): Change -1U to -1ULL.
11699 * output.h (Output_reloc::invalid_address): New constant.
11700 * reloc.cc (Sized_relobj::write_sections): Use constant
11701 invalid_address instead of -1U.
11702 (Sized_relobj::relocate_sections): Likewise.
11703 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11704 values for merge sections.
11705 * target-reloc.h (relocate_for_relocatable): Use constant
11706 invalid_address instead of -1U.
11707
89fc3421
CC
117082008-09-19 Cary Coutant <ccoutant@google.com>
11709
11710 Add plugin functionality for link-time optimization (LTO).
11711 * configure.ac (plugins): Add --enable-plugins option.
11712 * configure: Regenerate.
11713 * config.in: Regenerate.
11714 * Makefile.am (LIBDL): New variable.
11715 (CCFILES): Add plugin.cc.
11716 (HFILES): Add plugin.h.
11717 (ldadd_var): Add LIBDL.
11718 * Makefile.in: Regenerate.
11719
11720 * archive.cc: Include "plugin.h".
11721 (Archive::setup): Don't preread archive symbols when using a plugin.
11722 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11723 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11724 files.
11725 (Archive::include_member): Add symbols from plugin objects.
11726 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11727 * descriptors.cc (Descriptors::open): Check for file descriptors
11728 abandoned by plugins.
11729 (Descriptors::claim_for_plugin): New function.
11730 * descriptors.h (Descriptors::claim_for_plugin): New function.
11731 (Open_descriptor::is_claimed): New field.
11732 (claim_descriptor_for_plugin): New function.
11733 * fileread.cc (File_read::claim_for_plugin): New function.
11734 * fileread.h (File_read::claim_for_plugin): New function.
11735 (File_read::descriptor): New function.
11736 * gold.cc: Include "plugin.h".
11737 (queue_initial_tasks): Add task to call plugin hooks for generating
11738 new object files.
11739 * main.cc: Include "plugin.h".
11740 (main): Load plugin libraries.
11741 * object.h (Pluginobj): Declare.
11742 (Object::pluginobj): New function.
11743 (Object::do_pluginobj): New function.
11744 (Object::set_target): New function.
11745 * options.cc: Include "plugin.h".
11746 (General_options::parse_plugin): New function.
11747 (General_options::General_options): Initialize plugins_ field.
11748 (General_options::add_plugin): New function.
11749 * options.h (Plugin_manager): Declare.
11750 (General_options): Add --plugin option.
11751 (General_options::has_plugins): New function.
11752 (General_options::plugins): New function.
11753 (General_options::add_plugin): New function.
11754 (General_options::plugins_): New field.
11755 * plugin.cc: New file.
11756 * plugin.h: New file.
11757 * readsyms.cc: Include "plugin.h".
11758 (Read_symbols::do_read_symbols): Check for archive before checking
11759 for ELF file. Call plugin hooks to claim files.
11760 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11761 from a real object file; force override when processing replacement
11762 files.
11763 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11764 (Symbol::init_base_object): Likewise.
11765 (Symbol::init_base_output_data): Likewise.
11766 (Symbol::init_base_output_segment): Likewise.
11767 (Symbol::init_base_constant): Likewise.
11768 (Symbol::init_base_undefined): Likewise.
11769 (Symbol::output_section): Assert that object is not a plugin.
11770 (Symbol_table::add_from_pluginobj): New function.
11771 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11772 undefined.
11773 (Symbol_table::sized_write_globals): Likewise.
11774 (Symbol_table::add_from_pluginobj): Instantiate template.
11775 * symtab.h (Sized_pluginobj): Declare.
11776 (Symbol::in_real_elf): New function.
11777 (Symbol::set_in_real_elf): New function.
11778 (Symbol::in_real_elf_): New field.
11779 (Symbol_table::add_from_pluginobj): New function.
11780
11781 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11782 (LIBDL): New variable.
11783 (LDADD): Add LIBDL.
11784 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11785 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11786 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11787 (MOSTLYCLEANFILES): Likewise.
11788 * testsuite/Makefile.in: Regenerate.
11789 * testsuite/plugin_test.c: New file.
11790 * testsuite/plugin_test_1.sh: New file.
11791 * testsuite/plugin_test_2.sh: New file.
11792
de31bda5
ILT
117932008-09-16 Ian Lance Taylor <iant@google.com>
11794
9c2d0ef9
ILT
11795 * target-reloc.h (relocate_section): Check whether a symbol is
11796 defined by the ABI before reporting an undefined symbol error.
11797 * target.h (Target::is_defined_by_abi): Make parameter const.
11798 (Target::do_is_defined_by_abi): Likewise.
11799 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11800 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11801 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11802 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11803 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11804 * testsuite/Makefile.in: Rebuild.
11805
de31bda5
ILT
11806 * fileread.cc (make_view): Add casts to avoid warning.
11807
9fa33bee
AO
118082008-09-16 Alexandre Oliva <aoliva@redhat.com>
11809
11810 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11811 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11812
183fd0e3
AO
118132008-09-16 Alexandre Oliva <aoliva@redhat.com>
11814
11815 * options.h (General_options::output_is_executable): New.
11816 (General_options::output_is_pie): New.
11817 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11818 for shared libraries.
11819 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11820
7be8330a
CD
118212008-09-11 Chris Demetriou <cgd@google.com>
11822
11823 * options.h (origin): New -z option.
11824 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11825 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11826 in DT_FLAGS_1.
11827
a9caad02
CC
118282008-09-05 Cary Coutant <ccoutant@google.com>
11829
11830 * fileread.cc (File_read::make_view): Add check for attempt to map
11831 beyond end of file.
11832
ae6dce4d
CC
118332008-09-05 Cary Coutant <ccoutant@google.com>
11834
11835 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11836 explicit instantiations.
11837
d7ab2a47
KVH
118382008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11839
11840 PR gold/6858
11841 * options.cc (General_options::finalize): Allow undefined symbols
11842 in shlibs if linking -shared.
11843
11844 PR gold/6859
11845 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11846 symbols as not needing a dynsym entry.
11847
1e52a9c1
CS
118482008-08-20 Craig Silverstein <csilvers@google.com>
11849
11850 * fileread.cc (File_read::open): Do not lock the file unless it
11851 was successfully opened.
11852
d85c80a3
CC
118532008-08-14 Cary Coutant <ccoutant@google.com>
11854
11855 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11856 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11857 * testsuite/tls_test.cc (struct int128): 128-bit struct
11858 for testing TLS relocs with non-zero addend.
11859 (v12): New TLS variable.
11860 (t12): New test.
11861 (t_last): Add check for v12.
11862 * testsuite/tls_test.h (t12): New function.
11863 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11864
2d924fd9
ILT
118652008-08-13 Ian Lance Taylor <iant@google.com>
11866
11867 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11868 set tls_segment_ or relro_segment_.
11869 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11870 when appropriate.
11871 * output.h (Output_section::clear_is_relro): New function.
11872 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11873 sections specially even when output_data_ is empty.
11874 (Output_segment::maximum_alignment): When first section is relro,
11875 only force alignment for PT_LOAD segments.
11876 * script.cc (script_data_segment_align): New function.
11877 (script_data_segment_relro_end): New function.
11878 * script-c.h (script_data_segment_align): Declare.
11879 (script_data_segment_relro_end): Declare.
11880 * script-sections.h (class Script_sections): Declare
11881 data_segment_align and data_segment_relro_end. Add fields
11882 segment_align_index_ and saw_relro_end_.
11883 * script-sections.cc (class Sections_element): Add set_is_relro
11884 virtual function. Add new bool* parameter to place_orphan_here.
11885 Add get_output_section virtual function.
11886 (class Output_section_definition): Add set_is_relro. Add new
11887 bool* parameter to place_orphan_here. Add get_output_section.
11888 Add is_relro_ field.
11889 (Output_section_definition::Output_section_definition): Initialize
11890 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11891 and is_relro_ fields.
11892 (Output_section_definition::place_orphan_here): Add is_relro
11893 parameter.
11894 (Output_section_definition::set_section_addresses): Set relro for
11895 output section.
11896 (Output_section_definition::alternate_constraint): Likewise.
11897 (class Orphan_output_section): Add new bool* parameter to
11898 place_orphan_here. Add get_output_section.
11899 (Orphan_output_section::place_orphan_here): Add is_relro
11900 parameter.
11901 (Script_sections::Script_sections): Initialize
11902 data_segment_align_index_ and saw_relro_end_.
11903 (Script_sections::data_segment_align): New function.
11904 (Script_sections::data_segment_relro_end): New function.
11905 (Script_sections::place_orphan): Set or clear is_relro.
11906 (Script_sections::set_section_addresses): Force alignment of first
11907 TLS section.
11908 * yyscript.y (exp): Call script_data_segment_align and
11909 script_data_segment_relro_end.
11910 * testsuite/relro_script_test.t: New file.
11911 * testsuite/relro_test.cc (using_script): Declare.
11912 (t1, t2): Test using_script.
11913 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11914 (relro_script_test_SOURCES): Define.
11915 (relro_script_test_DEPENDENCIES): Define.
11916 (relro_script_test_LDFLAGS): Define.
11917 (relro_script_test_LDADD): Define.
11918 (relro_script_test.so): New target.
11919 * testsuite/Makefile.in: Rebuild.
11920
f827c9a9
CC
119212008-08-06 Cary Coutant <ccoutant@google.com>
11922
11923 * archive.cc (Archive::total_archives, Archive::total_members)
11924 (Archive::total_members_loaded): New variables.
11925 (Archive::setup): Add parameter. Add option to preread
11926 archive symbols.
11927 (Archive::read_armap): Add counter.
11928 (Archive::get_file_and_offset): New function.
11929 (Archive::get_elf_object_for_member): New function.
11930 (Archive::read_all_symbols): New function.
11931 (Archive::read_symbols): New function.
11932 (Archive::add_symbols): Add counters.
11933 (Archive::include_all_members): Use armap to find members if it's
11934 already built.
11935 (Archive::include_member): Skip reading symbols if already read.
11936 Factored code into Archive::get_file_and_offset and
11937 Archive::get_elf_object_for_member. Changed call to
11938 Mapfile::report_include_archive_member.
11939 (Archive::print_stats): New function.
11940 * archive.h: Declare Object and Read_symbols_data classes.
11941 (Archive::Archive): Add initializers for new members.
11942 (Archive::setup): Add parameter.
11943 (Archive::print_stats): New function.
11944 (Archive::total_archives, Archive::total_members)
11945 (Archive::total_members_loaded): New variables.
11946 (Archive::get_file_and_offset): New function.
11947 (Archive::get_elf_object_for_member): New function.
11948 (Archive::read_all_symbols): New function.
11949 (Archive::read_symbols): New function.
11950 (Archive::Archive_member): New class.
11951 (Archive::members_): New member.
11952 (Archive::num_members_): New member.
11953 * main.cc: Include archive.h.
11954 (main): Call Archive::print_stats.
11955 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11956 archive parameter; member_name is now the fully-decorated name.
11957 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11958 * options.h: (General_options): Add --preread-archive-symbols option.
11959 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11960 Archive::setup.
11961
de4c45bd
ILT
119622008-08-04 Ian Lance Taylor <iant@google.com>
11963
11964 * symtab.h (Symbol::use_plt_offset): New function.
11965 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11966 * powerpc.cc (Relocate::relocate): Likewise.
11967 * sparc.cc (Relocate::relocate): Likewise.
11968 * x86_64.cc (Relocate::relocate): Likewise.
11969 * testsuite/weak_plt.sh: New test.
11970 * testsuite/weak_plt_main.cc: New test.
11971 * testsuite/weak_plt_shared.cc: New test.
11972 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11973 (check_PROGRAMS): Add weak_plt.
11974 (check_DATA): Add weak_plt_shared.so.
11975 (weak_plt_main_pic.o, weak_plt): New targets.
11976 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11977 * testsuite/Makefile.in: Rebuild.
11978
11979 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11980 gcctestdir/ld.
11981 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11982 * testsuite/Makefile.in: Rebuild.
11983
323ee3f4
AM
119842008-08-04 Alan Modra <amodra@bigpond.net.au>
11985
11986 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11987 * Makefile.in: Regenerate.
11988 * po/POTFILES.in: Regenerate.
11989
7c07ecec
ILT
119902008-07-29 Ian Lance Taylor <iant@google.com>
11991
11992 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11993 symbols before other symbols.
11994 * testsuite/script_test_2.cc (test_addr): Declare.
11995 (test_addr_alias): Declare.
11996 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11997 values.
7c07ecec
ILT
11998 * testsuite/script_test_2.t: Define test_addr_alias and
11999 test_addr.
12000
5778530e
ILT
120012008-07-24 Ian Lance Taylor <iant@google.com>
12002
2a00e4fb
ILT
12003 PR 5990
12004 * descriptors.cc: New file.
12005 * descriptors.h: New file.
12006 * gold-threads.h (class Hold_optional_lock): New class.
12007 * fileread.cc: Include "descriptors.h".
12008 (File_read::~File_read): Release descriptor rather than closing
12009 it.
12010 (File_read::open) [file]: Call open_descriptor rather than open.
12011 Set is_descriptor_opened_.
12012 (File_read::open) [memory]: Assert that descriptor is not open.
12013 (File_read::reopen_descriptor): New function.
12014 (File_read::release): Release descriptor.
12015 (File_read::do_read): Make non-const. Reopen descriptor.
12016 (File_read::read): Make non-const.
12017 (File_read::make_view): Reopen descriptor.
12018 (File_read::do_readv): Likewise.
12019 * fileread.h (class File_read): Add is_descriptor_opened_ field.
12020 Update declarations.
12021 * layout.cc: Include "descriptors.h".
12022 (Layout::create_build_id): Use open_descriptor rather than open.
12023 * output.cc: Include "descriptors.h".
12024 (Output_file::open): Use open_descriptor rather than open.
12025 * archive.cc (Archive::const_iterator): Change Archive to be
12026 non-const.
12027 (Archive::begin, Archive::end): Make non-const.
12028 (Archive::count_members): Likewise.
12029 * archive.h (class Archive): Update declarations.
12030 * object.h (Object::read): Make non-const.
12031 * Makefile.am (CCFILES): Add descriptors.cc.
12032 (HFILES): Add descriptors.h.
12033 * Makefile.in: Rebuild.
12034
801647d1
ILT
12035 PR 6716
12036 * gold.h: Always include <clocale>. Add Solaris workarounds
12037 following code in binutils/sysdep.h.
12038
5edd166e
ILT
12039 PR 6048
12040 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
12041 this->eh_frame_hdr_ is NULL before using it.
12042
c89ad728
ILT
12043 * dynobj.cc (Versions::Versions): Update comment.
12044
aa86f06b
ILT
12045 * dynobj.cc (Versions::Versions): If there is an soname, use it as
12046 the base version name.
12047
5778530e
ILT
12048 * stringpool.cc (Stringpool_template::add_with_length): Set key to
12049 array size plus one.
12050 (Stringpool_template::set_string_offsets): Subtract one from key
12051 before using it as an array index.
12052 (Stringpool_template::get_offset_with_length): Likewise.
12053 (Stringpool_template::write_to_buffer): Likewise.
12054 * stringpool.h (Stringpool_template::get_offset_from_key):
12055 Likewise.
12056
057ead22
ILT
120572008-07-23 Ian Lance Taylor <iant@google.com>
12058
7f649c59
ILT
12059 PR 6658
12060 * object.h (Merged_symbol_value::value): Do our best to handle a
12061 negative addend.
12062
057ead22
ILT
12063 PR 6647
12064 * script.cc (Version_script_info::get_versions): Don't add empty
12065 version tag to return value.
12066 (Version_script_info::get_symbol_version_helper): Change return
12067 type to bool. Add pversion parameter. Change all callers.
12068 (script_register_vers_node): Don't require a non-NULL tag.
12069 * script.h (class Version_script_info): Update declarations.
12070 (Version_script_info::get_symbol_version): Change return type to
12071 bool. Add version parameter. Change all callers.
12072 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
12073 handling. Handle an empty version from a version script.
12074 (Symbol_table::define_special_symbol): Likewise.
12075 * testsuite/ver_test_10.script: New file.
12076 * testsuite/ver_test_10.sh: New file.
12077 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
12078 (check_DATA): Add ver_test_10.syms.
12079 (ver_test_10.syms, ver_test_10.so): New target.
12080 * testsuite/Makefile.in: Rebuild.
12081
58e54ac2
CD
120822008-07-23 Simon Baldwin <simonb@google.com>
12083
12084 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12085 to zero for undefined symbols from dynamic libraries.
12086
95d14cd3
ILT
120872008-07-23 Ian Lance Taylor <iant@google.com>
12088
12089 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12090 Change all callers.
12091 * symtab.h (class Symbol_table): Update declaration.
12092 * testsuite/ver_test_9.cc: New file.
12093 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12094 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12095 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12096 (ver_test_9.so, ver_test_9.o): New targets.
12097 * testsuite/Makefile.in: Rebuild.
12098
92de84a6
ILT
120992008-07-22 Ian Lance Taylor <iant@google.com>
12100
34810851
ILT
12101 * options.h (class General_options): Define --check-sections.
12102 * layout.cc (Layout::set_segment_offsets): Handle
12103 --check-sections.
12104
af6156ef
ILT
12105 * options.h (class General_options): Define -n/--nmagic and
12106 -N/--omagic.
12107 * options.cc (General_options::finalize): For -n/--nmagic or
12108 -N/--omagic, set -static.
12109 * layout.cc (Layout::attach_allocated_section_to_segment): If
12110 -N/--omagic, don't put read-only and read-write sections in
12111 different segments.
12112 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12113 finding a read-only segment.
12114 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12115 don't set the minimum segment alignment to the common page size,
12116 and don't set the file offset to the address modulo the page size.
12117 * script-sections.cc (Script_sections::create_segments): If
12118 -n/--omagic, don't put read-only and read-write sections in
12119 different segments.
12120
92de84a6
ILT
12121 * cref.cc: New file.
12122 * cref.h: New file.
12123 * options.h (class General_options): Add --print-symbol-counts.
12124 * main.cc (main): Issue defined symbol report if requested.
12125 * archive.cc (Archive::interpret_header): Make into a const member
12126 function.
12127 (Archive::add_symbols): Call Input_objects::archive_start and
12128 archive_stop.
12129 (Archive::const_iterator): Define new class.
12130 (Archive::begin, Archive::end): New functions.
12131 (Archive::include_all_members): Rewrite to use iterator.
12132 (Archive::count_members): New function.
12133 * archive.h (class Archive): Update declarations.
12134 (Archive::filename): New function.
12135 * object.cc: Include "cref.h".
12136 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12137 (Sized_relobj::do_get_global_symbol_counts): New function.
12138 (Input_objects::add_object): Add object to cross-referencer.
12139 (Input_objects::archive_start): New function.
12140 (Input_objects::archive_stop): New function.
12141 (Input_objects::print_symbol_counts): New function.
12142 * object.h: Declare Cref and Archive.
12143 (Object::get_global_symbol_counts): New function.
12144 (Object::do_get_global_symbol_counts): New pure virtual function.
12145 (class Sized_relobj): Add defined_count_ field. Update
12146 declarations.
12147 (class Input_objects): Add cref_ field. Update constructor.
12148 Update declarations.
12149 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12150 defined_count_.
12151 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12152 symbol counts.
12153 (Sized_dynobj::do_get_global_symbol_counts): New function.
12154 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12155 defined_count_. Update declarations. Define Symbols typedef.
12156 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12157 parameter. Change all callers.
12158 (Symbol_table::add_from_dynobj): Add sympointers and defined
12159 parameters. Change all callers.
12160 * symtab.h (class Symbol_table): Update declarations.
12161 * Makefile.am (CCFILES): Add cref.cc.
12162 (HFILES): Add cref.h.
12163 * Makefile.in: Rebuild.
12164
3f7c5e1d
CD
121652008-07-22 Simon Baldwin <simonb@google.com>
12166
12167 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12168 to zero when writing undefined symbols.
12169
e0b64032
ILT
121702008-07-22 Ian Lance Taylor <iant@google.com>
12171
12172 * output.cc (Output_section::add_input_section): Don't try to
12173 merge empty merge sections.
12174
096b02cf
CS
121752008-07-21 Craig Silverstein <csilvers@google.com>
12176
12177 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12178 Include symbol version in error message.
cd536b21 12179
1d1f116d
CD
121802008-07-20 Chris Demetriou <cgd@google.com>
12181
cd536b21 12182 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12183 (RANDOM_SEED_CFLAGS): New substituted variable.
12184 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12185 * configure: Rebuild.
12186 * Makefile.in: Likewise.
12187 * testsuite/Makefile.in: Likewise.
12188
a18f591e
ILT
121892008-07-18 Ian Lance Taylor <iant@google.com>
12190
12191 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12192 where we see NAME/NULL and NAME/VERSION as separate symbols.
12193 * testsuite/ver_test_main.cc (main): Call t4.
12194 (t4, t4_2a): Define.
12195 * testsuite/ver_test_2.cc (t4_2): Define.
12196 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12197 * testsuite/ver_test_4.cc (t4_2a): Define.
12198 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12199 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12200
c6e3f6ed
ILT
122012008-07-17 Ian Lance Taylor <iant@google.com>
12202
12203 * dynobj.cc (Versions::add_def): If we give an error about a
12204 missing version, go ahead and create the version anyhow.
12205
ef9beddf
ILT
122062008-07-10 Ian Lance Taylor <iant@google.com>
12207
12208 Handle output sections with more than 0x7fffffff bytes.
12209 * object.h (class Relobj): Change map_to_output_ to
12210 output_sections_, and just keep a section pointer. Change all
12211 uses. Move comdat group support to Sized_relobj.
12212 (Relobj::is_section_specially_mapped): Remove.
12213 (Relobj::output_section): Remove poff parameter. Change all
12214 callers.
12215 (Relobj::output_section_offset): New function.
12216 (Relobj::set_section_offset): Rewrite.
12217 (Relobj::map_to_output): Remove.
12218 (Relobj::output_sections): New function.
12219 (Relobj::do_output_section_offset): New pure virtual function.
12220 (Relobj::do_set_section_offset): Likewise.
12221 (class Sized_relobj): Add section_offsets_ field. Add comdat
12222 group support from Relobj. Update declarations.
12223 (Sized_relobj::get_output_section_offset): New function.
12224 (Sized_relobj::do_output_section_offset): New function.
12225 (Sized_relobj::do_set_section_offset): New function.
12226 * object.cc (Relobj::output_section_address): Remove.
12227 (Sized_relobj::Sized_relobj): Initialize new fields.
12228 (Sized_relobj::include_section_group): Cast find_kept_object to
12229 Sized_relobj.
12230 (Sized_relobj::include_linkonce_section): Likewise.
12231 (Sized_relobj::do_layout): Use separate arrays for output section
12232 and output offset.
12233 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12234 output_sections.
12235 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12236 output_sections and section_offsets.
12237 (Sized_relobj::write_local_symbols): Likewise.
12238 (map_to_kept_section): Compute output address directly.
12239 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12240 output_sections and section_offsets.
12241 (Sized_relobj::write_sections): Likewise.
12242 (Sized_relobj::relocate_sections): Likewise.
12243 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12244 * output.h (class Output_reloc): Update declarations. Change
12245 u2_.relobj to Sized_relobj*.
12246 (class Output_data_reloc): Change add functions to use
12247 Sized_relobj*.
12248 * output.cc (Output_reloc::Output_reloc): Change relobj to
12249 Sized_relobj*.
12250 (Output_reloc::local_section_offset): Change return type to
12251 Elf_Addr. Use get_output_section_offset.
12252 (Output_reloc::get_address): Likewise.
12253 (Output_section::is_input_address_mapped): Don't call
12254 is_section_specially_mapped.
12255 (Output_section::output_offset): Likewise.
12256 (Output_section::output_address): Likewise.
12257 (Output_section::starting_output_address): Likewise.
12258 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12259 parameter to Sized_relobj*.
12260 (Copy_relocs::need_copy_reloc): Likewise.
12261 (Copy_relocs::save): Likewise.
12262 * copy-relocs.h (class Copy_relocs): Update declarations.
12263 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12264 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12265 * target-reloc.h (relocate_for_relocatable): Change
12266 offset_in_output_section type to Elf_Addr. Change code that uses
12267 it as well.
12268 * layout.cc (Layout::layout): Always set *off.
12269 * mapfile.cc (Mapfile::print_input_section): Use
12270 output_section_offset.
12271 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12272 Sized_relobj*.
12273 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12274 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12275 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12276
5cb66f97
ILT
122772008-07-03 Ian Lance Taylor <iant@google.com>
12278
12279 * layout.cc (Layout::include_section): Do not discard unrecognized
12280 SHT_STRTAB sections.
12281
afe47622
CS
122822008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12283
12284 * script.cc (Lex::can_continue_name): Make '?' allowable in
12285 version-script names.
12286 * testsuite/version_script.map: Change glob pattern to use '?'
12287
5adf9721
ILT
122882008-06-30 Manish Singh <yosh@gimp.org>
12289
12290 PR 6585
12291 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12292 Correct typo.
12293
e6fde208
ILT
122942008-06-30 Ian Lance Taylor <iant@google.com>
12295
12296 PR 6660
12297 PR 6682
12298 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12299 versions]: Don't try to read the value in the contents, since we
12300 don't use it. Use the template endianness when writing.
12301
3f2e6a2d
CC
123022008-06-25 Cary Coutant <ccoutant@google.com>
12303
12304 * fileread.cc (File_read::make_view): Assert on zero-length view.
12305 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12306 symbol table when there are no symbols to read.
12307
c43d3a48
CS
123082008-06-23 Craig Silverstein <csilvers@google.com>
12309
12310 * version.cc (version_string): Bump to 1.7
12311
5f494ea0
CS
123122008-06-18 Craig Silverstein <csilvers@google.com>
12313
12314 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12315 constant 0xFFFF to type Valtype.
12316 (Powerpc_relocate_functions::rel16_ha): Likewise.
12317
c42e122e
ILT
123182008-06-17 Ian Lance Taylor <iant@google.com>
12319
f34787f8
ILT
12320 * output.h (Output_section::Input_section): Initialize p2align_ to
12321 zero for Output_section_data constructors.
12322 (Output_section::Input_section::addralign): If not an input
12323 section, return the alignment of the Output_section_data.
12324 * testsuite/copy_test.cc: New file.
12325 * testsuite/copy_test_1.cc: New file.
12326 * testsuite/copy_test_2.cc: New file.
12327 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12328 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12329 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12330 (copy_test_1_pic.o, copy_test_1.so): New targets.
12331 (copy_test_2_pic.o, copy_test_2.so): New targets.
12332 * testsuite/Makefile.in: Rebuild.
12333
c42e122e
ILT
12334 * script-sections.cc (Script_sections::place_orphan): Initialize
12335 local variable exact.
12336
ce3ac18a
DE
123372008-06-13 David Edelsohn <edelsohn@gnu.org>
12338
12339 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12340
42cacb20
DE
123412008-06-12 David Edelsohn <edelsohn@gnu.org>
12342 David S. Miller <davem@davemloft.net>
12343
12344 * powerpc.cc: New file.
12345 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12346 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12347 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12348 * Makefile.in: Rebuild.
12349
7b308235
ILT
123502008-06-09 Ian Lance Taylor <iant@google.com>
12351
12352 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12353 <exception>.
12354 (throwing, orig_terminate): New static variables.
12355 (terminate_handler): New static function.
12356 (t2): Set terminate handler.
12357
f0b886e3
ILT
123582008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12359
12360 PR 6584
cd536b21 12361 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12362 alignment.
12363
3e90f135
CC
123642008-05-30 Cary Coutant <ccoutant@google.com>
12365
12366 * archive.cc (Archive::include_all_members) Correct to step
12367 over symbol table and extended name table in thin archives.
12368
e09ad04a
ILT
123692008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12370
12371 PR 6407
12372 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12373 calculation.
12374
62b01cb5
ILT
123752008-05-28 Caleb Howe <cshowe@google.com>
12376
12377 * reduced_debug_output.cc: New file.
12378 * reduced_debug_output.h: New file.
92de84a6 12379 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12380 * options.cc (General_options::finalize): Add strip_debug_non_line
12381 to the strip heirarchy.
12382 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12383 fields.
12384 * layout.cc: Include "reduced_debug_output.h".
12385 (Layout::Layout): Initialize new fields.
12386 (line_only_debug_sections): New static array.
12387 (is_lines_only_debug_sections): New static inline function.
12388 (Layout::include_section): Handle --strip-debug-non-line.
12389 (Layout::make_output_section): If --strip-debug-non-line, build
12390 new output sections for .debug_abbrev and .debug_info.
12391 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12392 gold. Warn about possible overflow.
12393 (read_signed_LEB_128): Likewise.
12394 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12395 (read_signed_LEB_128): Declare.
12396 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12397 (HFILES): Add reduced_debug_output.h.
12398 * Makefile.in: Rebuild.
12399
7d9e3d98
ILT
124002008-05-21 Ian Lance Taylor <iant@google.com>
12401
12402 * mapfile.cc: New file.
12403 * mapfile.h: New file.
12404 * options.h (class General_options): Add -M/--print-map and -Map.
12405 * options.cc (General_options::finalize): Make -M equivalent to
12406 -Map -.
12407 * main.cc: Include <cstdio> and "mapfile.h".
12408 (main): Open mapfile if requested.
12409 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12410 constructor. Change caller.
12411 (queue_initial_tasks): Add mapfile parameter. Change caller.
12412 (queue_middle_tasks): Likewise.
12413 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12414 declarations.
12415 * archive.cc: Include "mapfile.h".
12416 (Archive::add_symbols): Add mapfile parameter. Change all
12417 callers. Pass mapfile, symbol, and reason to include_member.
12418 (Archive::include_all_members): Add mapfile parameter. Change all
12419 callers.
12420 (Archive::include_member): Add mapfile, sym, and why parameters.
12421 Change all callers. Report inclusion to map file.
12422 * archive.h: Include "fileread.h".
12423 (class Archive): Update declarations.
12424 (Archive::file): New const method.
12425 (class Add_archive_symbols): Add mapfile_ field. Update
12426 constructor. Change all callers.
12427 * readsyms.h (class Read_symbols): Likewise.
12428 (class Finish_group): Likewise.
12429 (class Read_script): Likewise.
12430 * common.cc: Include "mapfile.h".
12431 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12432 all callers.
12433 (Symbol_table::do_allocate_commons): Likewise.
12434 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12435 symbol allocation to mapfile.
12436 * common.h (class Allocate_commons_task): Add mapfile_ field.
12437 Update constructor. Change all callers.
12438 * symtab.h (class Symbol_table): Update declarations.
12439 * layout.cc: Include "mapfile.h".
12440 (Layout_task_runner::run): Print information to mapfile.
12441 (Layout::create_gold_note): Change Output_data_fixed_space to
12442 Output_data_zero_fill.
12443 (Layout::create_build_id): Likewise.
12444 (Layout::print_to_mapfile): New function.
12445 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12446 constructor. Change caller.
12447 (class Layout): Declare print_to_mapfile.
12448 * output.cc (Output_section::Input_section::print_to_mapfile): New
12449 function.
12450 (Output_section::add_input_section): If producing a map, always
12451 add to input_sections_ list.
12452 (Output_section::do_print_to_mapfile): New function.
12453 (Output_segment::print_sections_to_mapfile): New function.
12454 (Output_segment::print_section_list_to_mapfile): New function.
12455 * output.h: Include "mapfile.h".
12456 (Output_data::print_to_mapfile): New function.
12457 (Output_data::do_print_to_mapfile): New virtual function.
12458 (Output_segment_headers::do_print_to_mapfile): New function.
12459 (Output_file_header::do_print_to_mapfile): New function.
12460 (Output_data_const::do_print_to_mapfile): New function.
12461 (class Output_data_const_buffer): Add map_name_ field. Update
12462 constructor. Change all callers. Add do_print_to_mapfile
12463 function.
12464 (class Output_data_fixed_space): Likewise.
12465 (class Output_data_space): Likewise.
12466 (class Output_data_zero_fill): New class.
12467 (Output_data_strtab::do_print_to_mapfile): New function.
12468 (Output_data_reloc_base::do_print_to_mapfile): New function.
12469 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12470 (Output_data_group::do_print_to_mapfile): New function.
12471 (Output_data_got::do_print_to_mapfile): New function.
12472 (Output_data_dynamic::do_print_to_mapfile): New function.
12473 (Output_symtab_xindex::do_print_to_mapfile): New function.
12474 (class Output_section): Declare do_print_to_mapflie. Declare
12475 print_to_mapfile in Input_section.
12476 (class Output_segment): Declare new functions.
12477 * object.h (Sized_relobj::symbol_count): New function.
12478 * script-sections.cc
12479 (Output_section_element_dot_assignment::set_section_addresses):
12480 Change Output_data_fixed_space to Output_data_zero_fill.
12481 (Output_data_expression::do_print_to_mapfile): New function.
12482 * script.cc (read_input_script): Add mapfile parameter. Change
12483 all callers.
12484 * script.h (read_input_script): Update declaration.
12485 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12486 (Eh_frame::do_print_to_mapfile): New function.
12487 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12488 (Output_merge_string::do_print_to_mapfile): New function.
12489 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12490 function.
12491 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12492 function.
12493 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12494 function.
12495 * Makefile.am (CCFILES): Add mapfile.cc.
12496 (HFILES): Add mapfile.h.
12497 * Makefile.in: Rebuild.
12498
9f1d377b
ILT
124992008-05-19 Ian Lance Taylor <iant@google.com>
12500
12501 * options.h (class General_options): Add -z relro.
12502 * layout.cc (Layout::Layout): Initialize relro_segment_.
12503 (Layout::add_output_section_data): Return the output section.
12504 (Layout::make_output_section): Rcognize relro sections and mark
12505 them appropriately.
12506 (Layout::attach_allocated_section_to_segment): Put relro sections
12507 in a PT_GNU_RELRO segment.
12508 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12509 section as relro.
12510 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12511 PT_TLS segments.
12512 (Layout::linkonce_mapping): Map d.rel.ro.local to
12513 .data.rel.ro.local.
12514 (Layout::output_section_name): Us .data.rel.ro.local for any
12515 section which begins with that.
12516 * layout.h (class Layout): Update add_output_section_data
12517 declaration. Add relro_segment_ field.
12518 * output.cc (Output_section::Output_section): Initialize is_relro_
12519 and is_relro_local_ fields.
12520 (Output_segment::add_output_section): Group relro sections.
12521 (Output_segment::is_first_section_relro): New function.
12522 (Output_segment::maximum_alignment): If there is a relro section,
12523 align the segment to the common page size.
12524 (Output_segment::set_section_addresses): Track whether we are
12525 looking at relro sections. If the last section is a relro
12526 section, align to the common page size.
12527 (Output_segment::set_section_list_addresses): Add in_relro
12528 parameter. Change all callers. Align to the page size when
12529 moving from relro to non-relro section.
12530 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12531 segment.
12532 * output.h (class Output_section): Add is_relro_ and
12533 is_relro_local_ fields.
12534 (Output_section::is_relro): New function.
12535 (Output_section::set_is_relro): New function.
12536 (Output_section::is_relro_local): New function.
12537 (Output_section::set_is_relro_local): New function.
12538 (class Output_segment): Update declarations.
12539 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12540 * sparc.cc (Target_sparc::got_section): Likewise.
12541 * x86_64.cc (Target_x86_64::got_section): Likewise.
12542 * testsuite/relro_test_main.cc: New file.
12543 * testsuite/relro_test.cc: New file.
12544 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12545 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12546 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12547 (relro_test.so, relro_test_pic.o): New targets.
12548 * testsuite/Makefile.in: Rebuild.
12549
a984ee1d
ILT
125502008-05-16 Ian Lance Taylor <iant@google.com>
12551
01676dcd
ILT
12552 * output.cc (Output_segment::add_output_section): Remove front
12553 parameter.
12554 * output.h (class Output_segment): Remove
12555 add_initial_output_section and overloaded add_output_section.
12556 Update declaration of remaining add_output_section.
12557 * layout.cc (Layout::create_interp): Call add_output_section
12558 rather than add_initial_output_section.
12559 (Layout::finish_dynamic_section): Likewise.
12560
497897f9
ILT
12561 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12562 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12563 know the dynamic type.
12564 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12565 field. Initialize it in constructor.
12566 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12567 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12568 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12569 reloc.
12570
a984ee1d
ILT
12571 * output.cc (Output_reloc::get_address): Change return type to
12572 Elf_Addr.
12573 * output.h (class Output_reloc): Update get_address declaration.
12574 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12575 for section addresses.
12576
55ba0940
ILT
125772008-05-09 Ian Lance Taylor <iant@google.com>
12578
12579 PR 6493
12580 * gold.cc (gold_nomem): Use return value of write.
12581
75517b77
ILT
125822008-05-08 Ian Lance Taylor <iant@google.com>
12583
12584 * symtab.c (Symbol::init_base_output_data): Add version
12585 parameter. Change all callers.
12586 (Symbol::init_base_output_segment): Likewise.
12587 (Symbol::init_base_constant): Likewise.
12588 (Symbol::init_base_undefined): Likewise.
12589 (Sized_symbol::init_output_data): Likewise.
12590 (Sized_symbol::init_output_segment): Likewise.
12591 (Sized_symbol::init_constant): Likewise.
12592 (Sized_symbol::init_undefined): Likewise.
12593 (Symbol_table::do_define_in_output_data): If the new symbol has a
12594 version, mark it as the default.
12595 (Symbol_table::do_define_in_output_segment): Likewise.
12596 (Symbol_table::do_define_as_constant): Likewise.
12597 * symtab.h (class Symbol): Update declarations.
12598 (class Sized_symbol): Likewise.
12599 * resolve.cc (Symbol::override_version): New function.
c42e122e 12600 (Symbol::override_base): Call override_version.
75517b77
ILT
12601 (Symbol::override_base_with_special): Likewise.
12602 * testsuite/ver_script_8.script: New file.
12603 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12604 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12605 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12606 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12607
f1f70eae
ILT
126082008-05-06 Ian Lance Taylor <iant@google.com>
12609
f3e9c5c5
ILT
12610 PR 6049
12611 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12612 functions.
12613 (class General_options): Remove existing --undefined, and add
12614 --no-undefined instead. Add new --undefined as synonym for -u.
12615 * archive.cc (Archive::add_symbols): Check whether symbol was
12616 named with -u.
12617 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12618 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12619 all uses. Add IS_UNDEFINED. Update declarations to split
12620 different versions of init_base. Declare init_base_undefined.
12621 (Symbol::is_defined): Handle IS_UNDEFINED.
12622 (Symbol::is_undefined): Likewise.
12623 (Symbol::is_weak_undefined): Call is_undefined.
12624 (Symbol::is_absolute): Handle IS_CONSTANT.
12625 (class Sized_symbol): Update declarations to split different
12626 versions of init. Declare init_undefined.
12627 (class Symbol_table): Declare new functions.
12628 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12629 Change all callers.
12630 (Symbol::init_base_output_data): Likewise.
12631 (Symbol::init_base_output_segment): Likewise.
12632 (Symbol::init_base_constant): Likewise.
12633 (Symbol::init_base_undefined): New function.
12634 (Sized_symbol::init_object): Rename from init. Change all
12635 callers.
12636 (Sized_symbol::init_output_data): Likewise.
12637 (Sized_symbol::init_output_segment): Likewise.
12638 (Sized_symbol::init_constant): Likewise.
12639 (Sized_symbol::init_undefined): New function.
12640 (Symbol_table::add_undefined_symbols_from_command_line): New
12641 function.
12642 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12643 function.
12644 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12645 (Symbol::output_section): Likewise.
12646 (Symbol::set_output_section): Likewise.
12647 (Symbol_table::sized_finalize_symbol): Likewise.
12648 (Symbol_table::sized_write_globals): Likewise.
12649 * resolve.cc (Symbol_table::should_override): Likewise.
12650 (Symbol::override_base_with_special): Likewise.
12651
8bdcdf2c
ILT
12652 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12653 symbol, change it to have default visibility.
12654 * testsuite/protected_1.cc: New file.
12655 * testsuite/protected_2.cc: New file.
12656 * testsuite/protected_3.cc: New file.
12657 * testsuite/protected_main_1.cc: New file.
12658 * testsuite/protected_main_2.cc: New file.
12659 * testsuite/protected_main_3.cc: New file.
12660 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12661 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12662 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12663 (protected_1.so): New target.
12664 (protected_1_pic.o, protected_2_pic.o): New targets.
12665 (protected_3_pic.o): New target.
12666 (check_PROGRAMS): Add protected_2.
12667 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12668 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12669 * testsuite/Makefile.in: Rebuild.
12670
2b706932
ILT
12671 * options.h (DEFINE_var): Add set_user_set_##varname__.
12672 (DEFINE_bool_alias): New macro.
12673 (class General_options): Define -Bstatic using DEFINE_bool_alias
12674 rather than DEFINE_special. Add --undefined as an alias for -z
12675 defs.
12676 * options.cc (General_options::parse_Bstatic): Remove.
12677
d82a5bcc
ILT
12678 * options.h (class General_options): Add --fatal-warnings.
12679 * main.cc (main): Implement --fatal-warnings.
12680 * errors.h (Errors::warning_count): New function.
12681
f1f70eae
ILT
12682 * options.h (class General_options): Add -Bsymbolic-functions.
12683 * symtab.h (Symbol::is_preemptible): Check for
12684 -Bsymbolic-functions.
12685
8825ac63
ILT
126862008-05-05 Ian Lance Taylor <iant@google.com>
12687
d98bc257
ILT
12688 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12689 as noVARNAME rather than no-VARNAME.
12690 (class General_options): Add option -z combreloc.
12691 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12692 get_address.
12693 (Output_reloc::sort_before) [SHT_REL]: New function.
12694 (Output_reloc::sort_before) [SHT_RELA]: New function.
12695 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12696 Sort_relocs_comparison.
12697 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12698 parameter. Change all callers.
12699 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12700 sort_relocs parameter. Change all callers.
12701 * output.cc (Output_reloc::get_address): New function, broken out
12702 of write_rel.
12703 (Output_reloc::write_rel): Call it.
12704 (Output_reloc::compare): New function.
12705 (Output_data_reloc_base::do_write): Optionally sort relocs.
12706
60b2b4e7
ILT
12707 * configure.ac: If targ_extra_obj is set, link it in.
12708 * configure.tgt: Initialize all variables.
12709 (x86_64*): Set targ_extra_obj and targ_extra_size.
12710 * configure: Rebuild.
12711
8825ac63
ILT
12712 * object.cc (Sized_relobj::include_section_group): Adjust section
12713 indexes read from group data. Build vector to pass to
12714 layout_group.
12715 * layout.cc (Layout::layout_group): Add flags and shndxes
12716 parameters. Remove contents parameter. Change caller. Update
12717 explicit instantiations.
12718 * layout.h (class Layout): Update layout_group declaration.
12719 * output.cc (Output_data_group::Output_data_group): Add flags and
12720 input_shndxes parameters. Remove contents parameter. Change
12721 caller.
12722 (Output_data_group::do_write): Change input_sections_ to
12723 input_shndxes_.
12724 * output.h (class Output_data_group): Update constructor
12725 declaration. Rename input_sections_ to input_shndxes_.
12726 * testsuite/many_sections_test.cc: Add template.
12727
e94cf127
CC
127282008-04-30 Cary Coutant <ccoutant@google.com>
12729
4418b2d5
CC
12730 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12731
e94cf127
CC
12732 * layout.cc (Layout::include_section): Refactored check for debug
12733 info section.
12734 (Layout::add_comdat): Add new parameters. Change type
12735 of signature parameter. Add object and shndx to signatures table.
12736 (Layout::find_kept_object): New function.
12737 * layout.h: Include <cstring>.
12738 (Layout::is_debug_info_section): New function.
12739 (Layout::add_comdat): Add new parameters.
12740 (Layout::find_kept_object): New function.
12741 (Layout::Kept_section): New struct.
12742 (Layout::Signatures): Change type of map range.
12743 * object.cc (Relobj::output_section_address): New function.
12744 (Sized_relobj::include_section_group): Add new parameters. Change
12745 calls to Layout::add_comdat. Change to build table of kept comdat
12746 groups and table mapping discarded sections to kept sections.
12747 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12748 (Sized_relobj::do_layout): Change calls to include_section_group and
12749 include_linkonce_section.
12750 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12751 value to zero when section is discarded.
12752 (Sized_relobj::map_to_kept_section): New function.
12753 * object.h (Relobj::output_section_address): New function.
12754 (Relobj::Comdat_group): New type.
12755 (Relobj::find_comdat_group): New function.
12756 (Relobj::Comdat_group_table): New type.
12757 (Relobj::Kept_comdat_section): New type.
12758 (Relobj::Kept_comdat_section_table): New type.
12759 (Relobj::add_comdat_group): New function.
12760 (Relobj::set_kept_comdat_section): New function.
12761 (Relobj::get_kept_comdat_section): New function.
12762 (Relobj::comdat_groups_): New field.
12763 (Relobj::kept_comdat_sections_): New field.
12764 (Symbol_value::input_value): Update comment.
12765 (Sized_relobj::map_to_kept_section) New function.
12766 (Sized_relobj::include_linkonce_section): Add new parameter.
12767 * target-reloc.h (Comdat_behavior): New type.
12768 (get_comdat_behavior): New function.
12769 (relocate_section): Add code to map a discarded section to the
12770 corresponding kept section when applying a relocation.
12771
e4e5049b
CS
127722008-04-30 Craig Silverstein <csilvers@google.com>
12773
12774 * dwarf_reader.cc (next_generation_count): New static var.
12775 (Addr2line_cache_entry): New struct.
12776 (addr2line_cache): New static var.
12777 (Dwarf_line_info::one_addr2line): Added caching.
12778 (Dwarf_line_info::clear_addr2line_cache): New function.
12779 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12780 cache-size parameter.
12781 (Dwarf_line_info::one_addr2line_cache): New function.
12782 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12783 new cache-size argument to one_addr2line(), and clear cache.
12784
d09e9154
CC
127852008-04-28 Cary Coutant <ccoutant@google.com>
12786
12787 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12788 R_386_PC8 relocations.
12789
7ef73768
ILT
127902008-04-23 Ian Lance Taylor <iant@google.com>
12791
55438702
ILT
12792 * object.cc (Sized_relobj::include_section_group): Check for
12793 invalid section group.
12794
c165fb93
ILT
12795 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12796 header size.
12797
7ef73768
ILT
12798 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12799 than read for file header.
12800 * archive.cc (Archive::include_member): Likewise.
12801
6194aaab
L
128022008-04-23 Paolo Bonzini <bonzini@gnu.org>
12803
12804 * aclocal.m4: Regenerate.
12805 * configure: Regenerate.
12806
d491d34e
ILT
128072008-04-19 Ian Lance Taylor <iant@google.com>
12808
5ea2bac6
ILT
12809 * version.cc (version_string): Bump to 1.6.
12810
7bc3e21a
ILT
12811 * testsuite/Makefile.am (many_sections_r_test): New target.
12812 (many_sections_r_test_SOURCES): Remove.
12813 (many_sections_r_test_DEPENDENCIES): Remove.
12814 (many_sections_r_test_LDFLAGS): Remove.
12815 (many_sections_r_test_LDADD): Remove.
12816
7fcd3aa9
ILT
12817 * object.cc (Sized_relobj::do_add_symbols): Always pass
12818 local_symbol_count_ to add_from_relobj.
12819
4c94d6ae
ILT
12820 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12821 every thousand variables.
12822 * testsuite/Makefile.in: Rebuild.
12823
d491d34e
ILT
12824 * object.cc (Xindex::initialize_symtab_xindex): New function.
12825 (Xindex::read_symtab_xindex): New function.
12826 (Xindex::sym_xindex_to_shndx): New function.
12827 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12828 available.
12829 (Sized_relobj::do_initialize_xindex): New function.
12830 (Sized_relobj::do_read_symbols): Adjust section links.
12831 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12832 parameter. Change all callers.
12833 (Sized_relobj::include_section_group): Adjust section links and
12834 symbol section indexes.
12835 (Sized_relobj::do_layout): Adjust section links.
12836 (Sized_relobj::do_count_local_symbols): Adjust section links and
12837 symbol section indexes.
12838 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12839 ordinary and special symbols.
12840 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12841 dynsym_xindex parameters. Change all callers. Adjust section
12842 links. Use SHN_XINDEX when needed.
12843 (Sized_relobj::get_symbol_location_info): Adjust section links.
12844 Don't get fooled by special symbols.
12845 * object.h (class Xindex): Define.
12846 (class Object): Add xindex_ parameter. Declare virtual functoin
12847 do_initialize_xindex.
12848 (Object::adjust_sym_shndx): New function.
12849 (Object::set_xindex): New protected function.
12850 (class Symbol_value): Add is_ordinary_shndx_ field.
12851 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12852 (Symbol_value::value): Assert ordinary section.
12853 (Symbol_value::initialize_input_to_output_map): Likewise.
12854 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12855 Change all callers.
12856 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12857 all callers.
12858 (class Sized_relobj): Update declarations.
12859 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12860 parameter. Change all callers.
12861 (Sized_relobj::adjust_shndx): New function.
12862 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12863 field.
12864 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12865 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12866 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12867 (Sized_dynobj::read_dynsym_section): Adjust section links.
12868 (Sized_dynobj::read_dynamic): Likewise.
12869 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12870 section links.
12871 (Sized_dynobj::do_initialize_xindex): New function.
12872 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12873 do_initialize_xindex.
12874 (Sized_dynobj::adjust_shndx): New function.
12875 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12876 dynsym_xindex_ fields.
12877 (Layout::finalize): Add a call to set_section_indexes before
12878 creating the symtab sections.
12879 (Layout::set_section_indexes): Don't do anything if the section
12880 already has a section index.
12881 (Layout::create_symtab_sections): Add shnum parameter. Change
12882 caller. Create .symtab_shndx section if needed.
12883 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12884 caller.
12885 (Layout::allocated_output_section_count): New function.
12886 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12887 needed.
12888 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12889 fields. Update declarations.
12890 (Layout::symtab_xindex): New function.
12891 (Layout::dynsym_xindex): New function.
12892 (class Write_symbols_task): Add layout_ field.
12893 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12894 Change caller.
12895 * output.cc (Output_section_headers::Output_section_headers): Add
12896 shstrtab_section parameter. Change all callers.
12897 (Output_section_headers::do_sized_write): Store overflow values
12898 for section count and section string table section index in
12899 section header zero.
12900 (Output_file_header::do_sized_write): Check for overflow of
12901 section count and section string table section index.
12902 (Output_symtab_xindex::do_write): New function.
12903 (Output_symtab_xindex::endian_do_write): New function.
12904 * output.h (class Output_section_headers): Add shstrtab_section_.
12905 Update declarations.
12906 (class Output_symtab_xindex): Define.
12907 (Output_section::has_out_shndx): New function.
12908 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12909 field.
12910 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12911 Change all callers.
12912 (Sized_symbol::init): Likewise.
12913 (Symbol::output_section): Check for ordinary symbol.
12914 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12915 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12916 callers.
12917 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12918 Change all callers. Simplify handling of symbols from sections
12919 not included in the link.
12920 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12921 distinction.
12922 (Weak_alias_sorter::operator()): Assert that symbols are
12923 ordinary.
12924 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12925 distinction.
12926 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12927 parameters. Change all callers.
12928 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12929 symbol distinction. Use SHN_XINDEX when needed.
12930 (Symbol_table::write_section_symbol): Add symtab_xindex
12931 parameter. Change all callers.
12932 (Symbol_table::sized_write_section_symbol): Likewise. Use
12933 SHN_XINDEX when needed.
12934 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12935 declarations.
12936 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12937 (Symbol::is_defined): Check is_ordinary.
12938 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12939 (Symbol::is_absolute, Symbol::is_common): Likewise.
12940 (class Sized_symbol): Update declarations.
12941 (class Symbol_table): Update declarations.
12942 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12943 parameters. Change all callers.
12944 (Sized_symbol::override): Likewise.
12945 (Symbol_table::override): Likewise.
12946 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12947 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12948 is_ordinary, and orig_st_shndx parameters. Change all callers.
12949 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12950 to be in an ordinary section.
12951 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12952 object and is_ordinary parameters. Change all callers.
12953 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12954 Change all callers. Don't add undefined or non-ordinary symbols
12955 to reloc_map_.
12956 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12957 Change all callers.
12958 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12959 declarations.
12960 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12961 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12962 (Sized_relobj::relocate_sections): Likewise.
12963 * target-reloc.h (scan_relocs): Adjust section symbol index.
12964 (scan_relocatable_relocs): Likewise.
12965 * i386.cc (Scan::local): Check for ordinary symbols.
12966 * sparc.cc (Scan::local): Likewise.
12967 * x86_64.cc (Scan::local): Likewise.
12968 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12969 to symbol_section_and_value.
12970 * testsuite/many_sections_test.cc: New file.
12971 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12972 (check_PROGRAMS): Add many_sections_test.
12973 (many_sections_test_SOURCES): Define.
12974 (many_sections_test_DEPENDENCIES): Define.
12975 (many_sections_test_LDFLAGS): Define.
12976 (BUILT_SOURCES): Add many_sections_define.h.
12977 (many_sections_define.h): New target.
12978 (BUILT_SOURCES): Add many_sections_check.h.
12979 (many_sections_check.h): New target.
12980 (check_PROGRAMS): Add many_sections_r_test.
12981 (many_sections_r_test_SOURCES): Define.
12982 (many_sections_r_test_DEPENDENCIES): Define.
12983 (many_sections_r_test_LDFLAGS): Define.
12984 (many_sections_r_test_LDADD): Define.
12985 (many_sections_r_test.o): New target.
12986 * testsuite/Makefile.in: Rebuild.
12987
c5818ff1
CC
129882008-04-17 Cary Coutant <ccoutant@google.com>
12989
12990 * errors.cc (Errors::info): New function.
12991 (gold_info): New function.
12992 * errors.h (Errors::info): New function.
12993 * gold.h (gold_info): New function.
12994 * object.cc (Input_objects::add_object): Print trace output.
12995 * options.cc (options::parse_set): New function.
12996 (General_options::parse_wrap): Deleted.
12997 (General_options::General_options): Deleted initializer.
12998 * options.h (options::String_set): New typedef.
12999 (options::parse_set): New function.
13000 (DEFINE_set): New macro.
13001 (General_options::wrap): Changed to use DEFINE_set. Changed
13002 callers of any_wrap_symbols and is_wrap_symbol.
13003 (General_options::trace, General_options::trace_symbol):
13004 New options.
13005 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
13006 (General_options::wrap_symbols_): Deleted.
13007 * symtab.cc (Symbol_table::add_from_object): Print trace output.
13008
b5be4a7c
DM
130092008-04-17 David S. Miller <davem@davemloft.net>
13010
13011 * options.cc (General_options::parse_V): New function.
13012 * options.h: Add entries for -V and -Qy.
13013
155a0dd7
ILT
130142008-04-17 Ian Lance Taylor <iant@google.com>
13015
13016 * common.cc (Symbol_table::allocate_commons): Remove options
13017 parameter. Change caller.
13018 (Symbol_table::do_allocate_commons): Remove options parameter.
13019 Change caller. Just call do_allocate_commons_list twice.
13020 (Symbol_table::do_allocate_commons_list): New function, broken out
13021 of do_allocate_commons.
13022 * common.h (class Allocate_commons_task): Remove options_ field.
13023 Update constructor.
13024 * symtab.cc (Symbol_table::Symbol_table): Initialize
13025 tls_commons_.
13026 (Symbol_table::add_from_object): Put TLS common symbols on
13027 tls_commons_ list.
13028 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
13029 which are IN_OUTPUT_DATA.
13030 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
13031 allocate_commons and do_allocate_commons declarations. Declare
13032 do_allocate_commons_list.
13033 * gold.cc (queue_middle_tasks): Update creation of
13034 Allocate_commons_task to not pass options.
13035 * testsuite/Makefile.am (INCLUDES): Add -I.. .
13036 (TLS_TEST_C_FLAGS): New variable.
13037 (tls_test_c_pic.o): New target.
13038 (tls_test_shared.so): Link in tls_test_c_pic.o.
13039 (tls_test_c_pic_ie.o): New target.
13040 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
13041 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
13042 (tls_test_c.o): New target.
13043 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
13044 (tls_pic_test_LDADD): Likewise.
13045 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
13046 (tls_shared_gd_to_ie_test_LDADD): Likewise.
13047 (tls_test_c_gnu2.o): New target.
13048 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
13049 tls_test_c_gnu2.o.
13050 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
13051 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
13052 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
13053 * testsuite/tls_test.cc: Include "config.h".
13054 (t_last): Call t11_last.
13055 * testsuite/tls_test.h (t11, t11_last): Declare.
13056 * testsuite/tls_test_c.c: New file.
13057 * testsuite/tls_test_main.cc (thread_routine): Call t11.
13058 * configure.ac: Check for OpenMP support.
13059 * configure, config.in, Makefile.in: Rebuild.
13060 * testsuite/Makefile.in: Rebuild.
13061
edfbb029
CC
130622008-04-16 Cary Coutant <ccoutant@google.com>
13063
13064 * i386.cc (Target_i386::define_tls_base_symbol): New function.
13065 (Target_i386::tls_base_symbol_defined_): New field.
13066 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13067 (Target_i386::Scan::global): Likewise.
13068 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
13069 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
13070 (Target_x86_64::tls_base_symbol_defined_): New field.
13071 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
13072 (Target_x86_64::Scan::global): Likewise.
13073
f3c69fca
CC
130742008-04-16 Cary Coutant <ccoutant@google.com>
13075
13076 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
13077 (Symbol::needs_plt_entry): Allow weak undefined symbols.
13078 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
13079 building shared libraries.
13080 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
13081 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
13082 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13083 * testsuite/Makefile.in: Rebuild.
13084 * testsuite/weak_undef.h: New file.
13085 * testsuite/weak_undef_file1.cc: Add extra test cases.
13086 * testsuite/weak_undef_file2.cc: Likewise.
13087 * testsuite/weak_undef_test.cc: Likewise.
13088
7c414435
DM
130892008-04-16 David S. Miller <davem@davemloft.net>
13090
32b769e1
DM
13091 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13092 Add issued_non_pic_error_ field. Declare check_non_pic.
13093 (Target_sparc::Scan::check_non_pic): New function.
13094 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13095 (Target_sparc::Scan::global): Likewise.
13096
11936fb1
DM
13097 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13098 * configure: Rebuild.
13099
7c414435
DM
13100 * options.h (DEFINE_enable): New macro.
13101 (new_dtags): New enable option.
13102 (initfirst, interpose, loadfltr, nodefaultlib,
13103 nodelete, nodlopen, nodump): New -z options.
13104 * layout.cc (Layout:finish_dynamic_section): If new
13105 dtags enabled, emit DT_RUNPATH. Also, emit a
13106 DT_FLAGS_1 containing any specified -z flags.
13107
85c7bf8b
ILT
131082008-04-16 Ian Lance Taylor <iant@google.com>
13109
12c0daef
ILT
13110 * copy-relocs.cc: New file.
13111 * copy-relocs.h: New file.
13112 * reloc.cc: Remove Copy_relocs code.
13113 * reloc.h: Likewise.
13114 * reloc-types.h (struct Reloc_types) [both versions]: Add
13115 get_reloc_addend_noerror.
13116 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13117 variants of add_global which take an addend which must be zero.
13118 * i386.cc: Include "copy-relocs.h".
13119 (class Target_i386): Change type of copy_relocs_ to variable,
13120 update initializer.
13121 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13122 Change all callers.
13123 (Target_i386::do_finalize_sections): Change handling of
13124 copy_relocs_.
13125 * sparc.cc: Include "copy-relocs.h".
13126 (class Target_sparc): Change type of copy_relocs_ to variable,
13127 update initializer.
13128 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13129 Change all callers.
13130 (Target_sparc::do_finalize_sections): Change handling of
13131 copy_relocs_.
13132 * x86_64.cc: Include "copy-relocs.h".
13133 (class Target_x86_64): Change type of copy_relocs_ to variable,
13134 update initializer.
13135 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13136 class. Change all callers.
13137 (Target_x86_64::do_finalize_sections): Change handling of
13138 copy_relocs_.
13139 * Makefile.am (CCFILES): Add copy-relocs.cc.
13140 (HFILES): Add copy-relocs.h.
13141
4f4995b6
ILT
13142 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13143
85c7bf8b
ILT
13144 * testsuite/script_test_4.sh: Permit leading zeroes.
13145
4f2a9edd
ILT
131462008-04-15 Ian Lance Taylor <iant@google.com>
13147
e6188289
ILT
13148 * script-sections.cc (Script_sections::create_segments): Use
13149 header_size_adjustment even when there is enough room for the
13150 headers.
13151 * testsuite/script_test_4.sh: New file.
13152 * testsuite/script_test_4.t: New file.
13153 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13154 (check_DATA): Add script_test_4.stdout.
13155 (MOSTLYCLEANFILES): Likewise.
13156 (script_test_4): New target.
13157 (script_test_4.stdout): New target.
13158 * testsuite/Makefile.in: Rebuild.
13159
4f2a9edd
ILT
13160 * sparc.cc: Add definitions for Output_data_plt_sparc class
13161 constants.
13162
f5314dd5
DM
131632008-04-14 David S. Miller <davem@davemloft.net>
13164
13165 * sparc.cc: New file.
13166 * Makefile.am (TARGETSOURCES): Add sparc.cc
13167 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13168 * configure.tgt: Document targ_extra_size and
13169 targ_extra_big_endian. Add entries for sparc-* and
13170 sparc64-*.
13171 * configure.ac: Handle targ_extra_size and
13172 targ_extra_big_endian.
13173 * Makefile.in: Rebuild.
13174 * configure: Likewise.
13175 * po/POTFILES.in: Likewise.
13176 * po/gold.pot: Likewise.
13177
154e0e9a
ILT
131782008-04-14 Ian Lance Taylor <iant@google.com>
13179
13180 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13181 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13182 in the name/type/flags to section mapping. Don't call
13183 allocate_output_section.
13184 (Layout::choose_output_section): Change parameter from adjust_name
13185 to is_input_section. Don't permit input sections after sections
13186 are attached to segments. Don't call allocate_output_section.
13187 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13188 not write_enable_output_section.
13189 (Layout::make_output_section): Don't push to
13190 unattached_section_list_ nor call attach_to_segment. Call
13191 attach_section_to_segment if sections are attached.
13192 (Layout::attach_sections_to_segments): New function.
13193 (Layout::attach_section_to_segment): New function.
13194 (Layout::attach_allocated_section_to_segment): Rename from
13195 attach_to_segment. Remove flags parameter.
13196 (Layout::allocate_output_section): Remove function.
13197 (Layout::write_enable_output_section): Remove function.
13198 * layout.h (class Layout): Update for above changes. Add new
13199 field sections_are_attached_.
13200 * output.h (Output_section::update_flags_for_input_section): New
13201 function.
13202 * output.cc (Output_section::add_input_section): Call
13203 update_flags_for_input_section.
13204 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13205
009a67a2
CC
132062008-04-11 Cary Coutant <ccoutant@google.com>
13207
13208 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13209 thought unnecessary.
13210 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13211
759b1a24
ILT
132122008-04-11 Ian Lance Taylor <iant@google.com>
13213
13214 * output.h (class Output_section_data): Remove inline definition
13215 of set_addralign.
13216 * output.cc (Output_section_data::set_addralign): New function.
13217
c2b45e22
CC
132182008-04-11 Cary Coutant <ccoutant@google.com>
13219
13220 Add support for TLS descriptors for i386 and x86_64.
13221 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13222 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13223 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13224 GOT_TYPE_TLS_DESC.
13225 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13226 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13227 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13228 relocations.
13229 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13230 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13231 Fix problem with initial-exec relocations.
13232 (Target_i386::Relocate::relocate_tls): Likewise.
13233 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13234 relaxation.
13235 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13236 support for section-plus-offset dynamic table entries.
13237 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13238 (Output_data_dynamic::Dynamic_entry): Add support for
13239 section-plus-offset dynamic table entries.
13240 (Output_data_dynamic::Classification): Likewise.
13241 (Output_data_dynamic::classification_): Renamed offset_.
13242 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13243 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13244 (Target_x86_64::make_plt_section): New function.
13245 (Target_x86_64::reserve_tlsdesc_entries): New function.
13246 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13247 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13248 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13249 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13250 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13251 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13252 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13253 add extra PLT entry for TLS descriptors.
13254 (Output_data_plt_x86_64::got_): New field.
13255 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13256 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13257 fields.
13258 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13259 descriptors.
13260 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13261 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13262 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13263 R_386_TLS_DESC_CALL relocations.
13264 (Target_x86_64::Scan::global): Likewise.
13265 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13266 for TLS descriptors.
13267 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13268 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13269 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13270 GD-to-IE relaxation.
13271 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13272 and TLS_DESCRIPTORS.
13273 * Makefile.in: Rebuild.
13274 * configure: Rebuild.
13275 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13276 (tls_test_shared2.so): New target.
13277 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13278 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13279 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13280 (tls_shared_gd_to_ie_test_LDADD): New variable.
13281 (tls_shared_gnu2_gd_to_ie_test): New target.
13282 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13283 New targets.
13284 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13285 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13286 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13287 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13288 (tls_shared_gnu2_test): New target.
13289 (tls_test_gnu2_shared.so): New target.
13290 (tls_shared_gnu2_test_SOURCES): New variable.
13291 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13292 (tls_shared_gnu2_test_LDFLAGS): New variable.
13293 (tls_shared_gnu2_test_LDADD): New variable.
13294 * testsuite/Makefile.in: Rebuild.
13295 * testsuite/Makefile.
13296
83bfb6b7
ILT
132972008-04-11 Ian Lance Taylor <iant@google.com>
13298
13299 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13300 justsyms.t.
13301 * testsuite/Makefile.in: Rebuild.
13302
13303 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13304 long.
13305 * testsuite/script_test_2.cc (main): Adjust test.
13306
706e1f5e
ILT
133072008-04-11 David S. Miller <davem@davemloft.net>
13308 Ian Lance Taylor <iant@google.com>
13309
13310 * options.h (General_options): Add entries for '-Y' and
13311 '-relax'.
13312 * options.cc (General_options:finalize): If -Y was used, add those
13313 entries to the library path instead of the default "/lib" and
13314 "/usr/lib".
13315
7c98e6bb
DM
133162008-04-11 David S. Miller <davem@davemloft.net>
13317
13318 * testsuite/justsyms.t: Start at 0x100.
13319 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13320 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13321 long.
13322 * testsuite/script_test_2.cc: Adjust string and section length
13323 checks.
7c98e6bb 13324
99a37bfd
ILT
133252008-04-09 Ian Lance Taylor <iant@google.com>
13326
2cefc357
ILT
13327 PR gold/5996
13328 * script-sections.cc (Sections_element::allocate_to_segment): Add
13329 orphan parameter.
13330 (Output_section_definition::allocate_to_segment): Likewise.
13331 (Orphan_output_section::allocate_to_segment): Likewise.
13332 (Script_sections::attach_sections_using_phdrs_clause): Don't
13333 propagate non-PT_LOAD segments to orphan sections.
13334 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13335 readelf rather than objdump.
13336 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13337 .interp section and PT_INTERP segment are the same size.
13338 * testsuite/Makefile.in: Rebuild.
13339
99a37bfd
ILT
13340 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13341 aliases for symbols defined in the same object.
13342 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13343 (weak_alias_test_SOURCES): New variable.
13344 (weak_alias_test_DEPENDENCIES): New variable.
13345 (weak_alias_test_LDFLAGS): New variable.
13346 (weak_alias_test_LDADD): New variable.
13347 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13348 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13349 (weak_alias_test_3.o): New target.
13350 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13351 * testsuite/weak_alias_test_main.cc: New file.
13352 * testsuite/weak_alias_test_1.cc: New file.
13353 * testsuite/weak_alias_test_2.cc: New file.
13354 * testsuite/weak_alias_test_3.cc: New file.
13355
780e49c5
ILT
133562008-04-08 Ian Lance Taylor <iant@google.com>
13357
cdb0b8f5
ILT
13358 * options.h (class General_options): Add --noinhibit-exec option.
13359 * main.cc (main): Check --noinhibit-exec.
13360
0864d551
ILT
13361 * options.h (class General_options): Define --wrap as a special
13362 option. Add wrap_symbols_ field.
13363 (General_options::any_wrap_symbols): New function.
13364 (General_options::is_wrap_symbol): New function.
13365 * options.cc (General_options::parse_wrap): New function.
13366 (General_options::General_options): Initialize wrap_symbols_.
13367 * symtab.cc (Symbol_table::wrap_symbol): New function.
13368 (Symbol_table::add_from_object): Handle --wrap.
13369 * symtab.h (class Symbol_table): Declare wrap_symbol.
13370 * target.h (Target::wrap_char): New function.
13371 (Target::Target_info): Add wrap_char field.
13372 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13373 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13374 * testsuite/testfile.cc (Target_test::test_target_info):
13375 Likewise.
13376
789aa6de
ILT
13377 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13378 there is one.
13379
2c38906f
ILT
13380 * layout.h (class Layout): Add added_eh_frame_data_ field.
13381 * layout.cc (Layout::Layout): Initialize new field.
13382 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13383 output section until we find a section we merged successfully.
13384 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13385 that the size be non-zero.
13386
780e49c5
ILT
13387 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13388 qualifier.
13389
7fcd0256
ILT
133902008-04-08 Craig Silverstein <csilvers@google.com>
13391
13392 * configure.ac: Export new conditional variable HAVE_ZLIB.
13393 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13394 on HAVE_ZLIB.
13395 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13396 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13397
6835af53
ILT
133982008-04-07 Ian Lance Taylor <iant@google.com>
13399
e24f324c
ILT
13400 * version.cc (version_string): Set to "1.5".
13401
a036edd8
ILT
13402 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13403 Add issued_non_pic_error_ field. Declare check_non_pic.
13404 (Target_x86_64::Scan::check_non_pic): New function.
13405 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13406 (Target_x86_64::Scan::global): Likewise.
13407
624f8810
ILT
13408 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13409 addend parameter. Change caller. Handle merge sections.
13410 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13411 Address to Addend. Don't add in the result of
13412 local_section_offset, pass down the addend and use the returned
13413 value.
13414 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13415 Update declarations of local_section_offset and symbol_value.
13416 * testsuite/two_file_test_1.cc (t18): New function.
13417 * testsuite/two_file_test_2.cc (f18): New function.
13418 * testsuite/two_file_test_main.cc (main): Call t18.
13419 * testsuite/two_file_test.h (t18, f18): Declare.
13420
6835af53
ILT
13421 * configure.ac: Don't test for objdump, c++filt, or readelf.
13422 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13423 conditionals.
13424 (TEST_READELF): New variable.
13425 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13426 (check_PROGRAMS): Add two_file_strip_test.
13427 (two_file_strip_test): New target.
13428 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13429 (two_file_same_shared_strip_test_SOURCES): New variable.
13430 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13431 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13432 (two_file_same_shared_strip_test_LDADD): New variable.
13433 (two_file_shared_strip.so): New target.
13434 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13435 (ver_test_5.syms, ver_test_7.syms): Likewise.
13436 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13437 (strip_test_3.stdout): Use TEST_OBJDUMP.
13438 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13439
86925eef
CC
134402008-04-04 Cary Coutant <ccoutant@google.com>
13441
13442 * symtab.h (Symbol::is_weak_undefined): New function.
13443 (Symbol::is_strong_undefined): New function.
13444 (Symbol::is_absolute): New function.
13445 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13446 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13447 absolute symbols.
13448 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13449 (weak_undef_test): New target.
13450 * testsuite/Makefile.in: Rebuild.
13451 * testsuite/weak_undef_file1.cc: New file.
13452 * testsuite/weak_undef_file2.cc: New file.
13453 * testsuite/weak_undef_test.cc: New file.
13454
126f3ece
ILT
134552008-04-03 Craig Silverstein <csilvers@google.com>
13456
13457 * compressed_output.h (class Output_compressed_section): Use
13458 unsigned buffer.
13459 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13460 add zlib header.
13461 (zlib_compressed_suffix): Removed.
13462 (Output_compressed_section::set_final_data_size): Use unsigned
13463 buffers.
13464 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13465 Fix linker invocation.
13466 (flagstest_o_specialfile_and_compress_debug_sections):
13467 Likewise.
13468 * testsuite/Makefile.in: Regenerated.
13469
deae2a14
DM
134702008-04-02 David S. Miller <davem@davemloft.net>
13471
13472 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13473 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13474
70752818
ILT
134752008-04-02 Craig Silverstein <csilvers@google.com>
13476
13477 * TODO: New file.
13478
39d0cb0e
ILT
134792008-04-02 Ian Lance Taylor <iant@google.com>
13480
13481 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13482 parameters. Update for new key type to views_. Change all
13483 callers.
13484 (File_read::read): Adjust for byteshift in returned view.
13485 (File_read::add_view): New function, broken out of
13486 find_and_make_view.
13487 (File_read::make_view): New function, broken out of
13488 find_and_make_view.
13489 (File_read::find_or_make_view): Add offset and aligned
13490 parameters. Rewrite accordingly. Change all callers.
13491 (File_read::get_view): Add offset and aligned parameters. Adjust
13492 for byteshift in return value.
13493 (File_read::get_lasting_view): Likewise.
13494 * fileread.h (class File_read): Update declarations.
13495 (class File_read::View): Add byteshift_ field. Add byteshift to
13496 constructor. Add byteshift method.
13497 * archive.h (Archive::clear_uncached_views): New function.
13498 (Archive::get_view): Add aligned parameter. Change all callers.
13499 * object.h (Object::get_view): Add aligned parameter. Change all
13500 callers.
13501 (Object::get_lasting_view): Likewise.
13502
13503 * fileread.cc (File_read::release): Don't call clear_views if
13504 there are multiple objects.
13505 * fileread.h (File_read::clear_uncached_views): New function.
13506 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13507 on the archive.
13508
a1207466
CC
135092008-03-31 Cary Coutant <ccoutant@google.com>
13510
13511 Add thin archive support.
13512 * archive.cc (Archive::armagt): New const.
13513 (Archive::setup): Remove task parameter and calls to unlock.
13514 (Archive::unlock_nested_archives): New function.
13515 (Archive::read_header): Add nested_off parameter. Change
13516 all callers.
13517 (Archive::interpret_header): Likewise.
13518 (Archive::include_all_members): Change to handle thin
13519 archives.
13520 (Archive::include_member): Likewise.
13521 * archive.h (Archive::Archive): Add new parameters and
13522 initializers.
13523 (Archive::armagt): New const.
13524 (Archive::setup): Remove task parameter.
13525 (Archive::unlock_nested_archives): New function.
13526 (Archive::read_header): Add nested_off parameter.
13527 (Archive::interpret_header): Likewise.
13528 (Archive::Nested_archive_table): New typedef.
13529 (Archive::is_thin_archive_): New field.
13530 (Archive::nested_archives_): New field.
13531 (Archive::options_): New field.
13532 (Archive::dirpath_): New field.
13533 (Archive::task_): New field.
13534 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13535 for thin archives. Pass additional parameters to
13536 Archive::Archive. Unlock the archive file after calling
13537 Archive::setup.
cd536b21 13538
479f6503
ILT
135392008-03-29 Ian Lance Taylor <iant@google.com>
13540
686c8caf
ILT
13541 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13542 version symbol to be local.
13543 * testsuite/ver_test_4.sh: New file.
13544 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13545 (check_DATA): Add ver_test_4.syms.
13546 (ver_test_4.syms): New target.
13547 * testsuite/Makefile.in: Rebuild.
13548
ab794b6b
ILT
13549 * output.cc
13550 (Output_section::Input_section_sort_entry::has_priority): New
13551 function.
13552 (Output_section::Input_section_sort_entry::match_file_name): New
13553 function.
13554 (Output_section::Input_section_sort_entry::match_section_name):
13555 Remove.
13556 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13557 Remove.
13558 (Output_section::Input_section_sort_entry::match_section_file):
13559 Remove.
13560 (Output_section::Input_section_sort_compare::operator()): Rewrite
13561 using new Input_section_sort_entry functions. Sort crtbegin and
13562 crtend first. Sort sections with no priority before sections with
13563 a priority.
13564 * testsuite/initpri1.c (d3): Check j != 4.
13565 (cd5): New constructor/destructor function.
13566 (main): Check j != 2.
13567
479f6503
ILT
13568 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13569 new symbol when resolving, don't call set_is_default.
13570 * testsuite/ver_test_7.cc: New file.
13571 * testsuite/ver_test_7.sh: New file.
13572 * testsuite/Makefile.am (ver_test_7.so): New target.
13573 (ver_test_7.o): New target.
13574 (check_SCRIPTS): Add ver_test_7.sh.
13575 (check_DATA): Add ver_test_7.syms.
13576 (ver_test_7.syms): New target.
13577
2fd32231
ILT
135782008-03-28 Ian Lance Taylor <iant@google.com>
13579
13580 * layout.cc (Layout::layout): If we see an input section with a
13581 name that needs sorting, set the must_sort flag for the output
13582 section.
13583 (Layout::make_output_section): If the name of the output section
13584 indicates that it might require sorting, set the may_sort flag.
13585 * output.h (Output_section::may_sort_attached_input_sections): New
13586 function.
13587 (Output_section::set_may_sort_attached_input_sections): New
13588 function.
13589 (Output_section::must_sort_attached_input_sections): New
13590 function.
13591 (Output_section::set_must_sort_attached_input_sections): New
13592 function.
13593 (class Output_section): Declare Input_section_sort_entry. Define
13594 Input_section_sort_compare. Declare
13595 sort_attached_input_sections. Add new fields:
13596 may_sort_attached_input_sections_,
13597 must_sort_attached_input_sections_,
13598 attached_input_sections_are_sorted_.
13599 * output.cc (Output_section::Output_section): Initialize new
13600 fields.
13601 (Output_section::add_input_section): Add an entry to
13602 input_sections_ if may_sort or must_sort are true.
13603 (Output_section::set_final_data_size): Call
13604 sort_attached_input_sections if necessary.
13605 (Output_section::Input_section_sort_entry): Define new class.
13606 (Output_section::Input_section_sort_compare::operator()): New
13607 function.
13608 (Output_section::sort_attached_input_sections): New function.
13609 * configure.ac: Check whether the compiler supports constructor
13610 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13611 * testsuite/initpri1.c: New file.
13612 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13613 CONSTRUCTOR_PRIORITY.
13614 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13615 (initpri1_LDFLAGS): New variable.
13616 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13617
18e6b24e
ILT
136182008-03-27 Ian Lance Taylor <iant@google.com>
13619
49bdd526
ILT
13620 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13621 * testsuite/common_test_1.c: New file.
13622 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13623 (common_test_1_SOURCES): New variable.
13624 (common_test_1_DEPENDENCIES): New variable.
13625 (common_test_1_LDFLAGS): New variable.
13626
18e6b24e
ILT
13627 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13628 and commons_ correctly when NAME/VERSION does not override
13629 NAME/NULL.
13630 * testsuite/ver_test_6.c: New file.
13631 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13632 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13633 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13634
04bf7072
ILT
136352008-03-26 Ian Lance Taylor <iant@google.com>
13636
5871526f
ILT
13637 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13638 of an undefined symbol from a version script.
13639 * testsuite/Makefile.am (ver_test_5.so): New target.
13640 (ver_test_5.o): New target.
13641 (check_SCRIPTS): Add ver_test_5.sh.
13642 (check_DATA): Add ver_test_5.syms.
13643 (ver_test_5.syms): New target.
13644 * testsuite/ver_test_5.cc: New file.
13645 * testsuite/ver_test_5.script: New file.
13646 * testsuite/ver_test_5.sh: New file.
13647 * Makefile.in, testsuite/Makefile.in: Rebuild.
13648
04bf7072
ILT
13649 PR gold/5986
13650 Fix problems building gold with gcc 4.3.0.
13651 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13652 (gold_error_at_location, gold_warning_at_location): Use it.
13653 * configure.ac: Check whether we can compile and use a template
13654 function with a printf attribute.
13655 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13656 when jumping over bytes.
13657 * object.cc: Instantiate Object::read_section_data.
13658 * debug.h: Include <cstring>
13659 * dwarf_reader.cc: Include <algorithm>
13660 * main.cc: Include <cstring>.
13661 * options.cc: Include <cstring>.
13662 * output.cc: Include <cstring>.
13663 * script.cc: Include <cstring>.
13664 * script.h: Include <string>.
13665 * symtab.cc: Include <cstring> and <algorithm>.
13666 * target-select.cc: Include <cstring>.
13667 * version.cc: Include <string>.
13668 * testsuite/testmain.cc: Include <cstdlib>.
13669 * configure, config.in: Rebuild.
13670
874c5b28
ILT
136712008-03-25 Ian Lance Taylor <iant@google.com>
13672
819d6c3a
ILT
13673 * options.cc: Include "../bfd/bfdver.h".
13674 (options::help): Print bug reporting address.
13675
f4b2c6f5
ILT
13676 * version.cc (print_version): Adjust output for current value of
13677 BFD_VERSION_STRING.
13678
13679 * NEWS: New file.
13680
e96caa79
ILT
13681 * options.cc (options::help): Print list of supported targets.
13682 * target-select.h: Include <vector>.
13683 (class Target_selector): Make machine_, size_, and is_big_endian_
13684 fields const. Add bfd_name_ and instantiated_target_ fields.
13685 (Target_selector::Target_selector): Add bfd_name parameter.
13686 (Target_selector::recognize): Make non-virtual, call
13687 do_recognize.
13688 (Target_selector::recognize_by_name): Make non-virtual, call
13689 do_recognize_by_name.
13690 (Target_selector::supported_names): New function.
13691 (Target_selector::bfd_name): New function.
13692 (Target_selector::do_instantiate_target): New pure virtual
13693 function.
13694 (Target_selector::do_recognize): New virtual function.
13695 (Target_selector::do_recognize_by_name): New virtual function.
13696 (Target_selector::instantiate_target): New private function.
13697 (supported_target_names): Declare.
13698 * target-select.cc (Target_selector::Target_selector): Update for
13699 new parameter and fields.
13700 (select_target_by_name): Check that the name matches before
13701 calling recognize_by_name.
13702 (supported_target_names): New function.
13703 * i386.cc (class Target_selector_i386): Update Target_selector
13704 constructor call. Remove recognize and recognize_by_name. Add
13705 do_instantiate_target.
13706 * x86_64.cc (class Target_selector_x86_64): Likewise.
13707 * testsuite/testfile.cc (class Target_selector_test): Update for
13708 changes to Target_selector.
13709
874c5b28
ILT
13710 * README: Rewrite, with some notes on unsupported features.
13711
0a65a3a7
CC
137122008-03-24 Cary Coutant <ccoutant@google.com>
13713
13714 * i386.cc (Target_i386::Got_type): New enum declaration.
13715 (Target_i386::Scan::local): Updated callers of Output_data_got
13716 member functions.
13717 (Target_i386::Scan::global): Likewise.
13718 (Target_i386::Relocate::relocate): Likewise.
13719 (Target_i386::Relocate::relocate_tls): Likewise.
13720 * object.h (Got_offset_list): New class.
13721 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13722 (Sized_relobj::local_got_offset): Likewise.
13723 (Sized_relobj::set_local_got_offset): Likewise.
13724 (Sized_relobj::local_has_tls_got_offset): Removed.
13725 (Sized_relobj::local_tls_got_offset): Removed.
13726 (Sized_relobj::set_local_tls_got_offset): Removed.
13727 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13728 * output.cc (Output_data_got::add_global): Added got_type parameter.
13729 (Output_data_got::add_global_with_rel): Likewise.
13730 (Output_data_got::add_global_with_rela): Likewise.
13731 (Output_data_got::add_global_pair_with_rel): New function.
13732 (Output_data_got::add_global_pair_with_rela): New function.
13733 (Output_data_got::add_local): Added got_type parameter.
13734 (Output_data_got::add_local_with_rel): Likewise.
13735 (Output_data_got::add_local_with_rela): Likewise.
13736 (Output_data_got::add_local_pair_with_rel): New function.
13737 (Output_data_got::add_local_pair_with_rela): New function.
13738 (Output_data_got::add_global_tls): Removed.
13739 (Output_data_got::add_global_tls_with_rel): Removed.
13740 (Output_data_got::add_global_tls_with_rela): Removed.
13741 (Output_data_got::add_local_tls): Removed.
13742 (Output_data_got::add_local_tls_with_rel): Removed.
13743 (Output_data_got::add_local_tls_with_rela): Removed.
13744 * output.h (Output_data_got::add_global): Added got_type parameter.
13745 (Output_data_got::add_global_with_rel): Likewise.
13746 (Output_data_got::add_global_with_rela): Likewise.
13747 (Output_data_got::add_global_pair_with_rel): New function.
13748 (Output_data_got::add_global_pair_with_rela): New function.
13749 (Output_data_got::add_local): Added got_type parameter.
13750 (Output_data_got::add_local_with_rel): Likewise.
13751 (Output_data_got::add_local_with_rela): Likewise.
13752 (Output_data_got::add_local_pair_with_rel): New function.
13753 (Output_data_got::add_local_pair_with_rela): New function.
13754 (Output_data_got::add_global_tls): Removed.
13755 (Output_data_got::add_global_tls_with_rel): Removed.
13756 (Output_data_got::add_global_tls_with_rela): Removed.
13757 (Output_data_got::add_local_tls): Removed.
13758 (Output_data_got::add_local_tls_with_rel): Removed.
13759 (Output_data_got::add_local_tls_with_rela): Removed.
13760 * resolve.cc (Symbol::override_base_with_special): Removed
13761 reference to has_got_offset_ field.
13762 * symtab.cc (Symbol::init_fields): Replaced initialization
13763 of got_offset_ with got_offsets_. Removed initialization
13764 of has_got_offset_
53fcba31 13765 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13766 (Symbol::got_offset): Likewise.
13767 (Symbol::set_got_offset): Likewise.
13768 (Symbol::has_tls_got_offset): Removed.
13769 (Symbol::tls_got_offset): Removed.
13770 (Symbol::set_tls_got_offset): Removed.
13771 (Symbol::got_offset_): Removed.
13772 (Symbol::tls_mod_got_offset_): Removed.
13773 (Symbol::tls_pair_got_offset_): Removed.
13774 (Symbol::got_offsets_): New field.
13775 (Symbol::has_got_offset): Removed.
13776 (Symbol::has_tls_mod_got_offset): Removed.
13777 (Symbol::has_tls_pair_got_offset): Removed.
13778 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13779 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13780 member functions.
13781 (Target_x86_64::Scan::global): Likewise.
13782 (Target_x86_64::Relocate::relocate): Likewise.
13783 (Target_x86_64::Relocate::relocate_tls): Likewise.
13784
bd52eafb
BE
137852008-03-25 Ben Elliston <bje@au.ibm.com>
13786
13787 * yyscript.y: Fix spelling error in comment.
13788
8b105e34
ILT
137892008-03-24 Ian Lance Taylor <iant@google.com>
13790
8ed814a9
ILT
13791 * options.h (class General_options): Define build_id option.
13792 * layout.h (class Layout): Declare write_build_id, create_note,
13793 create_build_id. Add build_id_note_ member.
13794 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13795 "libiberty.h", "md5.h", "sha1.h".
13796 (Layout::Layout): Initialize eh_frame_data_,
13797 eh_frame_hdr_section_, and build_id_note_.
13798 (Layout::finalize): Call create_build_id.
13799 (Layout::create_note): New function, broken out of
13800 Layout::create_gold_note.
13801 (Layout::create_gold_note): Call create_note.
13802 (Layout::create_build_id): New function.
13803 (Layout::write_build_id): New function.
13804 (Close_task_runner::run): Call write_build_id.
13805
8b105e34
ILT
13806 * x86_64.cc: Correct license to GPLv3.
13807
086a1841
ILT
138082008-03-23 Ian Lance Taylor <iant@google.com>
13809
13810 * options.cc: Include "demangle.h".
13811 (parse_optional_string): New function.
13812 (parse_long_option): Handle takes_optional_argument.
13813 (parse_short_option): Update dash_z initializer. Handle
13814 takes_optional_argument.
13815 (General_options::General_options): Initialize do_demangle_.
13816 (General_options::finalize): Set do_demangle_. Handle demangling
13817 style.
13818 * options.h (parse_optional_string): Declare.
13819 (struct One_option): Add optional_arg field. Update constructor.
13820 Update call constructor calls. Add takes_optional_argument
13821 function.
13822 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13823 (DEFINE_optional_string): Define.
13824 (General_options::demangle): Change from DEFINE_bool to
13825 DEFINE_optional_string.
13826 (General_options::no_demangle): New function.
13827 (General_options::do_demangle): New function.
13828 (General_options::set_do_demangle): New function.
13829 (General_options::execstack_status_): Move definition to end of
13830 class definition.
13831 (General_options::static_): Likewise.
13832 (General_options::do_demangle_): New field.
13833 * object.cc (big_endian>::get_symbol_location_info): Call
13834 Options::do_demangle, not Options::demangle.
13835 * symtab.cc (demangle): Likewise.
13836
cbb93e63
ILT
138372008-03-22 Ian Lance Taylor <iant@google.com>
13838
13839 * gold.h: Include <cstddef> and <sys/types.h>
13840 * options.h: Include <cstring>.
13841
ec531623
ILT
138422008-03-21 Ian Lance Taylor <iant@google.com>
13843
13844 * Added source code to GNU binutils.
This page took 0.848196 seconds and 4 git commands to generate.