daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e5d5f5ed
AM
12012-09-29 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc (Target_powerpc::iplt_): New output section.
4 (Target_powerpc::iplt_section, make_iplt_section,
5 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
6 (Target_powerpc::make_plt_entry): Handle ifunc syms.
7 Target_powerpc::plt_entry_count): Count iplt entries too.
8 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
9 reloc section in constructor. New params.
10 (Target_powerpc::make_plt_section): Create reloc section here instead.
11 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
12 functions.
13 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
14 (Output_data_glink::add_entry, find_entry): New functions to
15 deal with local syms.
16 (Glink_sym_ent): Add support for local syms.
17 (Output_data_glink::do_write): Handle ifunc plt entries.
18 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
19 (Target_powerpc::Scan::local, global): Handle ifunc syms.
20 (Target_powerpc::Relocate::relocate): Likewise.
21 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
22
ec4dbad3
AM
232012-09-25 Alan Modra <amodra@gmail.com>
24
25 * object.h (Sized_relobj_file::adjust_local_symbol,
26 do_adjust_local_symbol): New functions.
27 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
28 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
29 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
30 and irregular opd entry spacing.
31 (Powerpc_relobj::do_read_relocs): Add opd size checks.
32 (Global_symbol_visitor_opd): New functor.
33 (Target_powerpc::do_finalize_sections): Omit global symbols defined
34 on deleted opd entries.
35
5c0b3823
WL
362012-09-15 Jiong Wang <jiwang@tilera.com>
37
38 * tilegx.cc: New file.
39 * Makefile.am (TARGETSOURCES): Add tilegx.cc
40 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
41 * configure.tgt: Add entries for tilegx*.
42 * configure.ac: Likewise.
43 * Makefile.in: Rebuild.
44 * configure: Likewise.
45 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
46 tilegx.
47
bfdfa4cd
AM
482012-09-13 Alan Modra <amodra@gmail.com>
49
50 * target-reloc.h (scan_relocs): Call scan.local for relocs
51 against symbols in discarded sections. Pass is_discarded
52 param.
53 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
54 Add is_discarded param.
55 * powerpc (Target_powerpc::Scan::local): Likewise. Use
56 is_discarded to flag opd entry as discarded. Don't emit dyn
57 relocs on such entries.
58 (Target_powerpc::Scan::global): Similarly detect and handle
59 such opd entries.
60 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
61 opd_ent_. Update all uses.
62 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
63 (Target_powerpc::relocate_section): Zero out discarded opd
64 entry relocs.
65
d77a0555
ILT
662012-09-12 Ian Lance Taylor <iant@google.com>
67
68 PR gold/14570
69 * output.cc: Rename Output_data_got template parameter from size
70 to got_size for all functions. Compile all variants of
71 Output_data_got.
72 (Output_data_got::Got_entry::write): Correct use of size for
73 symbol value. Use local_is_tls rather than casting to
74 Sized_relobj_file.
75 * object.h (class Object): Add local_is_tls and do_local_is_tls.
76 (class Sized_relobj_file): Add do_local_is_tls.
77 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
78
815a1205
AM
792012-09-11 Alan Modra <amodra@gmail.com>
80
81 PR gold/14566
82 * layout.cc (Layout::set_segment_offsets): When using
83 common-page-size alignment, ensure we are on a new max-page-size
84 page.
85 * output.cc (Output_segment::set_section_addresses): Use
86 abi_pagesize, not common_pagesize for relro boundary.
87 (Output_segment::set_offset): Likewise.
88
bd73a62d
AM
892012-09-11 Alan Modra <amodra@gmail.com>
90
91 * output.h (Output_data_got::add_global_tls, add_local_tls,
92 add_local_tls_pair): New functions.
93 (Output_data_got::add_local_pair_with_rel): Remove second
94 reloc param. Expand comment.
95 (Output_data_got::Got_entry): Rename use_plt_offset_ to
96 use_plt_or_tls_offset_, similarly for constructor param.
97 (Output_data_got::Got_entry::write): Add got_index param.
98 * output.cc (Output_data_got::add_global_tls, add_local_tls,
99 add_local_tls_pair): New functions.
100 (Output_data_got::Got_entry::write): Handle tls symbols
101 with use_plt_or_tls_offset_ set specially.
102 (Output_data_got::add_local_pair_with_rel): Only one reloc.
103 (Output_data_got::do_write): Replace iterator with index, pass
104 index to entry write function.
105 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
106 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
107 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
108 call.
109 * i386.cc (Target_i386::Scan::local): Likewise.
110 * sparc.cc (Target_sparc::Scan::local): Likewise.
111 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
112 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
113 do_tls_offset_for_global): New functions.
114 (Target_powerpc::Scan::local): Correct TLS relocations and got
115 entry values.
116 (Target_powerpc::Scan::global): Don't emit unnecessary
117 dynamic relocations on TLS GOT entries.
118
00716ab1
AM
1192012-09-10 Matthias Klose <doko@ubuntu.com>
120
121 * config.in: Disable sanity check for kfreebsd.
122
c891b3f9
SA
1232012-09-10 Sterling Augustine <saugustine@google.com>
124
125 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
126 (Gdb_index::pubtypes_read): New parameter.
127 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
128 to calls.
129 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
130 pubtypes_object_.
131
e81fea4d
AM
1322012-09-09 Alan Modra <amodra@gmail.com>
133
134 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
135 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
136 * gc.h (gc_process_relocs): Call target gc_add_reference.
137 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
138 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
139 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
140 unnecessary cast.
141 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
142 to cater for when we don't need code offset. Update use.
143 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
144 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
145 set_opd_valid): New functions.
146 (Target_powerpc::do_gc_add_reference): New function.
147 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
148 stashed refs.
149 (Target_powerpc::do_gc_mark_symbol): New function.
150
d2d60eef
CC
1512012-09-06 Cary Coutant <ccoutant@google.com>
152
153 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
154 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
155 (Dwarf_die::skip_attributes): Likewise.
156 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
157 * testsuite/gdb_index_test.cc (inline_func_1): New function.
158 (main): Call it.
159 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
160
32ed4573
L
1612012-09-05 H.J. Lu <hongjiu.lu@intel.com>
162
163 * testsuite/script_test_3.t: Add .got.plt output section
164 statement.
165 * testsuite/script_test_4.t: Likewise.
166
f4baf0d4
AM
1672012-09-05 Alan Modra <amodra@gmail.com>
168
169 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
170 update all uses and lose "enum" when using type.
171
864a1b56
AM
1722012-09-05 Alan Modra <amodra@gmail.com>
173
174 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
175 * configure: Regenerate.
176 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
177 (plugin_final_layout.stdout): Likewise.
178 (memory_test): Set page sizes to 0x1000.
179 * testsuite/Makefile.in: Regenerate.
180 * testsuite/discard_locals_test.sh: Add FIXME comment.
181 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
182 * testsuite/pr14265.t: Add .got output section statement.
183 * testsuite/script_test_2.t: Likewise.
184 * testsuite/script_test_3.t: Likewise.
185 * testsuite/script_test_4.t: Likewise.
186 * testsuite/script_test_5.t: Likewise.
187 * testsuite/script_test_6.t: Likewise.
188 * testsuite/script_test_7.t: Likewise.
189 * testsuite/script_test_9.t: Likewise.
190
3ea0a085
AM
1912012-09-05 Alan Modra <amodra@gmail.com>
192
193 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
194 (Powerpc_relocate_functions::Status): New typedef.
195 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
196 (Target_powerpc::Scan::local): Handle REL64.
197 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
198 for REL32 and REL64.
199 (Target_powerpc::symval_for_branch): New function, extracted from..
200 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
201 checks. Report overflow errors.
202
7404fe1b
AM
2032012-09-05 Alan Modra <amodra@gmail.com>
204
205 * object.h (Sized_relobj_file::emit_relocs): Delete.
206 (Sized_relobj_file::emit_relocs_reltype): Delete.
207 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
208 relocate_relocs for --emit-relocs.
209 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
210 * output.h: Update comment.
211 (Output_segment::first_section): New function.
212 (Output_segment::first_section_load_address): Use first_section.
213 * output.cc (Output_segment::first_section): New function extracted..
214 (Output_segment::first_section_load_address): ..from here. Delete.
215 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
216 * target.h (Sized_target::relocate_for_relocatable): Likewise.
217 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
218 adjust call to target.h function.
219 * i386.cc (Target_i386): Likewise.
220 * sparc.cc (Target_sparc): Likewise.
221 * x86_64.cc (Target_x86_64): Likewise.
222 * powerpc.cc (Target_powerpc): Likewise.
223 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
224 first tls section has section symbol for optimised local dynamic
225 output relocs.
226 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
227 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
228 optimised tls code.
229 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
230 Rename to relocate_relocs. Update error message.
231
957564c9
AS
2322012-09-04 Andreas Schwab <schwab@linux-m68k.org>
233
234 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
235 --just-symbols.
236
dd93cd0a
AM
2372012-08-31 Alan Modra <amodra@gmail.com>
238
239 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
240 (Powerpc_relobj::toc_base_offset): New stub function.
241 (Target_powerpc): Add tp_offset, dtp_offset. Rename
242 got_mod_index_offset to tlsld_got_offset. Update all refs.
243 (Target_powerpc::Relocate::enum skip_tls): New.
244 (Target_powerpc::call_tls_get_addr_): New var.
245 (Target_powerpc::is_branch_reloc): Move to file scope.
246 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
247 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
248 New functions.
249 (Target_powerpc::enum Got_type): Delete old values, add new ones.
250 (powerpc_info): Correct common_pagesize for ppc64.
251 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
252 (Powerpc_relocate_functions): Add overflow check enums and functions.
253 Add non-shift version of rela, rela_ua. Delete all rel public
254 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
255 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
256 addr16_ha3, addr14 functions.
257 (Output_data_got_powerpc::add_constant_pair): New function.
258 (Output_data_got_powerpc::got_base_offset): Likewise.
259 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
260 (instruction constants): Sort, add some more.
261 (Output_data_glink::do_write): Add and use Address typedef. Use
262 object->toc_base_offset() stub for 64-bit.
263 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
264 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
265 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
266 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
267 Always treat .opd relocs as against locally defined symbol.
268 Correct condition for RELATIVE relocs.
269 (Target_powerpc::do_finalize_sections): Test for NULL sections.
270 (Target_powerpc::Relocate::relocate): Use plt call stub as value
271 for 32-bit syms with a plt entry. Correct ppc64 toc base
272 calculations. Handle TLS relocs, and more. Add overflow
273 checking and adjust for Powerpc_relocate_functions changes.
274 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
275 Reinstate --emit-relocs code with FIXME.
276
a1373b60
AM
2772012-08-30 Alan Modra <amodra@gmail.com>
278
279 * layout.cc (Layout::set_segment_offsets): Set p_align to
280 abi_pagesize, not common_pagesize.
281 (Layout::relaxation_loop_body): Similarly use abi_pagesize
282 to determine whether file header can go in segment.
283
703d02da
AM
2842012-08-30 Alan Modra <amodra@gmail.com>
285
286 * output.h (Output_reloc::Output_reloc <output section>): Add
287 is_relative param. Adjust calls.
288 (Output_reloc::add_output_section_relative): New functions.
289 * output.cc (Output_reloc::Output_reloc <output section>): Handle
290 is_relative.
291 (Output_reloc::symbol_value): Handle SECTION_CODE.
292
16164a6b
ST
2932012-08-24 Sriraman Tallam <tmsriram@google.com>
294
295 * gold.cc (queue_middle_tasks): Call layout again when unique
296 segments for sections is desired.
297 * layout.cc (Layout::Layout): Initialize new members.
298 (Layout::get_output_section_flags): New function.
299 (Layout::choose_output_section): Call get_output_section_flags.
300 (Layout::layout): Make output section for mapping to a unique segment.
301 (Layout::insert_section_segment_map): New function.
302 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 303 output sections marked so.
16164a6b
ST
304 (Layout::segment_precedes): Check for unique segments when sorting.
305 * layout.h (Layout::Unique_segment_info): New struct.
306 (Layout::Section_segment_map): New typedef.
307 (Layout::insert_section_segment_map): New function.
308 (Layout::get_output_section_flags): New function.
309 (Layout::is_unique_segment_for_sections_specified): New function.
310 (Layout::set_unique_segment_for_sections_specified): New function.
311 (Layout::unique_segment_for_sections_specified_): New member.
312 (Layout::section_segment_map_): New member.
313 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
314 Rename is_gc_pass_one to is_pass_one.
315 Rename is_gc_pass_two to is_pass_two.
316 Rename is_gc_or_icf to is_two_pass.
317 Check for which pass based on whether symbols data is present.
318 Make it two pass when unique segments for sections is desired.
319 * output.cc (Output_section::Output_section): Initialize new
320 members.
321 * output.h (Output_section::is_unique_segment): New function.
322 (Output_section::set_is_unique_segment): New function.
323 (Output_section::is_unique_segment_): New member.
324 (Output_section::extra_segment_flags): New function.
325 (Output_section::set_extra_segment_flags): New function.
326 (Output_section::extra_segment_flags_): New member.
327 (Output_section::segment_alignment): New function.
328 (Output_section::set_segment_alignment): New function.
329 (Output_section::segment_alignment_): New member.
330 (Output_segment::Output_segment): Initialize is_unique_segment_.
331 (Output_segment::is_unique_segment): New function.
332 (Output_segment::set_is_unique_segment): New function.
333 (Output_segment::is_unique_segment_): New member.
334 * plugin.cc (allow_unique_segment_for_sections): New function.
335 (unique_segment_for_sections): New function.
336 (Plugin::load): Add new functions to transfer vector.
337 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
338 * Makefile.in: Regenerate.
339 * testsuite/plugin_final_layout.sh: Check if unique segment
340 functionality works.
341 * testsuite/plugin_section_order.c (onload): Check if new interfaces
342 are available.
343 (allow_unique_segment_for_sections): New global.
344 (unique_segment_for_sections): New global.
345 (claim_file_hook): Call allow_unique_segment_for_sections.
346 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 347
1e2bee4f
CC
3482012-08-22 Cary Coutant <ccoutant@google.com>
349
350 * layout.cc (Layout::include_section): Don't assert on GROUP
351 sections with --emit-relocs.
352
1d5dfe78
CC
3532012-08-21 Cary Coutant <ccoutant@google.com>
354
355 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
356 if --export-dynamic-symbol names an undef symbol.
357
c9269dff
AM
3582012-08-18 Alan Modra <amodra@gmail.com>
359
360 * powerpc.cc: Formatting and white space.
361 (Powerpc_relobj): Rename got2_section_ to special_.
362 Add opd_ent_shndx_ and opd_ent_off_ vectors.
363 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
364 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
365 (Target_powerpc): Add Address typedef and invalid_address. Use
366 throughout.
367 (Target_powerpc::is_branch_reloc): New function.
368 (Powerpc_relocate_functions): Add Address typedef, use throughout.
369 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
370 for dst_mask, value and addend.
371 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
372 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
373 (Output_data_glink::do_write): Correct toc base. Don't try to use
374 uint16_t for 24-bit offset. Use get_output_section_offset and
375 check return.
376 (Target_powerpc::Scan::local): Handle more relocs.
377 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
378 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
379 Plug in toc restoring insn after plt calls. Translate branches
380 to function descriptor symbols to corresponding entry point.
381 (Target_powerpc::relocate_for_relocatable): Check return from
382 get_output_section_offset.
383 * symtab.h: Comment typo.
384
b1759dce
ILT
3852012-08-14 Ian Lance Taylor <iant@google.com>
386
387 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
388 unsupported_relocal_local to call unsupported_reloc_global.
389
b9b2ae8b
NC
3902012-08-14 Nick Clifton <nickc@redhat.com>
391
392 PR ld/14265
393 * script-sections.cc (Sections_element::output_section_name): Add
394 keep return parameter.
395 (Output_section_element::match_name): Add keep return parameter.
396 Return the value of the keep_ member.
397 * script-sections.h (class Output_section): Update
398 output_section_name prototype.
399 * layout.cc (Layout::keep_input_section): New public member
400 function.
401 (Layout::choose_output_section): Pass keep parameter to
402 output_section_name.
403 * layout.h (class Layout): Add keep_input_section.
404 * object.cc (Sized_relobj_file::do_layout): Check for kept input
405 sections.
406 * testsuite/Makefile.am: Add a test.
407 * testsuite/Makefile.in: Regenerate.
408 * testsuite/pr14265.c: Source file for the test.
409 * testsuite/pr14265.t: Linker script for the test.
410 * testsuite/pr14265.sh: Shell script for the test.
411
921b5322
AM
4122012-08-14 Alan Modra <amodra@gmail.com>
413
414 * target.h (Target::output_section_name): New function.
415 (Target::do_output_section_name): New function.
416 * layout.cc (Layout::choose_output_section): Call the above.
417 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
418
6ce78956
AM
4192012-08-14 Alan Modra <amodra@gmail.com>
420
421 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
422 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
423 for replace_constant call.
424 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
425 (Output_data_glink::do_print_to_mapfile): New function.
426 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
427 (Target_powerpc::Relocate::relocate): Likewise.
428
d1a8cabd
AM
4292012-08-14 Alan Modra <amodra@gmail.com>
430
431 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
432 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
433 (Output_data_glink::add_entry,find_entry): Remove shndx param.
434 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
435 all references to shndx_. Handle special case for R_PPC_PLTREL24
436 here.
437 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
438 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
439 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
440 here.
441 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
442 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
443
d83ce4e3
AM
4442012-08-12 Alan Modra <amodra@gmail.com>
445
446 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
447 (glink insn constants): Use uint32_t.
448 (Output_data_glink::add_entry): Use insert, not [] operator.
449
cf43a2fe
AM
4502012-08-11 Alan Modra <amodra@gmail.com>
451
452 * object.h (Sized_relobj_file::find_shdr): New function.
453 (Sized_relobj_file::find_special_sections): New function.
454 * object.cc (Sized_relobj_file::find_shdr): New function.
455 (Sized_relobj_file::find_eh_frame): Use find_shdr.
456 (Sized_relobj_file::find_special_sections): New function, split out..
457 (Sized_relobj_file::do_read_symbols): ..from here.
458 * output.h (Output_data_got::replace_constant): New function.
459 (Output_data_got::num_entries): New function.
460 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
461 (Output_data_got::got_offset): Protected rather than private.
462 (Output_data_got::replace_got_entry): New function.
463 * output.cc (Output_data_got::replace_got_entry): New function.
464 * powerpc.cc (class Powerpc_relobj): New.
465 (class Powerpc_relocate_functions): Delete all psymval variants or
466 convert to value,addend type. Delete pcrela, pcrela_unaligned.
467 Implement _ha functions using corresponding _hi function.
468 (Powerpc_relobj::find_special_sections): New function.
469 (Target_powerpc::do_make_elf_object): New function.
470 (class Output_data_got_powerpc): New.
471 (class Output_data_glink): New.
472 (class Powerpc_scan_relocatable_reloc): New.
473 Many more changes througout file.
474
3c892704
NC
4752012-08-09 Nick Clifton <nickc@redhat.com>
476
477 * po/vi.po: Updated Vietnamese translation.
478
82435b3b
ILT
4792012-08-07 Ian Lance Taylor <iant@google.com>
480
481 * layout.cc (Layout::add_target_dynamic_tags): If
482 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
483 plt_rel.
484
a6dc81d2
NC
4852012-07-30 Nick Clifton <nickc@redhat.com>
486
487 * po/gold.pot: Updated template.
488 * po/es.po: Updated Spanish translation.
489
f1415016
CC
4902012-07-18 Cary Coutant <ccoutant@google.com>
491
492 PR gold/14344
493 * configure.ac: Add check for -gpubnames support.
494 * configure: Regenerate.
495 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
496 support; force -gno-pubnames.
497 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
498 support.
499 (gdb_index_test_4): New test.
500 * testsuite/Makefile.in: Regenerate.
501 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
502 * testsuite/gdb_index_test_2.sh: Likewise.
503 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
504 * testsuite/gdb_index_test_4.sh: New script.
505 * testsuite/gdb_index_test_comm.sh: New script with common code;
506 don't look for space after colon.
507
b7fd7c37
ST
5082012-07-16 Sriraman Tallam <tmsriram@google.com>
509
510 * gold.cc (queue_middle_tasks): Update function order only after
511 deferred objects due to plugins are processed.
512
1f3212db
ILT
5132012-07-11 Ian Lance Taylor <iant@google.com>
514
515 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
516 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
517 (Target_arm::scan_reloc_for_stub): Likewise.
518 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
519 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
520 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
521 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
522 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
523
81c82a68
ILT
5242012-07-10 Dodji Seketeli <dodji@redhat.com>
525 Ian Lance Taylor <iant@google.com>
526
527 PR gold/14309
528 * configure.ac: Test whether std::tr1::hash<off_t> works.
529 * gold.h: Add a specialization for std::tr1::hash<off_t> if
530 needed.
531 * output.h (class Output_fill): Add virtual destructor.
532 * configure, config.in: Rebuild.
533
eabc84f4
RM
5342012-06-22 Roland McGrath <mcgrathr@google.com>
535
536 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
537
370e30b6
RÁE
5382012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
539
540 * plugin.cc (Plugin::load): Handle position independent executables.
541
fb1b895d
CC
5422012-06-06 Cary Coutant <ccoutant@google.com>
543
544 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
545 add .debug_macro.
546 (lines_only_debug_sections): Likewise.
547 (gdb_fast_lookup_sections): New static array.
548 (is_gdb_debug_section): Rename formal parameter.
549 (is_lines_only_debug_section): Likewise.
550 (is_gdb_fast_lookup_section): New function.
551 (Layout::include_section): Check for ".zdebug_" prefix; pass
552 section name suffix to is_gdb_debug_section, et al.; check for
553 fast-lookup sections when building .gdb_index.
554 * options.h (--strip-debug-gdb): Update GDB version number.
555
7c0640fa
CC
5562012-06-06 Cary Coutant <ccoutant@google.com>
557
558 * configure.ac: Add check for fallocate.
559 * configure: Regenerate.
560 * config.in: Regenerate.
561
562 * options.h (class General_options): Add --mmap-output-file and
563 --posix-fallocate options.
564 * output.cc: (posix_fallocate): Remove; replace with...
565 (gold_fallocate): New function.
566 (Output_file::map_no_anonymous): Call gold_fallocate.
567 (Output_file::map): Check --mmap-output-file option.
568
2a49eb69
DK
5692012-06-05 Jing Yu <jingyu@google.com>
570
571 * gold.h (textdomain): Add do {} to empty while(0).
572 (bindtextdomain): Likewise.
573
fad072ac
CC
5742012-06-04 Cary Coutant <ccoutant@google.com>
575
576 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
577 has_dynsym_index.
578
8cc69fb6
ST
5792012-05-25 Sriraman Tallam <tmsriram@google.com>
580
581 * symtab.cc (Symbol_table::define_special_symbol):
582 Initialize *poldsym to prevent uninitialized variable errors.
583
1be75daa
CC
5842012-05-23 Cary Coutant <ccoutant@google.com>
585
586 * layout.cc (Layout::section_name_mapping): Add rules to handle
587 exact match on .data.rel.ro.local or .data.rel.ro.
588 (Layout::output_section_name): Check for exact matches.
589
9b689de0
CC
5902012-05-23 Cary Coutant <ccoutant@google.com>
591
592 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
593 more carefully.
594
b24fdbf5
CC
5952012-05-22 Cary Coutant <ccoutant@google.com>
596
597 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
598 object before exporting symbol.
599
e550e1a2
L
6002012-05-21 H.J. Lu <hongjiu.lu@intel.com>
601
602 * testsuite/tls_test.cc: Include "config.h" first.
603 * testsuite/tls_test_c.c: Likewise.
604
df7b86aa
NC
6052012-05-17 Daniel Richard G. <skunk@iskunk.org>
606 Nick Clifton <nickc@redhat.com>
607
608 PR 14072
609 * configure.in: Add check that sysdep.h has been included before
610 any system header files.
611 * configure: Regenerate.
612 * config.in: Regenerate.
613
1007b503
CC
6142012-05-14 Cary Coutant <ccoutant@google.com>
615
616 * layout.cc (Layout::make_output_section): Mark .tdata section
617 as RELRO.
618 * testsuite/relro_test.cc: Add a TLS variable.
619
fd885f3a
L
6202012-05-10 H.J. Lu <hongjiu.lu@intel.com>
621
622 PR gold/14091
623 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
624 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
625 R_X86_64_64.
626
80f5885c
CC
6272012-05-08 Cary Coutant <ccoutant@google.com>
628
629 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
630 (lines_only_debug_sections): Likewise.
631
2e702c99
RM
6322012-05-02 Roland McGrath <mcgrathr@google.com>
633
634 * nacl.cc: New file.
635 * nacl.h: New file.
636 * Makefile.am (CCFILES, HFILES): Add them.
637 * Makefile.in: Regenerate.
638 * i386.cc (Output_data_plt_i386_nacl): New class.
639 (Output_data_plt_i386_nacl_exec): New class.
640 (Output_data_plt_i386_nacl_dyn): New class.
641 (Target_i386_nacl): New class.
642 (Target_selector_i386_nacl): New class.
643 (target_selector_i386): Use it instead of Target_selector_i386.
644 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
645 (Target_x86_64_nacl): New class.
646 (Target_selector_x86_64_nacl): New class.
647 (target_selector_x86_64, target_selector_x32): Use it instead of
648 Target_selector_x86_64.
649 * arm.cc (Output_data_plt_arm_nacl): New class.
650 (Target_arm_nacl): New class.
651 (Target_selector_arm_nacl): New class.
652 (target_selector_arm, target_selector_armbe): Use it instead of
653 Target_selector_arm.
654
655 * target-select.cc (select_target): Take new Input_file* and off_t
656 arguments, pass them on to recognize method of selector.
657 * object.cc (make_elf_sized_object): Update caller.
658 * parameters.cc (parameters_force_valid_target): Likewise.
659 * incremental.cc (make_sized_incremental_binary): Likewise.
660 * target-select.h: Update decl.
661 (Target_selector::recognize): Take new Input_file* argument,
662 pass it on to do_recognize.
663 (Target_selector::do_recognize): Take new Input_file* argument.
664 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
665 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
666 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
667 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
668
669 * target.h (Target::Target_info): New members isolate_execinstr
670 and rosegment_gap.
671 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
672 * arm.cc (Target_arm::arm_info): Update initializer.
673 * i386.cc (Target_i386::i386_info): Likewise.
674 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
675 * sparc.cc (Target_sparc::sparc_info): Likewise.
676 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
677 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
678 * layout.cc (Layout::attach_allocated_section_to_segment):
679 Take new const Target* argument. If target->isolate_execinstr(), act
680 like --rosegment.
681 (Layout::find_first_load_seg): Take new const Target* argument;
682 if target->isolate_execinstr(), reject PF_X segments.
683 (Layout::relaxation_loop_body): Update caller.
684 (Layout::set_segment_offsets): If target->isolate_execinstr(),
685 reset file offset to zero when we hit LOAD_SEG, and then do a second
686 loop over the segments before LOAD_SEG to reassign offsets after
687 addresses have been determined. Handle target->rosegment_gap().
688 (Layout::attach_section_to_segment): Take new const Target* argument;
689 pass it to attach_allocated_section_to_segment.
690 (Layout::make_output_section): Update caller.
691 (Layout::attach_sections_to_segments): Take new const Target* argument;
692 pass it to attach_section_to_segment.
693 * gold.cc (queue_middle_tasks): Update caller.
694 * layout.h (Layout): Update method decls with new arguments.
695
696 * arm.cc (Target_arm::Target_arm): Take optional argument for the
697 Target_info pointer to use.
698 (Target_arm::do_make_data_plt): New virtual method.
699 (Target_arm::make_data_plt): New method that calls it.
700 (Target_arm::make_plt_entry): Use it.
701 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
702 for the section alignment.
703 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
704 method.
705 (Output_data_plt_arm::first_plt_entry_offset): Call it.
706 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
707 method.
708 (Output_data_plt_arm::get_plt_entry_size): Call it.
709 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
710 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
711 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
712 method.
713 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
714 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
715 method instead of sizeof(plt_entry).
716 (Output_data_plt_arm::add_entry): Likewise.
717 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
718 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
719 than static method.
720 (Target_arm::plt_entry_size): Likewise.
721 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
722 Move to ...
723 (Output_data_plt_arm_standard): ... here, new class.
724 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
725 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
726 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
727
728 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
729 Take additional argument for the PLT entry size.
730 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
731 Use get_plt_entry_size method rather than plt_entry_size variable.
732 (Output_data_plt_x86_64::reserve_slot): Likewise.
733 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
734 (Output_data_plt_x86_64::add_entry): Likewise.
735 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
736 (Output_data_plt_x86_64::address_for_global): Likewise.
737 (Output_data_plt_x86_64::address_for_local): Likewise.
738 (Output_data_plt_x86_64::set_final_data_size): Likewise.
739 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
740 Make method non-static.
741 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
742 method.
743 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
744 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
745 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
746 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
747 virtual method.
748 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
749 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
750 virtual method.
751 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
752 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
753 virtual method.
754 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
755 (Output_data_plt_x86_64::plt_entry_size)
756 (Output_data_plt_x86_64::first_plt_entry)
757 (Output_data_plt_x86_64::plt_entry)
758 (Output_data_plt_x86_64::tlsdesc_plt_entry)
759 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
760 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
761 (Output_data_plt_x86_64_standard): ... here, new class.
762 (Target_x86_64::Target_x86_64): Take optional argument for the
763 Target_info pointer to use.
764 (Target_x86_64::do_make_data_plt): New virtual method.
765 (Target_x86_64::make_data_plt): New method to call it.
766 (Target_x86_64::init_got_plt_for_update): Use that.
767 Call this->plt_->add_eh_frame method here.
768 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
769 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
770 rather than static method.
771 (Target_x86_64::plt_entry_size): Likewise.
772 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
773 rather than plt_entry_size variable. Move guts of PLT filling to...
774 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
775 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
776 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
777
778 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
779 additional argument for the section alignment.
780 Don't do add_eh_frame_for_plt here.
781 (Output_data_plt_i386::first_plt_entry_offset): Make the method
782 non-static. Use get_plt_entry_size method rather than plt_entry_size
783 variable.
784 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
785 method.
786 (Output_data_plt_i386::get_plt_entry_size): Call it.
787 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
788 (Output_data_plt_i386::add_eh_frame): New method to call it.
789 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
790 method.
791 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
792 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
793 method.
794 (Output_data_plt_i386::fill_plt_entry): New method to call it.
795 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
796 method instead of plt_entry_size.
797 (Output_data_plt_i386::plt_entry_size)
798 (Output_data_plt_i386::plt_eh_frame_fde_size)
799 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
800 (Output_data_plt_i386_standard): ... here, new class.
801 (Output_data_plt_i386_exec): New class.
802 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
803 (Output_data_plt_i386_exec::first_plt_entry): ... here.
804 (Output_data_plt_i386::exec_plt_entry): Move to ...
805 (Output_data_plt_i386_exec::plt_entry): ... here.
806 (Output_data_plt_i386_dyn): New class.
807 (Output_data_plt_i386::first_plt_entry): Move to ...
808 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
809 (Output_data_plt_i386::dyn_plt_entry): Move to ...
810 (Output_data_plt_i386_dyn::plt_entry): ... here.
811 (Target_i386::Target_i386): Take optional argument for the Target_info
812 pointer to use.
813 (Target_i386::do_make_data_plt): New virtual method.
814 (Target_i386::make_data_plt): New method to call it.
815 (Target_i386::make_plt_section): Use that.
816 Call this->plt_->add_eh_frame method here.
817 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
818 rather than plt_entry_size variable.
819 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
820 (Output_data_plt_i386::address_for_local): Likewise.
821 (Output_data_plt_i386::do_write): Likewise.
822 Move guts of PLT filling to...
823 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
824 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
825 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
826 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
827
b9b9f2ee
CC
8282012-05-01 Cary Coutant <ccoutant@google.com>
829
830 * dwarf_reader.cc (Dwarf_die::read_attributes)
831 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
832 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
833 * reduced_debug_output.cc
834 (Output_reduced_debug_info_section::get_die_end): Remove
835 DW_FORM_GNU_ref_index. Add default case.
836
57923f48
MW
8372012-04-26 Mark Wielaard <mjw@redhat.com>
838
839 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
840 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
841 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
842 DW_AT_high_pc as offset from DW_AT_low_pc.
843
844 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
845 * testsuite/Makefile.in: Regenerate.
846 * testsuite/gdb_index_test_3.c: New test source file.
847 * testsuite/gdb_index_test_3.sh: New test source file.
848
2c54b4f4
ILT
8492012-04-25 Ian Lance Taylor <iant@google.com>
850
851 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
852 pointer.
853 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
854 as a class, not a struct.
855 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
856 (Target_arm::apply_cortex_a8_workaround): Likewise.
857 * gc.h: Declare Reloc_types as a struct, not a class.
858 * object.h: Declare Symbols_data as a struct.
859 * reloc.h: Declare Read_relocs_data as a struct.
860 * target.h: Declare Relocate_info as a struct.
861
a5a5f7a3
DM
8622012-04-24 David S. Miller <davem@davemloft.net>
863
864 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
865 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
866 and R_SPARC_WPLT30.
867
f038d496
CC
8682012-04-24 Cary Coutant <ccoutant@google.com>
869
870 * incremental-dump.cc (find_input_containing_global): Replace
871 magic number with symbolic constant.
872 (dump_incremental_inputs): Update version number.
873 * incremental.cc (Output_section_incremental_inputs): Update version
874 number; import symbolic constants from Incremental_inputs_reader.
875 (Incremental_inputs::create_data_sections): Align relocations
876 section correctly for 64-bit targets.
877 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
878 constants; add padding.
879 (Output_section_incremental_inputs::write_header): Add assert for
880 header_size.
881 (Output_section_incremental_inputs::write_input_files): Add assert
882 for input_entry_size.
883 (Output_section_incremental_inputs::write_info_blocks): Add padding;
884 add assert for object_info_size, input_section_entry_size,
885 global_sym_entry_size.
886 * incremental.h (Incremental_inputs_reader): Add symbolic constants
887 for data structure sizes; use them.
888 (Incremental_input_entry_reader): Import symbolic constants from
889 Incremental_inputs_reader; use them.
890
a4d85145
DM
8912012-04-23 David S. Miller <davem@davemloft.net>
892
893 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
894 and elf_flags_set_.
895 (Target_sparc::Target_sparc): Initialize new fields.
896 (Target_sparc::do_make_elf_object): New function.
897 (Target_sparc::do_adjust_elf_header): New function.
898
1d509098
CC
8992012-04-23 Cary Coutant <ccoutant@google.com>
900
901 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
902 CU range table of gdb index.
903
7ebeff7f
DM
9042012-04-20 David S. Miller <davem@davemloft.net>
905
906 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
907 instead of false.
908
13cf9988
DM
9092012-04-16 David S. Miller <davem@davemloft.net>
910
2a1079e8
DM
911 * sparc.cc (Target_sparc::got_address): New function.
912 (Sparc_relocate_functions::gdop_hix22): New function.
913 (Sparc_relocate_functions::gdop_lox10): New function.
914 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
915 relocs.
916 (Target_sparc::Scan::local): Likewise if the global symbol is not
917 preemptible and is not IFUNC.
918 (Target_sparc::Relocate::relocate): Perform GOTDATA code
919 transformations for local and non-preemptible non-IFUNC global
920 symbols.
921
0bc964fc
DM
922 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
923 writing out 64-bit part of ranges.
924
661d7a80
DM
925 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
926 -fpic and -fpie respectively.
927 * Makefile.in: Regenerate.
928
8c2bf391
DM
929 * sparc.cc (class Target_sparc): Add rela_ifunc_.
930 (Target_sparc::Target_sparc): Initialize new field.
931 (Target_sparc::do_plt_section_for_global): New function.
932 (Target_sparc::do_plt_section_for_local): New function.
933 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
934 (Target_sparc::make_plt_section): New function, broken out of
935 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
936 (Target_sparc::make_plt_entry): Call make_plt_section.
937 (Target_sparc::make_local_ifunc_plt_entry): New function.
938 (Target_sparc::rela_ifunc_section): New function.
939 (Target_sparc::plt_section): Remove const.
940 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
941 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
942 and ifunc_count_ fields.
943 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
944 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
945 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
946 (Output_data_plt_sparc::rela_ifunc): New function.
947 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
948 (Output_data_plt_sparc::has_ifunc_section): New function.
949 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
950 (Output_data_plt_sparc::address_for_global): New function.
951 (Output_data_plt_sparc::address_for_local): New function.
952 (Output_data_plt_sparc::plt_index_to_offset): New function.
953 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
954 and entry_count.
955 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
956 entry_count.
957 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
958 R_SPARC_JMP_IREL to switch.
959 (Target_sparc::Scan::check_non_pic): Likewise.
960 (Target_sparc::Scan::local): Handle IFUNC symbols.
961 (Target_sparc::Scan::local): Likewise.
962 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
963 and plt_address_for_local.
964 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
965 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
966
13cf9988
DM
967 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
968 (class Output_data_reloc): Adjust calls to Output_reloc_type.
969 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
970 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
971 global relocs too.
972 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
973 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
974 calls.
975 * sparc.cc (Target_sparc::Scan::global): Likewise.
976 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
977
31821be0
CC
9782012-04-16 Cary Coutant <ccoutant@google.com>
979
980 * archive.cc (Library_base::should_include_member): Check for
981 --export-dynamic-symbol.
982 * options.h (class General_options): Add --export-dynamic-symbol.
983 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
984 --export-dynamic-symbol.
985 (Symbol_table::gc_mark_undef_symbols): Likewise.
986 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
987
2615994e
DM
9882012-04-12 David S. Miller <davem@davemloft.net>
989
990 * sparc.cc (Reloc::wdisp10): New relocation method.
991 (Reloc::h34): Likewise.
992 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
993 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
994 R_SPARC_WDISP10.
995 (Target_sparc::Scan::local): Likewise.
996 (Target_sparc::Scan::global): Likewise.
997 (Target_sparc::Relocate::relocate): Likewise.
998
6782735d
CC
9992012-04-09 Cary Coutant <ccoutant@google.com>
1000
1001 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
1002 low_pc == 0.
1003
8c7a0b00
ILT
10042012-04-06 Ian Lance Taylor <iant@google.com>
1005
1006 * timer.cc: #include <unistd.h>.
1007
58797674
RM
10082012-04-06 Roland McGrath <mcgrathr@google.com>
1009
1010 * configure.in (AC_CHECK_HEADERS): Add locale.h.
1011 * config.in: Regenerate.
1012 * configure: Regenerate.
1013
44350750
NC
10142012-04-05 Nick Clifton <nickc@redhat.com>
1015
1016 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
1017 (AM_LC_MESSAGES): Add.
1018 * aclocal.m4: Regenerate.
1019 * config.in: Regenerate.
1020 * configure: Regenerate.
1021
c1027032
CC
10222012-03-21 Cary Coutant <ccoutant@google.com>
1023
1024 * Makefile.am: Add gdb-index.cc, gdb-index.h.
1025 * Makefile.in: Regenerate.
1026 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
1027 (Sized_elf_reloc_mapper::symbol_section): New function.
1028 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
1029 (make_elf_reloc_mapper): New function.
1030 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
1031 (Dwarf_abbrev_table::do_read_abbrevs): New function.
1032 (Dwarf_abbrev_table::do_get_abbrev): New function.
1033 (Dwarf_ranges_table::read_ranges_table): New function.
1034 (Dwarf_ranges_table::read_range_list): New function.
1035 (Dwarf_pubnames_table::read_section): New function.
1036 (Dwarf_pubnames_table::read_header): New function.
1037 (Dwarf_pubnames_table::next_name): New function.
1038 (Dwarf_die::Dwarf_die): New function.
1039 (Dwarf_die::read_attributes): New function.
1040 (Dwarf_die::skip_attributes): New function.
1041 (Dwarf_die::set_name): New function.
1042 (Dwarf_die::set_linkage_name): New function.
1043 (Dwarf_die::attribute): New function.
1044 (Dwarf_die::string_attribute): New function.
1045 (Dwarf_die::int_attribute): New function.
1046 (Dwarf_die::uint_attribute): New function.
1047 (Dwarf_die::ref_attribute): New function.
1048 (Dwarf_die::child_offset): New function.
1049 (Dwarf_die::sibling_offset): New function.
1050 (Dwarf_info_reader::check_buffer): New function.
1051 (Dwarf_info_reader::parse): New function.
1052 (Dwarf_info_reader::do_parse): New function.
1053 (Dwarf_info_reader::do_read_string_table): New function.
1054 (Dwarf_info_reader::lookup_reloc): New function.
1055 (Dwarf_info_reader::get_string): New function.
1056 (Dwarf_info_reader::visit_compilation_unit): New function.
1057 (Dwarf_info_reader::visit_type_unit): New function.
1058 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
1059 Sized_elf_reloc_mapper.
1060 (Sized_dwarf_line_info::symbol_section): Remove function.
1061 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
1062 (Sized_dwarf_line_info::read_line_mappings): Remove object
1063 parameter, adjust callers.
1064 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
1065 * dwarf_reader.h: Include <sys/types.h>.
1066 (class Track_relocs): Remove forward declaration.
1067 (class Elf_reloc_mapper): New class.
1068 (class Sized_elf_reloc_mapper): New class.
1069 (class Dwarf_abbrev_table): New class.
1070 (class Dwarf_range_list): New class.
1071 (class Dwarf_ranges_table): New class.
1072 (class Dwarf_pubnames_table): New class.
1073 (class Dwarf_die): New class.
1074 (class Dwarf_info_reader): New class.
1075 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
1076 (Sized_dwarf_line_info::symbol_section): Remove member function.
1077 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1078 base class.
1079 * gdb-index.cc: New source file.
1080 * gdb-index.h: New source file.
1081 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1082 and .debug_types sections, call Layout::add_to_gdb_index.
1083 (Sized_relobj_incr::do_section_name): Implement.
1084 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1085 return type; Implement.
1086 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1087 return type.
1088 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1089 parameter list and return type.
1090 (Sized_incr_dynobj::do_section_contents): Likewise.
1091 * layout.cc: Include gdb-index.h.
1092 (Layout::Layout): Initialize gdb_index_data_.
1093 (Layout::init_fixed_output_section): Check for .gdb_index section.
1094 (Layout::add_to_gdb_index): New function. Instantiate.
1095 * layout.h: Add forward declaration for class Gdb_index.
1096 (Layout::add_to_gdb_index): New member function.
1097 (Layout::gdb_index_data_): New data member.
1098 * main.cc: Include gdb-index.h.
1099 (main): Print statistics for gdb index.
1100 * object.cc (Object::section_contents): Move code into
1101 do_section_contents.
1102 (need_decompressed_section): Check for sections needed when building
1103 gdb index.
1104 (build_compressed_section_map): Likewise.
1105 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1106 gdb index.
1107 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1108 sections; call Layout::add_to_gdb_index.
1109 (Sized_relobj_file::do_decompressed_section_contents): Call
1110 do_section_contents directly.
1111 * object.h (Object::do_section_contents): Adjust parameter list and
1112 return type.
1113 (Object::do_decompressed_section_contents): Call do_section_contents
1114 directly.
1115 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1116 return type.
1117 * options.h (class General_options): Add --gdb-index option.
1118 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1119 list and return type.
1120 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1121 * reloc.h (Track_relocs::checkpoint): New function.
1122 (Track_relocs::reset): New function.
1123
1124 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1125 New test cases.
1126 * testsuite/Makefile.in: Regenerate.
1127 * testsuite/gdb_index_test.cc: New test source file.
1128 * testsuite/gdb_index_test_1.sh: New test source file.
1129 * testsuite/gdb_index_test_2.sh: New test source file.
1130
647f1574
DK
11312012-03-19 Doug Kwan <dougkwan@google.com>
1132
1133 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1134 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1135 __exidx_start and __exidx_end. Make symbol table parameter
1136 anonymous as it is not used.
1137 * gold.cc (queue_middle_tasks): Call target hook to define any
1138 target-specific symbols.
1139 * target.h (Target::define_standard_symbols): New method.
1140 (Target::do_define_standard_symbols): Same.
1141 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1142 * testsuite/Makefile.in: Regenerate.
1143 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1144 and __exidx_end.
1145 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1146 relocations are generated for __exidx_start and __exidx_end.
1147
7c6109da
DK
11482012-03-16 Doug Kwan <dougkwan@google.com>
1149
1150 * testsuite/Makefile.am: Disable test initpri3b.
1151 * testsuite/Makefile.in: Regenerate.
1152
7b8957f8
DK
11532012-03-15 Doug Kwan <dougkwan@google.com>
1154
1155 * arm.cc (Target_arm::got_section): Make .got section read-only
1156 if -z now is given.
1157
14dc9ef7
ILT
11582012-03-15 Ian Lance Taylor <iant@google.com>
1159
1160 PR gold/13850
1161 * layout.cc (Layout::make_output_section): Correctly mark
1162 SHT_INIT_ARRAY, et. al., as relro.
1163
fa40b62a
DK
11642012-03-14 Doug Kwan <dougkwan@google.com>
1165
1166 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1167 dynamic relocations for protected symbols in shared objects.
1168
fd325007
ILT
11692012-03-13 Ian Lance Taylor <iant@google.com>
1170
1171 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1172 keep the larger alignment.
1173
e8dd54e1
CC
11742012-03-12 Cary Coutant <ccoutant@google.com>
1175
1176 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1177 handling of DW_LNE_define_file.
1178
feb5f3b0
CC
11792012-03-12 Cary Coutant <ccoutant@google.com>
1180
1181 * reduced_debug_output.cc
1182 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1183 codes to switch.
1184
a1fb4256
CC
11852012-02-29 Cary Coutant <ccoutant@google.com>
1186
1187 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1188
5dd8762a
CC
11892012-02-29 Cary Coutant <ccoutant@google.com>
1190
1191 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1192 Call Object::decompressed_section_contents.
1193 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1194 New dtor.
1195 (Sized_dwarf_line_info::buffer_start_): New data member.
1196 * merge.cc (Output_merge_data::do_add_input_section): Call
1197 Object::decompressed_section_contents.
1198 (Output_merge_string::do_add_input_section): Likewise.
1199 * object.cc (need_decompressed_section): New function.
1200 (build_compressed_section_map): Decompress sections needed later.
1201 (Sized_relobj_file::do_decompressed_section_contents): New function.
1202 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1203 * object.h (Object::decompressed_section_contents): New function.
1204 (Object::discard_decompressed_sections): New function.
1205 (Object::do_decompressed_section_contents): New function.
1206 (Object::do_discard_decompressed_sections): New function.
1207 (Compressed_section_info): New type.
1208 (Compressed_section_map): Include decompressed section contents.
1209 (Sized_relobj_file::do_decompressed_section_contents): New function.
1210 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1211
7b5de7ee
CC
12122012-02-16 Cary Coutant <ccoutant@google.com>
1213
1214 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1215 * testsuite/Makefile.in: Regenerate.
1216
f9fa4a63
CC
12172012-02-14 Cary Coutant <ccoutant@google.com>
1218
1219 * options.cc (General_options::finalize): Disallow -pie and -static.
1220
2c175ebc
DK
12212012-02-03 Doug Kwan <dougkwan@google.com>
1222
1223 * arm.cc (Arm_relocate_functions::abs8,
1224 Arm_relocate_functions::abs16): Use
1225 Bits::has_signed_unsigned_overflow32.
1226 (Arm_relocate_functions::thm_abs8): Correct range of
1227 overflow check.
1228 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1229 in assertions.
1230
90cff06f
DK
12312012-02-02 Doug Kwan <dougkwan@google.com>
1232
1233 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1234 position independent outputs, not just shared objects.
1235
63887f3d
L
12362012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1237
1238 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1239 * configure: Regenerated.
1240
bef2b434
ILT
12412012-01-27 Ian Lance Taylor <iant@google.com>
1242
1243 * reloc.h (Bits): New class with static functions, copied from
1244 namespace utils in arm.cc.
1245 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1246 instead.
1247
c335b55d
L
12482012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1249
1250 * incremental.cc (write_info_blocks): Correct relocation offset.
1251
41194d9f
L
12522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1253
1254 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1255 (Relocate::tls_gd_to_le): Likewise.
1256
1bae613c
L
12572012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1258
1259 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1260
24482ca0
L
12612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1262
1263 * configure.ac: Check if -mcmodel=medium works.
1264 * configure: Regenerated.
1265
c2c7840a
CC
12662012-01-24 Cary Coutant <ccoutant@google.com>
1267
1268 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1269 definition and ...
1270 (read_unsigned_LEB_128_x): ... this new function.
1271 (read_signed_LEB_128): Replaced with inline definition and ...
1272 (read_signed_LEB_128_x): ... this new function.
1273 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1274 (read_unsigned_LEB_128): Add inline definition.
1275 (read_signed_LEB_128_x): New function.
1276 (read_signed_LEB_128): Add inline definition.
1277 * testsuite/Makefile.am (leb128_unittest): New unit test.
1278 * testsuite/Makefile.in: Regenerate.
1279 * testsuite/leb128_unittest.cc: New unit test.
1280
833de760 12812012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1282
1283 PR gold/13617
1284 * i386.cc (Target_i386::do_code_fill): When using a jmp
1285 instruction, pad with nop instructions.
1286 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1287
618d6666
L
12882012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1289
1290 * x86_64.cc (gc_process_relocs): Add typename on types used in
1291 template.
1292 (scan_relocs): Likewise.
1293 (relocate_section): Likewise.
1294 (apply_relocation): Likewise.
1295
3660ff06
L
12962012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1297
1298 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1299 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1300 under x32.
1301
fc51264f
L
13022012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1303
1304 * x86_64.cc: Initial support for x32.
1305
dd74ae06
CC
13062012-01-03 Cary Coutant <ccoutant@google.com>
1307
1308 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1309 Use abstract base class for GOT.
1310 * gold/output.h (class Output_data_got_base): New abstract base class.
1311 (class Output_data_got): Derive from new base class, adjust ctors.
1312 (Output_data_got::reserve_slot): Make virtual; rename to
1313 do_reserve_slot; Adjust callers.
1314 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1315 pointer to abstract base class.
1316 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1317
83896202
ILT
13182011-12-18 Ian Lance Taylor <iant@google.com>
1319
1320 * object.h (Relobj::local_symbol_value): New function.
1321 (Relobj::local_plt_offset): New function.
1322 (Relobj::local_has_got_offset): New function.
1323 (Relobj::local_got_offset): New function.
1324 (Relobj::set_local_got_offset): New function.
1325 (Relobj::do_local_symbol_value): New pure virtual function.
1326 (Relobj::do_local_plt_offset): Likewise.
1327 (Relobj::do_local_has_got_offset): Likewise.
1328 (Relobj::do_local_got_offset): Likewise.
1329 (Relobj::do_set_local_got_offset): Likewise.
1330 (Sized_relobj::do_local_has_got_offset): Rename from
1331 local_has_got_offset.
1332 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1333 (Sized_relobj::do_set_local_got_offset): Rename from
1334 set_local_got_offset.
1335 (Sized_relobj_file::do_local_plt_offset): Rename from
1336 local_plt_offset.
1337 (Sized_relobj_file::do_local_symbol_value): New function.
1338 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1339 local_plt_offset.
1340 * output.cc (Output_data_got::Got_entry::write): Change object to
1341 Relobj. Use local_symbol_value.
1342 (Output_data_got::add_global_with_rel): Change rel_dyn to
1343 Output_data_reloc_generic*. Use add_global_generic.
1344 (Output_data_got::add_global_with_rela): Remove. Change all
1345 callers to use add_global_with_rel.
1346 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1347 Output_data_reloc_generic*. Use add_global_generic.
1348 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1349 callers to use add_global_pair_with_rel.
1350 (Output_data_got::add_local): Change object to Relobj*.
1351 (Output_data_got::add_local_plt): Likewise.
1352 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1353 change rel_dyn to Output_data_reloc_generic*. Use
1354 add_local_generic.
1355 (Output_data_got::add_local_with_rela): Remove. Change all
1356 callers to use all_local_with_rel.
1357 (Output_data_got::add_local_pair_with_rel): Change object to
1358 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1359 add_output_section_generic.
1360 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1361 callers to use add_local_pair_with_rel.
1362 (Output_data_got::reserve_local): Change object to Relobj*.
1363 * output.h: (class Output_data_reloc_generic): Add pure virtual
1364 declarations for add_global_generic, add_local_generic,
1365 add_output_section_generic.
1366 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1367 functions for Output_data_reloc_generic. Update declarations for
1368 changes listed in output.cc.
1369 (class Output_data_got): Change template parameter to got_size.
1370 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1371 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1372 function.
1373 (Sized_relobj_incr::do_local_plt_offset): New function.
1374 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1375 add_global_generic.
1376
76677ad0
CC
13772011-12-17 Cary Coutant <ccoutant@google.com>
1378
1379 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1380 * resolve.cc (Symbol_table::resolve): Likewise.
1381 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1382 arrays.
1383 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1384
8b8dd8d5
ILT
13852011-12-16 Ian Lance Taylor <iant@google.com>
1386
1387 * output.h (Output_data_reloc_generic::add): Only call
1388 add_dynamic_reloc if this is a dynamic reloc section.
1389
d55525b9
L
13902011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1391
1392 PR gold/13505
1393 * target-reloc.h (apply_relocation): Replace <64, false> with
1394 <size, big_endian>.
1395
ff81c7c1
NC
13962011-11-25 Nick Clifton <nickc@redhat.com>
1397
1398 * po/it.po: New Italian translation.
1399
628f39be
SA
14002011-11-17 Sterling Augustine <saugustine@google.com>
1401
1402 * script.cc (script_include_directive): Implement.
1403 (read_script_file): New local variables name and search_path. Update
1404 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1405 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1406 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1407
98ef3ea4
SA
14082011-11-11 Sterling Augustine <saugustine@google.com>
1409
1410 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1411 (file_or_sections_cmd): Likewise.
1412
f4a8b6d7
DK
14132011-11-11 Doug Kwan <dougkwan@google.com>
1414
1415 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1416 if --just-symbols is given.
1417
29ab395d
DK
14182011-11-10 Doug Kwan <dougkwan@google.com>
1419
1420 PR gold/13362
1421 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1422 when processing data relocs.
1423 * reloc.h (Relocate_functions::rel_unaligned): New method.
1424 (Relocate_functions::pcrel_unaligned): Ditto.
1425 (Relocate_functions::rel32_unaligned): Ditto.
1426 (Relocate_functions::pcrel32_unaligned): Ditto.
1427
2c339f71
DK
14282011-11-09 Doug Kwan <dougkwan@google.com>
1429
1430 PR gold/13362
1431 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1432 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1433 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1434 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1435 (Relocate_functions::rel_unaligned): New.
1436 (Relocate_functions::rel32_unaligned): New.
1437 * target-reloc.h (relocate_for_relocatable): Add code to handle
1438 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1439 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1440 arm_unaligned_reloc_r): New targets.
1441 * testsuite/Makefile.in: Regenerate.
1442 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1443 linking.
1444
3f3cddf1
ILT
14452011-11-02 Ian Lance Taylor <iant@google.com>
1446
1447 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1448 NATIVE_LINKER.
1449 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1450 * options.cc (General_options::finalize): Use library search path
1451 from configure script if specified. If not native and no sysroot,
1452 only search TOOLLIBDIR.
1453 * options.h (Search_directory::Search_directory): Change name to
1454 const std::string&.
1455 (General_options::add_to_library_path_with_sysroot): Change arg to
1456 const std::string&.
1457 * configure, Makefile.in, config.in: Rebuild.
1458
a8e2273b
ILT
14592011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1460
1461 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1462 we are working around the ARM1176 Erratum.
1463 * options.h (General_options::fix_arm1176): Add option.
1464 * testsuite/Makefile.am: Add testcases, and keep current ones
1465 working.
1466 * testsuite/Makefile.in: Regenerate.
1467 * testsuite/arm_fix_1176.s: New file.
1468 * testsuite/arm_fix_1176.sh: Likewise.
1469
cd6eab1c
ILT
14702011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1471
1472 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1473 may_use_blx_.
1474 (Target_arm::may_use_blx): Remove method.
1475 (Target_arm::set_may_use_blx): Likewise.
1476 (Target_arm::may_use_v4t_interworking): New method.
1477 (Target_arm::may_use_v5t_interworking): Likewise.
1478 (Target_arm::may_use_blx_): Remove member variable.
1479 (Arm_relocate_functions::arm_branch_common): Check for v5T
1480 interworking.
1481 (Arm_relocate_functions::thumb_branch_common): Likewise.
1482 (Reloc_stub::stub_type_for_reloc): Likewise.
1483 (Target_arm::do_finalize_sections): Correct interworking checks.
1484 * testsuite/Makefile.am: Add new tests.
1485 * testsuite/Makefile.in: Regenerate.
1486 * testsuite/arm_farcall_arm_arm.s: New test.
1487 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1488 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1489 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1490 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1491 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1492 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1493 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1494
286adcf4
CC
14952011-10-31 Cary Coutant <ccoutant@google.com>
1496
1497 PR gold/13023
1498 * expression.cc (Expression::eval_with_dot): Add
1499 is_section_dot_assignment parameter.
1500 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1501 absolute and assigning to dot within a section.
1502 * script-sections.cc
1503 (Output_section_element_assignment::set_section_addresses): Pass
1504 dot_section to set_if_absolute.
1505 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1506 as is_section_dot_assignment flag to eval_with_dot.
1507 (Output_section_element_dot_assignment::set_section_addresses):
1508 Likewise.
1509 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1510 parameter. Also set value if relative to dot_section; set the
1511 symbol's output_section.
1512 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1513 parameter. Adjust all callers.
1514 (Expression::eval_maybe_dot): Likewise.
1515 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1516 Adjust all callers.
1517 * testsuite/script_test_2.t: Test assignment of an absolute value
1518 to dot within an output section element.
1519
9634ed06
CC
15202011-10-31 Cary Coutant <ccoutant@google.com>
1521
1522 * options.h (class General_options): Add --[no-]gnu-unique options.
1523 * symtab.cc (Symbol_table::sized_write_globals): Convert
1524 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1525
de4101c7
CC
15262011-10-31 Cary Coutant <ccoutant@google.com>
1527
1528 PR gold/13359
1529 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1530 unnecessary assertion.
1531 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1532
7257cc92
ST
15332011-10-31 Sriraman Tallam <tmsriram@google.com>
1534
1535 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1536 gc_mark_symbol.
1537 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1538 gc_mark_symbol.
1539 Change to just keep the section associated with symbol.
1540 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1541 they are externally visible and --export-dynamic is turned on.
1542 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1543
bfc34b3f
ILT
15442011-10-19 Ian Lance Taylor <iant@google.com>
1545
1546 PR gold/13163
1547 * script-sections.cc
1548 (Output_section_element_dot_assignment::needs_output_section): New
1549 function.
1550
ea0d8c47
ILT
15512011-10-19 Ian Lance Taylor <iant@google.com>
1552
1553 PR gold/13204
1554 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1555 --section-start option was seen.
1556 * options.h (General_options::any_section_start): New function.
1557
abd242a9
DM
15582011-10-18 David S. Miller <davem@davemloft.net>
1559
1560 PR binutils/13301
1561 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1562 member to track relocation locations that have moved during TLS
1563 reloc optimizations.
1564 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1565 (Target_sparc::Relocate::relocate): Adjust view down by 4
1566 bytes if it matches reloc_adjust_addr_.
1567 (Target_sparc::Relocate::relocate_tls): Always move the
1568 __tls_get_addr call delay slot instruction forward 4 bytes when
1569 performing relaxation.
1570
bab9090f
CC
15712011-10-18 Cary Coutant <ccoutant@google.com>
1572
1573 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1574 (Output_file::map_no_anonymous): Check for non-zero
1575 return code from posix_fallocate.
1576
f7c5b166
CC
15772011-10-17 Cary Coutant <ccoutant@google.com>
1578
1579 PR gold/13245
1580 * plugin.cc (is_visible_from_outside): Check for symbols
1581 referenced from dynamic objects.
1582 * resolve.cc (Symbol_table::resolve): Don't count references
1583 from dynamic objects as references from real ELF files.
1584 * testsuite/plugin_test_2.sh: Adjust expected result.
1585
b490c0bb
CC
15862011-10-17 Cary Coutant <ccoutant@google.com>
1587
1588 * gold.cc: Include timer.h.
1589 (queue_middle_tasks): Stamp time.
1590 (queue_final_tasks): Likewise.
1591 * main.cc (main): Store timer in parameters. Print timers
1592 for each pass.
1593 * parameters.cc (Parameters::Parameters): Initialize timer_.
1594 (Parameters::set_timer): New function.
1595 (set_parameters_timer): New function.
1596 * parameters.h (Parameters::set_timer): New function.
1597 (Parameters::timer): New function.
1598 (Parameters::timer_): New data member.
1599 (set_parameters_timer): New function.
1600 * timer.cc (Timer::stamp): New function.
1601 (Timer::get_pass_time): New function.
1602 * timer.h (Timer::stamp): New function.
1603 (Timer::get_pass_time): New function.
1604 (Timer::pass_times_): New data member.
1605
f475cf7b
CC
16062011-10-17 Cary Coutant <ccoutant@google.com>
1607
1608 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1609 task for members of lib groups.
1610
cdd7e244
CC
16112011-10-17 Cary Coutant <ccoutant@google.com>
1612
1613 PR gold/13288
4f95c8b4 1614 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1615 (File_read::make_view): Move bounds check (replace with assert)...
1616 (File_read::find_or_make_view): ... to here.
1617
dfb45471
CC
16182011-10-12 Cary Coutant <ccoutant@google.com>
1619
4f95c8b4 1620 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1621 ::read returns less than requested size.
1622
53bbcc1b
CC
16232011-10-10 Cary Coutant <ccoutant@google.com>
1624
4f95c8b4 1625 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1626 Initialize defined_count_.
1627 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1628 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1629 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1630 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1631 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1632 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1633 member.
1634 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1635 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1636 Return zeroes instead of internal error.
1637
397b129b
CC
16382011-10-10 Cary Coutant <ccoutant@google.com>
1639
1640 PR gold/13249
4f95c8b4 1641 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1642 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1643 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1644 (Output_reloc::type_): Adjust size of bit field.
1645 (Output_reloc::use_plt_offset_): New bit field.
1646 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1647 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1648 flag. Adjust all callers.
4f95c8b4 1649 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1650 creating RELATIVE relocations.
1651
d5698657
NC
16522011-10-10 Nick Clifton <nickc@redhat.com>
1653
1654 * po/es.po: Updated Spanish translation.
1655 * po/fi.po: Updated Finnish translation.
1656
6a59a5c2
DN
16572011-10-03 Diego Novillo <dnovillo@google.com>
1658
1659 * options.cc (parse_uint): Fix dereference of RETVAL.
1660
f0558624
ST
16612011-09-29 Sriraman Tallam <tmsriram@google.com>
1662
1663 * layout.h (section_order_map_): New member.
1664 (get_section_order_map): New member function.
1665 * output.cc (Output_section::add_input_section): Check for patterns
1666 only when --section-ordering-file is specified.
1667 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1668 output_sections have been formed.
1669 * layout.cc (Layout_Layout): Initialize section_order_map_.
1670 * plugin.cc (update_section_order): Store order in order_map. Do not
1671 update the order.
1672 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1673 * testsuite/Makefile.in: Regenerate.
1674 * testsuite/plugin_section_order.c: New file.
1675 * testsuite/plugin_final_layout.cc: New file.
1676 * testsuite/plugin_final_layout.sh: New file.
1677
a7dac153
CC
16782011-09-29 Cary Coutant <ccoutant@google.com>
1679
4f95c8b4 1680 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1681 Check for NULL.
4f95c8b4 1682 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1683 symbols during incremental update.
1684 (Symbol_table::add_from_dynobj): Likewise.
1685
eebd87a5
ILT
16862011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1687 Ian Lance Taylor <iant@google.com>
1688
1689 * symtab.cc (Symbol_table::define_special_symbol): Always
1690 canonicalize version string.
1691
403a3331
CC
16922011-09-26 Cary Coutant <ccoutant@google.com>
1693
4f95c8b4
CC
1694 * gold.cc (queue_initial_tasks): Move option checks ...
1695 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1696 some options; make others fatal.
1697
235061c2
CC
16982011-09-26 Cary Coutant <ccoutant@google.com>
1699
1700 gcc PR lto/47247
1701 * plugin.cc (get_symbols_v2): New function.
1702 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1703 (is_referenced_from_outside): New function.
1704 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1705 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1706 (get_symbols): Pass version parameter.
1707 (get_symbols_v2): New function.
1708 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1709 parameter.
1710 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1711 (onload): Add LDPT_GET_SYMBOLS_V2.
1712 (all_symbols_read_hook): Use get_symbols_v2; check for
1713 LDPR_PREVAILING_DEF_IRONLY_EXP.
1714 * testsuite/plugin_test_3.sh: Update expected results.
1715
dc87f620
ILT
17162011-09-23 Simon Baldwin <simonb@google.com>
1717
1718 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1719 configuration options.
1720 * configure: Regenerate.
1721 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1722 * Makefile.in: Regenerate.
1723 * testsuite/Makefile.in: Regenerate.
1724
a8279f82
ST
17252011-09-19 Sriraman Tallam <tmsriram@google.com>
1726
1727 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1728
0c9350c8
CC
17292011-09-19 Cary Coutant <ccoutant@google.com>
1730
1731 * incremental.cc (can_incremental_update): Fix typo in comment.
1732 * incremental.h (can_incremental_update): Likewise.
1733
aa06ae28
CC
17342011-09-18 Cary Coutant <ccoutant@google.com>
1735
1736 * incremental.cc (can_incremental_update): New function.
1737 * incremental.h (can_incremental_update): New function.
1738 * layout.cc (Layout::init_fixed_output_section): Call it.
1739 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1740 * object.cc (Sized_relobj_file::do_layout): Call
1741 can_incremental_update.
1742
ebb300b2
CC
17432011-09-13 Cary Coutant <ccoutant@google.com>
1744
1745 * configure.ac: Check for glibc support for gnu_indirect_function
1746 support with static linking, setting automake conditional
1747 IFUNC_STATIC.
1748 * Makefile.in: Regenerate.
1749 * configure: Regenerate.
1750
1751 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1752 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1753 for IFUNC_STATIC.
1754 * testsuite/Makefile.in: Regenerate.
1755
1206d0d5
CC
17562011-09-13 Cary Coutant <ccoutant@google.com>
1757
1758 * incremental.cc (Sized_relobj_incr::do_layout): Call
1759 report_comdat_group for kept comdat sections.
1760 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1761 * testsuite/Makefile.in: Regenerate.
1762 * testsuite/incr_comdat_test_1.cc: New source file.
1763 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1764 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1765 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1766
40b29874
ILT
17672011-09-13 Ian Lance Taylor <iant@google.com>
1768
1769 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1770 variable external_symbols_offset.
1771
1b045aac
ILT
17722011-09-12 Ian Lance Taylor <iant@google.com>
1773
1774 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1775 triggered if object has no symbols.
1776
24c6c55a
DM
17772011-09-09 David S. Miller <davem@davemloft.net>
1778
1779 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1780 (Output_fill_debug_line::do_write): Likewise.
1781
66570254
CC
17822011-08-29 Cary Coutant <ccoutant@google.com>
1783
1784 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1785 casts to match formatting specs.
1786 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1787
8ea8cd50
CC
17882011-08-26 Cary Coutant <ccoutant@google.com>
1789
1790 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1791 remaining hole size when allocating.
1792 (Layout::make_output_section): Set fill methods for debug sections.
1793 * layout.h (Free_list::Free_list_node): Move from private to
1794 public.
1795 (Free_list::set_min_hole_size): New function.
1796 (Free_list::begin, Free_list::end): New functions.
1797 (Free_list::min_hole_): New data member.
1798 * output.cc: Include dwarf.h.
1799 (Output_fill_debug_info::do_minimum_hole_size): New function.
1800 (Output_fill_debug_info::do_write): New function.
1801 (Output_fill_debug_line::do_minimum_hole_size): New function.
1802 (Output_fill_debug_line::do_write): New function.
1803 (Output_section::Output_section): Initialize new data member.
1804 (Output_section::set_final_data_size): Ensure patch space is larger
1805 than minimum hole size.
1806 (Output_section::do_write): Fill holes in debug sections.
1807 * output.h (Output_fill): New class.
1808 (Output_fill_debug_info): New class.
1809 (Output_fill_debug_line): New class.
1810 (Output_section::set_free_space_fill): New function.
1811 (Output_section::free_space_fill_): New data member.
1812 * testsuite/Makefile.am (incremental_test_3): Add
1813 --incremental-patch option.
1814 (incremental_test_4): Likewise.
1815 (incremental_test_5): Likewise.
1816 (incremental_test_6): Likewise.
1817 (incremental_copy_test): Likewise.
1818 (incremental_common_test_1): Likewise.
1819 * testsuite/Makefile.in: Regenerate.
1820
7cf80422
NC
18212011-08-26 Nick Clifton <nickc@redhat.com>
1822
1823 * po/es.po: Updated Spanish translation.
1824
c3f7b0e5
CC
18252011-08-01 Cary Coutant <ccoutant@google.com>
1826
1827 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1828 * gold/testsuite/Makefile.in: Regenerate.
1829 * gold/testsuite/justsyms_exec.c: New source file.
1830 * gold/testsuite/justsyms_lib.c: New source file.
1831
9590bf25
CC
18322011-08-01 Cary Coutant <ccoutant@google.com>
1833
1834 * layout.cc (Layout::set_segment_offsets): Don't realign text
1835 segment if -Ttext was specified.
1836 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1837 file type.
1838 * object.h (Sized_relobj_file::e_type): New function.
1839 (Sized_relobj_file::e_type_): New data member.
1840 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1841 base address for ET_EXEC files.
1842 * target.cc (Target::do_make_elf_object_implementation): Allow
1843 ET_EXEC files with --just-symbols option.
1844
dcd8d12e
CC
18452011-07-28 Cary Coutant <ccoutant@google.com>
1846
1847 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1848 Add thread_number parameter.
1849 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1850 * workqueue-threads.cc
1851 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1852 current thread if its thread number is greater than desired thread
1853 count.
1854 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1855 Add thread_number parameter.
1856 (Workqueue::should_cancel_thread): Likewise.
1857 (Workqueue::find_runnable_or_wait): Pass thread_number to
1858 should_cancel_thread.
1859 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1860 parameter.
1861
804eb480
ST
18622011-07-22 Sriraman Tallam <tmsriram@google.com>
1863
1864 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1865 only after checking if it cannot be forced local.
1866 * symtab.h (is_externally_visible): Check if the symbol is not forced
1867 local.
1868
f1ddb600
ILT
18692011-07-15 Ian Lance Taylor <iant@google.com>
1870
1871 * options.h (class General_options): Add --print-output-format.
1872 Move -EL next to -EB, for better --help output.
1873 * target-select.cc: Include <cstdio>, "options.h", and
1874 "parameters.h".
1875 (Target_selector::do_target_bfd_name): New function.
1876 (print_output_format): New function.
1877 * target-select.h (class Target_selector): Update declarations.
1878 (Target_selector::target_bfd_name): New function.
1879 (print_output_format): Declare.
1880 * main.cc: Include "target-select.h".
1881 (main): Handle --print-output-format.
1882 * gold.cc: Include "target-select.h".
1883 (queue_initial_tasks): Handle --print-output-format when there are
1884 no input files.
1885 * parameters.cc (parameters_force_valid_target): Give a better
1886 error message if -EB/-EL does not match target.
1887 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1888 function.
1889
7d172687
ILT
18902011-07-15 Ian Lance Taylor <iant@google.com>
1891
1892 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1893 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1894 (Output_data_plt_i386::do_write): Write address of .dynamic
1895 section to first entry in .got.plt section.
1896 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1897 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1898 Initialize layout_.
1899 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1900 section to first entry in .got.plt section.
1901 * layout.h (Layout::dynamic_section): New function.
1902
e9552f7e
ST
19032011-07-13 Sriraman Tallam <tmsriram@google.com>
1904
1905 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1906 to claim_file call.
1907 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1908 input_section_position_, and input_section_glob_.
1909 (read_layout_from_file): Call function section_ordering_specified.
1910 * layout.h (is_section_ordering_specified): New function.
1911 (section_ordering_specified): New function.
1912 (section_ordering_specified_): New boolean member.
1913 * main.cc(main): Call load_plugins after layout object is defined.
1914 * output.cc (Output_section::add_input_section): Use
1915 function section_ordering_specified to check if section ordering is
1916 needed.
1917 * output.cc (Output_section::add_relaxed_input_section): Use
1918 function section_ordering_specified to check if section ordering is
1919 needed.
1920 (Output_section::update_section_layout): New function.
1921 (Output_section::sort_attached_input_sections): Check if input section
1922 must be reordered.
1923 * output.h (Output_section::update_section_layout): New function.
1924 * plugin.cc (get_section_count): New function.
1925 (get_section_type): New function.
1926 (get_section_name): New function.
1927 (get_section_contents): New function.
1928 (update_section_order): New function.
58797674 1929 (allow_section_ordering): New function.
e9552f7e
ST
1930 (Plugin::load): Add the new interfaces to the transfer vector.
1931 (Plugin_manager::load_plugins): New parameter.
1932 (Plugin_manager::all_symbols_read): New parameter.
1933 (Plugin_manager::claim_file): New parameter. Save the elf object for
1934 unclaimed objects.
1935 (Plugin_manager::get_elf_object): New function.
1936 (Plugin_manager::get_view): Change to directly use the bool to check
1937 if get_view is called from claim_file_hook.
1938 * plugin.h (input_objects): New function
1939 (Plugin__manager::load_plugins): New parameter.
1940 (Plugin_manager::claim_file): New parameter.
1941 (Plugin_manager::get_elf_object): New function.
1942 (Plugin_manager::in_claim_file_handler): New function.
1943 (Plugin_manager::in_claim_file_handler_): New member.
1944 (layout): New function.
1945 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1946 handler with an extra parameter. Make the elf object before calling
1947 claim_file handler.
1948 * testsuite/plugin_test.c (get_section_count): New function pointer.
1949 (get_section_type): New function pointer.
1950 (get_section_name): New function pointer.
1951 (get_section_contents): New function pointer.
1952 (update_section_order): New function pointer.
1953 (allow_section_ordering): New function pointer.
1954 (onload): Check if the new interfaces exist.
1955
9446efde
ILT
19562011-07-13 Ian Lance Taylor <iant@google.com>
1957
1958 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1959 relro section.
1960 * x86_64.cc (Target_x86_64::got_section): Likewise.
1961 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1962 (relro_now_test_SOURCES): New variable.
1963 (relro_now_test_DEPENDENCIES): New variable.
1964 (relro_now_test_LDFLAGS): New variable.
1965 (relro_now_test_LDADD): New variable.
1966 (relro_now_test.so): New target.
1967 * testsuite/Makefile.in: Rebuild.
1968
07aa62f2
ILT
19692011-07-12 Ian Lance Taylor <iant@google.com>
1970
1971 PR gold/12980
1972 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1973 GLOB_DAT relocation rather than a RELATIVE relocation for a
1974 protected symbol when creating a shared library.
1975 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1976 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1977 * testsuite/protected_main_1.cc (main): Test that protected
1978 function has same address.
1979
e2153196
ILT
19802011-07-11 Ian Lance Taylor <iant@google.com>
1981
1982 PR gold/12979
1983 * options.h (class General_options): Add -Bgroup.
1984 * options.cc (General_options::finalize): If -Bgroup is set,
1985 default to --unresolved-symbols=report-all.
1986 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1987 * target-reloc.h (issue_undefined_symbol_error): Handle
1988 --unresolved-symbols=report-all.
1989
6daf5215
ILT
19902011-07-08 Ian Lance Taylor <iant@google.com>
1991
1992 PR gold/11985
1993 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1994 if linker script discards key sections.
1995 (Layout::create_dynamic_symtab): Likewise.
1996 (Layout::assign_local_dynsym_offsets): Likewise.
1997 (Layout::sized_create_version_sections): Likewise.
1998 (Layout::create_interp): Likewise.
1999 (Layout::finish_dynamic_section): Likewise.
2000 (Layout::set_dynamic_symbol_size): Likewise.
2001
beabb2c6
ILT
20022011-07-08 Ian Lance Taylor <iant@google.com>
2003
2004 PR gold/12386
2005 * options.h (class General_options): Add --unresolved-symbols.
2006 * target-reloc.h (issue_undefined_symbol_error): Check
2007 --unresolved-symbols. Add comments.
2008
9c16daf1
ILT
20092011-07-08 Ian Lance Taylor <iant@google.com>
2010
2011 * testsuite/odr_violation2.cc (Ordering::operator()): Make
2012 expression more complex.
2013
191f1a2d
ILT
20142011-07-08 Ian Lance Taylor <iant@google.com>
2015
2016 PR gold/11317
2017 * target-reloc.h (issue_undefined_symbol_error): New inline
2018 function, broken out of relocate_section.
2019 (relocate_section): Call issue_undefined_symbol_error.
2020 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2021 there is no TLS segment if we are about to issue an undefined
2022 symbol error.
2023 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2024
62855347
ILT
20252011-07-08 Ian Lance Taylor <iant@google.com>
2026
2027 PR gold/12279
2028 * resolve.cc (Symbol_table::should_override): Add fromtype
2029 parameter. Change all callers. Give error when linking together
2030 TLS and non-TLS symbol.
2031 (Symbol_table::should_override_with_special): Add fromtype
2032 parameter. Change all callers.
2033 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
2034 there is no TLS segment if we have reported some errors.
2035 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
2036
67181c72
ILT
20372011-07-08 Ian Lance Taylor <iant@google.com>
2038
2039 PR gold/12372
2040 * target.h (Target::plt_address_for_global): New function.
2041 (Target::plt_address_for_local): New function.
2042 (Target::plt_section_for_global): Remove.
2043 (Target::plt_section_for_local): Remove.
2044 (Target::do_plt_address_for_global): New virtual function.
2045 (Target::do_plt_address_for_local): New virtual function.
2046 (Target::do_plt_section_for_global): Remove.
2047 (Target::do_plt_section_for_local): Remove.
2048 (Target::register_global_plt_entry): Add Symbol_table and Layout
2049 parameters.
2050 * output.cc (Output_data_got::Got_entry::write): Use
2051 plt_address_for_global and plt_address_for_local.
2052 * layout.cc (Layout::add_target_dynamic_tags): Use size and
2053 address of output section.
2054 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
2055 got_irelative_, and irelative_count_ fields. Update
2056 declarations.
2057 (Output_data_plt_i386::has_irelative_section): New function.
2058 (Output_data_plt_i386::entry_count): Add irelative_count_.
2059 (Output_data_plt_i386::set_final_data_size): Likewise.
2060 (class Target_i386): Add got_irelative_ and rel_irelative_
2061 fields. Update declarations.
2062 (Target_i386::Target_i386): Initialize new fields.
2063 (Target_i386::do_plt_address_for_global): New function replacing
2064 do_plt_section_for_global.
2065 (Target_i386::do_plt_address_for_local): New function replacing
2066 do_plt_section_for_local.
2067 (Target_i386::got_section): Create got_irelative_.
2068 (Target_i386::rel_irelative_section): New function.
2069 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
2070 fields. Don't define __rel_iplt_{start,end}.
2071 (Output_data_plt_i386::add_entry): Add symtab and layout
2072 parameters. Change all callers. Use different PLT and GOT for
2073 IFUNC symbols.
2074 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
2075 layout parameters. Change all callers. Use different PLT and
2076 GOT.
2077 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2078 (Output_data_plt_i386::rel_irelative): New function.
2079 (Output_data_plt_i386::address_for_global): New function.
2080 (Output_data_plt_i386::address_for_local): New function.
2081 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2082 IRELATIVE GOT when changing IFUNC GOT entries.
2083 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2084 reloc.
2085 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2086 if we didn't create an IRELATIVE GOT.
2087 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2088 plt_address_for_local.
2089 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2090 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2091 got_irelative_, and irelative_count_ fields. Update
2092 declarations.
2093 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2094 Initialize new fields. Remove symtab parameter. Change all
2095 callers.
2096 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2097 irelative_count_.
2098 (Output_data_plt_x86_64::has_irelative_section): New function.
2099 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2100 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2101 fields. Update declarations.
2102 (Target_x86_64::Target_x86_64): Initialize new fields.
2103 (Target_x86_64::do_plt_address_for_global): New function replacing
2104 do_plt_section_for_global.
2105 (Target_x86_64::do_plt_address_for_local): New function replacing
2106 do_plt_section_for_local.
2107 (Target_x86_64::got_section): Create got_irelative_.
2108 (Target_x86_64::rela_irelative_section): New function.
2109 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2110 all callers. Don't create __rel_iplt_{start,end}.
2111 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2112 parameters. Change all callers. Use different PLT and GOT for
2113 IFUNC symbols.
2114 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2115 layout parameters. Change all callers. Use different PLT and
2116 GOT.
2117 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2118 parameters. Change all callers. Use different PLT and GOT for
2119 IFUNC symbols.
2120 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2121 (Output_data_plt_x86_64::rela_irelative): New function.
2122 (Output_data_plt_x86_64::address_for_global): New function.
2123 (Output_data_plt_x86_64::address_for_local): New function.
2124 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2125 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2126 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2127 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2128 parameters.
2129 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2130 reloc.
2131 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2132 symbols if we didn't create an IRELATIVE GOT.
2133 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2134 plt_address_for_local.
2135 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2136 * testsuite/ifuncvar1.c: New test file.
2137 * testsuite/ifuncvar2.c: New test file.
2138 * testsuite/ifuncvar3.c: New test file.
2139 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2140 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2141 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2142 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2143 * testsuite/Makefile.in: Rebuild.
2144
33c15b45
CC
21452011-07-07 Cary Coutant <ccoutant@google.com>
2146
2147 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2148 (two_file_test_1_ndebug.o): Likewise.
2149 (two_file_test_1b_ndebug.o): Likewise.
2150 (two_file_test_2_ndebug.o): Likewise.
2151 (two_file_test_main_ndebug.o): Likewise.
2152 (incremental_test_2): Link with no-debug versions.
2153
f48b5fb7
CC
21542011-07-06 Cary Coutant <ccoutant@google.com>
2155
2156 * gold/incremental.cc
2157 (Output_section_incremental_inputs::write_info_blocks): Check for
2158 hidden and internal symbols.
2159
221597a5
CC
21602011-07-06 Cary Coutant <ccoutant@google.com>
2161
2162 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2163 Check disposition for startup file.
2164 (Incremental_inputs::report_command_line): Ignore
2165 --incremental-startup-unchanged option.
2166 * options.cc (General_options::parse_incremental_startup_unchanged):
2167 New function.
2168 (General_options::General_options): Initialize new data member.
2169 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2170 (General_options): Add --incremental-startup-unchanged option.
2171 (General_options::incremental_startup_disposition): New function.
2172 (General_options::incremental_startup_disposition_): New data member.
2173
e24719f6
CC
21742011-07-06 Cary Coutant <ccoutant@google.com>
2175
2176 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2177 input file index to Script_info ctor.
2178 (Sized_incremental_binary::do_file_has_changed): Find the
2179 command-line argument for files named in scripts.
2180 * incremental.h (Script_info::Script_info): New ctor
2181 with input file index.
2182 (Script_info::input_file_index): New function.
2183 (Script_info::input_file_index_): New data member.
2184 (Incremental_binary::get_library): Add const.
2185 (Incremental_binary::get_script_info): Add const.
2186 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2187 * testsuite/Makefile.am (incremental_test_5): New test case.
2188 (incremental_test_6): New test case.
2189 * testsuite/Makefile.in: Regenerate.
2190
8f7c81e8
CC
21912011-07-06 Cary Coutant <ccoutant@google.com>
2192
2193 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2194 debug output when command lines differ.
2195
9fbd3822
CC
21962011-07-06 Cary Coutant <ccoutant@google.com>
2197
2198 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2199 --incremental-patch option.
2200 * layout.cc (Free_list::allocate): Extend allocation beyond original
2201 end if enabled.
2202 (Layout::make_output_section): Mark sections that should get
2203 patch space.
2204 * options.cc (parse_percent): New function.
2205 * options.h (parse_percent): New function.
2206 (DEFINE_percent): New macro.
2207 (General_options): Add --incremental-patch option.
2208 * output.cc (Output_section::Output_section): Initialize new data
2209 members.
2210 (Output_section::add_input_section): Print section name when out
2211 of patch space.
2212 (Output_section::add_output_section_data): Likewise.
2213 (Output_section::set_final_data_size): Add patch space when
2214 doing --incremental-full.
2215 (Output_section::do_reset_address_and_file_offset): Remove patch
2216 space.
2217 (Output_segment::set_section_list_addresses): Print debug output
2218 only if --incremental-update.
2219 * output.h (Output_section::set_is_patch_space_allowed): New function.
2220 (Output_section::is_patch_space_allowed_): New data member.
2221 (Output_section::patch_space_): New data member.
2222 * parameters.cc (Parameters::incremental_full): New function.
2223 * parameters.h (Parameters::incremental_full): New function
2224 * testsuite/Makefile.am (incremental_test_2): Add test for
2225 --incremental-patch option.
2226 * testsuite/Makefile.in: Regenerate.
2227 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2228 (t18): Remove function body.
2229
f6cccc2c
DK
22302011-07-05 Doug Kwan <dougkwan@google.com>
2231
2232 PR gold/12771
2233 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2234 Arm_Address type for relocation result.
2235 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2236 overflow check.
2237 (Arm_relocate_functions::abs32): Use unaligned access.
2238 (Arm_relocate_functions::rel32): Ditto.
2239 (Arm_relocate_functions::prel31): Ditto.
2240 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2241 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2242 static data relocations.
2243 * testsuite/Makefile.in: Regnerate.
2244 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2245
28a13fec
ILT
22462011-07-05 Ian Lance Taylor <iant@google.com>
2247
2248 PR gold/12392
2249 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2250 symbols if necessary.
2251 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2252
24d47b34
ILT
22532011-07-05 Ian Lance Taylor <iant@google.com>
2254
2255 PR gold/12952
2256 * resolve.cc (Symbol::override_base_with_special): Simply override
2257 version with special symbol version, ignoring previous version.
2258
41f9cbbe
ILT
22592011-07-05 Ian Lance Taylor <iant@google.com>
2260
2261 * object.cc (Sized_relobj_file::include_section_group): Add
2262 information to comment about signature location.
2263
886288f1
ILT
22642011-07-02 Ian Lance Taylor <iant@google.com>
2265
2266 PR gold/12957
2267 * options.h (class General_options): Add -f and -F.
2268 * options.cc (General_options::finalize): Fatal error if -f/-F
2269 are used without -shared.
2270 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2271
ae3a6d4f
ILT
22722011-07-02 Ian Lance Taylor <iant@google.com>
2273
2274 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2275
21131061
ILT
22762011-07-01 Ian Lance Taylor <iant@google.com>
2277
2278 PR gold/12525
2279 PR gold/12952
2280 * resolve.cc (Symbol::override_base_with_special): Don't override
2281 the version if the overriding symbol has a different name.
2282 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2283 all callers. If we give an error about an undefined version,
2284 define the base version if necessary.
2285 * dynobj.h (class Versions): Update declaration.
2286 * testsuite/weak_alias_test_5.cc: New file.
2287 * testsuite/weak_alias_test.script: New file.
2288 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2289 and versioned_alias have the right value, and call t2.
2290 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2291 weak_alias_test_5.so.
2292 (weak_alias_test_LDADD): Likewise.
2293 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2294 * testsuite/Makefile.in: Rebuild.
2295
611062c0
ILT
22962011-07-01 Ian Lance Taylor <iant@google.com>
2297
2298 PR gold/12525
2299 * options.h (class General_options): Support -z notext.
2300 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2301 -Wl,-z,notext.
2302 (two_file_shared_nonpic.so): Likewise.
2303 (two_file_shared_mixed.so): Likewise.
2304 (two_file_shared_mixed_1.so): Likewise.
2305 (weak_undef_lib_nonpic.so): Likewise.
2306 (alt/weak_undef_lib_nonpic.so): Likewise.
2307 (tls_test_shared_nonpic.so): Likewise.
2308 * testsuite/Makefile.in: Rebuild.
2309
328c7c2f
ILT
23102011-07-01 Ian Lance Taylor <iant@google.com>
2311
2312 PR gold/12525
2313 * configure.ac: Test whether static linking works, setting
2314 the automake conditional HAVE_STATIC.
2315 * testsuite/Makefile.am: Disable tests using -static if
2316 HAVE_STATIC is not true.
2317 * configure, testsuite/Makefile.in: Rebuild.
2318
02d7cd44
ILT
23192011-07-01 Ian Lance Taylor <iant@google.com>
2320
2321 PR gold/12525
2322 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2323 Assert if we see DW_EH_PE_indirect.
2324 * target.h (Target::ehframe_datarel_base): New function.
2325 (Target::do_ehframe_datarel_base): New target function.
2326 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2327 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2328 function.
2329
07a60597
ILT
23302011-07-01 Ian Lance Taylor <iant@google.com>
2331
2332 PR gold/12571
2333 * options.h (class General_options): Add
2334 --ld-generated-unwind-info.
2335 * ehframe.cc (Fde::write): Add address parameter. Change all
2336 callers. If associated with PLT, fill in address and size.
2337 (Cie::set_output_offset): Only add merge mapping if there is an
2338 object.
2339 (Cie::write): Add address parameter. Change all callers.
2340 (Eh_frame::add_ehframe_for_plt): New function.
2341 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2342 input_offset_ fields into union u_, with new plt field.
2343 (Fde::Fde): Adjust for new union field.
2344 (Fde::Fde) [Output_data version]: New constructor.
2345 (Fde::add_mapping): Only add merge mapping if there is an object.
2346 (class Cie): Update declarations.
2347 (class Eh_frame): Declare add_ehframe_for_plt.
2348 * layout.cc (Layout::layout_eh_frame): Break out code into
2349 make_eh_frame_section, and call it.
2350 (Layout::make_eh_frame_section): New function.
2351 (Layout::add_eh_frame_for_plt): New function.
2352 * layout.h (class Layout): Update declarations.
2353 * merge.cc (Merge_map::add_mapping): Add assertion.
2354 * i386.cc: Include "dwarf.h".
2355 (class Output_data_plt_i386): Make first_plt_entry,
2356 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2357 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2358 and plt_eh_frame_fde.
2359 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2360 boundary. Call add_eh_frame_for_plt if appropriate.
2361 * x86_64.cc: Include "dwarf.h".
2362 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2363 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2364 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2365 and plt_eh_frame_fde.
2366 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2367 appropriate.
2368
14788a3f
ILT
23692011-06-29 Ian Lance Taylor <iant@google.com>
2370
2371 PR gold/12629
2372 * object.cc (Sized_relobj_file::layout_section): Change shdr
2373 parameter to be const.
2374 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2375 out of do_layout.
2376 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2377 appropriate. Call layout_eh_frame_section.
2378 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2379 sections.
2380 * object.h (class Sized_relobj_file): Update declarations.
2381
6c21fce1
ILT
23822011-06-29 Ian Lance Taylor <iant@google.com>
2383
37e41b03 2384 PR gold/12652
6c21fce1
ILT
2385 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2386 modifier.
2387 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2388
4d5e4e62
ILT
23892011-06-29 Ian Lance Taylor <iant@google.com>
2390
2391 PR gold/12675
2392 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2393 SHT_X86_64_UNWIND.
2394 * layout.cc (Layout::layout_eh_frame): Likewise.
2395
886f533a
ILT
23962011-06-29 Ian Lance Taylor <iant@google.com>
2397
2398 PR gold/12695
2399 * layout.cc (Layout::symtab_section_shndx): New function.
2400 * layout.h (class Layout): Declare symtab_section_shndx.
2401 * output.cc (Output_section::write_header): Call it.
2402
f3ae1b28
ILT
24032011-06-29 Ian Lance Taylor <iant@google.com>
2404
2405 PR gold/12818
2406 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2407 symbols which are not used in a relocation.
2408
aecf301f
ILT
24092011-06-28 Ian Lance Taylor <iant@google.com>
2410
2411 PR gold/12898
2412 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2413 script create indistinguishable segments.
2414 (Layout::set_segment_offsets): Use stable_sort when sorting
2415 segments. Pass this to Compare_segments constructor.
2416 * layout.h (class Layout): Make segment_precedes non-static.
2417 (class Compare_segments): Change from struct to class. Add
2418 layout_ field. Add constructor.
2419 * script-sections.cc
2420 (Script_sections::attach_sections_using_phdrs_clause): Rename
2421 local orphan to is_orphan. Don't report failure to put empty
2422 section in segment. On attachment failure, report name of
2423 section, and attach to first PT_LOAD segment.
2424
03ef7571
ILT
24252011-06-28 Ian Lance Taylor <iant@google.com>
2426
2427 PR gold/12934
2428 * target-select.cc (Target_selector::Target_selector): Add
2429 emulation parameter. Change all callers.
2430 (select_target_by_bfd_name): Rename from select_target_by_name.
2431 Change all callers.
2432 (select_target_by_emulation): New function.
2433 (supported_emulation_names): New function.
2434 * target-select.h (class Target_selector): Add emulation_ field.
2435 Update declarations.
2436 (Target_selector::recognize_by_bfd_name): Rename from
2437 recognize_by_name. Change all callers.
2438 (Target_selector::supported_bfd_names): Rename from
2439 supported_names. Change all callers.
2440 (Target_selector::recognize_by_emulation): New function.
2441 (Target_selector::supported_emulations): New function.
2442 (Target_selector::emulation): New function.
2443 (Target_selector::do_recognize_by_bfd_name): Rename from
2444 do_recognize_by_name. Change all callers.
2445 (Target_selector::do_supported_bfd_names): Rename from
2446 do_supported_names. Change all callers.
2447 (Target_selector::do_recognize_by_emulation): New function.
2448 (Target_selector::do_supported_emulations): New function.
2449 (select_target_by_bfd_name): Change name in declaration.
2450 (select_target_by_emulation): Declare.
2451 (supported_emulation_names): Declare.
2452 * parameters.cc (parameters_force_valid_target): Try to find
2453 target based on emulation from -m option.
2454 * options.h (class General_options): Change doc string for -m.
2455 * options.cc (help): Print emulations.
2456 (General_options::parse_V): Likewise.
2457 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2458 Add emulation parameter. Change all callers.
2459
200b2bb9
ILT
24602011-06-28 Ian Lance Taylor <iant@google.com>
2461
2462 * target.h (class Target): Add osabi_ field.
2463 (Target::osabi): New function.
2464 (Target::set_osabi): New function.
2465 (Target::Target): Initialize osabi_.
2466 (Target::do_adjust_elf_header): Make pure virtual.
2467 (Sized_target::do_adjust_elf_header): Declare.
2468 * target.cc (Sized_target::do_adjust_elf_header): New function.
2469 (class Sized_target): Instantiate all versions.
2470 * freebsd.h (class Target_freebsd): Remove.
2471 (Target_selector_freebsd::do_recognize): Call set_osabi on
2472 Target.
2473 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2474 (Target_selector_freebsd::set_osabi): Remove.
2475 * i386.cc (class Target_i386): Inherit from Sized_target rather
2476 than Target_freebsd.
2477 * x86_64.cc (class Target_x86_64): Likewise.
2478
b3ce541e
ILT
24792011-06-28 Ian Lance Taylor <iant@google.com>
2480
2481 * target.h (Target::can_check_for_function_pointers): Rewrite.
2482 Make non-virtual.
2483 (Target::can_icf_inline_merge_sections): Likewise.
2484 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2485 (Target::Target_info): Add can_icf_inline_merge_sections field.
2486 (Target::do_can_check_for_function_pointers): New virtual
2487 function.
2488 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2489 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2490 from can_check_for_function_pointers, move in file.
2491 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2492 section_may_have_icf_unsafe_poineters, move in file.
2493 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2494 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2495 Rename from can_check_for_function_pointers, move in file.
2496 (Target_i386::can_icf_inline_merge_sections): Remove.
2497 (Target_i386::i386_info): Initialize
2498 can_icf_inline_merge_sections.
2499 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2500 Initialize can_icf_inline_merge_sections.
2501 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2502 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2503 Rename from can_check_for_function_pointers, move in file.
2504 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2505 (Target_x86_64::x86_64_info): Initialize
2506 can_icf_inline_merge_sections.
2507 * testsuite/testfile.cc (Target_test::test_target_info):
2508 Likewise.
2509 * icf.cc (get_section_contents): Correct formatting.
2510
6d1c4efb
ILT
25112011-06-27 Ian Lance Taylor <iant@google.com>
2512
2513 * symtab.cc (Symbol::versioned_name): New function.
2514 (Symbol_table::add_to_final_symtab): Use versioned_name when
2515 appropriate.
2516 (Symbol_table::sized_write_symbol): Likewise.
2517 * symtab.h (class Symbol): Declare versioned_name.
2518 * stringpool.h (class Stringpool_template): Add variant of add
2519 which takes a std::basic_string.
2520 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2521 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2522 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2523 (ver_test_12.o): New target.
2524 * testsuite/Makefile.in: Rebuild.
2525
57eb9b50
DK
25262011-06-27 Doug Kwan <dougkwan@google.com>
2527
2528 * arm.cc (Arm_relocate_functions::thm_jump8,
2529 Arm_relocate_functions::thm_jump11): Use a wider signed
2530 type to compute offset.
2531 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2532 arm_thm_jump8.
2533 * testsuite/Makefile.in: Regenerate.
2534 * testsuite/arm_branch_in_range.sh: Check test results of
2535 arm_thm_jump11 and arm_thm_jump8.
2536 * testsuite/arm_thm_jump11.s: New test source file.
2537 * testsuite/arm_thm_jump11.t: New linker script.
2538 * testsuite/arm_thm_jump8.s: New test source file.
2539 * testsuite/arm_thm_jump8.t: New linker script.
2540
487b39df
ILT
25412011-06-24 Ian Lance Taylor <iant@google.com>
2542
2543 * layout.cc: Include "object.h".
2544 (ctors_sections_in_init_array): New static variable.
2545 (Layout::is_ctors_in_init_array): New function.
2546 (Layout::layout): Add entry to ctors_sections_in_init_array if
2547 appropriate.
2548 * layout.h (class Layout): Declare is_ctors_in_init_array.
2549 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2550 is_ctors_reverse_view is set.
2551 (Sized_relobj_file::write_sections): Add layout parameter. Change
2552 all callers. Set is_ctors_reverse_view field of View_size.
2553 (Sized_relobj_file::reverse_words): New function.
2554 * object.h (Sized_relobj_file::View_size): Add
2555 is_ctors_reverse_view field.
2556 (class Sized_relobj_file): Update declarations.
2557 * testsuite/initpri3.c: New test.
2558 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2559 initpri3b.
2560 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2561 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2562 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2563 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2564 * testsuite/Makefile.in: Rebuild.
2565
472076e4
CC
25662011-06-24 Cary Coutant <ccoutant@google.com>
2567
2568 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2569 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2570 (debug_msg_cdebug.err): New targets.
2571 * testsuite/Makefile.in: Regenerate.
2572 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2573 Fix checks for link with shared library.
2574
a60af0db
DK
25752011-06-24 Doug Kwan <dougkwan@google.com>
2576
2577 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2578 skip empty text sections.
2579 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2580
5393d741
ILT
25812011-06-22 Ian Lance Taylor <iant@google.com>
2582
2583 PR gold/12910
2584 * options.h (class General_options): Add --ctors-in-init-array.
2585 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2586 friends as SHT_PROGBITS for merging sections.
2587 (Layout::layout): Remove special handling of .init_array and
2588 friends. Don't sort if doing relocatable link. Sort for .ctors
2589 and .dtors if ctors_in_init_array.
2590 (Layout::make_output_section): Force correct section types for
2591 .init_array and friends. Don't sort if doing relocatable link,
2592 Don't sort .ctors and .dtors if ctors_in_init_array.
2593 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2594 (Layout::output_section_name): Add relobj parameter. Change all
2595 callers. Handle .ctors. and .dtors. in code rather than table.
2596 Handle .ctors and .dtors if ctors_in_init_array.
2597 (Layout::match_file_name): New function, moved from output.cc.
2598 * layout.h (class Layout): Update declarations.
2599 * output.cc: Include "layout.h".
2600 (Input_section_sort_entry::get_priority): New function.
2601 (Input_section_sort_entry::match_file_name): Just call
2602 Layout::match_file_name.
2603 (Output_section::Input_section_sort_init_fini_compare::operator()):
2604 Handle .ctors and .dtors. Sort by explicit priority rather than
2605 by name.
2606 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2607 * testsuite/initpri2.c: New test.
2608 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2609 (check_PROGRAMS): Add initpri2.
2610 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2611 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2612 * configure, testsuite/Makefile.in: Rebuild.
2613
e1f74f98
ILT
26142011-06-19 Ian Lance Taylor <iant@google.com>
2615
2616 PR gold/12880
2617 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2618 .interp section to a PT_INTERP segment even if we have seen a
2619 --dynamic-linker option. Don't do it if we have seen a PHDRS
2620 clause in a linker script.
2621 (Layout::finalize): Don't create a .interp section if we've
2622 already create a PT_INTERP segment.
2623 (Layout::create_interp): Always call choose_output_section (revert
2624 patch of 2011-06-17). Don't create PT_INTERP segment.
2625 * script-sections.cc
2626 (Script_sections::create_note_and_tls_segments): Add a .interp
2627 section to a PT_INTERP segment even if we have seen a
2628 --dynamic-linker option.
2629
766f91bb
ILT
26302011-06-18 Ian Lance Taylor <iant@google.com>
2631
2632 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2633 merely because a non-PT_LOAD segment has a dynamic reloc.
2634
0d212c3a
ILT
26352011-06-18 Ian Lance Taylor <iant@google.com>
2636
2637 * layout.cc (Layout::finish_dynamic_section): Don't create
2638 DT_FLAGS entry if not needed.
2639
911a5072
ILT
26402011-06-18 Ian Lance Taylor <iant@google.com>
2641
2642 PR gold/12745
2643 * layout.cc (Layout::layout_eh_frame): Correct handling of
2644 writable .eh_frame section.
2645
534b4e5f
ILT
26462011-06-17 Ian Lance Taylor <iant@google.com>
2647
2648 PR gold/12893
2649 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2650 symbol is redefined with the exact same object and value.
2651
10b4f102
ILT
26522011-06-17 Ian Lance Taylor <iant@google.com>
2653
2654 PR gold/12880
2655 * layout.h (class Layout): Add interp_segment_ field.
2656 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2657 (Layout::attach_allocated_section_to_segment): If making shared
2658 library, put .interp section in PT_INTERP segment.
2659 (Layout::finalize): Also call create_interp if -dynamic-linker
2660 option was used.
2661 (Layout::create_interp): Assert that there is no PT_INTERP
2662 segment. If not using a SECTIONS clause, use make_output_section.
2663 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2664 * script-sections.cc
2665 (Script_sections::create_note_and_tls_segments): If making shared
2666 library, put .interp section in PT_INTERP segment.
2667
a29b0dad
ILT
26682011-06-17 Ian Lance Taylor <iant@google.com>
2669
e588ea8d
ILT
2670 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2671 when making a shared library.
2672
26732011-06-17 Ian Lance Taylor <iant@google.com>
2674
2675 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2676 parameter. Change all callers. Don't issue warning about PC32
2677 against locally defined symbol.
a29b0dad 2678
9d3b0698
ILT
26792011-06-16 Ian Lance Taylor <iant@google.com>
2680
2681 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2682 occurs in same object.
2683
85b0f90c
AM
26842011-06-14 Alan Modra <amodra@gmail.com>
2685
2686 * po/POTFILES.in: Regenerate.
2687
a94907d9
ILT
26882011-06-09 Ian Lance Taylor <iant@google.com>
2689
2690 * script-sections.cc
2691 (Orphan_output_section::set_section_addresses): For a relocatable
2692 link set address to 0.
2693
4fb3a1c3
CC
26942011-06-09 Cary Coutant <ccoutant@google.com>
2695
2696 PR gold/12804
2697 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2698 used with --compress-debug-sections.
2699 * gold/object.cc (Sized_relobj_file::do_layout): Report
2700 uncompressed size of compressed input sections.
2701
61220854
CC
27022011-06-08 Cary Coutant <ccoutant@google.com>
2703
2704 PR gold/12804
2705 * testsuite/two_file_test_2_v1.cc: Change initialization of
2706 v2 to keep it in .data.
2707
e6455dfb
CC
27082011-06-07 Cary Coutant <ccoutant@google.com>
2709
2710 * common.cc (Symbol_table::do_allocate_commons_list): Call
2711 gold_fallback.
2712 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2713 (Errors::fallback): New function.
2714 (gold_fallback): New function.
2715 * errors.h (Errors::fallback): New function.
2716 * gold.cc (gold_exit): Change status parameter to enum; adjust
2717 all callers.
2718 (queue_initial_tasks): Call gold_fallback.
2719 * gold.h: Include cstdlib.
2720 (Exit_status): New enum type.
2721 (gold_exit): Change status parameter to enum.
2722 (gold_fallback): New function.
2723 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2724 (Layout::create_symtab_sections): Likewise.
2725 (Layout::create_shdrs): Likewise.
2726 * main.cc (main): Adjust call to gold_exit.
2727 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2728 (Output_data_got::add_got_entry_pair): Likewise.
2729 (Output_section::add_input_section): Likewise.
2730 (Output_section::add_output_section_data): Likewise.
2731 (Output_segment::set_section_list_addresses): Likewise.
2732 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2733
fb0e076f
CC
27342011-06-07 Cary Coutant <ccoutant@google.com>
2735
2736 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2737 for incremental links.
2738 * output.cc (Output_segment::set_section_list_addresses): Remove
2739 FIXME and test for TLS or BSS.
2740
a5ee4d5d
CC
27412011-06-07 Cary Coutant <ccoutant@google.com>
2742
2743 * testsuite/Makefile.am: Add incremental_copy_test,
2744 incremental_common_test_1.
2745 * testsuite/Makefile.in: Regenerate.
2746 * testsuite/common_test_1_v1.c: New source file.
2747 * testsuite/common_test_1_v2.c: New source file.
2748 * testsuite/copy_test_v1.cc: New source file.
2749
5146f448
CC
27502011-06-07 Cary Coutant <ccoutant@google.com>
2751
2752 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2753 update, allocate common from bss section's free list.
2754 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2755 linker-defined symbols.
2756 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2757 Skip GOT and PLT entries that are no longer referenced.
2758 (Output_section_incremental_inputs::write_info_blocks): Mark
2759 linker-defined symbols.
2760 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2761 * output.cc (Output_section::allocate): New function.
2762 * output.h (Output_section::allocate): New function.
2763 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2764 linker-defined symbols.
2765 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2766 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2767 (Symbol::init_base_output_data): Likewise.
2768 (Symbol::init_base_output_segment): Likewise.
2769 (Symbol::init_base_constant): Likewise.
2770 (Sized_symbol::init_output_data): Likewise.
2771 (Sized_symbol::init_output_segment): Likewise.
2772 (Sized_symbol::init_constant): Likewise.
2773 (Symbol_table::do_define_in_output_data): Likewise.
2774 (Symbol_table::do_define_in_output_segment): Likewise.
2775 (Symbol_table::do_define_as_constant): Likewise.
2776 * symtab.h (Symbol::is_predefined): New function.
2777 (Symbol::init_base_output_data): Add is_predefined parameter.
2778 (Symbol::init_base_output_segment): Likewise.
2779 (Symbol::init_base_constant): Likewise.
2780 (Symbol::is_predefined_): New data member.
2781 (Sized_symbol::init_output_data): Add is_predefined parameter.
2782 (Sized_symbol::init_output_segment): Likewise.
2783 (Sized_symbol::init_constant): Likewise.
2784 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2785
26d3c67d
CC
27862011-06-07 Cary Coutant <ccoutant@google.com>
2787
2788 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2789 instead of emit_copy_reloc.
2790 (Copy_relocs::emit_copy_reloc): Refactor.
2791 (Copy_relocs::make_copy_reloc): New function.
2792 (Copy_relocs::add_copy_reloc): Remove.
2793 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2794 section.
2795 (Copy_relocs::make_copy_reloc): New function.
2796 (Copy_relocs::add_copy_reloc): Remove.
2797 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2798 unchanged input files.
2799 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2800 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2801 Reserve BSS space for COPY relocations.
2802 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2803 (Output_section_incremental_inputs::write_info_blocks): Record
2804 whether a symbol is copied from a shared object.
2805 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2806 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2807 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2808 (Incremental_input_entry_reader::get_output_symbol_index): Add
2809 is_copy parameter.
2810 (Incremental_binary::emit_copy_relocs): New function.
2811 (Incremental_binary::do_emit_copy_relocs): New function.
2812 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2813 new data member.
2814 (Sized_incremental_binary::add_copy_reloc): New function.
2815 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2816 (Sized_incremental_binary::Copy_reloc): New struct.
2817 (Sized_incremental_binary::Copy_relocs): New typedef.
2818 (Sized_incremental_binary::copy_relocs_): New data member.
2819 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2820 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2821 * target.h (Sized_target::emit_copy_reloc): New function.
2822 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2823
7cdb37d9
CC
28242011-06-02 Cary Coutant <ccoutant@google.com>
2825
2826 PR gold/12163
2827 * gold/archive.cc (Archive::Archive): Initialize new data member.
2828 (Archive::include_all_members): Return if archive has already been
2829 included.
2830 * gold/archive.h (Archive::include_all_members_): New data member.
2831
cc643b88
NC
28322011-06-02 Nick Clifton <nickc@redhat.com>
2833
2834 * dynobj.h: Fix spelling mistake in comment.
2835 * output.cc: Likewise.
2836
f62a3ca7 28372011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2838 Asier Llano
f62a3ca7
DK
2839
2840 PR gold/12826
cc643b88 2841 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2842 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2843 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2844 redundant arm_exidx_test.so.
2845 * testsuite/Makefile.in: Regenerate.
2846 (check_SCRIPTS): Add pr12826.sh
2847 (check_DATA): Add pr12826.stdout
2848 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2849 * testsuite/pr12826.sh: New file.
2850 * testsuite/pr12826_1.s: Ditto.
2851 * testsuite/pr12826_1.s: Ditto.
2852
8dbe1edc
ILT
28532011-05-30 Ian Lance Taylor <iant@google.com>
2854
2855 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2856 sections.
2857
c49875be
ILT
28582011-05-29 Ian Lance Taylor <iant@google.com>
2859
2860 PR gold/12804
2861 * testsuite/Makefile.am: Use different file name for two_file_test
2862 temporary file for each incremental test.
2863 * testsuite/Makefile.in: Rebuild.
2864
69d53f7a
ILT
28652011-05-29 Ian Lance Taylor <iant@google.com>
2866
2867 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2868 binary input file is empty.
2869
41d0ab5f
ILT
28702011-05-27 Ian Lance Taylor <iant@google.com>
2871
2872 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2873 (ver_test_9.so): Likewise.
2874 * testsuite/Makefile.in: Rebuild.
2875
89d8a36b
CC
28762011-05-26 Cary Coutant <ccoutant@google.com>
2877
2878 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2879 * incremental.cc (Incremental_inputs::report_input_section): Fix
2880 comment, indentation.
2881 (Incremental_inputs::report_comdat_group): New function.
2882 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2883 of data for incremental input file entry.
2884 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2885 group count, COMDAT group signatures.
2886 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2887 an unchanged input file.
2888 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2889 Initialize new data member.
2890 (Incremental_object_entry::add_comdat_group): New function.
2891 (Incremental_object_entry::get_comdat_group_count): New function.
2892 (Incremental_object_entry::get_comdat_signature_key): New function.
2893 (Incremental_object_entry::groups_): New data member.
2894 (Incremental_inputs::report_comdat_group): New function.
2895 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2896 data for incremental input file entry.
2897 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2898 (Incremental_input_entry_reader::get_input_section): Adjust size of
2899 data for incremental input file entry.
2900 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2901 (Incremental_input_entry_reader::get_comdat_group_signature): New
2902 function.
2903 * object.cc (Sized_relobj::include_section_group): Report kept
2904 COMDAT groups for incremental links.
2905
1706a06f
ILT
29062011-05-24 David Meyer <pdox@google.com>
2907
2908 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2909 with name parameter. Add found_name parameter.
2910 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2911 * dirsearch.h (class Dirsearch): Update declaration.
2912
a10ae760
ILT
29132011-05-24 Ian Lance Taylor <iant@google.com>
2914
2915 * archive.cc (Library_base::should_include_member): Pull in object
2916 from archive if it defines the entry symbol.
2917 * parameters.cc (Parameters::entry): New function.
2918 * parameters.h (class Parameters): Declare entry.
2919 * output.h (class Output_file_header): Remove entry_ field.
2920 * output.cc (Output_file_header::Output_file_header): Remove entry
2921 parameter. Change all callers.
2922 (Output_file_header::entry): Use parameters->entry.
2923 * gold.cc (queue_middle_tasks): Likewise.
2924 * plugin.cc (Plugin_hook::run): Likewise.
2925
aa92d6ed
CC
29262011-05-24 Cary Coutant <ccoutant@google.com>
2927
2928 * gold.cc (queue_initial_tasks): Pass incremental base filename
2929 to Output_file::open_base_file; don't print error message.
2930 * incremental-dump.cc (main): Adjust call to
2931 Output_file::open_for_modification.
2932 * incremental-dump.cc (main): Likewise.
2933 * incremental.cc (Incremental_inputs::report_command_line):
2934 Ignore --incremental-base option when comparing command lines.
2935 Ignore parameter when given as separate argument.
2936 * options.h (class General_options): Add --incremental-base.
2937 * output.cc (Output_file::Output_file):
2938 (Output_file::open_base_file): Add base_name and writable parameters;
2939 read base file into new file; print error message here.
2940 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2941 callers.
2942 * output.h (Output_file::open_for_modification): Rename to...
2943 (Output_file::open_base_file): ...this; add base_name and
2944 writable parameters; adjust all callers.
2945 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2946 callers.
2947 * testsuite/Makefile.am (incremental_test_4): Test
2948 --incremental-base.
2949 * testsuite/Makefile.in: Regenerate.
2950
2eedd706
CC
29512011-05-24 Cary Coutant <ccoutant@google.com>
2952
2953 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2954 incremental_test_4.
2955 * testsuite/Makefile.in: Regenerate.
2956 * testsuite/two_file_test_1_v1.cc: New test source file.
2957 * testsuite/two_file_test_1b_v1.cc: New test source file.
2958 * testsuite/two_file_test_2_v1.cc: New test source file.
2959
0f1c85a6
CC
29602011-05-24 Cary Coutant <ccoutant@google.com>
2961
2962 * dynobj.h (Dynobj::do_dynobj): New function.
2963 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2964 flag and soname for shared objects.
2965 * incremental.cc (Incremental_inputs::report_object): Make
2966 either Incremental_object_entry or Incremental_dynobj_entry; add
2967 soname to string table.
2968 (Incremental_inputs::report_input_section): Add assertion.
2969 (Output_section_incremental_inputs::set_final_data_size): Adjust
2970 type of input file entry for shared libraries; adjust size of
2971 shared library info entry.
2972 (Output_section_incremental_inputs::write_input_files): Write
2973 as_needed flag for shared libraries.
2974 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2975 of input file entry for shared libraries; write soname.
2976 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2977 soname from incremental info.
2978 * incremental.h (enum Incremental_input_flags): Add
2979 INCREMENTAL_INPUT_AS_NEEDED.
2980 (Incremental_input_entry::Incremental_input_entry): Initialize new
2981 data member.
2982 (Incremental_input_entry::set_as_needed): New function.
2983 (Incremental_input_entry::as_needed): New function.
2984 (Incremental_input_entry::do_dynobj_entry): New function.
2985 (Incremental_input_entry::as_needed_): New data member.
2986 (Incremental_object_entry::Incremental_object_entry): Don't check
2987 for shared library.
2988 (Incremental_object_entry::do_type): Likewise.
2989 (class Incremental_dynobj_entry): New class.
2990 (Incremental_input_entry_reader::as_needed): New function.
2991 (Incremental_input_entry_reader::get_soname): New function.
2992 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2993 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2994 size of shared library info entry.
58797674 2995 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2996 incremental link when adding DT_NEEDED entries.
2997 * object.h (Object::Object): Initialize new data member.
2998 (Object::dynobj): New function.
2999 (Object::set_as_needed): New function.
3000 (Object::as_needed): New function.
3001 (Object::do_dynobj): New function.
3002 (Object::as_needed_): New data member.
3003
6fa2a40b
CC
30042011-05-24 Cary Coutant <ccoutant@google.com>
3005
3006 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
3007 info; adjust display of GOT entries.
3008 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3009 vector of input objects; remove file_status_.
3010 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
3011 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
3012 got_plt reader; call target hooks to reserve GOT entries.
3013 (Output_section_incremental_inputs::set_final_data_size): Adjust size
3014 of input file info header and GOT info entry.
3015 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
3016 relocation info.
3017 (Got_plt_view_info::got_descriptor): Remove.
3018 (Got_plt_view_info::sym_index): New data member.
3019 (Got_plt_view_info::input_index): New data member.
3020 (Local_got_offset_visitor::visit): Write input file index.
3021 (Global_got_offset_visitor::visit): Write 0 for input file index.
3022 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
3023 with sym_index and input_index.
3024 (Output_section_incremental_inputs::write_got_plt): Adjust size of
3025 incremental info GOT entry; replace got_descriptor with input_index.
3026 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
3027 map from input file index to object.
3028 (Sized_relobj_incr::do_layout): Replace direct data member reference
3029 with accessor function.
3030 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
3031 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
3032 Adjust size of input file info header.
3033 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
3034 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
3035 (Incremental_input_entry_reader::get_input_section): Adjust size of
3036 input file info header.
3037 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
3038 of incremental info GOT entry.
3039 (Incremental_got_plt_reader::get_got_desc): Remove.
3040 (Incremental_got_plt_reader::get_got_symndx): New function.
3041 (Incremental_got_plt_reader::get_got_input_index): New function.
3042 (Sized_incremental_binary::Sized_incremental_binary): Remove
3043 file_status_; add input_objects_.
3044 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
3045 (Sized_incremental_binary::set_file_is_unchanged): Remove.
3046 (Sized_incremental_binary::file_is_unchanged): Remove.
3047 (Sized_incremental_binary::set_input_object): New function.
3048 (Sized_incremental_binary::input_object): New function.
3049 (Sized_incremental_binary::file_status_): Remove.
3050 (Sized_incremental_binary::input_objects_): New data member.
3051 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
3052 references.
3053 (Sized_relobj_incr::invalid_address): Move to base class.
3054 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
3055 class.
3056 (Sized_relobj_incr::do_output_section_offset): Likewise.
3057 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
3058 (Sized_relobj_incr::section_offsets_): Likewise.
3059 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
3060 function.
3061 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
3062 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
3063 with accessor function.
3064 (Sized_relobj_file::do_layout): Likewise.
3065 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
3066 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
3067 (Sized_relobj_file::compute_final_local_value): Replace refs to
3068 section_offsets_ with accessor function.
3069 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
3070 * object.h (Relobj::Relobj): Initialize new data members.
3071 (Relobj::add_dyn_reloc): New function.
3072 (Relobj::first_dyn_reloc): New function.
3073 (Relobj::dyn_reloc_count): New function.
3074 (Relobj::first_dyn_reloc_): New data member.
3075 (Relobj::dyn_reloc_count_): New data member.
3076 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
3077 references.
3078 (Sized_relobj::Address): New typedef.
3079 (Sized_relobj::invalid_address): Move here from child class.
3080 (Sized_relobj::Sized_relobj): Initialize new data members.
3081 (Sized_relobj::sized_relobj): New function.
3082 (Sized_relobj::is_output_section_offset_invalid): Move here from
3083 child class.
3084 (Sized_relobj::get_output_section_offset): Likewise.
3085 (Sized_relobj::local_has_got_offset): Likewise.
3086 (Sized_relobj::local_got_offset): Likewise.
3087 (Sized_relobj::set_local_got_offset): Likewise.
3088 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3089 (Sized_relobj::clear_got_offsets): New function.
3090 (Sized_relobj::section_offsets): Move here from child class.
3091 (Sized_relobj::do_output_section_offset): Likewise.
3092 (Sized_relobj::do_set_section_offset): Likewise.
3093 (Sized_relobj::Local_got_offsets): Likewise.
3094 (Sized_relobj::local_got_offsets_): Likewise.
3095 (Sized_relobj::section_offsets_): Likewise.
3096 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3097 references.
3098 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3099 class.
3100 (Sized_relobj_file::sized_relobj): New function
3101 (Sized_relobj_file::local_has_got_offset): Move to base class.
3102 (Sized_relobj_file::local_got_offset): Likewise.
3103 (Sized_relobj_file::set_local_got_offset): Likewise.
3104 (Sized_relobj_file::get_output_section_offset): Likewise.
3105 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3106 (Sized_relobj_file::do_output_section_offset): Likewise.
3107 (Sized_relobj_file::do_set_section_offset): Likewise.
3108 (Sized_relobj_file::Local_got_offsets): Likewise.
3109 (Sized_relobj_file::local_got_offsets_): Likewise.
3110 (Sized_relobj_file::section_offsets_): Likewise.
3111 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3112 (all constructors).
3113 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3114 (Output_reloc::get_symbol_index): Likewise.
3115 (Output_reloc::local_section_offset): Likewise.
3116 (Output_reloc::get_address): Likewise.
3117 (Output_reloc::symbol_value): Likewise.
3118 (Output_data_got::reserve_slot): Move to class definition.
3119 (Output_data_got::reserve_local): New function.
3120 (Output_data_got::reserve_slot_for_global): Remove.
3121 (Output_data_got::reserve_global): New function.
3122 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3123 (all constructors, two instantiations).
3124 (Output_reloc::get_relobj): New function (two instantiations).
3125 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3126 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3127 (Output_data_reloc::add_global): Adjust type of relobj.
3128 (Output_data_reloc::add_global_relative): Likewise.
3129 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3130 (Output_data_reloc::add_local): Likewise.
3131 (Output_data_reloc::add_local_relative): Likewise.
3132 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3133 (Output_data_reloc::add_local_section): Likewise.
3134 (Output_data_reloc::add_output_section): Likewise.
3135 (Output_data_reloc::add_absolute): Likewise.
3136 (Output_data_reloc::add_target_specific): Likewise.
3137 (Output_data_got::reserve_slot): Move definition here.
3138 (Output_data_got::reserve_local): New function.
3139 (Output_data_got::reserve_global): New function.
3140 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3141 section_offsets_ with accessor function.
3142 (Sized_relobj_file::write_sections): Likewise.
3143 (Sized_relobj_file::do_relocate_sections): Likewise.
3144 * target.h (Sized_target::reserve_local_got_entry): New function.
3145 (Sized_target::reserve_global_got_entry): New function.
3146 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3147 (Target_x86_64::reserve_global_got_entry): New function.
3148 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3149
4829d394
CC
31502011-05-23 Cary Coutant <ccoutant@google.com>
3151
3152 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3153 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3154 bit when checking got_type.
3155 * incremental.cc (Sized_incremental_binary::setup_readers):
3156 Store symbol table and string table locations; initialize bit vector
3157 of file status flags.
3158 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3159 unchanged files.
3160 (Sized_incremental_binary::do_process_got_plt): New function.
3161 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3162 (Output_section_incremental_inputs::set_final_data_size): Record
3163 file index for each input file.
3164 (Output_section_incremental_inputs::write_got_plt): Store file index
3165 instead of input entry offset for each GOT entry.
3166 * incremental.h
3167 (Incremental_input_entry::Incremental_input_entry): Initialize new
3168 data member.
3169 (Incremental_input_entry::set_offset): Store file index.
3170 (Incremental_input_entry::get_file_index): New function.
3171 (Incremental_input_entry::file_index_): New data member.
3172 (Incremental_binary::process_got_plt): New function.
3173 (Incremental_binary::do_process_got_plt): New function.
3174 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3175 data members.
3176 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3177 (Sized_incremental_binary::set_file_is_unchanged): New function.
3178 (Sized_incremental_binary::file_is_unchanged): New function.
3179 (Sized_incremental_binary::do_process_got_plt): New function.
3180 (Sized_incremental_binary::file_status_): New data member.
3181 (Sized_incremental_binary::main_symtab_loc_): New data member.
3182 (Sized_incremental_binary::main_strtab_loc_): New data member.
3183 * output.cc (Output_data_got::Got_entry::write): Add case
3184 RESERVED_CODE.
3185 (Output_data_got::add_global): Call add_got_entry.
3186 (Output_data_got::add_global_plt): Likewise.
3187 (Output_data_got::add_global_with_rel): Likewise.
3188 (Output_data_got::add_global_with_rela): Likewise.
3189 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3190 (Output_data_got::add_global_pair_with_rela): Likewise.
3191 (Output_data_got::add_local): Call add_got_entry.
3192 (Output_data_got::add_local_plt): Likewise.
3193 (Output_data_got::add_local_with_rel): Likewise.
3194 (Output_data_got::add_local_with_rela): Likewise.
3195 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3196 (Output_data_got::add_local_pair_with_rela): Likewise.
3197 (Output_data_got::reserve_slot): New function.
3198 (Output_data_got::reserve_slot_for_global): New function.
3199 (Output_data_got::add_got_entry): New function.
3200 (Output_data_got::add_got_entry_pair): New function.
3201 (Output_section::add_output_section_data): Edit FIXME.
3202 * output.h
3203 (Output_section_data_build::Output_section_data_build): New
3204 constructor with size parameter.
3205 (Output_data_space::Output_data_space): Likewise.
3206 (Output_data_got::Output_data_got): Initialize new data member; new
3207 constructor with size parameter.
3208 (Output_data_got::add_constant): Call add_got_entry.
3209 (Output_data_got::reserve_slot): New function.
3210 (Output_data_got::reserve_slot_for_global): New function.
3211 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3212 (Output_data_got::add_got_entry): New function.
3213 (Output_data_got::add_got_entry_pair): New function.
3214 (Output_data_got::free_list_): New data member.
3215 * target.h (Sized_target::init_got_plt_for_update): New function.
3216 (Sized_target::register_global_plt_entry): New function.
3217 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3218 Initialize new data member; call init; add constructor with PLT count.
3219 (Output_data_plt_x86_64::init): New function.
3220 (Output_data_plt_x86_64::add_relocation): New function.
3221 (Output_data_plt_x86_64::reserve_slot): New function.
3222 (Output_data_plt_x86_64::free_list_): New data member.
3223 (Target_x86_64::init_got_plt_for_update): New function.
3224 (Target_x86_64::register_global_plt_entry): New function.
3225 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3226 incremental updates.
3227 (Output_data_plt_x86_64::add_relocation): New function.
3228 * testsuite/object_unittest.cc (Object_test): Set default options.
3229
ec69d6da
ILT
32302011-05-16 Ian Lance Taylor <iant@google.com>
3231
3232 * options.h (class General_options): Make -i a synonym for -r.
3233
732e31de
ILT
32342011-05-16 Ian Lance Taylor <iant@google.com>
3235
3236 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3237
403676b5
CC
32382011-05-10 Cary Coutant <ccoutant@google.com>
3239
3240 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3241 strip_all (-s).
3242
5b7b7d6e
ILT
32432011-05-06 Ian Lance Taylor <iant@google.com>
3244
3245 * layout.cc (Layout::layout): If the output section flags change,
3246 update the ordering.
3247
f0f9babf
CC
32482011-04-25 Cary Coutant <ccoutant@google.com>
3249
3250 * incremental-dump.cc (dump_incremental_inputs): Print local
3251 symbol info for each input file.
3252 * incremental.cc
3253 (Output_section_incremental_inputs::set_final_data_size): Add local
3254 symbol info to input file entries in incremental info.
3255 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3256 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3257 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3258 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3259 implementation.
3260 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3261 (Sized_incr_relobj::do_relocate): Write the local symbols.
3262 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3263 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3264 Adjust size of input file header.
3265 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3266 (Incremental_inputs_reader::get_local_symbol_count): New function.
3267 (Incremental_inputs_reader::get_input_section): Adjust size of input
3268 file header.
3269 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3270 (Sized_incr_relobj::This): New typedef.
3271 (Sized_incr_relobj::sym_size): New const data member.
3272 (Sized_incr_relobj::Local_symbol): New struct.
3273 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3274 (Sized_incr_relobj::do_local_symbol_offset): New function.
3275 (Sized_incr_relobj::local_symbol_count_): New data member.
3276 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3277 (Sized_incr_relobj::local_symbol_index_): New data member.
3278 (Sized_incr_relobj::local_symbol_offset_): New data member.
3279 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3280 (Sized_incr_relobj::local_symbols_): New data member.
3281 * object.h (Relobj::output_local_symbol_count): New function.
3282 (Relobj::local_symbol_offset): New function.
3283 (Relobj::do_output_local_symbol_count): New function.
3284 (Relobj::do_local_symbol_offset): New function.
3285 (Sized_relobj::do_output_local_symbol_count): New function.
3286 (Sized_relobj::do_local_symbol_offset): New function.
3287
d0a9ace3
ILT
32882011-04-22 Vladimir Simonov <sv@sw.ru>
3289
3290 * descriptors.cc (set_close_on_exec): New function.
3291 (Descriptors::open): Use set_close_on_exec.
3292 * output.cc (S_ISLNK): Define if not defined.
3293
94a3fc8b
CC
32942011-04-22 Cary Coutant <ccoutant@google.com>
3295
3296 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3297 global symbol map.
3298 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3299 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3300 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3301 relocations.
3302 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3303 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3304 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3305 * incremental.h
3306 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3307 function.
3308 (Incremental_binary::apply_incremental_relocs): New function.
3309 (Incremental_binary::do_apply_incremental_relocs): New function.
3310 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3311 data member.
3312 (Sized_incremental_binary::add_global_symbol): New function.
3313 (Sized_incremental_binary::global_symbol): New function.
3314 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3315 (Sized_incremental_binary::symbol_map_): New data member.
3316 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3317 * target.h (Sized_target::apply_relocation): New function.
3318 * target-reloc.h (apply_relocation): New function.
3319 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3320
c87e4302
DK
33212011-04-22 Doug Kwan <dougkwan@google.com>
3322
3323 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3324 flag of a SHT_ARM_EXIDX section.
2e702c99 3325 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3326 * testsuite/Makefile.in: Regenerate.
3327 * testsuite/arm_exidx_test.s: New file.
3328 * testsuite/arm_exidx_test.sh: Same.
3329
e7782cf6
CC
33302011-04-20 Cary Coutant <ccoutant@google.com>
3331
3332 PR gold/12689
3333 * archive.h (Incremental_archive_entry::Archive_member):
3334 Initialize arg_serial_ (second constructor).
3335
308ecdc7
ILT
33362011-04-17 Ian Lance Taylor <iant@google.com>
3337
3338 * object.cc (Relocate_info::location): Simplify location string.
3339 * errors.cc (Errors::error_at_location): Don't print program
3340 name.
3341 (Errors::warning_at_location): Likewise.
3342 (Errors::undefined_symbol): Likewise.
3343 * testsuite/debug_msg.sh: Update accordingly.
3344
bec5b579
CC
33452011-04-14 Cary Coutant <ccoutant@google.com>
3346
3347 * gold/layout.cc (Layout::symtab_section_offset): New function.
3348 * gold/layout.h (Layout::symtab_section_offset): New function.
3349 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3350
88597d34
ILT
33512011-04-12 Ian Lance Taylor <iant@google.com>
3352
3353 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3354 with MREMAP_MAYMOVE.
3355 * output.h (class Output_file): Add map_is_allocated_ field.
3356 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3357 not available, provide stubs. If mremap is not available, #define
3358 it to gold_mremap.
3359 (MREMAP_MAYMOVE): Define if not defined.
3360 (Output_file::Output_file): Initialize map_is_allocated_.
3361 (Output_file::resize): Check map_is_allocated_.
3362 (Output_file::map_anonymous): If mmap fails, use malloc.
3363 (Output_file::unmap): Don't do anything for an anonymous map.
3364 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3365 is not available, provide stubs.
3366 (File_read::View::~View): Use free rather than delete[].
3367 (File_read::make_view): Use malloc rather than new[]. If mmap
3368 fails, use malloc.
3369 (File_read::find_or_make_view): Use malloc rather than new[].
3370 * gold.h: Remove HAVE_REMAP code.
3371 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3372 exists. Rename mremap to gold_mremap. If mmap is not available
3373 don't do anything.
3374 * configure, config.in: Rebuild.
3375
11e361bc
ILT
33762011-04-11 Ian Lance Taylor <iant@google.com>
3377
3378 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3379 initialize local variable v.
3380
cdc29364
CC
33812011-04-11 Cary Coutant <ccoutant@google.com>
3382
3383 * archive.cc (Archive::include_member): Adjust call to
3384 report_object.
3385 (Add_archive_symbols::run): Track argument serial numbers.
3386 (Lib_group::include_member): Likewise.
3387 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3388 * archive.h (Incremental_archive_entry::Archive_member):
3389 Initialize arg_serial_.
3390 (Archive_member::arg_serial_): New data member.
3391 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3392 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3393 incremental link.
3394 (Sized_dynobj::do_for_all_local_got_entries): New function.
3395 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3396 function.
3397 * fileread.cc (get_mtime): New function.
3398 * fileread.h (get_mtime): New function.
3399 * gold.cc (queue_initial_tasks): Check for incremental update.
3400 (process_incremental_input): New function.
3401 (queue_middle_tasks): Don't force valid target for incremental
3402 update.
3403 * incremental-dump.cc (find_input_containing_global): Adjust
3404 size of symbol info entry.
3405 (dump_incremental_inputs): Dump argument serial number and
3406 in_system_directory flag; bias shndx by 1; print symbol names
3407 when dumping per-file symbol lists; use new symbol info readers.
3408 * incremental.cc
3409 (Output_section_incremental_inputs:update_data_size): New function.
3410 (Sized_incremental_binary::setup_readers): Setup input readers
3411 for each input file; build maps for files added from libraries
3412 and scripts.
3413 (Sized_incremental_binary::check_input_args): New function.
3414 (Sized_incremental_binary::do_check_inputs): Build map of argument
3415 serial numbers to input arguments.
3416 (Sized_incremental_binary::do_file_has_changed): Rename
3417 do_file_is_unchanged to this; compare file modification times.
3418 (Sized_incremental_binary::do_init_layout): New function.
3419 (Sized_incremental_binary::do_reserve_layout): New function.
3420 (Sized_incremental_binary::do_get_input_reader): Remove.
3421 (Sized_incremental_binary::get_symtab_view): New function.
3422 (Incremental_checker::can_incrementally_link_output_file): Remove.
3423 (Incremental_inputs::report_command_line): Exclude --debug options.
3424 (Incremental_inputs::report_archive_begin): Add parameter; track
3425 argument serial numbers; don't put input file entry for archive
3426 before archive members.
3427 (Incremental_inputs::report_archive_end): Put input file entry
3428 for archive after archive members.
3429 (Incremental_inputs::report_object): Add parameter; track argument
3430 serial numbers and in_system_directory flag.
3431 (Incremental_inputs::report_script): Add parameter; track argument
3432 serial numbers.
3433 (Output_section_incremental_inputs::set_final_data_size): Adjust
3434 size of symbol info entry; check for forwarding symbols.
3435 (Output_section_incremental_inputs::write_input_files): Write
3436 in_system_directory flag and argument serial number.
3437 (Output_section_incremental_inputs::write_info_blocks): Map section
3438 indices between incremental info and original input file; store
3439 input section index for each symbol.
3440 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3441 change operator() to visit().
3442 (class Global_got_offset_visitor): Likewise.
3443 (class Global_symbol_visitor_got_plt):
3444 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3445 classes.
3446 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3447 (Sized_incr_relobj::do_read_symbols): New function.
3448 (Sized_incr_relobj::do_layout): New function.
3449 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3450 (Sized_incr_relobj::do_add_symbols): New function.
3451 (Sized_incr_relobj::do_should_include_member): New function.
3452 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3453 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3454 (Sized_incr_relobj::do_section_size): New function.
3455 (Sized_incr_relobj::do_section_name): New function.
3456 (Sized_incr_relobj::do_section_contents): New function.
3457 (Sized_incr_relobj::do_section_flags): New function.
3458 (Sized_incr_relobj::do_section_entsize): New function.
3459 (Sized_incr_relobj::do_section_address): New function.
3460 (Sized_incr_relobj::do_section_type): New function.
3461 (Sized_incr_relobj::do_section_link): New function.
3462 (Sized_incr_relobj::do_section_info): New function.
3463 (Sized_incr_relobj::do_section_addralign): New function.
3464 (Sized_incr_relobj::do_initialize_xindex): New function.
3465 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3466 (Sized_incr_relobj::do_read_relocs): New function.
3467 (Sized_incr_relobj::do_gc_process_relocs): New function.
3468 (Sized_incr_relobj::do_scan_relocs): New function.
3469 (Sized_incr_relobj::do_count_local_symbols): New function.
3470 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3471 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3472 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3473 (Sized_incr_relobj::do_relocate): New function.
3474 (Sized_incr_relobj::do_set_section_offset): New function.
3475 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3476 (Sized_incr_dynobj::do_read_symbols): New function.
3477 (Sized_incr_dynobj::do_layout): New function.
3478 (Sized_incr_dynobj::do_add_symbols): New function.
3479 (Sized_incr_dynobj::do_should_include_member): New function.
3480 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3481 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3482 (Sized_incr_dynobj::do_section_size): New function.
3483 (Sized_incr_dynobj::do_section_name): New function.
3484 (Sized_incr_dynobj::do_section_contents): New function.
3485 (Sized_incr_dynobj::do_section_flags): New function.
3486 (Sized_incr_dynobj::do_section_entsize): New function.
3487 (Sized_incr_dynobj::do_section_address): New function.
3488 (Sized_incr_dynobj::do_section_type): New function.
3489 (Sized_incr_dynobj::do_section_link): New function.
3490 (Sized_incr_dynobj::do_section_info): New function.
3491 (Sized_incr_dynobj::do_section_addralign): New function.
3492 (Sized_incr_dynobj::do_initialize_xindex): New function.
3493 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3494 (make_sized_incremental_object): New function.
3495 (Incremental_library::copy_unused_symbols): New function.
3496 (Incremental_library::do_for_all_unused_symbols): New function.
3497 * incremental.h (enum Incremental_input_flags): New type.
3498 (class Incremental_checker): Remove.
3499 (Incremental_input_entry::Incremental_input_entry): Add argument
3500 serial number.
3501 (Incremental_input_entry::arg_serial): New function.
3502 (Incremental_input_entry::set_is_in_system_directory): New function.
3503 (Incremental_input_entry::is_in_system_directory): New function.
3504 (Incremental_input_entry::arg_serial_): New data member.
3505 (Incremental_input_entry::is_in_system_directory_): New data member.
3506 (class Script_info): Move here from script.h.
3507 (Script_info::Script_info): Add filename parameter.
3508 (Script_info::filename): New function.
3509 (Script_info::filename_): New data member.
3510 (Incremental_script_entry::Incremental_script_entry): Add argument
3511 serial number.
3512 (Incremental_object_entry::Incremental_object_entry): Likewise.
3513 (Incremental_object_entry::add_input_section): Build list of input
3514 sections with map to original shndx.
3515 (Incremental_object_entry::get_input_section_index): New function.
3516 (Incremental_object_entry::shndx_): New data member.
3517 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3518 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3519 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3520 serial number.
3521 (Incremental_inputs::report_archive_begin): Likewise.
3522 (Incremental_inputs::report_object): Likewise.
3523 (Incremental_inputs::report_script): Likewise.
3524 (class Incremental_global_symbol_reader): New class.
3525 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3526 and store flags and input file type.
3527 (Incremental_input_entry_reader::arg_serial): New function.
3528 (Incremental_input_entry_reader::type): Extract type from flags.
3529 (Incremental_input_entry_reader::is_in_system_directory): New function.
3530 (Incremental_input_entry_reader::get_input_section_count): Call
3531 accessor function for type.
3532 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3533 function for type; adjust size of global symbol entry.
3534 (Incremental_input_entry_reader::get_global_symbol_count): Call
3535 accessor function for type.
3536 (Incremental_input_entry_reader::get_object_count): Likewise.
3537 (Incremental_input_entry_reader::get_object_offset): Likewise.
3538 (Incremental_input_entry_reader::get_member_count): Likewise.
3539 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3540 (Incremental_input_entry_reader::get_member_offset): Likewise.
3541 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3542 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3543 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3544 (Incremental_input_entry_reader::get_global_symbol_reader): New
3545 function.
3546 (Incremental_input_entry_reader::get_output_symbol_index): New
3547 function.
3548 (Incremental_input_entry_reader::type_): Remove.
3549 (Incremental_input_entry_reader::flags_): New data member.
3550 (Incremental_inputs_reader::input_file_offset): New function.
3551 (Incremental_inputs_reader::input_file_index): New function.
3552 (Incremental_inputs_reader::input_file): Call input_file_offset.
3553 (Incremental_inputs_reader::input_file_at_offset): New function.
3554 (Incremental_relocs_reader::get_r_type): Reformat.
3555 (Incremental_relocs_reader::get_r_shndx): Reformat.
3556 (Incremental_relocs_reader::get_r_offset): Reformat.
3557 (Incremental_relocs_reader::data): New function.
3558 (Incremental_binary::Incremental_binary): Initialize new data members.
3559 (Incremental_binary::check_inputs): Add cmdline parameter.
3560 (Incremental_binary::file_is_unchanged): Remove.
3561 (Input_reader::arg_serial): New function.
3562 (Input_reader::get_unused_symbol_count): New function.
3563 (Input_reader::get_unused_symbol): New function.
3564 (Input_reader::do_arg_serial): New function.
3565 (Input_reader::do_get_unused_symbol_count): New function.
3566 (Input_reader::do_get_unused_symbol): New function.
3567 (Incremental_binary::input_file_count): New function.
3568 (Incremental_binary::get_input_reader): Change signature to use
3569 index instead of filename.
3570 (Incremental_binary::file_has_changed): New function.
3571 (Incremental_binary::get_input_argument): New function.
3572 (Incremental_binary::get_library): New function.
3573 (Incremental_binary::get_script_info): New function.
3574 (Incremental_binary::init_layout): New function.
3575 (Incremental_binary::reserve_layout): New function.
3576 (Incremental_binary::output_file): New function.
3577 (Incremental_binary::do_check_inputs): New function.
3578 (Incremental_binary::do_file_is_unchanged): Remove.
3579 (Incremental_binary::do_file_has_changed): New function.
3580 (Incremental_binary::do_init_layout): New function.
3581 (Incremental_binary::do_reserve_layout): New function.
3582 (Incremental_binary::do_input_file_count): New function.
3583 (Incremental_binary::do_get_input_reader): Change signature.
3584 (Incremental_binary::input_args_map_): New data member.
3585 (Incremental_binary::library_map_): New data member.
3586 (Incremental_binary::script_map_): New data member.
3587 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3588 new data members.
3589 (Sized_incremental_binary::output_section): New function.
3590 (Sized_incremental_binary::inputs_reader): Add const.
3591 (Sized_incremental_binary::symtab_reader): Add const.
3592 (Sized_incremental_binary::relocs_reader): Add const.
3593 (Sized_incremental_binary::got_plt_reader): Add const.
3594 (Sized_incremental_binary::get_symtab_view): New function.
3595 (Sized_incremental_binary::Inputs_reader): New typedef.
3596 (Sized_incremental_binary::Input_entry_reader): New typedef.
3597 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3598 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3599 (Sized_incremental_binary::do_file_has_changed): New function.
3600 (Sized_incremental_binary::do_init_layout): New function.
3601 (Sized_incremental_binary::do_reserve_layout): New function.
3602 (Sized_input_reader::Inputs_reader): Remove.
3603 (Sized_input_reader::Input_entry_reader): Remove.
3604 (Sized_input_reader::do_arg_serial): New function.
3605 (Sized_input_reader::do_get_unused_symbol_count): New function.
3606 (Sized_input_reader::do_get_unused_symbol): New function.
3607 (Sized_incremental_binary::do_input_file_count): New function.
3608 (Sized_incremental_binary::do_get_input_reader): Change signature;
3609 use index instead of filename.
3610 (Sized_incremental_binary::section_map_): New data member.
3611 (Sized_incremental_binary::input_entry_readers_): New data member.
3612 (class Sized_incr_relobj): New class.
3613 (class Sized_incr_dynobj): New class.
3614 (make_sized_incremental_object): New function.
3615 (class Incremental_library): New class.
3616 * layout.cc (Free_list::num_lists): New static data member.
3617 (Free_list::num_nodes): New static data member.
3618 (Free_list::num_removes): New static data member.
3619 (Free_list::num_remove_visits): New static data member.
3620 (Free_list::num_allocates): New static data member.
3621 (Free_list::num_allocate_visits): New static data member.
3622 (Free_list::init): New function.
3623 (Free_list::remove): New function.
3624 (Free_list::allocate): New function.
3625 (Free_list::dump): New function.
3626 (Free_list::print_stats): New function.
3627 (Layout_task_runner::run): Resize output file for incremental updates.
3628 (Layout::Layout): Initialize new data members.
3629 (Layout::set_incremental_base): New function.
3630 (Layout::init_fixed_output_section): New function.
3631 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3632 incremental updates.
3633 (Layout::create_gold_note): Do not create gold note section for
3634 incremental updates.
3635 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3636 for incremental updates.
3637 (Layout::set_section_offsets): For incremental updates, allocate space
3638 from free list.
3639 (Layout::create_symtab_sections): Layout with offsets relative to
3640 start of section; for incremental updates, allocate space from free
3641 list.
3642 (Layout::create_shdrs): For incremental updates, allocate space from
3643 free list.
3644 (Layout::finish_dynamic_section): For incremental updates, do not
3645 check --as-needed (fixed in subsequent patch).
3646 * layout.h (class Free_list): New class.
3647 (Layout::set_incremental_base): New function.
3648 (Layout::incremental_base): New function.
3649 (Layout::init_fixed_output_section): New function.
3650 (Layout::allocate): New function.
3651 (Layout::incremental_base_): New data member.
3652 (Layout::free_list_): New data member.
3653 * main.cc (main): Print Free_list statistics.
3654 * object.cc (Relobj::finalize_incremental_relocs): Add
3655 clear_counts parameter; clear counts only when clear_counts is set.
3656 (Sized_relobj::Sized_relobj): Initialize new base class.
3657 (Sized_relobj::do_layout): Don't report special sections.
3658 (Sized_relobj::do_for_all_local_got_entries): New function.
3659 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3660 symtab_off to all symbol table offsets.
3661 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3662 * object.h (class Got_offset_list): Move to top of file.
3663 (Object::Object): Allow case where input_file == NULL.
3664 (Object::~Object): Likewise.
3665 (Object::input_file): Assert that input_file != NULL.
3666 (Object::lock): Allow case where input_file == NULL.
3667 (Object::unlock): Likewise.
3668 (Object::is_locked): Likewise.
3669 (Object::token): Likewise.
3670 (Object::release): Likewise.
3671 (Object::is_incremental): New function.
3672 (Object::get_mtime): New function.
3673 (Object::for_all_local_got_entries): New function.
3674 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3675 (Object::set_is_in_system_directory): New function.
3676 (Object::is_in_system_directory): New function.
3677 (Object::do_is_incremental): New function.
3678 (Object::do_get_mtime): New function.
3679 (Object::do_for_all_local_got_entries): New function.
3680 (Object::is_in_system_directory_): New data member.
3681 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3682 (class Sized_relobj_base): New class.
3683 (class Sized_relobj): Derive from Sized_relobj_base.
3684 (class Sized_relobj::Symbols): Redeclare from base class.
3685 (class Sized_relobj::local_got_offset_list): Remove.
3686 (class Sized_relobj::Output_sections): Redeclare from base class.
3687 (class Sized_relobj::do_for_all_local_got_entries): New function.
3688 (class Sized_relobj::write_local_symbols): Add offset parameter.
3689 (class Sized_relobj::local_symbol_offset_): Update comment.
3690 (class Sized_relobj::local_dynsym_offset_): Update comment.
3691 * options.cc (Input_arguments::add_file): Remove const.
3692 * options.h (Input_file_argument::Input_file_argument):
3693 Initialize arg_serial_ (all constructors).
3694 (Input_file_argument::set_arg_serial): New function.
3695 (Input_file_argument::arg_serial): New function.
3696 (Input_file_argument::arg_serial_): New data member.
3697 (Input_arguments::Input_arguments): Initialize file_count_.
3698 (Input_arguments::add_file): Remove const.
3699 (Input_arguments::number_of_input_files): New function.
3700 (Input_arguments::file_count_): New data member.
3701 (Command_line::number_of_input_files): Call
3702 Input_arguments::number_of_input_files.
3703 * output.cc (Output_segment_headers::Output_segment_headers):
3704 Set current size.
3705 (Output_section::Input_section::current_data_size): New function.
3706 (Output_section::Output_section): Initialize new data members.
3707 (Output_section::add_input_section): Don't do merge sections for
3708 an incremental link; allocate space from free list for an
3709 incremental update.
3710 (Output_section::add_output_section_data): Allocate space from
3711 free list for an incremental update.
3712 (Output_section::update_data_size): New function.
3713 (Output_section::set_fixed_layout): New function.
3714 (Output_section::reserve): New function.
3715 (Output_segment::set_section_addresses): Remove const.
3716 (Output_segment::set_section_list_addresses): Remove const; allocate
3717 space from free list for an incremental update.
3718 (Output_segment::set_offset): Adjust size of RELRO segment for an
3719 incremental update.
3720 * output.h (Output_data::current_data_size): Move here from
3721 child classes.
3722 (Output_data::pre_finalize_data_size): New function.
3723 (Output_data::update_data_size): New function.
3724 (Output_section_headers::update_data_size): new function.
3725 (Output_section_data_build::current_data_size): Move to Output_data.
3726 (Output_data_strtab::update_data_size): New function.
3727 (Output_section::current_data_size): Move to Output_data.
3728 (Output_section::set_fixed_layout): New function.
3729 (Output_section::has_fixed_layout): New function.
3730 (Output_section::reserve): New function.
3731 (Output_section::update_data_size): New function.
3732 (Output_section::has_fixed_layout_): New data member.
3733 (Output_section::free_list_): New data member.
3734 (Output_segment::set_section_addresses): Remove const.
3735 (Output_segment::set_section_list_addresses): Remove const.
3736 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3737 New function.
3738 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3739 New function.
3740 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3741 parameter when calling Add_symbols constructor; store argument
3742 serial number for members of a lib group.
3743 (Add_symbols::locks): Allow case where token == NULL.
3744 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3745 (Read_member::~Read_member): New function.
3746 (Read_member::is_runnable): New function.
3747 (Read_member::locks): New function.
3748 (Read_member::run): New function.
3749 (Check_script::~Check_script): New function.
3750 (Check_script::is_runnable): New function.
3751 (Check_script::locks): New function.
3752 (Check_script::run): New function.
3753 (Check_library::~Check_library): New function.
3754 (Check_library::is_runnable): New function.
3755 (Check_library::locks): New function.
3756 (Check_library::run): New function.
3757 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3758 (Add_symbols::library_): New data member.
3759 (class Read_member): New class.
3760 (class Check_script): New class.
3761 (class Check_library): New class.
3762 * reloc.cc (Read_relocs::is_runnable): Allow case where
3763 token == NULL.
3764 (Read_relocs::locks): Likewise.
3765 (Scan_relocs::locks): Likewise.
3766 (Relocate_task::locks): Likewise.
3767 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3768 to clear counters.
3769 (Sized_relobj::incremental_relocs_scan): Fix comment.
3770 (Sized_relobj::do_relocate): Pass output file offset to
3771 write_local_symbols.
3772 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3773 from class declaration.
3774 * script.cc (read_input_script): Allocate Script_info; pass
3775 argument serial number to report_script.
3776 * script.h (class Script_info): Move to incremental.h.
3777 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3778 * symtab.h (Symbol_table::add_from_incrobj): New function.
3779 (Symbol_table::set_file_offset): New function.
3780
b961d0d7
CC
37812011-04-05 Cary Coutant <ccoutant@google.com>
3782
3783 * incremental-dump.cc (dump_incremental_inputs): Change signature
3784 to take a Sized_incremental_binary; change caller. Use readers
3785 in Sized_incremental_binary.
3786 * incremental.cc
3787 (Sized_incremental_binary::find_incremental_inputs_sections):
3788 Rename do_find_incremental_inputs_sections to this.
3789 (Sized_incremental_binary::setup_readers): New function.
3790 (Sized_incremental_binary::do_check_inputs): Check
3791 has_incremental_info_ flag; move setup code to setup_readers;
3792 use input readers.
3793 (Sized_incremental_binary::do_file_is_unchanged): New function.
3794 (Sized_incremental_binary::do_get_input_reader): New function.
3795 * incremental.h (class Incremental_binary): Move to end of file.
3796 (Incremental_binary::file_is_unchanged): New function.
3797 (Incremental_binary::do_file_is_unchanged): New function.
3798 (Incremental_binary::Input_reader): New class.
3799 (Incremental_binary::get_input_reader): New function.
3800 (class Sized_incremental_binary): Move to end of file.
3801 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3802 input section reader classes.
3803 (Sized_incremental_binary::has_incremental_info): New function.
3804 (Sized_incremental_binary::inputs_reader): New function.
3805 (Sized_incremental_binary::symtab_reader): New function.
3806 (Sized_incremental_binary::relocs_reader): New function.
3807 (Sized_incremental_binary::got_plt_reader): New function.
3808 (Sized_incremental_binary::do_file_is_unchanged): New function.
3809 (Sized_incremental_binary::Sized_input_reader): New class.
3810 (Sized_incremental_binary::get_input_reader): New function.
3811 (Sized_incremental_binary::find_incremental_inputs_sections):
3812 Rename do_find_incremental_inputs_sections to this.
3813 (Sized_incremental_binary::setup_readers): New function.
3814 (Sized_incremental_binary::has_incremental_info_): New data member.
3815 (Sized_incremental_binary::inputs_reader_): New data member.
3816 (Sized_incremental_binary::symtab_reader_): New data member.
3817 (Sized_incremental_binary::relocs_reader_): New data member.
3818 (Sized_incremental_binary::got_plt_reader_): New data member.
3819 (Sized_incremental_binary::current_input_file_): New data member.
3820
a869183f
PP
38212011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3822
3823 PR gold/12640
3824 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3825 violation.
3826
38272011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3828
3829 * archive.cc (Archive::include_member): Adjust call to report_object.
3830 (Add_archive_symbols::run): Add script_info to call to
3831 report_archive_begin.
3832 (Lib_group::include_member): Adjust call to report_object.
3833 (Add_lib_group_symbols::run): Adjust call to report_object.
3834 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3835 blocks. Add object count for script input files.
3836 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3837 script_info parameter; change all callers.
3838 (Incremental_inputs::report_object): Add script_info parameter;
3839 change all callers.
3840 (Incremental_inputs::report_script): Store backpointer to
3841 incremental info entry.
3842 (Output_section_incremental_inputs::set_final_data_size): Record
3843 additional information for scripts.
3844 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3845 * incremental.h (Incremental_script_entry::add_object): New function.
3846 (Incremental_script_entry::get_object_count): New function.
3847 (Incremental_script_entry::get_object): New function.
3848 (Incremental_script_entry::objects_): New data member; adjust
3849 constructor.
3850 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3851 (Incremental_inputs::report_object): Add script_info parameter.
3852 (Incremental_inputs_reader::get_object_count): New function.
3853 (Incremental_inputs_reader::get_object_offset): New function.
3854 * options.cc (Input_arguments::add_file): Return reference to
3855 new input argument.
3856 * options.h (Input_argument::set_script_info): New function.
3857 (Input_argument::script_info): New function.
3858 (Input_argument::script_info_): New data member; adjust all
3859 constructors.
3860 (Input_file_group::add_file): Return reference to new input argument.
3861 (Input_file_lib::add_file): Likewise.
3862 (Input_arguments::add_file): Likewise.
3863 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3864 * script.cc (Parser_closure::Parser_closure): Add script_info
3865 parameter; adjust all callers.
3866 (Parser_closure::script_info): New function.
3867 (Parser_closure::script_info_): New data member.
3868 (read_input_script): Report scripts earlier to incremental info.
3869 (script_add_file): Set script_info in Input_argument.
3870 (script_add_library): Likewise.
3871 * script.h (Script_options::Script_info): Rewrite class.
3872
a869183f 38732011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3874
3875 * archive.cc (Library_base::should_include_member): Move
3876 method here from class Archive.
3877 (Archive::Archive): Initialize base class.
3878 (Archive::should_include_member): Move to base class.
3879 (Archive::do_for_all_unused_symbols): New function.
3880 (Add_archive_symbols::run): Remove redundant access to
3881 incremental_inputs.
3882 (Lib_group::Lib_group): Initialize base class.
3883 (Lib_group::do_filename): New function.
3884 (Lib_group::include_member): Pass pointer to Lib_group to
3885 report_object.
3886 (Lib_group::do_for_all_unused_symbols): New function.
3887 (Add_lib_group_symbols::run): Report archive information for
3888 incremental links.
3889 * archive.h (class Library_base): New base class.
3890 (class Archive): Derive from Library_base.
3891 (Archive::filename): Move to base class.
3892 (Archive::set_incremental_info): Likewise.
3893 (Archive::incremental_info): Likewise.
3894 (Archive::Should_include): Likewise.
3895 (Archive::should_include_member): Likewise.
3896 (Archive::Armap_entry): Remove.
3897 (Archive::Unused_symbol_iterator): Remove.
3898 (Archive::unused_symbols_begin): Remove.
3899 (Archive::unused_symbols_end): Remove.
3900 (Archive::do_filename): New function.
3901 (Archive::do_get_mtime): New function.
3902 (Archive::do_for_all_unused_symbols): New function.
3903 (Archive::task_): Move to base class.
3904 (Archive::incremental_info_): Likewise.
3905 (class Lib_group): Derive from Library_base.
3906 (Lib_group::do_filename): New function.
3907 (Lib_group::do_get_mtime): New function.
3908 (Lib_group::do_for_all_unused_symbols): New function.
3909 (Lib_group::task_): Move to base class.
3910 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3911 function.
3912 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3913 function.
3914 * incremental.cc (Incremental_inputs::report_archive_begin):
3915 Use Library_base; call library's get_mtime; add incremental inputs
3916 entry before members.
3917 (class Unused_symbol_visitor): New class.
3918 (Incremental_inputs::report_archive_end): Use Library_base; use
3919 visitor class to record unused symbols; don't add incremental inputs
3920 entry after members.
3921 (Incremental_inputs::report_object): Use Library_base.
3922 * incremental.h
3923 (Incremental_archive_entry::Incremental_archive_entry): Remove
3924 unused Archive parameter.
3925 (Incremental_inputs::report_archive_begin): Use Library_base.
3926 (Incremental_inputs::report_archive_end): Likewise.
3927 (Incremental_inputs::report_object): Likewise.
3928 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3929 function.
3930 * object.h (Object::for_all_global_symbols): New function.
3931 (Object::do_for_all_global_symbols): New function.
3932 (Sized_relobj::do_for_all_global_symbols): New function.
3933 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3934 function.
3935 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3936 function.
3937
61ab3e40
ILT
39382011-03-27 Ian Lance Taylor <iant@google.com>
3939
3940 * archive.cc (Archive::interpret_header): Return -1 if something
3941 goes wrong. Change callers accordingly.
3942
30e1f9e6
CC
39432011-03-25 Cary Coutant <ccoutant@google.com>
3944
3945 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3946 * testsuite/Makefile.in: Regenerate.
3947
9370ce59 39482011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3949
3950 * plugin.cc (get_view): New.
3951 (Plugin::load): Pass get_view to the plugin.
3952 (Plugin_manager::get_view): New.
3953
9312bb0a
ILT
39542011-03-21 Ian Lance Taylor <iant@google.com>
3955
3956 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3957 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3958
7e12ba9e
ST
39592011-03-21 Sriraman Tallam <tmsriram@google.com>
3960
3961 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3962 Change == to -eq.
3963 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3964 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3965 Change == to -eq.
3966 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3967 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3968
fd7a005d
ILT
39692011-03-14 Ian Lance Taylor <iant@google.com>
3970
3971 * script-sections.cc (Sort_output_sections::script_compare):
3972 Rename from is_before, change return type.
3973 (Sort_output_sections::operator()): Adjust accordingly.
3974
ed16fd1b
ILT
39752011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3976
3977 PR gold/12572
3978 * testsuite/odr_violation2.cc: Add comment to make all error line
3979 numbers double digits.
3980 * testsuite/debug_msg.sh: Adjust expected errors.
3981
71ff8986
ILT
39822011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3983
3984 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3985 but mark earlier ones as non-canonical
3986 (offset_to_iterator): Update search target and example
3987 (do_addr2line): Return extra lines in a vector*
3988 (format_file_lineno): Extract from do_addr2line
3989 (one_addr2line): Add vector* out-param
3990 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3991 when a lineno entry appeared last for its instruction
3992 (Dwarf_line_info): Add vector* out-param
3993 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3994 * symtab.cc (Odr_violation_compare): Include the lineno in the
3995 comparison again.
3996 (linenos_from_loc): New. Combine the canonical line for an
3997 address with its other lines.
3998 (True_if_intersect): New. Helper functor to make
3999 std::set_intersection a query.
4000 (detect_odr_violations): Compare sets of lines instead of just
4001 one line for each function. This became less deterministic, but
4002 has fewer false positives.
4003 * symtab.h: Declarations.
4004 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
4005 mix an optimized and non-optimized object in the same binary
4006 (odr_violation2.so): Same.
4007 * testsuite/Makefile.in: Regenerate from Makefile.am.
4008 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
4009 * testsuite/debug_msg.sh: Update line numbers and add
4010 assertions.
4011 * testsuite/odr_violation1.cc: Use OdrDerived, in a
4012 non-optimized context.
4013 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
4014 isn't inlined, and use OdrDerived in an optimized context.
4015 * testsuite/odr_header1.h: Defines OdrDerived, where
4016 optimization will change the
4017 first-instruction-in-the-destructor's file and line number.
4018 * testsuite/odr_header2.h: Defines OdrBase.
4019
a19fefdc
ILT
40202011-03-09 Ian Lance Taylor <iant@google.com>
4021
4022 * fileread.cc (File_read::clear_views): Don't delete the whole
4023 file view.
4024
ecb351e9
ILT
40252011-03-08 Ian Lance Taylor <iant@google.com>
4026
4027 PR gold/12525
4028 * fileread.cc: #include <climits>.
4029 (GOLD_IOV_MAX): Define.
4030 (File_read::read_multiple): Limit number of entries by iov_max.
4031 * fileread.h (class File_read): Always set max_readv_entries to
4032 128.
4033
b821d13c
ILT
40342011-03-07 Ian Lance Taylor <iant@google.com>
4035
4036 PR gold/12525
4037 * options.h (class General_options): Add -dy and -dn.
4038
89243142
CC
40392011-03-02 Cary Coutant <ccoutant@google.com>
4040
4041 * testsuite/script_test_9.t: Add TLS segment.
4042
d0773f31
ILT
40432011-03-02 Simon Baldwin <simonb@google.com>
4044
4045 * configure.ac: Add check for gnu_indirect_function support in
4046 the toolchain building binutils.
4047 * configure: Rebuild.
4048
9370ce59 40492011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
4050
4051 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
4052 plugin only symbols.
4053 (Symbol_table::sized_finalize_symbol) Mark symbol only present
4054 in plugin files as not needed in the symbol table.
4055
4cf7a849
ST
40562011-02-11 Sriraman Tallam <tmsriram@google.com>
4057
4058 * output.cc (Output_section::add_input_section): Delay fill
4059 generation for section ordering.
4060
b578bd7d
ILT
40612011-02-09 Ian Lance Taylor <iant@google.com>
4062
4063 PR gold/12316
4064 * object.h (class Sized_relobj): Remove clear_local_symbols.
4065 * reloc.cc (Sized_relobj::do_relocate): Don't call
4066 clear_local_symbols.
4067
9370ce59 40682011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
4069
4070 * plugin.cc (is_visible_from_outside): Return true for symbols
4071 in the -u option.
4072
55382fb7
ILT
40732011-02-04 Jeffrey Yasskin <jyasskin@google.com>
4074
4075 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
4076 filename.
4077
4e271fff
ST
40782011-02-02 Sriraman Tallam <tmsriram@google.com>
4079
4080 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4081 to std::string.
4e271fff 4082 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4083 section_name to be std::string.
4e271fff
ST
4084 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4085
d433c3ac
ILT
40862011-01-25 Ian Lance Taylor <iant@google.com>
4087
4088 * script.cc (script_add_extern): Rewrite to use
4089 add_symbol_reference.
4090
880473a6
DK
40912011-01-25 Doug Kwan <dougkwan@google.com>
4092
d433c3ac 4093 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4094
f30f86fa
ILT
40952011-01-24 Ian Lance Taylor <iant@google.com>
4096
4097 * options.h (class General_options): Accept
4098 --no-detect-odr-violations.
4099
8e51a0b9
ILT
41002011-01-24 Ian Lance Taylor <iant@google.com>
4101
4102 * version.cc (version_string): Bump to 1.11.
4103
0f3b89d8
ILT
41042011-01-24 Ian Lance Taylor <iant@google.com>
4105
4106 * plugin.cc (class Plugin_rescan): Define new class.
4107 (Plugin_manager::claim_file): Set any_claimed_.
4108 (Plugin_manager::save_archive): New function.
4109 (Plugin_manager::save_input_group): New function.
4110 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4111 necessary.
4112 (Plugin_manager::new_undefined_symbol): New function.
4113 (Plugin_manager::rescan): New function.
4114 (Plugin_manager::rescannable_defines): New function.
4115 (Plugin_manager::add_input_file): Set any_added_.
4116 * plugin.h (class Plugin_manager): define new fields rescannable_,
4117 undefined_symbols_, any_claimed_, and any_added_. Declare
4118 Plugin_rescan as friend. Declare new functions.
4119 (Plugin_manager::Rescannable): Define type.
4120 (Plugin_manager::Rescannable_list): Define type.
4121 (Plugin_manager::Undefined_symbol_list): Define type.
4122 (Plugin_manager::Plugin_manager): Initialize new fields.
4123 * archive.cc (Archive::defines_symbol): New function.
4124 (Add_archive_symbols::run): Pass archive to plugins if any.
4125 * archive.h (class Archive): Declare defines_symbol.
4126 * readsyms.cc (Input_group::~Input_group): New function.
4127 (Finish_group::run): Pass input_group to plugins if any.
4128 * readsyms.h (class Input_group): Declare destructor.
4129 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4130 any.
4131
3bb951e5
ILT
41322011-01-10 Ian Lance Taylor <iant@google.com>
4133
4134 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4135 section as relro.
4136 (Layout::set_segment_offsets): Reset increase_relro before calling
4137 set_section_addresses a second time.
4138
0aa45fac
CC
41392011-01-04 Cary Coutant <ccoutant@google.com>
4140
4141 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4142 sections before NOBITS sections.
4143
0db46eb4
L
41442011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4145
4146 * version.cc (print_version): Update copyright to 2011.
4147
829c9745
CC
41482010-12-23 Cary Coutant <ccoutant@google.com>
4149
4150 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4151 of OS to this->add. Add OD parameter to second form of the function.
4152
7500420b
ILT
41532010-12-20 Ian Lance Taylor <iant@google.com>
4154
4155 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4156 second of two consecutive entries with same offset.
4157
f8e9a930
RW
41582010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4159
4160 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4161 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4162 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4163 to avoid unneeded links against $(LDADD).
4164 * testsuite/Makefile.in: Regenerate.
4165
2fbb4320
ILT
41662010-12-15 Ian Lance Taylor <iant@google.com>
4167
4168 PR gold/12324
4169 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4170 for R_X86_64_32 and R_X86_64_PC32.
4171 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4172 ver_matching_def_pic.o.
4173 (ver_matching_def_pic.o): New target.
4174
fedb228d
RW
41752010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4176
4177 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4178 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4179 Move definition before File_read::View member definitions.
4180 (File_read::View::~View): Initialize and hold lock before
4181 updating current_mapped_bytes.
4182
9b547ce6
RW
41832010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4184
4185 * dwarf_reader.cc: Remove outdated comment.
4186 * gold-threads.cc: Fix typo in error message.
4187 * archive.cc: Fix typos in comments.
4188 * archive.h: Likewise.
4189 * arm-reloc-property.cc: Likewise.
4190 * arm-reloc-property.h: Likewise.
4191 * arm-reloc.def: Likewise.
4192 * arm.cc: Likewise.
4193 * attributes.h: Likewise.
4194 * cref.cc: Likewise.
4195 * ehframe.cc: Likewise.
4196 * fileread.h: Likewise.
4197 * gold.h: Likewise.
4198 * i386.cc: Likewise.
4199 * icf.cc: Likewise.
4200 * incremental.h: Likewise.
4201 * int_encoding.cc: Likewise.
4202 * layout.h: Likewise.
4203 * main.cc: Likewise.
4204 * merge.h: Likewise.
4205 * object.cc: Likewise.
4206 * object.h: Likewise.
4207 * options.cc: Likewise.
4208 * readsyms.cc: Likewise.
4209 * reduced_debug_output.cc: Likewise.
4210 * reloc.cc: Likewise.
4211 * script-sections.cc: Likewise.
4212 * sparc.cc: Likewise.
4213 * symtab.h: Likewise.
4214 * target-reloc.h: Likewise.
4215 * target.cc: Likewise.
4216 * target.h: Likewise.
4217 * timer.cc: Likewise.
4218 * timer.h: Likewise.
4219 * x86_64.cc: Likewise.
4220
83e17bd5
CC
42212010-12-09 Cary Coutant <ccoutant@google.com>
4222
4223 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4224 stack.
4225 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4226 parameter; change all callers.
4227 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4228 * options.h (warn_execstack): New option.
4229
017257f8
DK
42302010-12-07 Doug Kwan <dougkwan@google.com>
4231
4232 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4233 like function call relocations.
4234
c20cbc06
ILT
42352010-12-07 Ian Lance Taylor <iant@google.com>
4236
4237 * archive.cc (Archive::get_elf_object_for_member): Permit
4238 punconfigured to be NULL.
4239 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4240 (Archive::include_member): Pass NULL to get_elf_object_for_member
4241 if we searched for the archive and this is the first included
4242 object.
4243
4dbfafcc
ILT
42442010-12-01 Ian Lance Taylor <iant@google.com>
4245
4246 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4247 track_relocs_type_ field.
4248 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4249 Set track_relocs_type_.
4250 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4251 contents when using RELA relocs.
4252 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4253 reloc_map_.
4254 * reloc.cc (Track_relocs::next_addend): New function.
4255 * reloc.h (class Track_relocs): Declare next_addend.
4256
e5e19edd
ILT
42572010-12-01 Ian Lance Taylor <iant@google.com>
4258
4259 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4260 virtual destructor.
4261
9a5ce24c
ILT
42622010-12-01 Ian Lance Taylor <iant@google.com>
4263
4264 * README: Update compilers known to work and fail.
4265
c7791212
NC
42662010-11-23 Matthias Klose <doko@ubuntu.com>
4267
4268 * configure.in: For --enable-gold, handle value `default' instead of
4269 `both*'. Always install ld as ld.bfd, install as ld if gold is
4270 not the default.
4271 * configure: Regenerate.
4272
0ad220c9
DK
42732010-11-18 Doug Kwan <dougkwan@google.com>
4274
4275 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4276 and right_alignment to be zero. Store result alignment only if it is
4277 greater than existing alignment.
4278
ab8056e0
CC
42792010-11-16 Cary Coutant <ccoutant@google.com>
4280
4281 PR gold/12220
4282 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4283 Check for ".zdebug_line".
4284
fd064a5b
CC
42852010-11-16 Doug Kwan <dougkwan@google.com>
4286 Cary Coutant <ccoutant@google.com>
4287
4288 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4289 by reference; adjust all callers.
4290 * output.cc (Output_segment::set_section_addresses): Adjust references
4291 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4292 list is empty.
4293 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4294 end at page boundary.
4295
6fc6ea19
CC
42962010-11-16 Cary Coutant <ccoutant@google.com>
4297
4298 PR gold/12220
4299 * layout.cc (Layout::choose_output_section): Transform names of
4300 compressed sections even when using a script with a SECTIONS clause.
4301 (Layout::output_section_name): Remove code to transform
4302 compressed debug section names.
4303 * output.cc (Output_section::add_input_section): Use uncompressed
4304 section size when tracking input sections.
4305
95a2c8d6
RS
43062010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4307
4308 * symtab.h (Symbol::NON_PIC_REF): Remove.
4309 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4310 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4311 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4312 (Symbol::use_plt_offset): Take a flags argument and pass it
4313 directly to needs_dynamic_reloc. Restrict check for undefined
4314 weak symbols to function calls.
4315 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4316 (Target_arm::Scan::global): Use it.
4317 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4318 (Target_arm::Relocate::relocate): Likewise.
4319 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4320 parameter with an r_type parameter. Use get_reference_flags
4321 to get the flags.
4322 (Target_arm::Relocate::relocate): Update accordingly.
4323 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4324 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4325 (Target_i386::Scan::global): Likewise.
4326 (Target_i386::Relocate::relocate): Likewise.
4327 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4328 parameter with an r_type parameter. Use get_reference_flags
4329 to get the flags.
4330 (Target_i386::Relocate::relocate): Update accordingly.
4331 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4332 (Target_powerpc::Scan::global): Use it.
4333 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4334 (Target_powerpc::Relocate::relocate): Likewise.
4335 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4336 (Target_sparc::Scan::global): Use it.
4337 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4338 (Target_sparc::Relocate::relocate): Likewise.
4339 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4340 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4341 (Target_x86_64::Scan::global): Likewise.
4342 (Target_x86_64::Relocate::relocate): Likewise.
4343
f625ae50
DK
43442010-11-08 Doug Kwan <dougkwan@google.com>
4345 Cary Coutant <ccoutant@google.com>
4346
4347 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4348 (Arm_exidx_merge_section::section_contents_): New data member.
4349 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4350 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4351 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4352 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4353 in parameters instead of calling Object::section_contents without
4354 locking.
4355 (Arm_output_section::group_section): New parameter TASK. Pass it
4356 to callees that need locking objects.
4357 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4358 to lock EXIDX input sections. Fix a formatting issue. Call
4359 Arm_exidx_merged_section::build_contents to create merged section
4360 contents.
4361 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4362 to lock object of stub table owner.
4363 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4364 TEXT_SIZE to initialize data member TEXT_SIZE_.
4365 (Arm_exidx_input_section::addralign): Fix typo in comment.
4366 (Arm_exidx_input_section::text_size): New method.
4367 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4368 that require locking objects. Lock objects before scanning for stubs
4369 and updating local symbols.
4370 (Arm_input_section<big_endian>::init): Copy contents of original
4371 input section.
2e702c99 4372 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4373 original input section instead of calling Object::section_contents
4374 without locking.
4375 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4376 size without calling Object::section_size().
4377 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4378 for size. Allocate a buffer for merged EXIDX entries.
4379 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4380 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4381 building code to Arm_exidx_merged_section::build_contetns. Write
4382 out contetns in buffer instead of building it on the fly.
4383 (Arm_relobj::make_exidx_input_section): Also pass text section size
4384 to Arm_exidx_input_section constructor.
4385 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4386 (Arm_dynobj::do_read_symbols): Fix memory leak.
4387 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4388 * target.h: (class Task): Add forward declaration.
4389 (Target::relax): Add new parameter TASK and pass it to
4390 Target::do_relax().
4391 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4392
5f9bcf58
CC
43932010-11-05 Cary Coutant <ccoutant@google.com>
4394
4395 PR gold/10708
4396 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4397 object when reading from the file.
4398 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4399 second layout pass.
4400 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4401 when reading section contents.
4402 (get_section_contents): Likewise.
4403 (icf::find_identical_sections): Likewise.
4404 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4405 object when reading from the file.
4406 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4407 the object when doing deferred section layout.
4408
e597fa08
NC
44092010-11-03 Nick Clifton <nickc@redhat.com>
4410
4411 PR gold/12001
4412 * script.h (class Symbol_assignment: name): New member. Returns
4413 the name of the symbol.
4414 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4415 Returns true if the given symbol name is on the list of
4416 assignments wating to be processed.
4417 * archive.cc (should_incldue_member): If the symbol is undefined,
4418 check to see if it is on the list of symbols pending assignment.
4419
3f9a3278
ILT
44202010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4421
4422 * script-sections.cc (Script_sections::find_memory_region): Check
4423 for a NULL output section pointer.
4424
d06fb4d1
DK
44252010-10-29 Doug Kwan <dougkwan@google.com>
4426
4427 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4428 Output_section::add_relaxed_input_section.
4429 * output.cc (Output_section::add_relaxed_input_section): Add new
4430 arguments LAYOUT and NAME. Set section order index.
4431 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4432 Copy section order index.
4433 * output.h (Output_section::add_relaxed_input_section): Add new
4434 arguments LAYOUT and NAME.
4435
90e24de5
ILT
44362010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4437
4438 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4439 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4440 * testsuite/Makefile.in: Regenerate.
4441
c9484ea5
DK
44422010-10-20 Doug Kwan <dougkwan@google.com>
4443
4444 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4445 without SHF_LINK_ORDER flags.
4446 * layout.cc (Layout::choose_output_section): Do not filter
4447 SHF_LINK_ORDER flag in a relocatable link.
4448
5bc2f5be
CC
44492010-10-17 Cary Coutant <ccoutant@google.com>
4450
4451 * output.h (Output_segment::set_section_addresses): Change function
4452 signature. Update all callers.
4453 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4454 sections.
4455 (Output_segment::set_section_addresses): Align after last TLS
4456 section. Add padding before last relro section instead of after.
4457
0c91cf04
DK
44582010-10-17 Doug Kwan <dougkwan@google.com>
4459
4460 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4461 GOT output section to be writable.
4462
8c21d9d3
CC
44632010-10-14 Cary Coutant <ccoutant@google.com>
4464
4465 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4466 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4467 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4468 mode.
4469 * incremental.cc (report_command_line): Ignore all forms of
4470 --incremental.
4471 * layout.cc (Layout::Layout): Check parameters for incremental link
4472 mode.
4473 * options.cc (General_options::parse_incremental): New function.
4474 (General_options::parse_no_incremental): New function.
4475 (General_options::parse_incremental_full): New function.
4476 (General_options::parse_incremental_update): New function.
4477 (General_options::incremental_mode_): New data member.
4478 (General_options::finalize): Check incremental_mode_.
4479 * options.h (General_options): Update help text for --incremental.
4480 Add --no-incremental, --incremental-full, --incremental-update.
4481 (General_options::Incremental_mode): New enum type.
4482 (General_options::incremental_mode): New function.
4483 (General_options::incremental_mode_): New data member.
4484 * parameters.cc (Parameters::incremental_mode_): New data member.
4485 (Parameters::set_options): Set incremental_mode_.
4486 (Parameters::set_incremental_full): New function.
4487 (Parameters::incremental): New function.
4488 (Parameters::incremental_update): New function.
4489 (set_parameters_incremental_full): New function.
4490 * parameters.h (Parameters::set_incremental_full): New function.
4491 (Parameters::incremental): New function.
4492 (Parameters::incremental_update): New function.
4493 (Parameters::incremental_mode_): New data member.
4494 (set_parameters_incremental_full): New function.
4495 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4496 incremental link mode.
4497 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4498 (Sized_relobj::do_relocate_sections): Likewise.
4499 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4500 option.
4501 * testsuite/Makefile.in: Regenerate.
4502 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4503
bb32aa18 45042010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4505
4506 * script-sections.h (class Script_sections): Make
4507 Sections_elements typedef public.
4508 * script-sections.cc (class Sort_output_sections): Add elements_
4509 field. Add constructor which sets it; change all callers.
4510 (Sort_output_sections::is_before): New function.
4511 (Sort_output_sections::operator()): Call is_before.
4512 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4513 conditional.
4514 * testsuite/script_test_10.sh: New test. Test script section
4515 order.
4516 * testsuite/script_test_10.t: Likewise.
4517 * testsuite/script_test_10.s: Likewise.
4518 * testsuite/Makefile.am: Wrap the cross linker tests and the
4519 common tests into NATIVE_OR_CROSS_LINKER.
4520 (check_SCRIPTS): Add script_test_10.sh.
4521 (check_DATA): Add script_test_10.stdout.
4522 (script_test_10.o, script_test_10): New targets.
4523 (script_test_10.stdout): New target.
4524 * configure, testsuite/Makefile.in: Regenerate.
4525
3cef7179
ILT
45262010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4527
4528 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4529 error for the deprecated relocations.
4530 (Target_arm::Scan::global): Likewise.
4531 (Target_arm::Relocate::relocate): Likewise.
4532
7411e9a8
RS
45332010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4534
4535 * fileread.cc (Input_file::find_file): Initialize *found_name
4536 and *namep when using the fallback search for case 4.
4537
6a9da32a
CC
45382010-10-11 Cary Coutant <ccoutant@google.com>
4539
4540 * options.h (class General_options): Redefine -z lazy as an alias for
4541 the negation of -z now.
4542
ac897c20
ILT
45432010-10-11 Ian Lance Taylor <iant@google.com>
4544
4545 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4546 binding.
4547
ea5cae92
NC
45482010-10-06 Nick Clifton <nickc@redhat.com>
4549
4550 * script-sections.cc(class Memory_region): Remove
4551 current_lma_offset_ field. Rename current_vma_offset_ to
4552 current_offset_. Add last_section_ field.
4553 (Memory_region::get_current_vma_address): Rename to
4554 get_current_address.
4555 (Memory_region::get_current_lma_address): Delete.
4556 (Memory_region::increment_vma_offset): Rename to
4557 increment_offset.
4558 (Memory_region::increment_lma_offset): Delete.
4559 (Memory_region::attributes_compatible): New method. Returns
4560 true if the provided section is compatible with the region.
4561 (Memory_region::get_last_section): New method. Returns the last
4562 section to use the region.
4563 (Memory_region::set_last_section): New method. Stores the last
4564 section to use the region.
4565 (Script_sections::block_in_region): New method. Returns true if
4566 a block of memory is contained within a region.
4567 (Script_sections::find_memory_region): New method. Locates a
4568 memory region to be used to set a VMA or LMA address.
4569 (Output_section_definition::set_section_addresses): Add code to
4570 check for addresses set by memory regions.
4571 (Output_segment::set_section_addresses): Remove memory region
4572 walking code.
4573 (Script_sections::create_segment): Add a warning if a header
4574 segment is created outside of any region.
4575 * script-sections.h (class Script_sections): Add prototypes for
4576 find_memory_region and block_in_region methods.
4577 * testsuite/memory_test.s: Use .long instead of .word.
4578 * testsuite/memory_test.t: Add some more output sections.
4579 * testsuite/memory_test.sh: Update expected output.
4580
a9bfd952
DK
45812010-10-02 Doug Kwan <dougkwan@google.com>
4582
4583 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4584 defintion to symtab.h
4585 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4586 declaration to defintion.
4587
bacff3ab
NC
45882010-10-01 Nick Clifton <nickc@redhat.com>
4589
4590 * expression.cc (eval): Replace dummy argument with NULL.
4591 (eval_maybe_dot): Check for a NULL result section pointer.
4592 (Symbol_expression::value): Likewise.
4593 (Dot_expression::value): Likewise.
4594 (BINARY_EXPRESSION): Likewise.
4595 (Max_expression::value): Likewise.
4596 (Min_expression::value): Likewise.
4597 (Absolute_expression::value): Likewise.
4598 (Addr_expression::value_from_output_section): Likewise.
4599 (Loaddddr_expression::value_from_output_section): Likewise.
4600 (Segment_start_expression::value): Likewise.
4601 * script-sections.cc
4602 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4603 argument with NULL.
4604 (Sections_elememt_dot_assignment::set_section_addresses):
4605 Likewise.
4606 (Output_data_expression::do_write_to_buffer): Likewise.
4607 (Output_section_definition::finalize_symbols): Likewise.
4608 (Output_section_definition::set_section_addresses): Likewise.
4609
f81bc8b5
DK
46102010-09-30 Doug Kwan <dougkwan@google.com>
4611
4612 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4613
c95e9f27
ST
46142010-09-28 Sriraman Tallam <tmsriram@google.com>
4615
4616 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4617 function.
c95e9f27
ST
4618 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4619 virtual function.
4620 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4621 virtual function.
4622 * icf.cc (get_section_contents): Inline merge sections only when
4623 target allows it.
4624
3cac54d2
RW
46252010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4626
4627 * configure: Regenerate.
4628
2904037a
ILT
46292010-09-17 Ian Lance Taylor <iant@google.com>
4630
4631 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4632 * testsuite/Makefile.am (memory_test.o): New target.
4633 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4634 memory_test.t.
4635 * testsuite/Makefile.in: Rebuild.
2904037a 4636
bca7fb63
DK
46372010-09-17 Doug Kwan <dougkwan@google.com>
4638
4639 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4640 defintion if relocation uses GOT entries of the symbol.
4641 * testsuite/icf_safe_test.sh: Fix test.
4642 * testsuite/icf_safe_so_test.sh: Fix test.
4643
4ef28648
CC
46442010-09-16 Cary Coutant <ccoutant@google.com>
4645
4646 * script_sections.cc (class Memory_region): Remove "NULL" from
4647 vector initializations.
4648
793990de
CC
46492010-09-15 Cary Coutant <ccoutant@google.com>
4650
4651 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4652 Resolve forwarding symbols.
4653
81e015e2
DK
46542010-09-15 Doug Kwan <dougkwan@google.com>
4655
4656 * gold/testsuite/script_test_3.t: Add ARM special sections.
4657 * gold/testsuite/script_test_4.t: Same.
4658 * gold/testsuite/script_test_5.t: Same.
4659 * gold/testsuite/script_test_6.t: Same.
4660 * gold/testsuite/script_test_7.t: Same.
4661 * gold/testsuite/script_test_7.t: Same.
4662 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4663
36171d64
CC
46642010-09-14 Cary Coutant <ccoutant@google.com>
4665
4666 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4667 (Target_x86_64::Relocate::relocate_tls): Replace check for
4668 saw_tls_block_reloc_ with test for executable section.
4669
d89051bd
CC
46702010-09-12 Cary Coutant <ccoutant@google.com>
4671
4672 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4673 position-independent executables to shared libraries need dynamic
4674 relocations.
4675 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4676 position-independent executables.
4677 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4678 * testsuite/Makefile.in: Regenerate.
4679
fca41f0f
NC
46802010-09-10 Nick Clifton <nickc@redhat.com>
4681
4682 PR gold/11997
4683 * testsuite/memory_test.t: Discard any sections that are not
4684 needed.
4685
6695e4b3
L
46862010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4687
4688 PR gold/11996
4689 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4690 "This::" to work around a bug in gcc 4.2.
4691
4692 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4693
0f72bf6f
RÁE
46942010-09-09 Rafael Espindola <espindola@google.com>
4695
4696 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4697 sections with different PF_X flags in the same segment.
4698 (Layout::find_first_load_seg): Search all segments to find the first
4699 one.
4700 * options.h (rosegment): New.
4701
47022010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4703
05a79166 4704 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4705
aa98ff75
DK
47062010-09-08 Doug Kwan <dougkwan@google.com>
4707
4708 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4709 (Arm_relobj::do_relocate_sections): Add new parameter for output
4710 file to match the parent.
4711 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4712 of local symbols instead of input values. Update code to track
4713 changes in gold::relocate_section.
4714 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4715 (Sized_relobj::compute_final_local_value_internal): New methods.
4716 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4717 body into private version of Sized_relobj::compute_final_local_value.
4718 Call the inline method.
4719 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4720 merged symbol value if there is one.
4721 (Symbol_value::has_output_value): New method defintiion.
4722 (Sized_relobj::Compute_final_local_value_status): New enum type.
4723 (Sized_relobj::compute_final_local_value): New methods.
4724 (Sized_relobj::compute_final_local_value_internal): New methods.
4725 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4726 and arm_cortex_a8.sh.
4727 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4728 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4729 New tests.
4730 * Makefile.in: Regenerate.
4731 * testsuite/arm_bl_out_of_range.s: Update test.
4732 * testsuite/thumb_bl_out_of_range.s: Ditto.
4733 * testsuite/thumb_blx_out_of_range.s: Ditto.
4734 * testsuite/arm_branch_out_of_range.sh: New file.
4735 * testsuite/arm_cortex_a8.sh: Ditto.
4736 * testsuite/arm_cortex_a8_b.s: Ditto.
4737 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4738 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4739 * testsuite/arm_cortex_a8_bl.s: Ditto.
4740 * testsuite/arm_cortex_a8_blx.s: Ditto.
4741 * testsuite/arm_cortex_a8_local.s: Ditto.
4742 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4743 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4744
05a79166
L
47452010-09-08 Rafael Espindola <espindola@google.com>
4746
4747 * Makefile.am (memory_test.stdout): Run readelf with -W.
4748 * Makefile.in: Regenerate.
4749 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4750 64 bit output.
4751
33dbc701
RÁE
47522010-09-08 Rafael Espindola <espindola@google.com>
4753
4754 * script-sections.cc (Script_sections::add_memory_region): Convert
4755 field precision to int.
4756 * script.cc (script_set_section_region, script_set_section_region):
4757 Convert field precision to int.
4758
731ca54a
RÁE
47592010-09-08 Rafael Espindola <espindola@google.com>
4760
4761 * arm.cc (do_finalize_sections): Create the __exidx_start and
4762 __exdix_end symbols even when the section is missing.
4763
7f8cd844
NC
47642010-09-08 Nick Clifton <nickc@redhat.com>
4765
4766 * README: Remove claim that MEMORY is not supported.
4767 * expression.cc (script_exp_function_origin)
4768 (script_exp_function_length): Move from here to ...
4769 * script.cc: ... here.
4770 (script_set_section_region, script_add_memory)
4771 (script_parse_memory_attr, script_include_directive): New
4772 functions.
4773 * script-sections.cc
4774 (class Memory_region): New class.
4775 (class Output_section_definition): Add set_memory_region,
4776 set_section_vma, set_section_lma and get_section_name methods.
4777 (class Script_Sections): Add add_memory_region,
4778 find_memory_region, find_memory_region_origin,
4779 find_memory_region_length and set_memory_region methods.
4780 Have set_section_addresses method walk the list of set memory
4781 regions.
4782 Extend the print methos to display memory regions.
4783 * script-sections.h: Add prototypes for new methods.
4784 Add enum for MEMORY region attributes.
4785 * yyscript.y: Add support for parsing MEMORY regions.
4786 * script-c.h: Add prototypes for new functions.
4787 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4788 * testsuite/Makefile.in: Regenerate.
4789 * testsuite/memory_test.sh: New script.
4790 * testsuite/memory_test.s: New assembler source file.
4791 * testsuite/memory_test.t: New linker script.
4792
a4649286
DK
47932010-08-27 Doug Kwan <dougkwan@google.com>
4794
4795 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4796 reference override an existing dynamic weak reference.
4797 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4798 * testsuite/Makefile.in: Regenerate.
4799 * testsuite/dyn_weak_ref.sh: New file.
4800 * testsuite/dyn_weak_ref_1.c: Ditto.
4801 * testsuite/dyn_weak_ref_2.c: Ditto.
4802
b56648ad
ILT
48032010-08-27 Ian Lance Taylor <iant@google.com>
4804
4805 * incremental.h (class Incremental_input_entry): Add virtual
4806 destructor.
4807
809313cb
ILT
48082010-08-27 Ian Lance Taylor <iant@google.com>
4809
4810 * testsuite/start_lib_test_3.c: Mark t3 as used.
4811
11e32464
NC
48122010-08-27 Nick Clifton <nickc@redhat.com>
4813
4814 * options.cc (version_script): Fix small typo in previous
4815 whitespace tidyup.
4816
ca09d69a
NC
48172010-08-25 Nick Clifton <nickc@redhat.com>
4818
4819 * archive.cc: Formatting fixes: Remove whitespace between
4820 typename and following asterisk. Remove whitespace between
4821 function name and opening parenthesis.
4822 * archive.h: Likewise.
4823 * arm.cc: Likewise.
4824 * attributes.cc: Likewise.
4825 * attributes.h: Likewise.
4826 * common.cc: Likewise.
4827 * copy-relocs.cc: Likewise.
4828 * dirsearch.h: Likewise.
4829 * dynobj.cc: Likewise.
4830 * ehframe.cc: Likewise.
4831 * ehframe.h: Likewise.
4832 * expression.cc: Likewise.
4833 * fileread.cc: Likewise.
4834 * fileread.h: Likewise.
4835 * gc.h: Likewise.
4836 * gold-threads.cc: Likewise.
4837 * gold.cc: Likewise.
4838 * i386.cc: Likewise.
4839 * icf.h: Likewise.
4840 * incremental-dump.cc: Likewise.
4841 * incremental.cc: Likewise.
4842 * layout.cc: Likewise.
4843 * layout.h: Likewise.
4844 * main.cc: Likewise.
4845 * merge.cc: Likewise.
4846 * merge.h: Likewise.
4847 * object.cc: Likewise.
4848 * object.h: Likewise.
4849 * options.cc: Likewise.
4850 * options.h: Likewise.
4851 * output.cc: Likewise.
4852 * output.h: Likewise.
4853 * plugin.cc: Likewise.
4854 * plugin.h: Likewise.
4855 * powerpc.cc: Likewise.
4856 * reloc.cc: Likewise.
4857 * script-c.h: Likewise.
4858 * script-sections.cc: Likewise.
4859 * script.cc: Likewise.
4860 * stringpool.cc: Likewise.
4861 * symtab.cc: Likewise.
4862 * symtab.h: Likewise.
4863 * target.cc: Likewise.
4864 * timer.cc: Likewise.
4865 * timer.h: Likewise.
4866 * version.cc: Likewise.
4867 * x86_64.cc: Likewise.
4868
b8fa8750
NC
48692010-08-24 Nick Clifton <nickc@redhat.com>
4870
4871 PR 11899
4872 * layout.cc (segment_precedes): Sort segments by their physical
4873 addresses, if they have been set.
4874
9919d93b
CC
48752010-08-23 Cary Coutant <ccoutant@google.com>
4876
4877 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4878 symbols data.
4879 (Lib_group::include_member): Unlock object after deleting its
4880 symbols data.
4881 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4882 the bug fixed here.
4883
97b4be1c
CC
48842010-08-19 Neil Vachharajani <nvachhar@google.com>
4885 Cary Coutant <ccoutant@google.com>
4886
4887 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4888 constructor, and set_blocker.
4889 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4890 readsyms_blocker_.
4891 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4892 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4893 * testsuite/Makefile.am (start_lib_test): New test case.
4894 * testsuite/Makefile.in: Regenerate.
4895 * testsuite/start_lib_test_main.c: New file.
4896 * testsuite/start_lib_test_1.c: New file.
4897 * testsuite/start_lib_test_2.c: New file.
4898 * testsuite/start_lib_test_3.c: New file.
4899
dd0b1884
ILT
49002010-08-19 Ian Lance Taylor <iant@google.com>
4901
4902 * Makefile.in: Rebuild with automake 1.11.1.
4903 * aclocal.m4: Likewise.
4904 * testsuite/Makefile.in: Likewise.
4905
7223e9ca
ILT
49062010-08-19 Ian Lance Taylor <iant@google.com>
4907
4908 PR 10893
4909 * i386.cc (class Output_data_plt_i386): Update declarations.
4910 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4911 local_ifuncs_ fields.
4912 (Target_i386::do_plt_section_for_global): New function.
4913 (Target_i386::do_plt_section_for_local): New function.
4914 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4915 parameter; change all callers. Initialize global_ifuncs_ and
4916 local_ifuncs_. If doing a static link define __rel_iplt_start and
4917 __rel_iplt_end.
4918 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4919 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4920 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4921 symbols.
4922 (Target_i386::make_plt_section): New function, broken out of
4923 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4924 (Target_i386::make_plt_entry): Call make_plt_section.
4925 (Target_i386::make_local_ifunc_plt_entry): New function.
4926 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4927 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4928 R_386_IRELATIVE to switch.
4929 (Target_i386::Scan::global): Likewise.
4930 (Target_i386::Relocate::relocate): Likewise.
4931 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4932 switch.
4933 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4934 (Target_x86_64::do_plt_section_for_global): New function.
4935 (Target_x86_64::do_plt_section_for_local): New function.
4936 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4937 parameter; change all callers. If doing a static link define
4938 __rela_iplt_start and __rela_iplt_end.
4939 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4940 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4941 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4942 to point to .plt.
4943 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4944 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4945 switch.
4946 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4947 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4948 R_X86_64_IRELATIVE to switch.
4949 (Target_x86_64::Scan::global): Likewise.
4950 (Target_x86_64::Relocate::relocate): Likewise.
4951 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4952 switch.
4953 * target.h (class Target): Add plt_section_for_global and
4954 plt_section_for_local functions. Add do_plt_section_for_global
4955 and do_plt_section_for_local virtual functions.
4956 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4957 clarifying comments.
4958 (Symbol::use_plt_offset): Handle IFUNC symbol.
4959 * object.cc (Sized_relobj::Sized_relobj): Initialize
4960 local_plt_offsets_.
4961 (Sized_relobj::local_has_plt_offset): New function.
4962 (Sized_relobj::local_plt_offset): New function.
4963 (Sized_relobj::set_local_plt_offset): New function.
4964 (Sized_relobj::do_count): Handle IFUNC symbol.
4965 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4966 a bit away from input_shndx_ field. Add set_is_func_symbol and
4967 is_ifunc_symbol functions.
4968 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4969 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4970 local_plt_offsets_ field.
4971 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4972 * output.h (class Output_section_data): Add non-const
4973 output_section function.
4974 (class Output_data_got): Update declarations.
4975 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4976 Add use_plt_offset parameter to global and local constructors.
4977 Change all callers. Change local_sym_index_ field to 31 bits.
4978 Change GSYM_CODE and CONSTANT_CODE accordingly.
4979 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4980 doing a static link don't set sh_link field.
4981 (Output_data_got::Got_entry::write): Use PLT offset if
4982 appropriate.
4983 (Output_data_got::add_global_plt): New function.
4984 (Output_data_got::add_local_plt): New function.
4985 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4986 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4987 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4988 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4989 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4990 IFUNC conditional.
4991 * testsuite/ifunc-sel.h: New file.
4992 * testsuite/ifuncmain1.c: New file.
4993 * testsuite/ifuncmain1vis.c: New file.
4994 * testsuite/ifuncmod1.c: New file.
4995 * testsuite/ifuncdep2.c: New file.
4996 * testsuite/ifuncmain2.c: New file.
4997 * testsuite/ifuncmain3.c: New file.
4998 * testsuite/ifuncmod3.c: New file.
4999 * testsuite/ifuncmain4.c: New file.
5000 * testsuite/ifuncmain5.c: New file.
5001 * testsuite/ifuncmod5.c: New file.
5002 * testsuite/ifuncmain6pie.c: New file.
5003 * testsuite/ifuncmod6.c: New file.
5004 * testsuite/ifuncmain7.c: New file.
5005 * configure, testsuite/Makefile.in: Rebuild.
5006
56f75c03
ILT
50072010-08-18 Ian Lance Taylor <iant@google.com>
5008
5009 * incremental.cc
5010 (Output_section_incremental_inputs::write_input_files): Add cast
5011 to avoid signed/unsigned comparison warning.
5012 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5013
55455f89
CC
50142010-08-12 Cary Coutant <ccoutant@google.com>
5015
5016 * common.cc (Sort_commons::operator()): Remove unnecessary code.
5017
e2054bcb
ILT
50182010-08-13 Ian Lance Taylor <iant@google.com>
5019
5020 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
5021
74f67560
DK
50222010-08-12 Cary Coutant <ccoutant@google.com>
5023 Doug Kwan <dougkwan@google.com>
5024
5025 * resolve.cc (Symbol_table::should_override): When a weak dynamic
5026 defintion overrides non-weak undef, remember that the original undef
5027 is not weak.
5028 * symtab.cc (Symbol_table::sized_write_global): For undef without
5029 an original weak binding, set binding to global in output.
5030 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
5031 * testsuite/Makefile.in: Regenerate.
5032 * testsuite/strong_ref_weak_def.sh: New file.
5033 * testsuite/strong_ref_weak_def_1.c: Ditto.
5034 * testsuite/strong_ref_weak_def_2.c: Ditto.
5035
d1238d12
CC
50362010-08-12 Cary Coutant <ccoutant@google.com>
5037
5038 * testsuite/incremental_test.sh: Rewrite.
5039 * testsuite/incremental_test_1.c: Rewrite.
5040 * testsuite/incremental_test_2.c: Rewrite.
5041
0e70b911
CC
50422010-08-12 Cary Coutant <ccoutant@google.com>
5043
5044 * arm.cc (Target_arm::got_size): Add const.
5045 (Target_arm::got_entry_count): New function.
5046 (Target_arm::plt_entry_count): New function.
5047 (Target_arm::first_plt_entry_offset): New function.
5048 (Target_arm::plt_entry_size): New function.
5049 (Output_data_plt_arm::entry_count): New function.
5050 (Output_data_plt_arm::first_plt_entry_offset): New function.
5051 (Output_data_plt_arm::get_plt_entry_size): New function.
5052 * i386.cc (Target_i386::got_size): Add const.
5053 (Target_i386::got_entry_count): New function.
5054 (Target_i386::plt_entry_count): New function.
5055 (Target_i386::first_plt_entry_offset): New function.
5056 (Target_i386::plt_entry_size): New function.
5057 (Output_data_plt_i386::entry_count): New function.
5058 (Output_data_plt_i386::first_plt_entry_offset): New function.
5059 (Output_data_plt_i386::get_plt_entry_size): New function.
5060 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
5061 find_incremental_inputs_sections. Dump incremental_got_plt section.
5062 * incremental.cc: Include target.h.
5063 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
5064 parameter. Adjust all callers. Find incremental_got_plt section.
5065 (Incremental_inputs::create_data_sections): Create incremental_got_plt
5066 section.
5067 (Output_section_incremental_inputs::set_final_data_size): Calculate
5068 size of incremental_got_plt section.
5069 (Output_section_incremental_inputs::do_write): Write the
5070 incremental_got_plt section.
5071 (Got_plt_view_info): New struct.
5072 (Local_got_offset_visitor): New class.
5073 (Global_got_offset_visitor): New class.
5074 (Global_symbol_visitor_got_plt): New class.
5075 (Output_section_incremental_inputs::write_got_plt): New function.
5076 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
5077 Add parameter. Adjust all callers.
5078 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5079 (Incremental_inputs::got_plt_section): New function.
5080 (Incremental_inputs::got_plt_section_): New data member.
5081 (Incremental_got_plt_reader): New class.
5082 * layout.cc (Layout::create_incremental_info_sections): Add the
5083 incremental_got_plt section.
5084 * object.h (Got_offset_list::get_list): New function.
5085 (Got offset_list::for_all_got_offsets): New function.
5086 (Sized_relobj::local_got_offset_list): New function.
5087 * powerpc.cc (Target_powerpc::got_size): Add const.
5088 (Target_powerpc::got_entry_count): New function.
5089 (Target_powerpc::plt_entry_count): New function.
5090 (Target_powerpc::first_plt_entry_offset): New function.
5091 (Target_powerpc::plt_entry_size): New function.
5092 (Output_data_plt_powerpc::entry_count): New function.
5093 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5094 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5095 * sparc.cc (Target_sparc::got_size): Add const.
5096 (Target_sparc::got_entry_count): New function.
5097 (Target_sparc::plt_entry_count): New function.
5098 (Target_sparc::first_plt_entry_offset): New function.
5099 (Target_sparc::plt_entry_size): New function.
5100 (Output_data_plt_sparc::entry_count): New function.
5101 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5102 (Output_data_plt_sparc::get_plt_entry_size): New function.
5103 * symtab.h (Symbol::got_offset_list): New function.
5104 (Symbol_table::for_all_symbols): New function.
5105 * target.h (Sized_target::got_entry_count): New function.
5106 (Sized_target::plt_entry_count): New function.
5107 (Sized_target::plt_entry_size): New function.
5108 * x86_64.cc (Target_x86_64::got_size): Add const.
5109 (Target_x86_64::got_entry_count): New function.
5110 (Target_x86_64::plt_entry_count): New function.
5111 (Target_x86_64::first_plt_entry_offset): New function.
5112 (Target_x86_64::plt_entry_size): New function.
5113 (Output_data_plt_x86_64::entry_count): New function.
5114 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5115 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5116
09ec0418
CC
51172010-08-12 Cary Coutant <ccoutant@google.com>
5118
5119 * archive.cc: Include incremental.h.
5120 (Archive::Archive): Initialize incremental_info_.
5121 (Archive::include_member): Record archive members in incremental info.
5122 (Add_archive_symbols::run): Record begin and end of an archive in
5123 incremental info.
5124 (Lib_group::include_member): Record objects in incremental info.
5125 * archive.h (Incremental_archive_entry): Forward declaration.
5126 (Archive::set_incremental_info): New member function.
5127 (Archive::incremental_info): New member function.
5128 (Archive::Unused_symbol_iterator): New class.
5129 (Archive::unused_symbols_begin): New member function.
5130 (Archive::unused_symbols_end): New member function.
5131 (Archive::incremental_info_): New data member.
5132 * incremental-dump.cc (find_input_containing_global): New function.
5133 (dump_incremental_inputs): Dump new incremental info sections.
5134 * incremental.cc: Include symtab.h.
5135 (Output_section_incremental_inputs): New class.
5136 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5137 new incremental info sections.
5138 (Sized_incremental_binary::do_check_inputs): Likewise.
5139 (Incremental_inputs::report_archive): Remove.
5140 (Incremental_inputs::report_archive_begin): New function.
5141 (Incremental_inputs::report_archive_end): New function.
5142 (Incremental_inputs::report_object): New function.
5143 (Incremental_inputs::finalize_inputs): Remove.
5144 (Incremental_inputs::report_input_section): New function.
5145 (Incremental_inputs::report_script): Rewrite.
5146 (Incremental_inputs::finalize): Do nothing but finalize string table.
5147 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5148 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5149 (Incremental_inputs::create_data_sections): New function.
5150 (Incremental_inputs::relocs_entsize): New function.
5151 (Output_section_incremental_inputs::set_final_data_size): New function.
5152 (Output_section_incremental_inputs::do_write): New function.
5153 (Output_section_incremental_inputs::write_header): New function.
5154 (Output_section_incremental_inputs::write_input_files): New function.
5155 (Output_section_incremental_inputs::write_info_blocks): New function.
5156 (Output_section_incremental_inputs::write_symtab): New function.
5157 * incremental.h (Incremental_script_entry): Forward declaration.
5158 (Incremental_object_entry): Forward declaration.
5159 (Incremental_archive_entry): Forward declaration.
5160 (Incremental_inputs): Forward declaration.
5161 (Incremental_inputs_header_data): Remove.
5162 (Incremental_inputs_header): Remove.
5163 (Incremental_inputs_header_write): Remove.
5164 (Incremental_inputs_entry_data): Remove.
5165 (Incremental_inputs_entry): Remove.
5166 (Incremental_inputs_entry_write): Remove.
5167 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5168 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5169 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5170 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5171 Likewise.
5172 (Incremental_input_entry): New class.
5173 (Incremental_script_entry): New class.
5174 (Incremental_object_entry): New class.
5175 (Incremental_archive_entry): New class.
5176 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5177 (Incremental_inputs::report_inputs): Remove.
5178 (Incremental_inputs::report_archive): Remove.
5179 (Incremental_inputs::report_archive_begin): New function.
5180 (Incremental_inputs::report_archive_end): New function.
5181 (Incremental_inputs::report_object): Change prototype.
5182 (Incremental_inputs::report_input_section): New function.
5183 (Incremental_inputs::report_script): Change prototype.
5184 (Incremental_inputs::get_reloc_count): New function.
5185 (Incremental_inputs::set_reloc_count): New function.
5186 (Incremental_inputs::create_data_sections): New function.
5187 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5188 (Incremental_inputs::inputs_section): New function.
5189 (Incremental_inputs::symtab_section): New function.
5190 (Incremental_inputs::relocs_section): New function.
5191 (Incremental_inputs::get_stringpool): Add const.
5192 (Incremental_inputs::command_line): Add const.
5193 (Incremental_inputs::inputs): Remove.
5194 (Incremental_inputs::command_line_key): New function.
5195 (Incremental_inputs::input_file_count): New function.
5196 (Incremental_inputs::input_files): New function.
5197 (Incremental_inputs::relocs_entsize): New function.
5198 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5199 (Incremental_inputs::finalize_inputs): Remove.
5200 (Incremental_inputs::Input_info): Remove.
5201 (Incremental_inputs::lock_): Remove.
5202 (Incremental_inputs::inputs_): Change type.
5203 (Incremental_inputs::inputs_map_): Remove.
5204 (Incremental_inputs::current_object_entry_): New data member.
5205 (Incremental_inputs::inputs_section_): New data member.
5206 (Incremental_inputs::symtab_section_): New data member.
5207 (Incremental_inputs::relocs_section_): New data member.
5208 (Incremental_inputs::reloc_count_): New data member.
5209 (Incremental_inputs_reader): New class.
5210 (Incremental_symtab_reader): New class.
5211 (Incremental_relocs_reader): New class.
5212 * layout.cc (Layout::finalize): Move finalization of incremental info
5213 and creation of incremental info sections to follow finalization of
5214 symbol table. Set offsets for postprocessing sections.
5215 (Layout::create_incremental_info_sections): Call
5216 Incremental_inputs::create_data_sections. Add incremental symtab
5217 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5218 sections to layout after input sections.
5219 * layout.h (struct Timespec): Forward declaration.
5220 (Layout::incremental_inputs): Add const.
5221 (Layout::create_incremental_info_sections): Add parameter.
5222 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5223 * object.cc: Include incremental.h.
5224 (Relobj::finalize_incremental_relocs): New function.
5225 (Sized_relobj::do_layout): Record input sections in incremental info.
5226 * object.h (Object::output_section): New function.
5227 (Object::output_section_offset): Moved from Relobj.
5228 (Object::get_incremental_reloc_base): New function.
5229 (Object::get_incremental_reloc_count): New function.
5230 (Object::do_output_section): New function.
5231 (Object::do_output_section_offset): Moved from Relobj.
5232 (Object::do_get_incremental_reloc_base): New function.
5233 (Object::do_get_incremental_reloc_count): New function.
5234 (Object::Object): Initialize new data members.
5235 (Relobj::output_section): Renamed do_output_section and moved to
5236 protected.
5237 (Relobj::output_section_offset): Moved to Object.
5238 (Relobj::do_get_incremental_reloc_base): New function.
5239 (Relobj::do_get_incremental_reloc_count): New function.
5240 (Relobj::allocate_incremental_reloc_counts): New function.
5241 (Relobj::count_incremental_reloc): New function.
5242 (Relobj::finalize_incremental_relocs): New function.
5243 (Relobj::next_incremental_reloc_index): New function.
5244 (Relobj::reloc_counts_): New data member.
5245 (Relobj::reloc_bases_): New data member.
5246 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5247 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5248 (Sized_relobj::incremental_relocs_scan): New function.
5249 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5250 (Sized_relobj::incremental_relocs_write): New function.
5251 (Sized_relobj::incremental_relocs_write_reltype): New function.
5252 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5253 incremental link.
5254 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5255 archives and object files elsewhere.
5256 (Add_symbols::run): Report object files here.
5257 (Finish_group::run): Report end of archive at end of group.
5258 * reloc.cc: Include layout.h, incremental.h.
5259 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5260 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5261 (Sized_relobj::incremental_relocs_scan): New function.
5262 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5263 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5264 (Sized_relobj::incremental_relocs_write): New function.
5265 (Sized_relobj::incremental_relocs_write_reltype): New function.
5266 * script.cc (read_input_script): Rewrite test for incremental link.
5267 Change call to Incremental_inputs::report_script.
5268 * symtab.h (Symbol_table::first_global_index): New function.
5269 (Symbol_table::output_count): New function.
5270
ce0d1972
DK
52712010-08-12 Doug Kwan <dougkwan@google.com>
5272
5273 * arm.cc (Target_arm::merge_object_attributes): Check command line
5274 options --no-wchar-size-warning and --no-enum-size-warning.
5275 * options.h (General_options): Add ld-compatible options
5276 --no-enum-size-warning and --no-wchar-size-warning.
5277
6e5710ce
ILT
52782010-08-04 Ian Lance Taylor <iant@google.com>
5279
5280 * x86_64.cc (Target_x86_64::Scan::local): Use
5281 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5282 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5283 (Target_x86_64::Scan::global): Likewise.
5284 (Target_x86_64::Relocate::relocate): Likewise.
5285 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5286 Likewise.
5287
fef830db
CC
52882010-08-03 Cary Coutant <ccoutant@google.com>
5289
5290 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5291 to reserve space in merged_strings vector. Keep total input size
5292 for stats.
5293 (Output_merge_string::do_print_merge_stats): Print total input size.
5294 * merge.h (Output_merge_string): Add input_size_ field.
5295 * stringpool.cc (Stringpool_template::string_length): Move
5296 implementations out of Stringpool_template class and place in
5297 stringpool.h.
5298 * stringpool.h (string_length): Move out of Stringpool_template.
5299
1e3811b0
ILT
53002010-08-03 Ian Lance Taylor <iant@google.com>
5301
5302 PR 11712
5303 * layout.cc (relaxation_loop_body): If address of load segment is
5304 set, adjust address to include headers if possible.
5305
7af0c620
ILT
53062010-08-03 Ian Lance Taylor <iant@google.com>
5307
5308 * version.cc (version_string): Bump to 1.10.
5309
22f0da72
ILT
53102010-08-03 Ian Lance Taylor <iant@google.com>
5311
5312 PR 11805
5313 * layout.h (enum Output_section_order): Define.
5314 (class Layout): Update declarations.
5315 * layout.cc (Layout::get_output_section): Add order parameter.
5316 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5317 is_first_non_relro parameters. Change all callers.
5318 (Layout::choose_output_section): Likewise.
5319 (Layout::add_output_section_data): Likewise.
5320 (Layout::make_output_section): Likewise. Set order.
5321 (Layout::default_section_order): New function.
5322 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5323 * output.cc (Output_section::Output_section): Initialize order_.
5324 Don't initialize deleted fields.
5325 (Output_segment::Output_segment): Don't initialize deleted
5326 fields.
5327 (Output_segment::add_output_section_to_load): New function
5328 replacing add_output_section. Change all callers to call this or
5329 add_output_section_to_nonload.
5330 (Output_segment::add_output_section_to_nonload): New function.
5331 (Output_segment::remove_output_section): Rewrite.
5332 (Output_segment::add_initial_output_data): Likewise.
5333 (Output_segment::has_any_data_sections): Likewise.
5334 (Output_segment::is_first_section_relro): Likewise.
5335 (Output_segment::maximum_alignment): Likewise.
5336 (Output_segment::has_dynamic_reloc): New function replacing
5337 dynamic_reloc_count. Change all callers.
5338 (Output_segment::has_dynamic_reloc_list): New function replacing
5339 dynamic_reloc_count_list. Change all callers.
5340 (Output_segment::set_section_addresses): Rewrite.
5341 (Output_segment::set_offset): Rewrite.
5342 (Output_segment::find_first_and_last_list): Remove.
5343 (Output_segment::set_tls_offsets): Rewrite.
5344 (Output_segment::first_section_load_address): Likewise.
5345 (Output_segment::output_section_count): Likewise.
5346 (Output_segment::section_with_lowest_load_address): Likewise.
5347 (Output_segment::write_section_headers): Likewise.
5348 (Output_segment::print_sections_to_map): Likewise.
5349 * output.h (class Output_data): Remove dynamic_reloc_count_
5350 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5351 (Output_data::add_dynamic_reloc): Rewrite.
5352 (Output_data::has_dynamic_reloc): New function.
5353 (Output_data::dynamic_reloc_count): Remove.
5354 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5355 is_last_relro_, is_first_non_relro_, is_interp_,
5356 is_dynamic_linker_section_ fields. Add order and set_order
5357 functions. Remove is_relro_local, set_is_relro_local,
5358 is_last_relro, set_is_last_relro, is_first_non_relro,
5359 set_is_first_non_relro functions, is_interp, set_is_interp,
5360 is_dynamic_linker_section, and set_is_dynamic_linker_section
5361 functions.
5362 (class Output_segment): Change Output_data_list from std::list to
5363 std:;vector. Add output_lists_ field. Remove output_data_ and
5364 output_bss_ fields. Update declarations.
5365
3ff2ccb0
ILT
53662010-08-02 Ian Lance Taylor <iant@google.com>
5367
5368 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5369 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5370 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5371
88a4108b
ILT
53722010-08-02 Ian Lance Taylor <iant@google.com>
5373
5374 PR 11855
5375 * script.cc (Script_options::Script_options): Initialize
5376 symbol_definitions_ and symbol_references_.
5377 (Script_options::add_symbol_assignment): Update
5378 symbol_definitions_ and symbol_references_.
5379 (Script_options::add_symbol_reference): New function.
5380 (script_symbol): New function.
5381 * script.h (class Script_options): Add symbol_definitions_ and
5382 symbol_references_ fields.
5383 (Script_options::referenced_const_iterator): New type.
5384 (Script_options::referenced_begin): New function.
5385 (Script_options::referenced_end): New function.
5386 (Script_options::is_referenced): New function.
5387 (Script_options::any_unreferenced): New function.
5388 * script-c.h (script_symbol): Declare.
5389 * yyscript.y (exp): Call script_symbol.
5390 * symtab.cc: Include "script.h".
5391 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5392 Change all callers. Check symbols referenced by scripts.
5393 (Symbol_table::add_undefined_symbols_from_command_line): Add
5394 layout parameter. Change all callers.
5395 (Symbol_table::do_add_undefined_symbols_from_command_line):
5396 Likewise. Break out loop body. Check symbols referenced by
5397 scripts.
5398 (Symbol_table::add_undefined_symbol_from_command_line): New
5399 function broken out of
5400 do_add_undefined_symbols_from_command_line.
5401 * symtab.h (class Symbol_table): Update declarations.
5402 * archive.cc: Include "layout.h".
5403 (Archive::should_include_member): Add layout parameter. Change
5404 all callers. Check for symbol mentioned in expression.
5405 * archive.h (class Archive): Update declaration.
5406 * object.cc (Sized_relobj::do_should_include_member): Add layout
5407 parameter.
5408 * object.h (Object::should_include_member): Add layout parameter.
5409 Change all callers.
5410 (Object::do_should_include_member): Add layout parameter.
5411 (class Sized_relobj): Update declaration.
5412 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5413 parameter.
5414 * dynobj.h (class Sized_dynobj): Update declaration.
5415 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5416 layout parameter.
5417 * plugin.h (class Sized_pluginobj): Update declaration.
5418
5f1ab67a
ILT
54192010-08-02 Ian Lance Taylor <iant@google.com>
5420
5421 PR 11866
5422 * output.cc (Output_segment::set_offset): Search for the first and
5423 last sections rather than assuming that the list is in order.
5424 (Output_segment::find_first_and_last_list): New function.
5425 * output.h (class Output_segment): Update declarations.
5426 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5427 (relro_strip_test_SOURCES): New variable.
5428 (relro_strip_test_DEPENDENCIES): New variable.
5429 (relro_strip_test_LDFLAGS): New variable.
5430 (relro_strip_test_LDADD): New variable.
5431 (relro_strip_test.so): New target.
5432
a8df5856
ILT
54332010-08-02 Ian Lance Taylor <iant@google.com>
5434
5435 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5436 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5437 (Target_i386::got_tlsdesc_section): New function.
5438 (Target_i386::got_section): Create space for GOT entries for
5439 TLSDESC relocations.
5440 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5441 R_386_TLS_GOTDESC.
5442 (Target_i386::Scan::global): Likewise.
5443 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5444 using TLSDESC GOT.
5445 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5446 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5447 (Target_x86_64::got_tlsdesc_section): New function.
5448 (Target_x86_64::got_section): Create space for GOT entries for
5449 TLSDESC relocations.
5450 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5451 R_386_TLS_GOTDESC.
5452 (Target_x86_64::Scan::global): Likewise.
5453 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5454 using TLSDESC GOT.
5455
0c10a0a6
ILT
54562010-08-02 Ian Lance Taylor <iant@google.com>
5457
5458 * testsuite/final_layout.sh: Use dc to convert from hex to
5459 decimal.
5460
41cbeecc
ST
54612010-07-29 Sriraman Tallam <tmsriram@google.com>
5462
5463 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5464 paramter to the call to gold::gc_process_relocs.
5465 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5466 paramter to the call to gold::gc_process_relocs.
5467 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5468 parameter to the call to gold::gc_process_relocs.
5469 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5470 template parameter to the call to gold::gc_process_relocs.
5471 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5472 paramter to the call to gold::gc_process_relocs.
5473 * gc.h (get_embedded_addend_size): New function.
5474 (gc_process_relocs): Save the size of the reloc for use by ICF.
5475 * icf.cc (get_section_contents): Get the addend from the text section
5476 for SHT_REL relocation sections.
5477 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5478 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5479 * int_encoding.h (read_from_pointer): New overloaded function.
5480 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5481 * testsuite/icf_sht_rel_addend_test.sh: New file.
5482 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5483 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5484
6ea55b82
RW
54852010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5486
5487 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5488 * Makefile.in: Regenerate.
5489 * testsuite/Makefile.in: Regenerate.
5490
9691462b
ILT
54912010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5492
5493 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5494 * gold/testsuite/debug_msg.cc: Likewise.
5495 * gold/testsuite/odr_violation1.cc
5496 * gold/testsuite/odr_violation2.cc
5497
76897331
CC
54982010-07-21 Cary Coutant <ccoutant@google.com>
5499
5500 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5501 string, and length fields.
5502 (Output_merge_string::Merged_strings_list): New type.
5503 (Output_merge_string::Merged_strings_lists): New typedef.
5504 (Output_merge_string): Replace merged_strings_ with
5505 merged_strings_lists_.
5506 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5507 Merged_strings_list per input object and section. Don't store pointer
5508 to the string. Don't store length with each merged string entry.
5509 (Output_merge_string::finalize_merged_data): Loop over list of merged
5510 strings lists. Recompute length of each merged string.
5511
78384e8f
CC
55122010-07-15 Cary Coutant <ccoutant@google.com>
5513
5514 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5515 here.
5516
783659f9
ILT
55172010-07-14 Ian Lance Taylor <iant@google.com>
5518
5519 * descriptors.cc (Descriptors::open): Report correct name in error
5520 message.
5521
131687b4
DK
55222010-07-13 Doug Kwan <dougkwan@google.com>
5523
5524 * arm.cc (Arm_input_section::Arm_input_section): For a
5525 SHT_ARM_EXIDX section, always keeps the input sections.
5526 (Arm_input_section::set_exidx_section_link): New method.
5527 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5528 has_errors_ to false.
5529 (Arm_exidx_input_section::has_errors,
5530 Arm_exidx_input_section::set_has_errors): New methods.
5531 (Arm_exidx_input_section::has_errors_): New data member.
5532 (Arm_relobj::get_exidx_shndx_list): New method.
5533 (Arm_output_section::append_text_sections_to_list): Do not skip
5534 section without SHF_EXECINSTR.
5535 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5536 errors.
2e702c99 5537 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5538 section header. Make error messages more verbose. Check for
5539 a non-executable section linked to an EXIDX section.
5540 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5541 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5542 check that there is no deferred EXIDX section if we exit early.
5543 Instead of not making an EXIDX section in case of an error, make one
5544 and set the has_errors flag of it.
5545 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5546 in a relocatable link.
5547 (Target_arm::do_relax): Look for the EXIDX output section instead of
5548 assuming that it is called .ARM.exidx.
2e702c99 5549 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5550 section list. Do not check for SHF_EXECINSTR section flags but
5551 skip any input section with errors.
5552 * output.cc (Output_section::Output_section): Initialize
5553 always_keeps_input_sections_ to false.
5554 (Output_section::add_input_section): Check for
5555 always_keeps_input_sections_.
5556 * output.h (Output_section::always_keeps_input_sections,
5557 Output_section::set_always_keeps_input_sections): New methods.
5558 (Output_section::always_keeps_input_sections): New data member.
5559
69517287
RÁE
55602010-07-13 Rafael Espindola <espindola@google.com>
5561
5562 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5563 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5564
82742395
ILT
55652010-07-13 Philip Herron <herron.philip@googlemail.com>
5566 Ian Lance Taylor <iant@google.com>
5567
5568 * output.h (Output_section_lookup_maps::add_merge_section):
5569 Correct check of whether value was inserted.
5570 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5571 (Output_section_lookup_maps::add_relaxed_input_section):
5572 Likewise.
5573 * arm.cc (Target_arm::got_section): Remove used local os.
5574 * i386.cc (Target_i386::got_section): Likewise.
5575 * x86_64.cc (Target_x86_64::got_section): Likewise.
5576 * sparc.cc (Target_sparc::got_section): Likewise.
5577 (Target_sparc::relocate): Remove unused local have_got_offset.
5578 * powerpc.cc (Target_powerpc::relocate): Likewise.
5579
f2d707b5
ILT
55802010-07-13 Ian Lance Taylor <iant@google.com>
5581
241531d6
ILT
5582 * compressed_output.cc (zlib_decompress): Fix signature in
5583 !HAVE_ZLIB_H case.
5584
f2d707b5
ILT
5585 * archive.cc (Archive::include_member): Unlock an external member
5586 of a thin archive. Don't bother to delete an object we know is
5587 NULL.
5588
a2e47362
CC
55892010-07-12 Cary Coutant <ccoutant@google.com>
5590
5591 * compressed_output.cc (zlib_decompress): New function.
5592 (get_uncompressed_size): New function.
5593 (decompress_input_section): New function.
5594 * compressed_output.h (get_uncompressed_size): New function.
5595 (decompress_input_section): New function.
5596 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5597 Handle compressed debug sections.
5598 * layout.cc (is_compressed_debug_section): New function.
5599 (Layout::output_section_name): Map compressed section names to
5600 canonical names.
5601 * layout.h (is_compressed_debug_section): New function.
5602 (is_debug_info_section): Recognize compressed debug sections.
5603 * merge.cc: Include compressed_output.h.
5604 (Output_merge_data::do_add_input_section): Handle compressed
5605 debug sections.
5606 (Output_merge_string::do_add_input_section): Handle compressed
5607 debug sections.
5608 * object.cc: Include compressed_output.h.
5609 (Sized_relobj::Sized_relobj): Initialize new data members.
5610 (build_compressed_section_map): New function.
5611 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5612 * object.h (Object::section_is_compressed): New method.
5613 (Object::do_section_is_compressed): New method.
5614 (Sized_relobj::Compressed_section_map): New type.
5615 (Sized_relobj::do_section_is_compressed): New method.
5616 (Sized_relobj::compressed_sections_): New data member.
5617 * output.cc (Output_section::add_input_section): Handle compressed
5618 debug sections.
5619 * reloc.cc: Include compressed_output.h.
5620 (Sized_relobj::write_sections): Handle compressed debug sections.
5621
ce279a62
CC
56222010-07-08 Cary Coutant <ccoutant@google.com>
5623
5624 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5625 weak when resolving to a dynamic def.
5626 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5627 for weak undef/dynamic def cases. Adjust callers.
5628 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5629 undef_binding_weak_.
5630 (Symbol_table::sized_write_globals): Adjust symbol binding.
5631 (Symbol_table::sized_write_symbol): Add binding parameter.
5632 * symtab.h (Symbol::set_undef_binding): New method.
5633 (Symbol::is_undef_binding_weak): New method.
5634 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5635 (Symbol_table::should_override): Add new parameter.
5636 (Symbol_table::sized_write_symbol): Add new parameter.
5637
5638 * testsuite/weak_undef_file1.cc: Add new test case.
5639 * testsuite/weak_undef_file2.cc: Fix header comment.
5640 * testsuite/weak_undef_test.cc: Add new test case.
5641
b2286c10
DK
56422010-06-29 Doug Kwan <dougkwan@google.com>
5643
5644 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5645 Initialize USE_SYMBOL_.
5646 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5647 definition.
5648 (Arm_reloc_property::uses_symbol_): New data member declaration.
5649 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5650 uses symbol value and symbol is undefined but not weakly undefined.
5651
4802450a
RÁE
56522010-06-28 Rafael Espindola <espindola@google.com>
5653
5654 * plugin.cc (Plugin::load): Use dlerror.
5655
e5ca47ba
ILT
56562010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5657
5658 * symtab.cc (detect_odr_violations): When reporting an ODR
5659 violation, report an object where the symbol is defined.
5660
8a75a161
DK
56612010-06-25 Doug Kwan <dougkwan@google.com>
5662
5663 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5664 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5665 definition.
5666 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5667 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5668 target hook to detect function points.
5669 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5670 * icf.h (Icf::check_section_for_function_pointers): Change type of
5671 parameter SECTION_NAME to const reference to std::string. Use
5672 target hook to determine if section may have unsafe pointers.
5673 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5674 method definition.
5675
42218b9f
RÁE
56762010-06-21 Rafael Espindola <espindola@google.com>
5677
5678 * fileread.cc (Input_file::find_fie): New
5679 (Input_file::open): Use Input_file::find_fie.
5680 * fileread.h (Input_file::find_fie): New
5681 * plugin.cc (set_extra_library_path): New.
5682 (Plugin::load): Add set_extra_library_path to the transfer vector.
5683 (Plugin_manager::set_extra_library_path): New.
5684 (Plugin_manager::add_input_file): Use the extra search path if set.
5685 (set_extra_library_path(): New.
5686 * plugin.h (Plugin_manager): Add set_extra_library_path and
5687 extra_search_path_.
5688
a0506cca
CC
56892010-06-19 Cary Coutant <ccoutant@google.com>
5690
5691 * layout.cc (gdb_sections): Add .debug_types.
5692 (lines_only_debug_sections): Likewise.
5693
6508b958
RÁE
56942010-06-18 Rafael Espindola <espindola@google.com>
5695
5696 * plugin.cc (add_input_file,add_input_library)
5697 (Plugin_manager::add_input_file): Make filename arguments const.
5698 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5699 const.
5700
3e235302
DK
57012010-06-16 Doug Kwan <dougkwan@google.com>
5702
5703 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5704 .ARM.attributes section if we have not merged any input
5705 attributes sections.
5706
106e8a6c
DK
57072010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5708
5709 * arm.cc: Allow combining objects with no EABI version
5710 information.
5711
91ff43fe
RÁE
57122010-06-15 Rafael Espindola <espindola@google.com>
5713
5714 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5715
68ed838c
ILT
57162010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5717
5718 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5719 (struct iovec): Correct !HAVE_READV definition.
5720
f3a2388f
CC
57212010-06-10 Cary Coutant <ccoutant@google.com>
5722
5723 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5724 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5725 reloc sections.
5726 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5727
5728 PR 11683
5729 * symtab.h (Symbol::is_placeholder): New member function.
5730 * target-reloc.h (relocate_section): Check for placeholder symbols.
5731
5732 * testsuite/Makefile.am (plugin_test_8): New test.
5733 (plugin_test_9): New test.
5734 * testsuite/Makefile.in: Regenerate.
5735
e1df38aa
NC
57362010-06-09 Nick Clifton <nickc@redhat.com>
5737
5738 * yyscript.y (input_list_element): Allow strings prefixed with
5739 the '-' character. Treat these as libraries.
5740 * script.cc (script_add_library): New function. Adds a library
5741 specified by "-l<name>" found in an input script.
5742 * script-c.h: Add prototype for script_add_library.
5743
25bbe950
DK
57442010-06-07 Doug Kwan <dougkwan@google.com>
5745
5746 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5747 Restrict stub-group size to be within long conditional branch
5748 range when working around cortex-A8 erratum.
5749
0f32ea4c
ILT
57502010-06-07 Damien Diederen <dd@crosstwine.com>
5751
5752 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5753 #ifdef typo.
5754
8fe2a369
ST
57552010-06-03 Sriraman Tallam <tmsriram@google.com>
5756
5757 PR gold/11658
5758 * output.cc
5759 (Output_section::Input_section_sort_entry::compare_section_ordering):
5760 Change to return non-zero correctly.
5761 (Output_section::Input_section_sort_section_order_index_compare
5762 ::operator()): Change to fix ambiguity in comparisons.
5763
6e9ba2ca
ST
57642010-06-01 Sriraman Tallam <tmsriram@google.com>
5765
5766 * gold.h (is_wildcard_string): New function.
5767 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5768 (Layout::layout_eh_frame): Ditto.
5769 (Layout::find_section_order_index): New method.
5770 (Layout::read_layout_from_file): New method.
5771 * layout.h (Layout::find_section_order_index): New method.
5772 (Layout::read_layout_from_file): New method.
5773 (Layout::input_section_position_): New private member.
5774 (Layout::input_section_glob_): New private member.
5775 * main.cc (main): Call read_layout_from_file here.
5776 * options.h (--section-ordering-file): New option.
5777 * output.cc (Output_section::input_section_order_specified_): New
5778 member.
5779 (Output_section::Output_section): Initialize new member.
5780 (Output_section::add_input_section): Add new parameter.
5781 Keep input sections when --section-ordering-file is used.
5782 (Output_section::set_final_data_size): Sort input sections when
5783 section ordering file is specified.
5784 (Output_section::Input_section_sort_entry): Add new parameter.
5785 Check sorting type.
5786 (Output_section::Input_section_sort_entry::compare_section_ordering):
5787 New method.
5788 (Output_section::Input_section_sort_compare::operator()): Change to
5789 consider section_order_index.
5790 (Output_section::Input_section_sort_init_fini_compare::operator()):
5791 Change to consider section_order_index.
5792 (Output_section::Input_section_sort_section_order_index_compare
5793 ::operator()): New method.
5794 (Output_section::sort_attached_input_sections): Change to sort
5795 according to section order when specified.
e1df38aa
NC
5796 (Output_section::add_input_section<32, true>): Add new parameter.
5797 (Output_section::add_input_section<64, true>): Add new parameter.
5798 (Output_section::add_input_section<32, false>): Add new parameter.
5799 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5800 * output.h (Output_section::add_input_section): Add new parameter.
5801 (Output_section::input_section_order_specified): New
5802 method.
5803 (Output_section::set_input_section_order_specified): New method.
5804 (Input_section::Input_section): Initialize section_order_index_.
5805 (Input_section::section_order_index): New method.
5806 (Input_section::set_section_order_index): New method.
5807 (Input_section::section_order_index_): New member.
5808 (Input_section::Input_section_sort_section_order_index_compare): New
5809 struct.
5810 (Output_section::input_section_order_specified_): New member.
5811 * script-sections.cc (is_wildcard_string): Delete and move modified
5812 method to gold.h.
5813 (Output_section_element_input::Output_section_element_input): Modify
5814 call to is_wildcard_string.
5815 (Output_section_element_input::Input_section_pattern
5816 ::Input_section_pattern): Ditto.
5817 (Output_section_element_input::Output_section_element_input): Ditto.
5818 * testsuite/Makefile.am (final_layout): New test case.
5819 * testsuite/Makefile.in: Regenerate.
5820 * testsuite/final_layout.cc: New file.
5821 * testsuite/final_layout.sh: New file.
5822
3537c84b
RÁE
58232010-06-01 Rafael Espindola <espindola@google.com>
5824
5825 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5826
105b6afd
RÁE
58272010-06-01 Rafael Espindola <espindola@google.com>
5828
5829 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5830 visibility of symbols.
5831
29e11421
DK
58322010-05-27 Doug Kwan <dougkwan@google.com>
5833
5834 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5835 from start of output section instead of address for a local symbol
5836 in a merged or relaxed section when doing a relocatable link.
5837
5e0f337e
RÁE
58382010-05-26 Rafael Espindola <espindola@google.com>
5839
703d02da 5840 PR 11604
5e0f337e
RÁE
5841 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5842 adding sections the garbage collector removed.
5843 * gold/testsuite/Makefile.am: Add test.
5844 * gold/testsuite/Makefile.in: Regenerate.
5845 * gold/testsuite/plugin_test_7.sh: New.
5846 * gold/testsuite/plugin_test_7_1.c: New.
5847 * gold/testsuite/plugin_test_7_2.c: New.
5848
f4187277
RÁE
58492010-05-26 Rafael Espindola <espindola@google.com>
5850
5851 * script-sections.cc (Output_section_definition::set_section_addresses):
5852 Check for --section-start.
5853
5c388529
DK
58542010-05-26 Doug Kwan <dougkwan@google.com>
5855
5856 * arm.cc (Arm_scan_relocatable_relocs): New class.
5857 (Target_arm::relocate_special_relocatable): New method.
5858 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5859 (Arm_relocate_functions::thumb_branch_common): Same.
5860 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5861 instead of Default_scan_relocatable_relocs.
5862 * target-reloc.h (relocate_for_relocatable): Let target handle
5863 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5864 * target.h (Sized_target::relocate_special_relocatable): New method.
5865
bca1c3ae
ILT
58662010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5867
5868 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5869
0439c796
DK
58702010-05-23 Doug Kwan <dougkwan@google.com>
5871
5872 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5873 instead of a cast.
5874 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5875 with a direct branch, not a conditional branch, to a stub.
5876 * merge.cc (Output_merge_base::record_input_section): New method
5877 defintion.
5878 (Output_merge_data::do_add_input_section): Record input section if
5879 keeps-input-sections flag is set.
5880 (Output_merge_string::do_add_input_section): Ditto.
5881 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5882 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5883 INPUT_SECTIONS_.
5884 (Output_merge_base::keeps_input_sections,
5885 Output_merge_base::set_keeps_input_sections,
5886 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5887 method definitions.
5888 (Output_merge_base::Input_sections): New type declaration.
5889 (Output_merge_base::input_sections_begin,
5890 Output_merge_base::input_sections_end,
5891 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5892 (Output_merge_base::bool keeps_input_sections_,
5893 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5894 Output_merge_base::input_sections_): New data members.
5895 (Output_merge_data::do_set_keeps_input_sections): New method
5896 defintion.
5897 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5898 * output.cc (Output_section::Input_section::relobj): Move method
5899 defintion from class declaration to here and handle merge sections.
5900 (Output_section::Input_section::shndx): Ditto.
5901 (Output_section::Output_section): Remove initializations of removed
5902 data members and initialize new data member LOOKUP_MAPS_.
5903 (Output_section::add_input_section): Set keeps-input-sections flag
5904 for a newly created merge output section as appropriate. Adjust code
5905 to use Output_section_lookup_maps class.
5906 (Output_section::add_relaxed_input_section): Adjst code for lookup
5907 maps code refactoring.
2e702c99 5908 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5909 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5910 class. If adding input section to a newly created merge output
5911 section fails, remove the new merge section.
5912 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5913 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5914 (Output_section::find_merge_section): Ditto.
0439c796 5915 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5916 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5917 Output_section_lookup_maps class.
5918 (Output_section::get_input_sections): Export merge sections. Adjust
5919 code to use Output_section_lookup_maps class.
5920 (Output_section:::add_script_input_section): Adjust code to use
5921 Output_section_lookup_maps class. Update lookup maps for merge
5922 sections also.
5923 (Output_section::discard_states): Use Output_section_lookup_maps.
5924 (Output_section::restore_states): Same.
5925 * output.h (Merge_section_properties): Move class defintion out of
5926 Output_section.
5927 (Output_section_lookup_maps): New class.
5928 (Output_section::Input_section::is_merge_section): New method
5929 defintion.
5930 (Output_section::Input_section::relobj): Move defintion out of class
5931 defintion. Declare method only.
5932 (Output_section::Input_section::shndx): Ditto.
5933 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5934 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5935 (Output_section::Merge_section_by_properties_map,
5936 Output_section::Output_section_data_by_input_section_map,
5937 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5938 Remove types.
2e702c99 5939 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5940 KEEPS_INPUT_SECTIONS.
5941 (Output_section::build_lookup_maps): New method declaration.
5942 (Output_section::merge_section_map_,
5943 Output_section::merge_section_by_properties_map_,
5944 Output_section::relaxed_input_section_map_,
5945 Output_section::is_relaxed_input_section_map_valid_): Remove data
5946 members.
5947 (Output_section::lookup_maps_): New data member.
5948
76295588
L
59492010-05-21 Doug Kwan <dougkwan@google.com>
5950
5951 PR gold/11619
5952 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5953 avoid a compilation error.
5954
d103a984
RÁE
59552010-05-19 Rafael Espindola <espindola@google.com>
5956
5957 * script-sections.cc (Output_section_definition::allocate_to_segment):
5958 Update the phdrs_list even when the output section is NULL.
5959 * testsuite/Makefile.am: Add test.
5960 * testsuite/Makefile.in: Regenerate.
5961 * testsuite/script_test_9.cc: New.
5962 * testsuite/script_test_9.sh: New.
5963 * testsuite/script_test_9.t: New.
5964
6625d24e
DK
59652010-05-19 Doug Kwan <dougkwan@google.com>
5966
5967 * arm.cc (Arm_input_section::original_size): New method.
5968 (Arm_input_section::do_addralign): Add a cast.
5969 (Arm_input_section::do_output_offset): Remove static cast.
5970 (Arm_input_section::original_addralign,
5971 Arm_input_section::original_size_): Change type to uint32_t.
5972 (Arm_input_section::init): Add safe casts for section alignment
5973 and size.
5974 (Arm_input_section::set_final_data_size): Do not set address and
5975 offset of stub table.
5976 (Arm_output_section::fix_exidx_coverage): Change use of of
5977 Output_section::Simple_input_section to that of
5978 Output_section::Input_section.
5979 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5980 except for the first pass.
5981 * output.cc (Output_section::get_input_sections): Change type of
5982 input_sections to std::list<Input_section>.
5983 (Output_section::add_script_input_section): Rename from
5984 Output_section::add_simple_input_section. Change type of SIS
5985 parameter from Simple_input_section to Input_section.
5986 * output.h (Output_section::Simple_input_section): Remove class.
5987 (Output_section::Input_section): Change class visibility to public.
5988 (Output_section::Input_section::addralign): Use stored alignments
5989 for special input sections if set.
5990 (Output_section::Input_section::set_addralign): New method.
5991 (Output_section::get_input_sections): Change parameter type from
5992 list of Simple_input_section to list of Input_section.
5993 (Output_section::add_script_input_section): Rename from
5994 Output_section::add_simple_input_section. Change first parameter's
5995 type from Simple_input_section to Input_section and remove the
5996 second and third parameters.
5997 * script-sections.cc (Input_section::Input_section_list): Change
5998 type to list of Output_section::Input_section/
5999 (Input_section_info::Input_section_info): Change parameter type of
6000 INPUT_SECTION to Output_section::Input_section.
6001 (Input_section_info::input_section): Change return type.
6002 (Input_section_info::input_section_): Change type to
6003 Output_section::Input_section.
6004 (Output_section_element_input::set_section_addresses): Adjust code
6005 to use Output_section::Input_section instead of
6006 Output_section::Simple_input_section. Adjust code for renaming
6007 of Output_section::add_simple_input_section.
6008 (Orphan_output_section::set_section_addresses): Ditto.
6009
e1e82ea4
RW
60102010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6011
6012 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
6013 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
6014
91e75c8a
RÁE
60152010-05-18 Rafael Espindola <espindola@google.com>
6016
6017 * options.cc (General_options::finalize): Handle -nostdlib.
6018 * options.h (nostdlib): New option.
6019 * script.cc (script_add_search_dir): Handle -nostdlib.
6020
da59ad79
DK
60212010-05-12 Doug Kwan <dougkwan@google.com>
6022
6023 * arm.cc (Target_arm::do_finalize_sections): Create an empty
6024 attributes section only if there no attributes section after merging.
6025 (Target_arm::merge_object_attributes): Move value of
e1df38aa 6026 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
6027 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
6028 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
6029 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
6030 and arm_attr_merge_7.stdout.
6031 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
6032 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
6033 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
6034 arm_attr_merge_7b.o): New rules.
6035 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
6036 arm_attr_merge_7
6037 * testsuite/Makefile.in: Regenerate.
6038 * testsuite/arm_attr_merge.sh: New file.
6039 * testsuite/arm_attr_merge_[67][ab].s: Same.
6040
3e01a7fd
NC
60412010-05-05 Nick Clifton <nickc@redhat.com>
6042
6043 * po/es.po: Updated Spanish translation.
6044
7ad2014a
L
60452010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6046
6047 * Makefile.am (install-exec-local): Properly install gold as
6048 default cross linker.
6049 * Makefile.in: Regenerated.
6050
4fda8867
NC
60512010-04-27 H.J. Lu <hongjiu.lu@intel.com>
6052 Nick Clifton <nickc@redhat.com>
6053
6054 * configure.ac (install_as_default): Define and set to false
6055 unless --enable-gold or --enable-gold=both/gold has been
6056 specified.
6057 * configure: Regenerate.
6058
6059 * Makefile.am (install-exec-local): Install the executable as
6060 'ld.gold'. If install_as_default is true then also install it as
6061 'ld'.
6062 * Makefile.in: Regenerated.
6063
bd288ea2
ILT
60642010-04-24 Ian Lance Taylor <iant@google.com>
6065
6066 * layout.cc (Layout::layout_reloc): In relocatable link don't
6067 combine reloc sections for grouped sections.
6068
ef38fd8a
ST
60692010-04-23 Sriraman Tallam <tmsriram@google.com>
6070
6071 * gc.h (gc_process_relocs): Pass information on relocs pointing to
6072 sections that are not ordinary to icf.
6073 * icf.cc (get_section_contents): Handle relocation pointing to section
6074 with no object or shndx information.
6075 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
6076 * testsuite/Makefile.in: Regenerate.
6077 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6078 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6079
f6973bdc
ILT
60802010-04-22 Ian Lance Taylor <iant@google.com>
6081
6082 * expression.cc (Expression::Expression_eval_info): Add
6083 result_alignment_pointer field.
6084 (Expression::eval_with_dot): Add result_alignment_pointer
6085 parameter. Change all callers.
6086 (Expression::eval_maybe_dot): Likewise.
6087 (class Binary_expression): Add alignment_pointer parameter to
6088 left_value and right_value. Change all callers.
6089 (BINARY_EXPRESSION): Set result alignment.
6090 (class Trinary_expression): Add alignment_pointer parameter to
6091 arg2_value and arg3_value. Change all callers.
6092 (Trinary_cond::value): Set result alignment.
6093 (Max_expression::value, Min_expression::value): Likewise.
6094 (Align_expression::value): Likewise.
6095 * script-sections.cc (class Sections_element): Add dot_alignment
6096 parameter to set_section_addresses virtual function. Update
6097 instantiations.
6098 (class Output_section_element): Likewise.
6099 (Script_sections::create_segments): Add dot_alignment parameter.
6100 Change all callers.
6101 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6102 (Script_sections::set_phdrs_clause_addresses): Likewise.
6103 * script-sections.h: Update declarations.
6104 * script.h: Update declarations.
6105 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6106 min_p_align.
6107 * testsuite/script_test_3.t: Set large alignment.
6108 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6109 segment has expected alignment.
6110
9c9c98a5
NC
61112010-04-22 Nick Clifton <nickc@redhat.com>
6112
6113 * po/gold.pot: Updated by the Translation project.
6114 * po/vi.po: Updated Vietnamese translation.
6115
2253bfba
L
61162010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6117
6118 * testsuite/Makefile.am (check_PROGRAMS): Add
6119 icf_virtual_function_folding_test.
6120 * testsuite/Makefile.in: Regenerated.
6121
85fdf906
AH
61222010-04-15 Andrew Haley <aph@redhat.com>
6123
6124 * options.h (merge_exidx_entries): New option.
6125 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6126 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6127 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6128 (Target_arm::merge_exidx_entries): New function.
6129 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6130 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6131 to Arm_exidx_fixup constructor.
6132 Add new arg, merge_exidx_entries.
6133 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6134 Arm_output_section::fix_exidx_coverage.
6135
ce97fa81
ST
61362010-04-18 Sriraman Tallam <tmsriram@google.com>
6137
6138 * icf.cc (get_section_contents): Check for preemptible functions.
6139 Ignore addend when appropriate.
6140 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6141 section folded.
6142 (add_from_relobj): Check for section folded.
6143 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6144 * symtab.h (should_add_dynsym_entry): Add new parameter.
6145 * target-reloc.h (scan_relocs): Check for section folded.
6146 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6147 Check reloc types for function pointers in shared objects.
6148 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6149 case.
6150 (icf_preemptible_functions_test): New test case.
6151 (icf_string_merge_test): New test case.
6152 * testsuite.Makefile.in: Regenerate.
6153 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6154 bar_glob. Refactor code.
6155 * testsuite/icf_preemptible_functions_test.cc: New file.
6156 * testsuite/icf_preemptible_functions_test.sh: New file.
6157 * testsuite/icf_string_merge_test.cc: New file.
6158 * testsuite/icf_string_merge_test.sh: New file.
6159 * testsuite/icf_virtual_function_folding_test.cc: New file.
6160 * testsuite/icf_virtual_function_folding_test.sh: New file.
6161
04ceb17c
DK
61622010-04-14 Doug Kwan <dougkwan@google.com>
6163
6164 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6165 for local symbol recounting if we remove a section due to ICF.
6166 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6167 there are no regular objects in input.
6168
153e7da4
DK
61692010-04-13 Doug Kwan <dougkwan@google.com>
6170
6171 * arm.cc (Arm_input_section::set_final_data_size): Compute
6172 accurate final data size instead of using current data size.
6173
4dbd9faf
DK
61742010-04-09 Doug Kwan <dougkwan@google.com>
6175
6176 * layout.cc (Layout::choose_output_section): Handle script section
6177 types.
6178 (Layout::make_output_section_for_script): Add section type parameter.
6179 Handle script section types.
6180 * layout.h (Layout::make_output_section_for_script): Add section
6181 type parameter.
6182 * output.cc (Output_section::Output_section): Initialize data member
6183 is_noload_.
6184 (Output_section::do_reset_address_and_file_offset): Do not set address
6185 to 0 if section is a NOLOAD section.
6186 * output.h (Output_section::is_noload): New method.
6187 (Output_section::set_is_noload): Ditto.
6188 (Output_section::is_noload_): New data member.
6189 * script-c.h (Script_section_type): New enum type.
6190 (struct Parser_output_section_header): Add new file section_type.
6191 * script-sections.cc (Sections_element::output_section_name): Add
6192 parameter for returning script section type.
6193 (Output_section_definition::output_section_name): Ditto.
6194 (Output_section_definition::section_type)P; New method.
6195 (Output_section_definiton::script_section_type_name): Ditto.
6196 (Output_section_definition::script_section_type_): New data member.
6197 (Output_section_definition::Output_section_definition): Initialize
6198 data member Output_section_definition::script_section_type_.
6199 (Output_section_definition::create_sections): Pass script section type
6200 to Layout::make_output_section_for_script.
6201 (Output_section_definition::output_section_name): Return script
6202 section type to caller.
6203 (Output_section_definition::set_section_address): Do not advance
6204 dot value and load address if section type is NOLOAD. Set address
6205 of NOLOAD sections regardless of section flags.
6206 (Output_section_definition::print): Print section type if it is
6207 not SCRIPT_SECTION_TYPE_NONE.
6208 (Output_section_definition::section_type): New method.
6209 (Output_section_definition::script_section_type_name): Ditto.
6210 (Script_sections::output_section_name): Add new parameter
6211 PSECTION_TYPE for returning script section type. Pass it to
6212 section elements. Handle discard sections.
6213 (Sort_output_sections::operator()): Handle NOLOAD sections.
6214 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6215 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6216 returning script section type.
6217 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6218 INFO and NOLOAD.
6219 * yyscript.y (union): Add new field SECTION_TYPE.
6220 (COPY, DSECT, INFO, NOLOAD): New tokens.
6221 (opt_address_and_section_type): Change type to output_section_header.
6222 (section_type): New non-terminal
6223 (section_header): Handle section type.
2253bfba 6224 (opt_address_and_section_type): Return section type value.
4dbd9faf 6225
721ea635
L
62262010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6227
6228 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6229 * testsuite/plugin_common_test_2.c (foo): Likewise.
6230
6bf924b0
DK
62312010-04-08 Doug Kwan <dougkwan@google.com>
6232
6233 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6234 Output_merge_data.
6235 * output.cc (Output_section::add_merge_input_section): Simplify
6236 code and return status of Output_merge_base::add_input_section.
e1df38aa 6237 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6238 returns true.
6239
24af6f92
DK
62402010-04-07 Doug Kwan <dougkwan@google.com>
6241
6242 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6243 if section is marked as containing instructions but has no mapping
6244 symbols.
6245 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6246 correct section index.
6247 (Arm_relobj::find_linked_text_section): Ditto.
6248
00698fc5
CC
62492010-04-07 Cary Coutant <ccoutant@google.com>
6250
6251 * archive.cc (include_member): Destroy Read_symbols_data object before
6252 releasing file.
6253 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6254 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6255 (Read_symbols_data::~Read_symbols_data) New destructor.
6256 (Section_relocs::Section_relocs) New constructor.
6257 (Section_relocs::~Section_relocs) New destructor.
6258 (Read_relocs_data::Read_relocs_data) New constructor.
6259 (Read_relocs_data::~Read_relocs_data) New destructor.
6260 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6261 pointers to NULL after deleting.
6262
7296d933
DK
62632010-04-07 Doug Kwan <dougkwan@google.com>
6264
6265 * arm.cc: Replace "endianity" with "endianness" in comments.
6266 (Arm_exidx_cantunwind): Ditto.
6267 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6268 (Arm_relobj::merge_flags_and_attributes): New method.
6269 (Arm_relobj::merge_flags_and_attributes_): New data member.
6270 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6271 (Arm_relobj::scan_sections_for_stubs): Ditto.
6272 (Arm_relobj::do_read_symbols): Check to see if we really want to
6273 merge processor-specific flags and attributes. Exit early if
6274 an object is empty except for section names and the undefined symbol.
6275 (Target_arm::do_finalize_sections): Move check for ELF format to
6276 Arm_relobj::do_read_symbols. Merge processor specific flags and
6277 attributes from a regular object only when we have determined that
6278 it is aapropriate. Do not create an .ARM.attributes section in
6279 output if there is no regular input object.
6280 (Target_arm::merge_processor_specific_flags): Check
6281 --warn-mismatch before printing any error.
6282 (Target_arm::merge_object_attributes): Ditto.
6283 * gold.cc (queue_middle_tasks): Handle the case in which there is
6284 no regular object in input.
6285 * options.cc (General_options::parse_EB): New method.
6286 (General_options::parse_EL): Same.
6287 (General_options::General_options): Initialize endianness_.
6288 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6289 New options.
6290 (General_options::Endianness): New enum.
6291 (General_options::endianness): New method.
6292 (General_options::endianness_): New data member.
6293 * parameters.cc (Parameters::set_options): Check target endianness.
6294 (Parameters::set_target_once): Ditto.
6295 (Parameters::check_target_endianness): New method.
6296 (parameters_force_valid_target): If either -EL or -EB is specified,
6297 use it to define endianness of default target.
6298 * parameters.h (Parameters::check_target_endianness): New method
6299 declaration.
6300 * target.h (class Target): Change "endianity" to "endianness"
6301 in comments.
6302
efc8d4f2
RW
63032010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6304
6305 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6306 * configure: Regenerate.
6307 * Makefile.in: Regenerate.
6308 * testsuite/Makefile.in: Regenerate.
6309
be234d88
CC
63102010-04-06 Cary Coutant <ccoutant@google.com>
6311
6312 gcc PR lto/42757
6313 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6314 prevailing definitions of common symbols.
6315 * testsuite/plugin_test_6.sh: New test case.
6316 * testsuite/plugin_common_test_1.c: New test case.
6317 * testsuite/plugin_common_test_2.c: New test case.
6318 * testsuite/Makefile.am (plugin_test_6): New test case.
6319 * testsuite/Makefile.in: Regenerate.
6320
bd32c6bd
NC
63212010-04-06 Nick Clifton <nickc@redhat.com>
6322
6323 * po/vi.po: New Vietnamese translation.
6324
323c532f
DK
63252010-03-30 Doug Kwan <dougkwan@google.com>
6326
6327 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6328
4fcd97eb
DK
63292010-03-25 Doug Kwan <dougkwan@google.com>
6330
6331 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6332 to avoid a conversion warning on a 32-bit host.
6333
4ebf39db
ILT
63342010-03-24 Ian Lance Taylor <iant@google.com>
6335
6336 * testsuite/script_test_3.t: Add a TLS segment.
6337 * testsuite/Makefile.am (check_PROGRAMS): Add
6338 tls_phdrs_script_test.
6339 (tls_phdrs_script_test_SOURCES): Define.
6340 (tls_phdrs_script_test_DEPENDENCIES): Define.
6341 (tls_phdrs_script_test_LDFLAGS): Define.
6342 (tls_phdrs_script_test_LDADD): Define.
6343 * testsuite/Makefile.in: Rebuild.
6344
4a599bdd
CC
63452010-03-23 Cary Coutant <ccoutant@google.com>
6346
6347 * fileread.cc (find_or_make_view): Fix comment.
6348
6c93b22c
ILT
63492010-03-23 Ian Lance Taylor <iant@google.com>
6350
6351 * script-sections.cc (class Orphan_section_placement): Define
6352 PLACE_TLS and PLACE_TLS_BSS.
6353 (Orphan_section_placement::Orphan_section_placement): Initialize
6354 new places.
6355 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6356 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6357 (tls_script_test_SOURCES): Define.
6358 (tls_script_test_DEPENDENCIES): Define.
6359 (tls_script_test_LDFLAGS): Define.
6360 (tls_script_test_LDADD): Define.
6361 * testsuite/Makefile.in: Rebuild.
6362
a2c7281b
DK
63632010-03-22 Doug Kwan <dougkwan@google.com>
6364
6365 * arm.cc (Arm_relocate_functions::abs8,
6366 Arm_relocate_functions::abs16): Use correct check for overflow
6367 specified in the ARM ELF specs.
6368 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6369 target of a BLX instruction specially.
6370 (Reloc_stub::stub_type_for_reloc): Ditto.
6371 (Relocate::relocate): Use symbolic names instead of numeric relocation
6372 codes to report error.
6373 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6374 workaround.
6375 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6376 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6377 thumb2_blx_out_of_range.stdout
6378 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6379 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6380 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6381 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6382 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6383 thumb2_blx_in_range, thumb2_blx_in_range.o,
6384 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6385 thumb2_blx_out_of_range.o): New rules.
2e702c99 6386 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6387 thumb2_blx_in_range and thumb2_blx_out_of_range.
6388 * testsuite/Makefile.in: Regenerate.
6389 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6390 * testsuite/thumb_blx_in_range.s: New file.
6391 * testsuite/thumb_blx_out_of_range.s: New file.
6392
b0193076
RÁE
63932010-03-22 Rafael Espindola <espindola@google.com>
6394
6395 * archive.cc (Should_include): Move to archive.h.
6396 (should_include_member): Make it a member of Archive.
6397 (Lib_group): New.
6398 (Add_lib_group_symbols): New.
6399 * archive.h: Include options.h.
6400 (Archive_member): Moved from Archive.
6401 (Should_include): Moved from archive.cc.
6402 (Lib_group): New.
6403 (Add_lib_group_symbols): New.
6404 * dynobj.cc (do_should_include_member): New.
6405 * dynobj.h (do_should_include_member): New.
6406 * gold.cc (queue_initial_tasks): Update call to queue.
6407 * main.cc (main): Print lib group stats.
6408 * object.cc (do_should_include_member): New.
6409 * object.h: Include archive.h.
6410 (Object::should_include_member): New.
6411 (Object::do_should_include_member): New.
6412 (Sized_relobj::do_should_include_member): New.
6413 * options.cc (General_options::parse_start_lib): New.
6414 (General_options::parse_end_lib): New.
6415 (Input_arguments::add_file): Handle lib groups.
6416 (Input_arguments::start_group): Check we are not in a lib.
6417 (Input_arguments::start_lib): New.
6418 (Input_arguments::end_lib): New.
6419 * options.h (General_options): Add start_lib and end_lib.
6420 (Input_argument::lib_): New.
6421 (Input_argument::lib): New.
6422 (Input_argument::is_lib): New.
6423 (Input_file_lib): New.
6424 (Input_arguments::in_lib_): New.
6425 (Input_arguments::in_lib): New.
6426 (Input_arguments::start_lib): New.
6427 (Input_arguments::end_lib_): New.
6428 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6429 in unused members as preempted.
6430 (Sized_pluginobj::do_should_include_member): New.
6431 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6432 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6433 return the blocker.
6434 (Read_symbols::do_whole_lib_group): New.
6435 (Read_symbols::do_lib_group): New.
6436 (Read_symbols::do_read_symbols): Handle lib groups.
6437 (Read_symbols::get_name): Handle lib groups.
6438 * readsyms.h (Read_symbols): Add an archive member pointer.
6439 (Read_symbols::do_whole_lib_group): New.
6440 (Read_symbols::do_lib_group): New.
6441 (Read_symbols::member_): New.
6442 * script.cc (read_input_script): Update call to queue_soon.
6443
d099120c
DK
64442010-03-19 Doug Kwan <dougkwan@google.com>
6445
6446 * arm.cc (Stub_table::Stub_table): Initialize new data members
6447 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6448 (Stub_table::add_reloc_stub): Assign stub offset and update
6449 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6450 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6451 New data members.
2e702c99 6452 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6453 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6454 instead of going over all reloc stubs.
2e702c99 6455 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6456 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6457 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6458 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6459 Stringpool_template::offset_.
6460 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6461 Stringpool_template::offset_ to zero.
6462
1aa37384
DK
64632010-03-15 Doug Kwan <dougkwan@google.com>
6464
6465 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6466 offset_.
6467 (Stringpool_template::new_key_offset): New method.
6468 (Stringpool_template::add_string): Assign offsets when adding new
6469 strings.
6470 (Stringpool_template::set_string_offsets): Do not set string offsets
6471 when not optimizing.
6472 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6473 member size_.
2e702c99
RM
6474 (Chunked_vector::clear): Clear size_.
6475 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6476 (Chunked_vector::size): Return size_.
6477 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6478 (Chunked_vector::size_): New data member.
1aa37384
DK
6479 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6480 (Stringpool_template::new_key_offset): New method declaration.
6481 (Stringpool_template::offset_): New data member.
6482
b672b057
RÁE
64832010-03-15 Rafael Espindola <espindola@google.com>
6484
6485 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6486 Add_symbols' constructor.
6487 * readsyms.h (Add_symbols): Remove the input_group member.
6488
b6848d3c
ILT
64892010-03-10 Ian Lance Taylor <iant@google.com>
6490
6491 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6492 target to ask whether a reference to a symbol requires a stack
6493 split.
6494 * target.h (Target::is_call_to_non_split): New function.
6495 (Target::do_is_call_to_non_split): Declare virtual function.
6496 * target.cc: Include "symtab.h".
6497 (Target::do_is_call_to_non_split): New function.
6498 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6499
a2a5469e
CC
65002010-03-10 Cary Coutant <ccoutant@google.com>
6501
6502 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6503 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6504 (File_read::open[2]): Add whole_file_view_ to list of views.
6505 (File_read::make_view): Remove test of whole_file_view_.
6506 (File_read::find_or_make_view): Create whole_file_view_ if
6507 necessary.
6508 (File_read::clear_views): Replace bool parameter with enum;
6509 adjust all callers. Don't delete views with permanent data;
6510 do delete cached views and views from archives if
6511 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6512 if clearing the corresponding view.
6513 * fileread.h (File_read::Clear_views_mode): New enum.
6514 (File_read::View::is_permanent_view): New method.
6515 (File_read::clear_views): Replace bool parameter
6516 with enum; adjust all callers.
6517 * options.h (General_options): Change keep_files_mapped option;
6518 add map_whole_files.
6519 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6520 releasing the file.
6521 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6522 the file.
6523
8861f32b
DM
65242010-03-10 David S. Miller <davem@davemloft.net>
6525
6526 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6527
d62d0f5f
ST
65282010-03-09 Sriraman Tallam <tmsriram@google.com>
6529
6530 * icf.cc (get_section_contents): Add '@' marker after processing the
6531 merge reloc.
6532
9177756d
DK
65332010-03-08 Doug Kwan <dougkwan@google.com>
6534
6535 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6536 due to a conversion warning.
6537 (Arm_relobj::update_output_local_symbol_count): Check for local
6538 symbol with unset output index.
6539
9e9e071b
ILT
65402010-03-05 Ian Lance Taylor <iant@google.com>
6541
6542 * options.h (class General_options): Add --spare-dynamic-tags.
6543 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6544 --spare-dynamic-tags.
6545
a81ee015
ILT
65462010-03-05 Ian Lance Taylor <iant@google.com>
6547
6548 * incremental.cc: Include "libiberty.h".
6549
44ec90b9
RO
65502010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6551
6552 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6553 function, is_info_ member.
6554 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6555 (Versions::Versions): Update caller.
6556 (Versions::define_base_version): Likewise.
6557 (Versions::add_def): Likewise.
6558
0897ed3b
ST
65592010-03-03 Sriraman Tallam <tmsriram@google.com>
6560
6561 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6562 (Scan::possible_function_pointer_reloc): New function.
6563 (Scan::local_reloc_may_be_function_pointer): Change to call
6564 possible_function_pointer_reloc.
6565 (Scan::global_reloc_may_be_function_pointer): Ditto.
6566 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6567 relocations in ".data.rel.ro._ZTV" section.
6568 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6569 * testsuite/icf_safe_so_test.cc: Ditto.
6570 * testsuite/icf_safe_test.cc: Ditto.
6571 * testsuite/icf_safe_test.sh: Ditto.
6572
d3bbad62
ILT
65732010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6574 Ian Lance Taylor <iant@google.com>
6575
6576 * target-reloc.h (relocate_section): Check the symbol table index
6577 for -1U before setting the local symbol index.
6578 (scan_relocatable_relocs): If copying the relocation, record that
6579 the local symbol is required.
6580 * object.h (Symbol_value::is_output_symtab_index_set): New
6581 function.
6582 (Symbol_value::may_be_discarded_from_output_symtab): New
6583 function.
6584 (Symbol_value::has_output_symtab_entry): New function.
6585 (Symbol_value::needs_output_symtab_entry): Remove.
6586 (Symbol_value::output_symtab_index): Make sure the symbol index is
6587 set.
6588 (Symbol_value::set_output_symtab_index): Make sure the symbol
6589 index is not set. Make sure the new index is valid.
6590 (Symbol_value::set_must_have_output_symtab_entry): New function.
6591 (Symbol_value::has_output_dynsym_entry): New function.
6592 (Symbol_value::set_output_dynsym_index): Make sure the new index
6593 is valid.
6594 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6595 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6596 local symbol if permitted.
6597 (Sized_relobj::do_finalize_local_symbols): Call
6598 is_output_symtab_index_set rather than needs_output_symtab_entry.
6599 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6600 rather than needs_output_symtab_entry. Call
6601 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6602 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6603 is_output_symtab_index_set rather than needs_output_symtab_entry.
6604 * testsuite/discard_locals_relocatable_test.c: New file.
6605 * testsuite/discard_locals_test.sh: Test -r.
6606 * testsuite/Makefile.am (check_DATA): Add
6607 discard_locals_relocatable_test1.syms,
6608 discard_local_relocatable_test2.syms.
6609 (MOSTLYCLEANFILES): Likewise. Also add
6610 discard_locals_relocatable_test1.lout and
6611 discard_locals_relocatable_test2.out.
6612 (discard_locals_relocatable_test1.syms): New target.
6613 (discard_locals_relocatable_test.o): New target.
6614 (discard_locals_relocatable_test1.out): New target.
6615 (discard_locals_relocatable_test2.syms): New target.
6616 (discard_locals_relocatable_test2.out): New target.
6617 (various): Add missing ../ld-new dependencies.
6618 * testsuite/Makefile.in: Rebuild.
6619
7e8ccf26
NC
66202010-03-03 Nick Clifton <nickc@redhat.com>
6621
6622 * po/fi.po: New Finnish translation.
6623
2a0ff005
DK
66242010-03-01 Doug Kwan <dougkwan@google.com>
6625
6626 * layout.cc (Layout::Layout): Force section types of .init_array*,
6627 .preinit_array* and .fini_array* sections.
6628 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6629 Fix check of return value of std::string::find.().
6630 (Output_section::Input_section_sort_compare::operator()): Remove
6631 comment about .init_array.
6632 (Output_section::Input_section_sort_init_fini_compare::operator()):
6633 New method.
6634 (Output_section::sort_attached_input_sections): Handle .init_array
6635 and .fini_array specially.
6636 * output.h (Output_section::Inut_section_sort_compare): Update
6637 comment.
6638 (Output_section::Input_section_sort_init_fini_compare): New struct.
6639
c3e4ae29
DK
66402010-02-26 Doug Kwan <dougkwan@google.com>
6641
6642 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6643 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6644 * testsuite/debug_msg.sh: Avoid matching source line number for
6645 use of global variable undef_int.
6646
2fd9ae7a
DK
66472010-02-26 Doug Kwan <dougkwan@google.com>
6648
6649 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6650 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6651 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6652 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6653 * options.cc (General_options::General_options): Initialize member
6654 fix_v4bx_.
6655 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6656 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6657 and rm_no_fix_v4bx.stdout
6658 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6659 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6660 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6661 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6662 and arm_no_fix_v4bx.
6663 * Makefile.in: Regenerate.
6664 * testsuite/arm_fix_v4bx.s: New file.
6665 * testsuite/arm_fix_v4bx.sh: Ditto.
6666
67ec7d0b
DK
66672010-02-24 Doug Kwan <dougkwan@google.com>
6668
6669 * arm.cc (Target_arm::got_section): Make the .got section the first
6670 non RELRO section in the data segment.
6671 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6672 suffixes of section names.
6673
10165461
DK
66742010-02-24 Doug Kwan <dougkwan@google.com>
6675
6676 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6677 flags and attributes merging if an input file is a binary file.
6678 * fileread.cc (Input_file::open): Record format of original file.
6679 * fileread.h (Input_file::Format): New enum type.
2e702c99 6680 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6681 (Input_file::format): New method definition.
6682 (Input_file::format_):: New data member.
6683
4a54abbb
DK
66842010-02-24 Doug Kwan <dougkwan@google.com>
6685
6686 * arm.cc (Arm_output_data_got): New class.
6687 (ARM_TCB_SIZE): New constant
6688 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6689 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6690 If user uses a script with a SECTIONS clause, issue only a warning
6691 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6692 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6693 garbage collection.
6694 (Target_arm::got_mode_index_entry): Handle static linking.
6695 (Target_arm::Scan::local): Ditto.
6696 (Target_arm::Scan::global): Ditto.
6697 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6698 all incorrectly implemented relocations.
e1df38aa 6699 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6700 Arm_output_section::fix_exidx_coverage.
6701 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6702 from ".ARM.exidx." and ".ARM.extab.".
6703
ca419a6f
ILT
67042010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6705
6706 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6707 section if it does not already exist.
6708 * attributes.cc (Attributes_section_data::Attributes_section_data):
6709 Don't crash if size is zero.
6710
135b9c78
ILT
67112010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6712 Ian Lance Taylor <iant@google.com>
6713
6714 * gold.cc (queue_middle_tasks): If no input files were opened,
6715 exit.
6716 * workqueue.h (Task_function::Task_function): Assert that there is
6717 a blocker.
6718
bb0bfe4f
DK
67192010-02-22 Doug Kwan <dougkwan@google.com>
6720
6721 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6722 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6723 types to avoid warnings due to different uint64_t implementations
6724 on different hosts.
6725
2a2b6d42
DK
67262010-02-21 Doug Kwan <dougkwan@google.com>
6727
6728 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6729 handling of the maximum backward branch offset.
2e702c99 6730 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6731 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6732 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6733 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6734 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6735 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6736 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6737 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6738 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6739 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6740 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6741 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6742 thumb2_bl_out_of_range.o): New rules.
6743 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6744 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6745 thumb2_bl_out_of_range
6746 * testsuite/Makefile.in: Regenerate.
6747 * testsuite/arm_bl_in_range.s: New file.
6748 * testsuite/arm_bl_out_of_range.s: Ditto.
6749 * testsuite/arm_branch_in_range.sh: Ditto.
6750 * testsuite/arm_branch_range.t: Ditto.
6751 * testsuite/thumb2_branch_range.t: Ditto.
6752 * testsuite/thumb_bl_in_range.s: Ditto.
6753 * testsuite/thumb_bl_out_of_range.s: Ditto.
6754 * testsuite/thumb_branch_range.t: Ditto.
6755
b487ad64
ST
67562010-02-20 Sriraman Tallam <tmsriram@google.com>
6757
6758 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6759 Add reloc offset information.
6760 * icf.cc (get_section_contents): Change iterators to point to the new
6761 vectors. Add reloc offset information to the contents.
6762 * icf.h (Icf::Sections_reachable_info): New typedef.
6763 (Icf::Sections_reachable_list): New typedef.
6764 (Icf::Offset_info): New typedef.
6765 (Icf::Reloc_info): New struct typedef.
6766 (Icf::Reloc_info_list): New typedef.
6767 (Icf::symbol_reloc_list): Delete method.
6768 (Icf::addend_reloc_list): Delete method.
6769 (Icf::section_reloc_list): Delete method.
6770 (Icf::reloc_info_list): New method.
6771 (Icf::reloc_info_list_): New member.
6772
f96accdf
DK
67732010-02-19 Doug Kwan <dougkwan@google.com>
6774
6775 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6776 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6777 * arm.cc (Arm_relocation_functions): New forward declaration.
6778 (Target_arm::Target_arm): Initialize new data members
6779 got_mod_index_offset_ and tls_base_symbol_defined_.
6780 (Target_arm::Relocate::relocate_tls): New method.
6781 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6782 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6783 New methods.
2e702c99 6784 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6785 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6786 (Target_arm::got_mod_index_offset_,
6787 Target_arm::tls_base_symbol_defined_): New data members.
6788 (Target_arm::Scan::local, Target::Scan::global,
6789 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6790 relocations.
6791
c8761b9a
DK
67922010-02-18 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6795 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6796 text section as a parameter becuase some broken tools may not set
6797 the link in section header.
6798 (Target_arm::has_got_section): New method.
6799 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6800 without any mapping symbol as data only. Remove warning.
6801 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6802 link in its section header, try to discover the link by inspecting the
6803 REL31 relocation at the beginning of the section.
6804 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6805 in error message.
6806 (Target_arm::Scan::global): Treat any reference to the symbol
6807 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6808
21bb3914
ST
68092010-02-12 Sriraman Tallam <tmsriram@google.com>
6810
6811 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6812 (Scan::global_reloc_may_be_function_pointer): New function.
6813 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6814 (Scan::global_reloc_may_be_function_pointer): New function.
6815 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6816 (Scan::global_reloc_may_be_function_pointer): New function.
6817 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6818 (Scan::global_reloc_may_be_function_pointer): New function.
6819 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6820 (Scan::global_reloc_may_be_function_pointer): New function.
6821 (Scan::possible_function_pointer_reloc): New function.
6822 (Target_x86_64::can_check_for_function_pointers): New function.
6823 * gc.h (gc_process_relocs): Scan relocation types to determine if
6824 function pointers were taken for targets that support it.
6825 * icf.cc (Icf::find_identical_sections): Include functions for
6826 folding in safe ICF whose pointer is not taken.
6827 * icf.h (Secn_fptr_taken_set): New typedef.
6828 (fptr_section_id_): New member.
6829 (section_has_function_pointers): New function.
6830 (set_section_has_function_pointers): New function.
6831 (check_section_for_function_pointers): New function.
6832 * options.h: Fix comment for safe ICF option.
6833 * target.h (can_check_for_function_pointers): New function.
6834 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6835 Modify icf_safe_test for X86-64.
6836 * testsuite/Makefile.in: Regenerate.
6837 * testsuite/icf_safe_so_test.cc: New file.
6838 * testsuite/icf_safe_so_test.sh: New file.
6839 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6840 (main): Change to take pointer to function kept_func_3.
6841 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6842 folding is done correctly for X86-64.
6843
0da6fa6c
DM
68442010-02-12 David S. Miller <davem@davemloft.net>
6845
6846 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6847 is_symbolless parameter.
6848 (Output_reloc<SHT_REL>::is_symbolless): New.
6849 (Output_reloc<SHT_REL>::is_symbolless_): New.
6850 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6851 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6852 (Output_reloc<SHT_RELA>::is_symbolless): New.
6853 (Output_data_reloc::add_global): Handle is_symbolless.
6854 (Output_data_reloc::add_global_relative): Likewise.
6855 (Output_data_reloc::add_local): Likewise.
6856 (Output_data_reloc::add_local_relative): Likewise.
6857 (Output_data_reloc::add_symbolless_global_addend): New.
6858 (Output_data_reloc::add_symbolless_local_addend): New.
6859 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6860 is_symbolless.
6861 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6862 instead of ->is_relative_
6863 (Output_reloc::write): Likewise.
6864 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6865 (Output_reloc::write_rel): Simplify.
6866
6867 * sparc.cc (Target_sparc::Scan::local): Use
6868 ->add_symbolless_local_addend as needed.
6869 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6870 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6871 based upon relocation offset.
6872
e4782e83
DK
68732010-02-11 Doug Kwan <dougkwan@google.com>
6874
6875 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6876 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6877 beginning of function.
6878 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6879 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6880 parameter is_32bit in calls to should_apply_static_reloc.
6881 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6882 (check_DATA): Add arm_abs_global.stdout.
6883 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6884 arm_abs_global.stdout): New rules.
6885 (MOSTLLYCLEANFILES): Add arm_abs_global
6886 * Makefile.in: Regenerate.
6887 * testsuite/arm_abs_global.s: New file.
6888 * testsuite/arm_abs_global.sh: Ditto.
6889 * testsuite/arm_abs_lib.s: Ditto.
6890
93ceb764
ILT
68912010-02-11 Ian Lance Taylor <iant@google.com>
6892
6893 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6894 Read_relocs task.
6895 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6896 Allocate_commons_task first.
6897 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6898 task, rather than symtab_lock_.
6899 (Gc_process_relocs::~Gc_process_relocs): New function.
6900 (Gc_process_relocs::is_runnable): Check this_blocker_.
6901 (Gc_process_relocs::locks): Use next_blocker_ rather than
6902 blocker_.
6903 (Scan_relocs::~Scan_relocs): New function.
6904 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6905 symtab_lock_.
6906 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6907 next_blocker_.
6908 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6909 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6910 constructor accordingly.
6911 (class Gc_process_relocs): Likewise.
6912 (class Scan_relocs): Likewise.
6913 * common.h (class Allocate_commons_task): Remove symtab_lock_
6914 field, and corresponding constructor parameter.
6915 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6916 symtab_lock_.
6917 (Allocate_commons_task::locks): Likewise.
6918
114dfbe1
ILT
69192010-02-11 Ian Lance Taylor <iant@google.com>
6920
6921 * gold-threads.h (class Once): Define.
6922 (class Initialize_lock): Rewrite as child of Once.
6923 * gold-threads.cc (class Once_initialize): Define.
6924 (once_pointer_control): New static variable.
6925 (once_pointer, once_arg): New static variables.
6926 (c_run_once): New static function.
6927 (Once::Once, Once::run_once, Once::internal_run): New functions.
6928 (class Initialize_lock_once): Remove.
6929 (initialize_lock_control): Remove.
6930 (initialize_lock_pointer): Remove.
6931 (initialize_lock_once): Remove.
6932 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6933 (Initialize_lock::initialize): Rewrite.
6934 (Initialize_lock::do_run_once): New function.
6935 * archive.cc (Archive::interpret_header): Only clear name if it is
6936 not already empty.
6937 * fileread.cc: Include "gold-threads.h"
6938 (file_counts_lock): New static variable.
6939 (file_counts_initialize_lock): Likewise.
6940 (File_read::release): Only increment counts when using --stats.
6941 Use a lock around the increment.
6942 * parameters.cc (class Set_parameters_target_once): Define.
6943 (set_parameters_target_once): New static variable.
6944 (Parameters::Parameters): Move here from parameters.h.
6945 (Parameters::set_target): Rewrite.
6946 (Parameters::set_target_once): New function.
6947 (Parameters::clear_target): Move here and rewrite.
6948 * parameters.h (class Parameters): Update declarations. Add
6949 set_parameters_target_once_ field.
6950 (Parameters::Parameters): Move to parameters.cc.
6951 (Parameters::clear_target): Likewise.
6952 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6953 task.
6954 (Start_group::~Start_group): New function.
6955 (Start_group::is_runnable): New function.
6956 (Start_group::locks, Start_group::run): New functions.
6957 (Finish_group::run): Change saw_undefined to size_t.
6958 * readsyms.h (class Start_group): Define.
6959 (class Finish_group): Change saw_undefined_ field to size_t.
6960 (Finish_group::Finish_group): Remove saw_undefined and
6961 this_blocker parameters. Change all callers.
6962 (Finish_group::set_saw_undefined): New function.
6963 (Finish_group::set_blocker): New function.
6964 * symtab.h (class Symbol_table): Change saw_undefined to return
6965 size_t. Change saw_undefined_ field to size_t.
6966 * target-select.cc (Set_target_once::do_run_once): New function.
6967 (Target_selector::Target_selector): Initialize set_target_once_
6968 field. Don't initialize lock_ and initialize_lock_ fields.
6969 (Target_selector::instantiate_target): Rewrite.
6970 (Target_selector::set_target): New function.
6971 * target-select.h (class Set_target_once): Define.
6972 (class Target_selector): Update declarations. Make
6973 Set_target_once a friend. Remove lock_ and initialize_lock_
6974 fields. Add set_target_once_ field.
6975
fa17a3f4
ILT
69762010-02-10 Ian Lance Taylor <iant@google.com>
6977
6978 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6979 queueing any tasks.
6980 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6981 (queue_middle_tasks): Add all blockers before queueing any tasks.
6982 (queue_final_tasks): Likewise.
6983 * token.h (Task_token::add_blockers): New function.
6984 * object.h (Input_objects::number_of_relobjs): New function.
6985
c7177d31
ILT
69862010-02-10 Ian Lance Taylor <iant@google.com>
6987
5de0e392
ILT
6988 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6989 shared, not if not position independent.
6990 * x86_64.cc (Relocate::relocate_tls): Likewise.
6991 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6992 (tls_pie_pic_test): New target.
6993 * testsuite/Makefile.in: Rebuild.
6994
c7177d31
ILT
6995 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6996 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6997 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6998 * testsuite/Makefile.in: Rebuild.
6999
684b268a
DM
70002010-02-09 David S. Miller <davem@davemloft.net>
7001
7002 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
7003 R_SPARC_RELATIVE using ->add_local_relative().
7004 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
7005
612a8d3d
DM
7006 * output.h (Output_data_dynamic::add_section_size): New method
7007 that takes two Output_data objects.
7008 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
7009 entry param. Handle it in initializers.
7010 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
7011 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
7012 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
7013 arg.
7014 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
7015 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
7016 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
7017 for dynrel_includes_plt.
7018 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7019 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7020 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
7021 before .rela.plt
7022 (Target_sparc::do_finalize_sections): Update to pass true for
7023 dynrel_includes_plt.
7024 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
7025 output before .rela.plt
7026 (Target_powerpc::do_finalize_sections): Update to pass true for
7027 dynrel_includes_plt when 32-bit.
7028
cb1be87e
DK
70292010-02-08 Doug Kwan <dougkwan@google.com>
7030
7031 * arm.cc (Arm_relobj::simple_input_section_output_address): New
7032 method.
7033 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
7034 Arm_relobj::scan_section_for_cortex_a8_stubs,
7035 Arm_relobj::do_relocation_section): Instead of calling
7036 Output_section::output_address, use faster
7037 Arm_relobj::simple_input_section_output_address.
7038
705b5121
DM
70392010-02-08 David S. Miller <davem@davemloft.net>
7040
7041 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
7042 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
7043 relocation helper function.
7044
024c4466
DM
7045 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
7046 just like R_SPARC_GOT{10,13,22}.
7047 (Target_sparc::Scan::local): Likewise.
7048 (Target_sparc::Relocate:relocate): Likewise.
7049
9109c078
ILT
70502010-02-06 Ian Lance Taylor <iant@google.com>
7051
7052 * configure.ac: Rewrite targetobjs duplicate removal code to use
7053 only shell constructs.
7054 * configure: Rebuild.
7055
cf846138
DK
70562010-02-05 Doug Kwan <dougkwan@google.com>
7057
7058 PR 11247
7059 * arm.cc (Arm_relobj::section_is_scannable): New method.
7060 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
7061 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
7062
6cfaf60b
DK
70632010-02-04 Doug Kwan <dougkwan@google.com>
7064
7065 PR 11247
7066 * arm-reloc-property.cc (cstdio): Include.
7067 * configure.ac (targetobjs): Remove duplicates.
7068 * configure: Regenerate.
7069 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
7070 big and little endian version for a given address size.
7071
5c57f1be
DK
70722010-02-03 Doug Kwan <dougkwan@google.com>
7073
7074 * arm-reloc-property.cc
7075 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7076 definition.
7077 * arm-reloc-property.h
7078 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7079 New method definition.
7080 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7081 declaration.
7082 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7083 overflow to N.
7084 (GOT_PREL): Change implemented to Y.
7085 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7086 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7087 (Arm_relocate_functions::movw_abs_nc): Remove method.
7088 (Arm_relocate_functions::movt_abs): Ditto.
7089 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7090 (Arm_relocate_functions::thm_movt_abs): Ditto.
7091 (Arm_relocate_functions::movw_rel_nc): Ditto.
7092 (Arm_relocate_functions::movw_rel): Ditto.
7093 (Arm_relocate_functions::movt_rel): Ditto.
7094 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7095 (Arm_relocate_functions:thm_movw_rel): Ditto.
7096 (Arm_relocate_functions:thm_movt_rel): Ditto.
7097 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7098 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7099 New method definitions.
7100 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7101 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7102 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7103 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7104 (Target_arm::Relocate::relocate): Check for non-static or
7105 unimplemented relocation code and exit early. Change calls to
7106 Target_arm::reloc_uses_thumb_bit and
7107 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7108 instead. Refactor code to handle similar relocations to increase
7109 code sharing. Remove check for unsupported relocation code in switch
7110 statement.
7111 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7112 relocation property table to find out size. Change error message to
7113 print out the name of a relocation code instead of the numeric value.
7114 (Target_arm::scan_reloc_for_stub): Use relocation property table
7115 instead of calling Target_arm::reloc_uses_thumb_bit().
7116
218c5831
DK
71172010-02-02 Doug Kwan <dougkwan@google.com>
7118
7119 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7120 types of relaxed input section.
7121
0d31c79d
DK
71222010-02-02 Doug Kwan <dougkwan@google.com>
7123
7124 * Makefile.am (HFILES): Add arm-reloc-property.h.
7125 (DEFFILES): New.
2e702c99
RM
7126 (TARGETSOURCES): Add arm-reloc-property.cc
7127 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7128 (libgold_a_SOURCES): $(DEFFILES)
7129 * Makefile.in: Regenerate.
7130 * arm-reloc-property.cc: New file.
7131 * arm-reloc-property.h: New file.
7132 * arm-reloc.def: New file.
7133 * arm.cc: Update comments.
7134 (arm-reloc-property.h): New included header.
7135 (arm_reloc_property_table): New global variable.
7136 (Target_arm::do_select_as_default_target): New method definition.
7137 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7138 arm-reloc-property to targ_extra_obj.
7139 * parameters.cc (set_parameters_target): Call
7140 Target::select_as_default_target().
7141 * target.h (Target::select_as_default_target): New method definition.
7142 (Target::do_select_as_default_target): Same.
7143
546c7457
DK
71442010-02-01 Doug Kwan <dougkwan@google.com>
7145
7146 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7147 first_output_text_section_.
7148 (Arm_exidx_fixup::first_output_text_section): New method definition.
7149 (Arm_exidx_fixup::first_output_text_section_): New data member.
7150 (Arm_exidx_fixup::process_exidx_section): Record the first text
7151 output section seen.
7152 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7153 and entsize in output section header.
7154
11b861d5
DK
71552010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7156
7157 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7158 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7159 (Arm_relocate_functions::thm_alu11): New Method.
7160 (Arm_relocate_functions::thm_pc8): New Method.
7161 (Arm_relocate_functions::thm_pc12): New Method.
7162 (Target_arm::Scan::local): Handle the relocations.
7163 (Target_arm::Scan::global): Likewise.
7164 (Target_arm::Relocate::relocate): Likewise.
7165 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7166
c9a2c125
DK
71672010-01-29 Doug Kwan <dougkwan@google.com>
7168
7169 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7170 of relocation types as ld.
7171
1521477a
DK
71722010-01-29 Doug Kwan <dougkwan@google.com>
7173
7174 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7175 to public.
7176 (Arm_relocate_functions::thumb_branch_common): Ditto.
7177 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7178 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7179 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7180 Arm_relocate_functions::jump24): Remove.
7181 (Target_arm::Relocate::relocate): Adjust code to call
7182 Arm_relocation_functions::arm_branch_common and
7183 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7184 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7185
e7eca48c
DK
71862010-01-29 Doug Kwan <dougkwan@google.com>
7187
7188 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7189 output_local_symbol_count_needs_update_.
7190 (Arm_relobj::output_local_symbol_count_needs_update,
7191 Arm_relobj::set_output_local_symbol_count_needs_update,
7192 Arm_relobj::update_output_local_symbol_count): New methods.
7193 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7194 member.
7195 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7196 of pointed function as in a R_ARM_PREL31 relocation.
7197 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7198 for output local symbol count updating.
7199 (Target_arm::do_relax): Update output local symbol counts in objects
7200 if necessary.
7201 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7202
02961d7e
ILT
72032010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7204
7205 * arm.cc: Added support for the ARM relocations:
7206 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7207 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7208 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7209 movw_prel_nc).
7210 (Arm_relocate_functions::movw_rel): New method.
7211 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7212 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7213 thm_movw_prel_nc).
7214 (Arm_relocate_functions::thm_movw_rel): New method.
7215 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7216 thm_movt_prel).
7217 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7218 relocations.
7219 (Target_arm::Scan::global): Likewise.
7220 (Target_arm::Relocate::relocate): Likewise.
7221 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7222 Likewise.
7223
b10d2873
ILT
72242010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7225
7226 * arm.cc: Added support for ARM group relocations.
7227 (Target_arm::reloc_needs_sym_origin): New method.
7228 (Arm_relocate_functions::calc_grp_kn): New method.
7229 (Arm_relocate_functions::calc_grp_residual): New method.
7230 (Arm_relocate_functions::calc_grp_gn): New method.
7231 (Arm_relocate_functions::arm_grp_alu): New Method.
7232 (Arm_relocate_functions::arm_grp_ldr): New Method.
7233 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7234 (Arm_relocate_functions::arm_grp_ldc): New Method.
7235 (Target_arm::Scan::local): Handle the ARM group relocations.
7236 (Target_arm::Scan::global): Likewise.
7237 (Target_arm::Relocate::relocate): Likewise.
7238 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7239 Likewise.
7240
2b328d4e
DK
72412010-01-26 Doug Kwan <dougkwan@google.com>
7242
7243 * arm.cc (set): Include.
7244 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7245 pointer type.
2e702c99 7246 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7247 (Arm_output_section::append_text_sections_to_list): New method.
7248 (Arm_output_section::fix_exidx_coverage): Ditto.
7249 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7250 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7251 Relobj::set_section_offset() instead of
7252 Sized_relobj::invalidate_section_offset().
2e702c99 7253 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7254 parameter for section headers. Ignore relocation sections for
7255 unallocated sections and EXIDX sections.
7256 (Target_arm::fix_exidx_coverage): New method.
7257 (Target_arm::output_section_address_less_than): New type.
7258 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7259 linked text section instead of the EXIDX section.
7260 (Arm_output_section::create_stub_group): Add an assertion to check
7261 that this is not an EXIDX output section.
7262 (Arm_output_section::append_text_sections_to_list): New method.
7263 (Arm_output_section::fix_exidx_coverage): Ditto.
7264 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7265 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7266 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7267 first pass.
7268 (Target_arm::fix_exidx_coverage): New method.
7269 * object.h (Relobj::set_output_section): New method.
7270 (Sized_relobj::invalidate_section_offset): Remove method.
7271 (Sized_relobj::do_invalidate_section_offset): Remove method.
7272 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7273
c7f3c371
DK
72742010-01-25 Doug Kwan <dougkwan@google.com>
7275
7276 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7277 Fix warning due to signed and unsigned comparison on a 32-bit host.
7278
8923b24c
DK
72792010-01-22 Doug Kwan <dougkwan@google.com>
7280
7281 * arm.cc (Target_arm::do_relax): Record an output section for section
7282 offset adjustment it contains any stub table that has changed.
7283 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7284 offsets in an output section if necessary.
7285 * output.cc (Output_section::Output_section): Initialize
7286 section_offsets_need_adjustments_.
7287 (Output_section::add_input_section_for_script): Renamed to
7288 Output_section::add_simple_input_section.
7289 (Output_section::save_states): Add a comment.
7290 (Output_section::discard_states): New method defintion.
7291 (Output_section::adjust_section_offsets): Same.
7292 * output.h (Output_section::add_input_section_for_script): Renamed to
7293 Output_section::add_simple_input_section.
7294 (Output_section::discard_states): New method declaration.
7295 (Output_section::adjust_section_offsets): Same.
7296 (Output_section::section_offsets_need_adjustment,
7297 Output_section::set_section_offsets_need_adjustment): New method
7298 definitions.
7299 (Output_section::section_offsets_need_adjustment_): New data member.
7300 * script-sections.cc
7301 (Output_section_element_input::set_section_address): Adjust code for
7302 renaming of Output_section::add_input_section_for_script.
7303 (Orphan_output_section::set_section_address): Same.
7304
9b2fd367
DK
73052010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7306
7307 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7308 Fix_v4bx enum values .
7309 * gold/options.h (General_options): New option definitions.
7310 (General_options::fix_v4bx): New method.
7311 (General_options::Fix_v4bx): New enum.
7312 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7313 (General_options::parse_fix_v4bx_interworking): New method.
7314
80d0d023
DK
73152010-01-22 Doug Kwan <dougkwan@google.com>
7316
7317 * arm.cc (Arm_exidx_fixup): New class.
7318
af2cdeae
DK
73192010-01-21 Doug Kwan <dougkwan@google.com>
7320
7321 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7322 classes.
7323 (Arm_exidx_section_offset_map): New type.
7324
993d07c1
DK
73252010-01-21 Doug Kwan <dougkwan@google.com>
7326
7327 * arm.cc (Arm_exidx_input_section): New class.
7328 (Arm_relobj::exidx_input_section_by_link,
7329 Arm_relobj::exidx_input_section_by_shndx,
7330 Arm_relobj::make_exidx_input_section): New methods.
7331 (read_arm_attributes_section): Remove.
7332 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7333 information about them.
7334 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7335 to here.
7336
5ac169d4
DK
73372010-01-20 Doug Kwan <dougkwan@google.com>
7338
7339 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7340 Input_section_specifier to Section_id.
7341 (Target_arm::new_arm_input_section: Adjust code for change of key
7342 type.
7343 (Target_arm::find_arm_input_section): Ditto.
7344 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7345 (Section_id): Remove.
7346 (Garbage_collection::Section_id_hash): Remove.
7347 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7348 (Section_id): Remove.
7349 (Icf::Section_id_hash): Remove.
7350 * object.h (Section_id, Const_section_id, Section_id_hash,
7351 Const_section_id_hash): New type definitions.
7352 * output.cc (Output_section::add_relaxed_input_section): Change to
7353 use Const_section_id instead of Input_section_specifier as key type.
7354 (Output_section::add_merge_input_section): Ditto.
7355 (Output_section::build_relaxation_map): Change to use Section_id
7356 instead of Input_section_specifier as key type.
2e702c99 7357 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7358 Ditto.
7359 (Output_section::convert_input_sections_to_relaxed_sections): Change
7360 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7361 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7362 (Output_section::find_relaxed_input_section): Ditto.
7363 * output.h (Input_section_specifier): Remove class.
7364 (Output_section::Output_section_data_by_input_section_map): Change
7365 key type to Const_section_id.
7366 (Output_section::Output_relaxed_input_section_by_input_section_map):
7367 Ditto.
7368 (Output_section::Relaxation_map): Change key type to Section_id.
7369
a2162063
ILT
73702010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7371
7372 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7373 (class Arm_v4bx_stub): New class.
7374 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7375 (Stub_factory::make_arm_v4bx_stub): New method.
7376 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7377 (Stub_table::empty): Handle v4bx stubs.
7378 (Stub_table::add_arm_v4bx_stub): New method.
7379 (Stub_table::find_arm_v4bx_stub): New method.
7380 (Arm_relocate_functions::v4bx): New method.
7381 (Target_arm::fix_v4bx): New method.
7382 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7383 (Stub_table::relocate_stubs): Likewise.
7384 (Stub_table::do_write): Likewise.
7385 (Stub_table::update_data_size_and_addralign): Likewise.
7386 (Stub_table::finalize_stubs): Likewise.
7387 (Target_arm::Scan::local): Likewise.
7388 (Target_arm::Scan::global): Likewise.
7389 (Target_arm::do_finalize_sections): Likewise.
7390 (Target_arm::Relocate::relocate): Likewise.
7391 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7392 Likewise.
7393 (Target_arm::scan_reloc_for_stub): Likewise.
7394 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7395
5696ab0b
ILT
73962010-01-19 Ian Lance Taylor <iant@google.com>
7397
7398 * output.cc (Output_section_headers::do_sized_write): Write large
7399 segment count to sh_info field.
7400 (Output_file_header::do_sized_write): For large segment count,
7401 write PN_XNUM to e_phnum field.
7402
800d0f56
ILT
74032010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7404
7405 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7406 (Arm_relocate_functions::thm_jump8): New function.
7407 (Arm_relocate_functions::thm_jump11): New function.
7408 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7409 R_ARM_THM_JUMP11.
7410 (Target_arm::Scan::global): Likewise.
7411 (Target_arm::Relocate::relocate): Likewise.
7412 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7413 Likewise.
7414
41263c05
DK
74152010-01-14 Doug Kwan <dougkwan@google.com>
7416
7417 * arm.cc (map, utility): Include headers.
7418 (Target_arm::apply_cortex_a8_workaround): New method.
7419 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7420 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7421 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7422 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7423 the --[no-]fix-cortex-a8 command line options.
7424 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7425 (Target_arm::relocate_stub): Use addend in instruction template.
7426 * options.h (DEFINE_bool): Set the user-set flag.
7427 (General_options): Add --[no-]-fix-cortex options.
7428 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7429 : Update fast look-up map after conversion.
41263c05 7430
459e9b03
ST
74312010-01-14 Sriraman Tallam <tmsriram@google.com>
7432
7433 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7434 in the first pass of do_layout.
7435
b521dfe4
DK
74362010-01-13 Doug Kwan <dougkwan@google.com>
7437
7438 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7439 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7440 apparent compiler problem of not folding static constant integral
7441 data members of elfcpp::Elf_sizes<32>.
7442
44272192
DK
74432010-01-13 Doug Kwan <dougkwan@google.com>
7444
7445 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7446 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7447 Arm_relobj::scan_section_for_cortex_a8_erratum,
7448 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7449 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7450 sections to scan for relocation stubs into a new method
7451 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7452 relocation and Cortex-A8 stub scanning.
7453 (Target_arm::do_relax): Force stubs to be after stubbed sections
7454 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7455 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7456 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7457
44b71ece
ILT
74582010-01-12 Ian Lance Taylor <iant@google.com>
7459
7460 * target-reloc.h (visibility_error): New inline function.
7461 (relocate_section): Call visibility_error.
7462 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7463 (MOSTLYCLEANFILES): Likewise.
7464 (protected_4_pic.o, protected_3.err): New targets.
7465 * testsuite/protected_4.cc: New file.
7466
a120bc7f
DK
74672010-01-12 Doug Kwan <dougkwan@google.com>
7468
7469 * arm.cc (Cortex_a8_reloc): New class.
7470 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7471 and cortex_a8_relocs_info_.
7472 (Target_arm::fix_cortex_a8): New method definition.
7473 (Target_arm::Cortex_a8_relocs_info): New type.
7474 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7475 New data member declarations.
7476 (Target_arm::scan_reloc_for_stub): Record information about
7477 relocations for THUMB branches that might be exempted from the
7478 Cortex-A8 workaround.
7479 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7480 at the beginning of a relaxation pass.
7481
20138696
DK
74822010-01-12 Doug Kwan <dougkwan@google.com>
7483
7484 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7485 (Arm_relobj::Mapping_symbol_position,
7486 Arm_reloj::Mapping_symbol_position_less,
7487 Arm_relobj::Mapping_symbols_info): New types.
7488 (Target_arm::is_mapping_symbol_name): New method definition.
7489 (Arm_relobj::do_count_local_symbols): Save information about mapping
7490 symbols.
7491
089d69dc
DK
74922010-01-11 Doug Kwan <dougkwan@google.com>
7493
7494 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7495 Arm_relocate_functions::thumb32_branch_upper,
7496 Arm_relocate_functions::thumb32_branch_lower,
7497 Arm_relocate_functions::thumb32_cond_branch_offset,
7498 Arm_relocate_functions::thumb32_cond_branch_upper,
7499 Arm_relocate_functions::thumb32_cond_branch_lower,
7500 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7501 branch offset encoding.
7502 (Arm_relocate_functions::thumb_branch_common): Use new branch
7503 offset encoding methods to avoid code duplication.
7504 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7505 (Stub_addend_reader::operator()): Use new branch encoding method
7506 to avoid code duplication.
7507
99e5bff2
DK
75082010-01-11 Doug Kwan <dougkwan@google.com>
7509
7510 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7511 (Target_arm::do_finalize_sections): Define special EXIDX section
7512 symbols only if referenced.
7513 * gc.h (Garbage_collection::add_reference): New method.
7514 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7515 code duplication.
7516
98e090bd
ILT
75172010-01-11 Ian Lance Taylor <iant@google.com>
7518
d0a91bd8
ILT
7519 * script.cc (Version_script_info::build_expression_list_lookup):
7520 Change complaing about duplicate wildcard match from error to
7521 warning.
7522
98e090bd
ILT
7523 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7524 of 2009-12-30.
7525 (Version_script_info::Version_script_info): Initialize globs_,
7526 default_version_, default_is_global_, and exact_. Don't
7527 initialize globals_ or locals_.
7528 (Version_script_info::build_lookup_tables): Build local symbols
7529 first.
7530 (Version_script_info::unquote): New function.
7531 (Version_script_info::add_exact_match): New function.
7532 (Version_script_info::build_expression_list_lookup): Remove lookup
7533 parameter. Add is_global parameter. Change all callers. Handle
7534 wildcard pattern specially. Unquote pattern. Call
7535 add_exact_match.
7536 (Version_script_info::get_name_to_match): New function.
7537 (Version_script_info::get_symbol_version): New function.
7538 (Version_script_info::get_symbol_version_helper): Remove.
7539 (Version_script_info::check_unmatched_names): Call unquote.
7540 * script.h (class Version_script_info): Change get_symbol_version
7541 to be non-inline and add is_global parameter; change all callers.
7542 Rewrite symbol_is_local. Update declarations. Define struct
7543 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7544 Remove globals_ and locals_ members. Add exact_, globs_,
7545 default_version_, is_global_.
7546 (Version_script_info::Glob): Remove pattern, add expression and
7547 is_global. Update constructor. Change all callers.
7548 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7549 default version.
7550 (Versions::symbol_section_contents): If a symbol is undefined, or
7551 defined in a dynamic object, set the version index to
7552 VER_NDX_LOCAL.
7553 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7554 symbol_is_local.
7555 (Symbol_table::add_from_pluginobj): Likewise.
7556 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7557
d56962d3
DK
75582010-01-11 Doug Kwan <dougkwan@google.com>
7559
7560 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7561 (incremental_dump_LDADD): Add linking option for libintl.
7562 * Makefile.in: Regenerate.
7563
94e6ee91
L
75642010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7565
7566 PR gold/11144
7567 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7568 instead of -Ds.
7569 * testsuite/Makefile.in: Regenerated.
7570
e96c574b
DK
75712010-01-10 Doug Kwan <dougkwan@google.com>
7572
7573 * options.h (DEFINE_var): Use parentheses around argument varname__
7574 in macro body to avoid any unintended subsequent substitutions.
7575
7198066b
ILT
75762010-01-10 Ian Lance Taylor <iant@google.com>
7577
ba4d53bf
ILT
7578 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7579 candidates before doing symbol resolution.
7580
7198066b
ILT
7581 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7582 ODR candidates if only one is weak.
7583
a2beed37
ILT
75842010-01-08 Ian Lance Taylor <iant@google.com>
7585
7586 * script.cc (Version_script_info::build_expression_list_lookup):
7587 Don't warn about ambiguous version, just record the ambiguity.
7588 (Version_script_info::get_symbol_version_helper): Give error if
7589 version is ambiguous.
7590
2fb7225c
DK
75912010-01-08 Doug Kwan <dougkwan@google.com>
7592
7593 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7594 prev_data_size_ and prev_addralign_. Remove initializer for
7595 deleted data member has_been_changed_.
7596 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7597 to determine if the table is empty.
7598 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7599 Remove.
7600 (Stub_table::add_reloc_stub): Define method in class definition
7601 instead of just declaring it there.
7602 (Stub_table::add_cortex_a8_stub): New method definition.
7603 (Stub_table::update_data_size_and_addralign): Ditto.
7604 (Stub_table::finalize_stubs): Ditto.
7605 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7606 (Stub_table::do_addralign_): Return address alignment in the
7607 (Stub_table::do_reset_address_and_file_offset): Define method in
7608 class definition instead of declaring it there. Set current data
7609 size to be the data size of the previous pass.
7610 (Stub_table::set_final_data_size): Use current data size as the
7611 final data size.
7612 (Stub_table::relocate_stub): Change parameter type of stub from
7613 Reloc_stub pointer to Stub pointer.
7614 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7615 (Stub_table::Cortex_a8_stub_list): New typedef.
7616 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7617 Stub_table::prev_addralign_): New data member.
7618 (Arm_relobj::Arm_relobj): Initialize data member
7619 section_has_cortex_a8_workaround_.
7620 (Arm_relobj::section_has_cortex_a8_workaround,
7621 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7622 definitions.
7623 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7624 declarations.
7625 (Target_arm::relocate_stub): Change parameter type of stub from
7626 Reloc_stub pointer to Stub pointer.
7627 (Insn_template::size, Insn_template::alignment): Handle
7628 THUMB16_SPECIAL_TYPE.
7629 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7630 Stub_table::update_data_size_and_addralign,
7631 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7632 definitions.
7633 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7634 (Stub_table::do_write): Ditto.
7635 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7636
880cd20d
ILT
76372010-01-08 Ian Lance Taylor <iant@google.com>
7638
7639 PR 11108
7640 * symtab.h (class Symbol): Remove fields is_target_special_ and
7641 has_plt_offset_. Add field is_defined_in_discarded_section_.
7642 (Symbol::is_defined_in_discarded_section): New function.
7643 (Symbol::set_is_defined_in_discarded_section): New function.
7644 (Symbol::has_plt_offset): Rewrite.
7645 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7646 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7647 Don't initialize is_target_special_ or has_plt_offset_.
7648 Initialize is_defined_in_discarded_section_.
7649 (Symbol_table::add_from_relobj): If appropriate, set
7650 is_defined_in_discarded_section.
7651 * resolve.cc (Symbol::override_base_with_special): Don't test
7652 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7653 * target-reloc.h (relocate_section): Do special handling for
7654 symbols defined in discarded sections for global symbols as well
7655 as local symbols.
7656
2703e3eb
ILT
76572010-01-08 Ian Lance Taylor <iant@google.com>
7658
7659 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7660 the SHT_SYMTAB case.
7661
339d40a3
ILT
76622010-01-08 Ian Lance Taylor <iant@google.com>
7663
7664 * object.cc (Sized_relobj::do_layout): Don't get confused if
7665 layout_eh_frame returns NULL.
7666
abecea76
ILT
76672010-01-08 Ian Lance Taylor <iant@google.com>
7668
7669 PR 11084
7670 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7671 dynamic symbol table, use the normal symbol table.
7672 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7673 symbol table.
7674
6b7dd3f3
ILT
76752010-01-08 Ian Lance Taylor <iant@google.com>
7676
7677 PR 11072
7678 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7679 sections.
7680
36c50e63
L
76812010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7682
7683 * version.cc (print_version): Change to "Copyright 2010".
7684
e291e7b9
ILT
76852010-01-08 Ian Lance Taylor <iant@google.com>
7686
7687 PR 10287
7688 PR 11063
7689 * i386.cc (class Target_i386): Change return type of plt_section
7690 to be non-const.
7691 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7692 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7693 tls_desc_rel_ field.
7694 (Output_data_plt_i386::rel_tls_desc): New function.
7695 (Target_i386::rel_tls_desc_section): New function.
7696 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7697 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7698 R_386_TLS_DESC reloc in rel_tls_desc_section.
7699 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7700 Define struct Tlsdesc_info.
7701 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7702 (Target_x86_64::do_reloc_symbol_index): New function.
7703 (Target_x86_64::add_tlsdesc_info): New function.
7704 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7705 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7706 tlsdesc_rel_ field.
7707 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7708 all callers.
7709 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7710 (Target_x86_64::rela_tlsdesc_section): New function.
7711 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7712 handling.
7713 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7714 (Target_x86_64::do_reloc_addend): New function.
7715 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7716 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7717 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7718 (Output_reloc::type): New function.
7719 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7720 (Output_reloc::is_target_specific): New function.
7721 (Output_reloc::target_arg): New function.
7722 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7723 absolute relocs and target specific relocs.
7724 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7725 add_target_specific.
7726 (class Output_data_reloc) [SHT_RELA]: Likewise.
7727 * output.cc (Output_reloc::Output_reloc): Add four new versions
7728 for absolute relocs and target specific relocs.
7729 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7730 (Output_reloc::get_symbol_index): Likewise.
7731 (Output_reloc::local_section_offset): Check that local_sym_index_
7732 is not TARGET_CODE or 0.
7733 (Output_reloc::symbol_value): Likewise.
7734 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7735 reloc.
7736 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7737 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7738 functions.
7739 * layout.cc (add_target_dynamic_tags): Use output section for
7740 DT_PLTRELSZ and DT_JMPREL.
7741
3a44184e
ILT
77422010-01-07 Ian Lance Taylor <iant@google.com>
7743
7744 PR 11061
7745 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7746 function.
7747 (class Output_data_reloc_generic): Define.
7748 (class Output_data_reloc_base): Change base class to
7749 Output_data_reloc_generic. Change add() method to call
7750 bump_relative_reloc_count for a relative reloc. Remove
7751 sort_relocs_ field.
7752 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7753 to sort_relocs().
7754 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7755 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7756 appropriate.
7757 * layout.h (class Layout): Update declaration.
7758
ea715a34
ILT
77592010-01-07 Ian Lance Taylor <iant@google.com>
7760
7761 * output.h (class Output_data): Add const version of
7762 output_section and do_output_section.
7763 (class Output_section_data): Add const version of
7764 do_output_section.
7765 (class Output_section): Likewise.
7766 * layout.cc (Layout::add_target_dynamic_tags): New function.
7767 * layout.h (class Layout): Update declarations.
7768 * arm.cc (Target_arm::do_finalize_sections): Use
7769 add_target_dynamic_tags.
7770 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7771 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7772 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7773 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7774
659948a4
ILT
77752010-01-07 Ian Lance Taylor <iant@google.com>
7776
7777 PR 11042
7778 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7779 object as needed.
7780
9d3b86f6
ILT
77812010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7782 Ian Lance Taylor <iant@google.com>
7783
7784 PR 11019
7785 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7786 Xindex::read_symtab_xindex.
7787
bb0d3eb0
DK
77882010-01-07 Doug Kwan <dougkwan@google.com>
7789
7790 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7791 (Insn_template::thumb16_bcond_insn): New method declaration.
7792 (Insn_template): Fix spelling.
7793 (Stub::thumb16_special): New method declaration.
7794 (Stub::do_write): Define virtual method which was previously pure
7795 virtual.
7796 (Stub::do_thumb16_special): New method declaration.
7797 (Stub::do_fixed_endian_write): New template member.
7798 (Reloc_stub::do_write): Remove.
7799 (Reloc_stub::do_fixed_endian_write): Remove.
7800 (Cortex_a8_stub): New class definition.
7801 (Stub_factory::make_cortex_a8_stub): New method definition.
7802 (Stub_factory::Stub_factory): Add missing static storage class
7803 qualifier for elf32_arm_stub_a8_veneer_blx.
7804
ffeef7df
ILT
78052010-01-07 Ian Lance Taylor <iant@google.com>
7806
dc3f80fe
ILT
7807 PR 10980
7808 * options.h (class General_options): Add --warn-unresolved-symbols
7809 and --error-unresolved-symbols.
7810 * errors.cc (Errors::undefined_symbol): Implement
7811 --warn-unresolved-symbols.
7812
ffeef7df
ILT
7813 * options.h (class General_options): Add -z text and -z textoff.
7814 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7815
f1ec9ded
ST
78162010-01-06 Sriraman Tallam <tmsriram@google.com>
7817
7818 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7819 (Garbage_collection::cident_sections): New function.
7820 (Garbage_collection::add_cident_section): New function.
7821 (Garbage_collection::cident_sections_): New member.
7822 (gc_process_relocs): Add references to sections whose names are C
7823 identifiers.
7824 * gold.h (cident_section_start_prefix): New constant.
7825 (cident_section_stop_prefix): New constant.
7826 (is_cident): New function.
7827 * layout.cc (Layout::define_section_symbols): Replace string constants
7828 with the newly defined constants.
7829 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7830 C identifiers.
7831 * testsuite/Makefile.am: Add gc_orphan_section_test.
7832 * testsuite/Makefile.in: Regenerate.
7833 * testsuite/gc_orphan_section_test.cc: New file.
7834 * testsuite/gc_orphan_section_test.sh: New file.
7835
6eda8c29
ILT
78362010-01-06 Ian Lance Taylor <iant@google.com>
7837
b9674e17
ILT
7838 PR 10980
7839 * options.h (class General_options): Add --warn-shared-textrel.
7840 * layout.cc (Layout::finish_dynamic_section): Implement
7841 --warn-shared-textrel.
7842
6eda8c29
ILT
7843 PR 10980
7844 * options.h (class General_options): Add --warn-multiple-gp.
7845
32dcd44e
ILT
78462010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7847
7848 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7849 $(THREADSLIB) and $(LIBDL).
7850 * Makefile.in: Rebuild.
7851
a192ba05
ILT
78522010-01-06 Ian Lance Taylor <iant@google.com>
7853
7854 PR 10980
7855 * options.cc (General_options::parse_section_start): New function.
7856 (General_options::section_start): New function.
7857 (General_options::General_options): Initialize all members.
7858 * options.h: Include <map>
7859 (class General_options): Add --section-start. Add section_starts_
7860 member.
7861 * layout.cc (Layout::attach_allocated_section_to_segment): If
7862 --section-start was used, set the address of the segment. Remove
7863 local sort_sections.
7864 (Layout::relaxation_loop_body): If the address of the load segment
7865 has been set by --section-start, don't use it.
7866 * output.h (Output_segment::update_flags_for_output_section): New
7867 function.
7868 * output.cc (Output_segment::add_output_section): Call
7869 update_flags_for_output_section.
7870
dde3f402
ILT
78712010-01-05 Ian Lance Taylor <iant@google.com>
7872
62dfdd4d
ILT
7873 PR 10980
7874 * options.h (class General_options): Add --undefined-version.
7875 * script.cc (struct Version_expression): Add was_matched_by_symbol
7876 field.
7877 (Version_script_info::matched_symbol): New function.
7878 (Version_script_info::get_symbol_version_helper): Call
7879 matched_symbol.
7880 (Version_script_info::check_unmatched_names): New function.
7881 * script.h (class Version_script_info): Update declarations.
7882 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7883
9c4ae156
ILT
7884 * options.h (class General_options): Use DEFINE_bool_alias for
7885 allow_multiple_definition.
7886 * resolve.cc (Symbol_table::should_override): Don't test
7887 allow_multiple_definition.
7888
dde3f402
ILT
7889 PR 10980
7890 * options.h (class General_options): Add --cref.
7891 * main.cc (main): Print cref table if --cref. Don't close mapfile
7892 until after printing cref table.
7893 * cref.cc: Include "symtab.h".
7894 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7895 (Cref_table_compare::operator()): New function.
7896 (Cref_inputs::gather_cref): New function.
7897 (filecol): New static const.
7898 (Cref_inputs::print_cref): New function.
7899 (Cref::print_cref): New function.
7900 * cref.h: Include <cstdio>.
7901 (class Cref): Update declarations.
7902 * mapfile.h (Mapfile::file): New function.
7903 * object.h (class Object): Define Symbols. Declare virtual
7904 do_get_global_symbols.
7905 (Object::get_global_symbols): New function.
7906 * object.cc (Input_objects::add_object): Pass object to cref_ if
7907 --cref.
7908 (Input_objects::archive_start): Likewise.
7909 (Input_objects::archive_stop): Likewise.
7910 (Input_objects::print_cref): New function.
7911 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7912 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7913 --cref.
7914 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7915 function.
7916 * plugin.h (class Sized_pluginobj): Update declarations.
7917
8781f709
ILT
79182010-01-05 Ian Lance Taylor <iant@google.com>
7919
7920 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7921 to is_default_version. Rename insdef to insdefault.
7922 (Symbol_table::add_from_relobj): Rename def to is_default_version
7923 and local to is_forced_local.
7924 (Symbol_table::add_from_pluginobj): Likewise.
7925 (Symbol_table::add_from_dynobj): Likewise.
7926 (Symbol_table::define_special_symbol): Rename insdef to
7927 insdefault.
7928
fe35d28d
ILT
79292010-01-04 Ian Lance Taylor <iant@google.com>
7930
30bc8c46
ILT
7931 PR 10980
7932 * options.h (class General_options): Add
7933 --allow-multiple-definition and -z muldefs.
7934 * resolve.cc (Symbol_table::should_override): Don't warn about a
7935 multiple symbol definition if --allow-multiple-definition or -z
7936 muldefs.
7937
7eaea549
ILT
7938 PR 10980
7939 * options.h (class General_options): Add --add-needed and
7940 --copy-dt-needed-entries. Tweak --as-needed help entry.
7941 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7942 error if --copy-dt-needed-entries aka --add-needed is used and
7943 would cause a change in behaviour.
7944
fe35d28d
ILT
7945 PR 10980
7946 * options.h (class General_options): Add -G as a short version of
7947 --shared. Add no-op options -assert, -g, and -i.
7948
55a2bb35
ST
79492010-01-04 Sriraman Tallam <tmsriram@google.com>
7950
7951 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7952 check for .text or .gnu.linkonce.t sections.
7953 * icf.cc (Icf::find_identical_sections): Ditto.
7954 Change the detection for mangled function name within the section
7955 name.
7956 * icf.h (is_section_foldable_candidate): New function.
7957
719328e1
ILT
79582009-12-30 Ian Lance Taylor <iant@google.com>
7959
7960 PR 10980
7961 * options.h (class General_options): Permit two dashes with
7962 --retain-symbols-file.
7963
d7bb5745
ILT
79642009-12-30 Ian Lance Taylor <iant@google.com>
7965
403a15dd
ILT
7966 PR 10979
7967 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7968 don't put the file header and segment headers in the text
7969 segment.
7970
eda294df
ILT
7971 PR 10979
7972 * common.cc (Sort_commons::operator()): Stabilize sort when both
7973 entries are NULL.
7974 (Symbol_table::do_allocate_commons_list): When allocating common
7975 symbols, skip a symbol which is no longer common.
7976 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7977 an object before checking its type.
7978 * testsuite/common_test_2.c: New file.
7979 * testsuite/common_test_3.c: New file.
7980 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7981 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7982 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7983 (common_test_2_pic.o, common_test_2.so): New targets.
7984 (common_test_3_pic.o, common_test_3.so): New targets.
7985 * testsuite/Makefile.in: Rebuild.
7986
d7bb5745
ILT
7987 PR 10979
7988 * script.cc (read_input_script): If we see a new SECTIONS clause,
7989 and we have added an input section, give an error.
7990 * layout.h (class Layout): Add have_added_input_section function.
7991 Add have_added_input_section_ field.
7992 * layout.cc (Layout::Layout): Initialize
7993 have_added_input_section_.
7994 (Layout::layout): Set have_added_input_section_.
7995 (Layout::layout_eh_frame): Likewise.
7996
fc59c572
ILT
79972009-12-30 Ian Lance Taylor <iant@google.com>
7998
7999 PR 10931
8000 * options.h (class General_options): Add --sort-common option.
8001 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
8002 * common.cc (Sort_common): Add sort_order parameter to
8003 constructor. Add sort_order_ field.
8004 (Sort_commons::operator): Check sort_order_.
8005 (Symbol_table::allocate_commons): Determine the sort order.
8006 (Symbol_table::do_allocate_commons): Add sort_order parameter.
8007 Change all callers.
8008 (Symbol_table::do_allocate_commons_list): Likewise.
8009
1c74fab0
ILT
80102009-12-30 Ian Lance Taylor <iant@google.com>
8011
8012 PR 10916
8013 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
8014 symbols from this object, don't change the visibility of an
8015 undefined symbol.
8016 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
8017
6affe781
ILT
80182009-12-30 Ian Lance Taylor <iant@google.com>
8019
8020 PR 10861
8021 * script.h (class Version_script_info): Define Language enum.
8022 Update declarations. Define Glob, Exact, and Lookup types. Add
8023 new fields globals_, locals_, and is_finalized_.
8024 * script.cc: Various formatting fixes.
8025 (class Parser_closure): Change language_stack_ from a vector of
8026 std::string to one of Version_script_info::Language. Adjust all
8027 uses accordingly.
8028 (class Lazy_demangler): Remove.
8029 (struct Version_expression): Change language from std::string to
8030 Version_script_info::Language.
8031 (Version_script_info::Version_script_info): New function.
8032 (Version_script_info::~Version_script_info): Don't call clear.
8033 (Version_script_info::finalize): New function.
8034 (Version_script_info::build_lookup_tables): New function.
8035 (Version_script_info::build_expression_list_lookup): New
8036 function.
8037 (Version_script_info::get_symbol_version_helper): Rewrite to use
8038 lookup tables.
8039 (Version_script_info::print_expression_list): Adjust to use
8040 Version_script_info::Language.
8041 (script_push_lex_into_version_mode): Check that the version script
8042 has not been finalized.
8043 (version_script_push_lang): Change language string to
8044 Version_script_info::Language.
8045 * options.cc (Command_line::version_script): New function.
8046 * options.h (class General_options): Add finalize_dynamic_list
8047 function. Change version_script from declaration to definition.
8048 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
8049 * testsuite/version_script.map: Remove duplicate def of foo.
8050 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
8051 version_script.map.
8052 * testsuite/Makefile.in: Rebuild.
8053
818bf354
ILT
80542009-12-30 Ian Lance Taylor <iant@google.com>
8055
8056 PR 10843
8057 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
8058 if the input symbol index is 0, make the output symbol index 0.
8059
ebcc8304
ILT
80602009-12-30 Ian Lance Taylor <iant@google.com>
8061
8062 PR 10670
8063 * options.h (class General_options): Add -x/--discard-all.
8064 * object.cc (Sized_relobj::do_count_local_symbols): Handle
8065 --discard-all. If the local symbol needs a dynamic entry, check
8066 that before handling --discard-locals.
8067
176fe33f
ILT
80682009-12-30 Ian Lance Taylor <iant@google.com>
8069
bb321bb1
ILT
8070 PR 10450
8071 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
8072 flags to PF_R.
8073 (Output_segment::add_output_section): Don't change the flags if
8074 the type is PT_TLS.
8075
176fe33f
ILT
8076 PR 10450
8077 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8078 GNU hash table if they need a dynamic value. Otherwise, don't add
8079 them if they are defined in a dynamic object or are forced local.
8080
e8cd95c7
ILT
80812009-12-29 Ian Lance Taylor <iant@google.com>
8082
1b81fb71
ILT
8083 PR 10450
8084 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8085 .gnu.hash table for a 32-bit target.
8086
8d6d383d
ILT
8087 PR 10450
8088 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8089 regular and a dynamic object only needs a dynamic symbol table
8090 entry if it is externally visible.
8091
e785ec03
ILT
8092 PR 10450
8093 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8094 constructor. Add global_offset_table_ field.
8095 (Target_i386::got_section): Set global_offset_table_.
8096 (Target_i386::do_finalize_sections): Set global_offset_table_
8097 size.
8098 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8099 in constructor. Add global_offset_table_ field.
8100 (Target_x86_64::got_section): Set global_offset_table_.
8101 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8102 size.
8103
1a2dff53
ILT
8104 * layout.cc (Layout::Layout): Initialize increase_relro_.
8105 (Layout::get_output_section): Add is_relro, is_last_relro, and
8106 is_first_non_relro parameters. Change all callers.
8107 (Layout::choose_output_section): Likewise.
8108 (Layout::add_output_section_data): Likewise.
8109 (Layout::make_output_section): Likewise.
8110 (Layout::set_segment_offsets): Clear increase_relro when using a
8111 linker script.
8112 * layout.h (class Layout): Add increase_relro method. Add
8113 increase_relro_ field. Update declarations.
8114 * output.cc (Output_section::Output_section): Initialize
8115 is_last_relro_ and is_first_non_relro_.
8116 (Output_segment::add_output_section): Group relro sections is
8117 do_sort is true. Handle is_last_relro and is_first_non_relro.
8118 (Output_segment::maximum_alignment): Remove relro handling.
8119 (Output_segment::set_section_addresses): Add increase_relro
8120 parameter. Change all callers. Add initial alignment to align
8121 relro sections on separate page. Remove old relro handling.
8122 (Output_segment::set_section_list_addresses): Remove in_relro
8123 parameter. Change all callers.
8124 (Output_segment::set_offset): Add increase parameter. Change all
8125 callers. Remove old relro handling.
8126 * output.h (class Output_section): Add new methods: is_last_relro,
8127 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8128 Add is_last_relro_ and is_first_non_relro_ fields.
8129 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8130 Create separate .got.plt section. Call increase_relro.
8131 * x86_64.cc (Target_x86_64::got_section): Likewise.
8132 * testsuite/relro_script_test.t: Add .got.plt.
8133
f0ba79e2
ILT
8134 PR 10450
8135 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8136 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8137 (Layout::finalize): Call set_dynamic_symbol_size.
8138 (Layout::set_dynamic_symbol_size): New function.
8139 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8140 set_dynamic_symbol_size.
8141
e8cd95c7
ILT
8142 PR 10450
8143 * output.h (class Output_section): Add is_entsize_zero_ field.
8144 * output.cc (Output_section::Output_section): Initialize
8145 is_entsize_zero_.
8146 (Output_section::set_entsize): If two different entsizes are
8147 requested, force it to zero.
8148 (Output_section::add_input_section): Set flags for .debug_str
8149 before updating section flags. Set entsize.
8150 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8151 and SHF_STRING if all input sections have those flags.
8152
3e1b9a8a
RÁE
81532009-12-29 Rafael Espindola <espindola@google.com>
8154
8155 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8156 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8157 reporting.
3e1b9a8a 8158
3dcad376
ST
81592009-12-29 Sriraman Tallam <tmsriram@google.com>
8160
8161 * options.cc (General_options::parse_version): Allow -v to exit
8162 without an error if there is nothing to link.
8163
084e2665
ILT
81642009-12-29 Ian Lance Taylor <iant@google.com>
8165
8166 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8167 using a version of gcc before 4.1.
8168 * configure: Rebuild.
8169
250acde3
CD
81702009-12-28 Chris Demetriou <cgd@google.com>
8171
8172 * attributes.cc (Output_attributes_section_data::do_write): Use
8173 std::vector::front rather than std::vector::data.
8174
99fff23b
ILT
81752009-12-28 Ian Lance Taylor <iant@google.com>
8176
8177 * symtab.h (class Symbol_table): Add enum Defined.
8178 * resolve.cc (Symbol_table::should_override): Add defined
8179 parameter. Change all callers. Test whether object is NULL
8180 before calling a method on it.
8181 (Symbol_table::report_resolve_problem): Add defined parameter.
8182 Change all callers.
8183 (Symbol_table::should_override_with_special): Likewise.
8184 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8185 parameter. Change all callers.
8186 (Symbol_table::do_define_in_output_data): Likewise.
8187 (Symbol_table::define_in_output_segment): Likewise.
8188 (Symbol_table::do_define_in_output_segment): Likewise.
8189 (Symbol_table::define_as_constant): Likewise.
8190 (Symbol_table::do_define_as_constant): Likewise.
8191 * script.h (class Symbol_assignment): Add is_defsym parameter to
8192 constructor; change all callers.
8193 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8194 parameter. Change all callers. Add is_defsym_ field.
8195 (class Parser_closure): Add parsing_defsym parameter to
8196 constructor; change all callers. Add parsing_defsym accessor
8197 function. Add parsing_defsym_ field.
8198
556bd683
ILT
81992009-12-28 Ian Lance Taylor <iant@google.com>
8200
8201 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8202 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8203
1782c879
ILT
82042009-12-23 Ian Lance Taylor <iant@google.com>
8205
8206 * i386.cc (Target_i386::do_calls_non_split): Recognize
8207 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8208 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8209 -fsplit-stack prologue when using %r11.
1782c879 8210
329ca2b1
ST
82112009-12-21 Sriraman Tallam <tmsriram@google.com>
8212
8213 * options.cc (General_options::parse_version): Make -v continue and do
8214 the link like GNU ld does.
8215
d675ff46
RÁE
82162009-12-17 Rafael Avila de Espindola <espindola@google.com>
8217
8218 * Makefile.am (CCFILES): Add timer.cc.
8219 (HFILES): Add timer.h.
8220 * configure.ac: Check for sysconf and times.
8221 * main.cc: include timer.h.
8222 (main): Use Timer instead of get_run_time.
8223 * timer.cc: New.
8224 * timer.h: New.
8225 * workqueue.cc: include timer.h.
8226 (Workqueue::find_and_run_task):
8227 Report user, sys and wall time.
8228 * Makefile.in: Regenerate.
8229 * config.in: Regenerate.
8230 * configure: Regenerate.
8231
d6344fb5
DK
82322009-12-16 Doug Kwan <dougkwan@google.com>
8233
8234 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8235 sections.
8236 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8237 relaxed input sections.
8238 * output.cc (Output_section::find_relaxed_input_section): Change
8239 return type to Output_relaxed_input_section pointer. Adjust code
8240 for new type of relaxed_input_section_map_.
8241 * output.h (Output_section::find_relaxed_input_section): Change
8242 return type to Output_relaxed_input_section pointer.
8243 (Output_section::Output_relaxed_input_section_by_input_section_map):
8244 New type.
8245 (Output_section::relaxed_input_section_map_): Change type to
8246 Output_section::Output_relaxed_input_section_by_input_section_map.
8247 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8248 input section.
8249
0e0d5469
ILT
82502009-12-15 Ian Lance Taylor <iant@google.com>
8251
8252 * layout.cc (Layout::create_shstrtab): Only write out after input
8253 sections if we are compressing debug sections.
8254
0649a889
ILT
82552009-12-15 Ian Lance Taylor <iant@google.com>
8256
8257 * archive.cc (Archive::add_symbols): Only look up a symbol without
8258 a version if there is, in fact, a version.
8259
2ea97941
ILT
82602009-12-14 Ian Lance Taylor <iant@google.com>
8261
8262 Revert -Wshadow changes, all changes from:
8263 2009-12-11 Doug Kwan <dougkwan@google.com>
8264 2009-12-11 Nick Clifton <nickc@redhat.com>
8265 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8266
b0eec2cc
DK
82672009-12-11 Doug Kwan <dougkwan@google.com>
8268
8269 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8270 due to -Wshadow.
8271 * attributes.cc (Object_attribute::size): Ditto.
8272 (Attributes_section_data::size): Ditto.
8273 (Attributes_section_data::Attributes_section_data): Ditto.
8274 (Output_attributes_section_data::do_write): Ditto.
8275 * attributes.h (Object_attribute::set_type): Ditto.
8276 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8277
91d6fa6a
NC
82782009-12-11 Nick Clifton <nickc@redhat.com>
8279
8280 * archive.cc: Fix shadowed variable warnings.
8281 * arm.cc: Likewise.
8282 * compressed_output.cc: Likewise.
8283 * compressed_output.h: Likewise.
8284 * configure: Likewise.
8285 * dwarf_reader.cc: Likewise.
8286 * dynobj.cc: Likewise.
8287 * dynobj.h: Likewise.
8288 * ehframe.cc: Likewise.
8289 * ehframe.h: Likewise.
8290 * errors.cc: Likewise.
8291 * expression.cc: Likewise.
8292 * fileread.cc: Likewise.
8293 * fileread.h: Likewise.
8294 * freebsd.h: Likewise.
8295 * i386.cc: Likewise.
8296 * icf.cc: Likewise.
8297 * incremental.h: Likewise.
8298 * layout.cc: Likewise.
8299 * layout.h: Likewise.
8300 * mapfile.cc: Likewise.
8301 * merge.cc: Likewise.
8302 * merge.h: Likewise.
8303 * object.cc: Likewise.
8304 * object.h: Likewise.
8305 * options.h: Likewise.
8306 * output.cc: Likewise.
8307 * output.h: Likewise.
8308 * parameters.cc: Likewise.
8309 * plugin.cc: Likewise.
8310 * powerpc.cc: Likewise.
8311 * reduced_debug_output.cc: Likewise.
8312 * reduced_debug_output.h: Likewise.
8313 * reloc.cc: Likewise.
8314 * reloc.h: Likewise.
8315 * resolve.cc: Likewise.
8316 * script-sections.cc: Likewise.
8317 * script.cc: Likewise.
8318 * script.h: Likewise.
8319 * sparc.cc: Likewise.
8320 * symtab.cc: Likewise.
8321 * symtab.h: Likewise.
8322 * target-select.cc: Likewise.
8323 * target-select.h: Likewise.
8324 * token.h: Likewise.
8325 * workqueue.cc: Likewise.
8326 * workqueue.h: Likewise.
8327 * x86_64.cc: Likewise.
8328
a0351a69
DK
83292009-12-10 Doug Kwan <dougkwan@google.com>
8330
8331 * arm.cc (attributes.h): New include.
8332 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8333 (Arm_relobj::~Arm_relobj): Delete object pointed by
8334 attributes_section_data_.
8335 (Arm_relobj::attributes_section_data): New method definition.
8336 (Arm_relobj::attributes_section_data_): New data member declaration.
8337 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8338 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8339 attributes_section_data_.
8340 (Arm_dynobj::attributes_section_data): New method definition.
8341 (Arm_dynobj::attributes_section_data_): New data member declaration.
8342 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8343 initialization value of may_use_blx_ to false.
2e702c99 8344 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8345 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8346 object attributes to compute results instead of hard-coding.
8347 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8348 Target_arm::get_secondary_compatible_arch,
8349 Target_arm::set_secondary_compatible_arch
8350 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8351 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8352 New method declarations.
8353 (Target_arm::get_aeabi_object_attribute): New method definition.
8354 (Target_arm::attributes_section_data_): New data member declaration.
8355 (read_arm_attributes_section): New template definition.
8356 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8357 (Arm_dynobj::do_read_symbols): Ditto.
8358 (Target_arm::do_finalize_sections): Merge attributes sections from
8359 input. Check for BLX use after attributes section merging.
8360 Fix __exidx_start and __exidx_end visibility. Create an
8361 .ARM.attributes section if necessary.
8362 (Target_arm::get_secondary_compatible_arch,
8363 Target_arm::set_secondary_compatible_arch,
8364 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8365 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8366 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8367 New method definitions.
8368
b59befec
ILT
83692009-12-09 Ian Lance Taylor <iant@google.com>
8370
8371 * plugin.cc (Plugin::load): Don't cast from void* to a function
8372 pointer.
8373
1276bc89
ILT
83742009-12-09 Ian Lance Taylor <iant@google.com>
8375
8376 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8377 information fields.
8378
2f2de248
L
83792009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8380
8381 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8382 Replace two_file_shared_1.so with two_file_shared_2.so.
8383 * testsuite/Makefile.in: Regenerated.
8384
4f787271
DK
83852009-12-08 Doug Kwan <dougkwan@google.com>
8386
8387 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8388 (HFILES): Add attributes.h and int_encoding.h.
8389 * Makefile.in: Regenerate.
8390 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8391 function definitions to int_encoding.cc
8392 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8393 prototypes to int_encoding.h
8394 * reduced_debug_output.cc (int_encoding.h): New include.
8395 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8396 function definitions to int_encoding.cc
8397 (insert_into_vector, read_from_pointer): Move template definitions to
8398 int_encoding.h
8399 * attributes.cc: New file.
8400 * attributes.h: New file.
8401 * int_encoding.cc: New file.
8402 * int_encoding.h: New file.
8403
20b52f1a
RÁE
84042009-12-07 Rafael Avila de Espindola <espindola@google.com>
8405
8406 PR gold/11055
8407 * incremental-dump.cc (dump_incremental_inputs): New.
8408 (main): Use dump_incremental_inputs.
8409
53d7974c
L
84102009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8411
8412 PR gold/10893
8413 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8414 checking elfcpp::STT_FUNC.
8415 (Target_i386::Relocate::relocate): Likewise.
8416 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8417
8418 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8419 symbols from shared libraries into normal FUNC symbols.
8420
8421 * symtab.h (Symbol): Add is_func and use it.
8422
05a352e6
DK
84232009-12-05 Doug Kwan <dougkwan@google.com>
8424
8425 * arm.cc (Target_arm::arm_info): Initialize new fields
8426 attributes_section and attributes_vendor.
8427 * i386.cc (Target_i386::i386_info): Same.
8428 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8429 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8430 fields attributes_section and attributes_vendor.
53d7974c 8431 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8432 * target.h (Target::attributes_section, Target::attributes_vendor,
8433 Target::is_attributes_section, Target::attribute_arg_type,
8434 Target::attributes_order): New method definitions.
8435 (Target::Target_info::attributes_section,
8436 Target::Target_info::attributes_vendor): New fields.
8437 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8438 virtual method definitions.
8439 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8440 attributes_section and attributes_vendor.
8441 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8442
f4e5969c
DK
84432009-12-05 Doug Kwan <dougkwan@google.com>
8444
8445 * arm.cc: Update comments about interworking and stub generation.
8446 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8447 considered as non-PIC.
8448 (Arm_relocate_functions::base_abs): Fix formatting.
8449 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8450 of function to use GOT entry address instead of offset.
8451 (Target_arm::Scan::global): Issue an error if a symbol would need a
8452 PLT does not get one because it is untyped. Remove code to create
8453 dynamic symbols for relative branches.
8454 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8455 takes unsigned integer instead of boolean.
8456
1abce4a6
L
84572009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8458
8459 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8460 (two_file_test_LDADD): Likewise.
8461 (common_test_1_LDADD): Likewise.
8462 (exception_test_LDADD) Likewise.
8463 (weak_test_LDADD): Likewise.
8464 (many_sections_test_LDADD): Likewise.
8465 (initpri1_LDADD): Likewise.
8466 (script_test_1_LDADD): Likewise.
8467 (script_test_2_LDADD): Likewise.
8468 (justsyms_LDADD): Likewise.
8469 (binary_test_LDADD): Likewise.
8470 (large_LDADD): Likewise.
8471 * testsuite/Makefile.in: Regenerated.
8472
adcf2816 84732009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8474
adcf2816
L
8475 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8476 (Symbol_table::override_with_special): Likewise.
8477 (Symbol_table::add_from_object): Likewise.
8478
28e67f5d
RÁE
84792009-12-04 Rafael Avila de Espindola <espindola@google.com>
8480
8481 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8482 Don't set the data_offset twice.
8483
ae10a101
RÁE
84842009-12-04 Rafael Avila de Espindola <espindola@google.com>
8485
8486 * testsuite/Makefile.in: Regenerate.
8487
f59f41f3
DK
84882009-12-03 Doug Kwan <dougkwan@google.com>
8489
8490 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8491 (Target_arm::do_finalize_sections): Add parameter for symbol table
8492 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8493 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8494 parameter for symbol table pointer.
8495 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8496 an additional parameter for a pointer to symbol table.
8497 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8498 parameter for a symbol table pointer.
8499 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8500 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8501 Ditto.
8502 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8503 parameter for a symbol table pointer.
8504
ca55d848
RÁE
85052009-12-03 Rafael Avila de Espindola <espindola@google.com>
8506
8507 * incremental.cc (Incremental_inputs_header)
8508 (Incremental_inputs_header_write, Incremental_inputs_entry)
8509 (Incremental_inputs_entry_write): Move ...
8510 * incremental.h (Incremental_inputs_header)
8511 (Incremental_inputs_header_write, Incremental_inputs_entry)
8512 (Incremental_inputs_entry_write): here.
8513
3aec4f9c
RÁE
85142009-12-02 Rafael Avila de Espindola <espindola@google.com>
8515
8516 * incremental.cc (make_sized_incremental_binary): Set the target.
8517 Error if it is incompatible.
8518 * output.h (Output_file): Add filename method.
8519
9c0ae74d
RÁE
85202009-12-02 Rafael Avila de Espindola <espindola@google.com>
8521
8522 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8523 from the get_* methods.
8524
a45500ae
RÁE
85252009-12-02 Rafael Avila de Espindola <espindola@google.com>
8526
8527 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8528 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8529 Write 0 for the data_offset of scripts.
8530
325e6408
RÁE
85312009-12-02 Rafael Avila de Espindola <espindola@google.com>
8532
8533 * testsuite/Makefile.am: Add the incremental_test.sh test.
8534 * testsuite/incremental_test.sh: New.
8535 * testsuite/incremental_test_1.c: New.
8536 * testsuite/incremental_test_2.c: New.
8537
954c3e2e
RÁE
85382009-12-01 Rafael Avila de Espindola <espindola@google.com>
8539
703d02da 8540 * incremental-dump.cc (main): Fix typos.
954c3e2e 8541
f8086623
RÁE
85422009-11-27 Rafael Avila de Espindola <espindola@google.com>
8543
8544 PR gold/11025
8545 * incremental-dump.cc (main): Use llu to print 64 bit values.
8546
3b0dd6ac
L
85472009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8548 H.J. Lu <hongjiu.lu@intel.com>
8549
8550 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8551 $(LIBDL).
8552 (incremental_dump_LDADD): Likewise.
8553 * Makefile.in: Regenerated.
8554
a6d1ef57 85552009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8556
a6d1ef57
DK
8557 Revert:
8558
8559 2009-11-25 Doug Kwan <dougkwan@google.com>
8560
8561 * arm.cc (Target_arm::Target_arm): Move method definition
8562 outside of class definition. Add code to handle
8563 --target1-rel, --target1-abs and --target2= options.
8564 (Target_arm::get_reloc_reloc_type): Change method to be
8565 non-static and const.
8566 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8567 New data member declaration.
8568 (Target_arm::Scan::local, Target_arm::Scan::global,
8569 Target_arm::Relocate::relocate,
8570 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8571 Adjust call to Target_arm::get_real_reloc_type.
8572 (Target_arm::get_real_reloc_type): Use command line options
8573 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8574 * options.h (--target1-rel, --target1-abs, --target2): New
8575 ARM-only options.
8576
50aeb7d4
DK
85772009-11-25 Doug Kwan <dougkwan@google.com>
8578
8579 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8580 class definition. Add code to handle --target1-rel, --target1-abs
8581 and --target2= options.
8582 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8583 and const.
8584 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8585 member declaration.
8586 (Target_arm::Scan::local, Target_arm::Scan::global,
8587 Target_arm::Relocate::relocate,
8588 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8589 call to Target_arm::get_real_reloc_type.
8590 (Target_arm::get_real_reloc_type): Use command line options to
8591 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8592 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8593 options.
8594
51938283
DK
85952009-11-25 Doug Kwan <dougkwan@google.com>
8596
8597 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8598 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8599 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8600 formatting.
8601 (Arm_relocate_functions::thm_call): Replace body with a call to
8602 Arm_relocate_functions::thumb_branch_common.
8603 (Arm_relocate_functions::thm_jump24,
8604 Arm_relocate_functions::thm_xpc22): New method definitions.
8605 (Arm_relocate_functions::thumb_branch_common): New method definition.
8606 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8607 operator.
8608 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8609 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8610
e2b8f3c4
RÁE
86112009-11-24 Rafael Avila de Espindola <espindola@google.com>
8612
8613 * Makefile.am: Build incremental-dump
8614 * Makefile.in: Regenerate.
8615 * incremental-dump.cc: New.
8616 * incremental.cc (Incremental_inputs_header_data,
8617 Incremental_inputs_entry_data): Move to incremental.h
8618 * incremental.h: (Incremental_inputs_header_data,
8619 Incremental_inputs_entry_data): Move from incremental.cc
8620
bcba9aec
RÁE
86212009-11-24 Rafael Avila de Espindola <espindola@google.com>
8622
8623 * incremental.cc (Incremental_inputs_header,
8624 Incremental_inputs_header_write, Incremental_inputs_entry,
8625 Incremental_inputs_entry_write): Add a typedef with the data type.
8626
7c3afe08
RÁE
86272009-11-24 Rafael Avila de Espindola <espindola@google.com>
8628
8629 * incremental.cc (Incremental_inputs_header,
8630 Incremental_inputs_header_write, Incremental_inputs_entry,
8631 Incremental_inputs_entry_write): Update comment about which
8632 type has the filed descriptions.
8633
d204b6e9
DK
86342009-11-15 Doug Kwan <dougkwan@google.com>
8635
8636 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8637 (Arm_relocate_functions::arm_branch_common): Change method defintion
8638 in class definition to a method declaration and update list of formal
8639 parameters.
8640 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8641 Arm_relocation_functions::jump24): Adjust call to
8642 Arm_relocate_functions::arm_branch_common. Update list of formal
8643 parameters.
8644 (Arm_relocate_functions::xpc25): New method definition.
8645 (Arm_relocate_functions::arm_branch_common): Move method defintion
8646 out from class definition. Use stubs for mode-switching and extending
8647 branch ranges.
8648 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8649 specially. Change code to enable use of stubs in ARM branches.
8650
43d12afe
DK
86512009-11-10 Doug Kwan <dougkwan@google.com>
8652
8653 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8654 in method declaration.
8655 (Target_arm::relocate_stub): New method declaration.
8656 (Target_arm::default_target): Change to return a pointer instead of
8657 a const reference.
8658 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8659 Target_arm::default_target.
8660 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8661 method definition.
8662 (Target_arm::relocate_section): Adjust view.
8663 (Target_arm::relocate_stub): New method definition.
8664
ac33a407
DK
86652009-11-10 Doug Kwan <dougkwan@google.com>
8666
8667 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8668 a format warning.
8669 * incremental.cc (open_incremental_binary): Initialized local
8670 variables to avoid warnings.
8671 * object.cc (make_elf_object): Ditto.
8672 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8673 a format warning.
e1df38aa 8674
88ee28e9
L
8675009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8676
8677 PR gold/10930
8678 * testsuite/plugin_test.c: Include "config.h".
8679
2daedcd6
DK
86802009-11-09 Doug Kwan <dougkwan@google.com>
8681
8682 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8683 (arm_symbol_value): Remove.
8684 (Arm_relocate_functions::arm_branch_common,
8685 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8686 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8687 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8688 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8689 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8690 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8691 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8692 Arm_relocate_functions::thm_mobw_abs_nc,
8693 Arm_relocate_functions::thm_mov_abs,
8694 Arm_relocate_functions::movw_prel_nc,
8695 Arm_relocate_functions::thm_movt_abs,
8696 Arm_relocate_functions::movt_prel,
8697 Arm_relocate_functions::thm_movw_prel_nc,
8698 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8699 (Target_arm::Relocate::relocate): Only decompose address into two
8700 parts if relocation type uses the thumb-bit and pass the actual
8701 bit instead of a flag indicating that the thumb-bit is used. Adjust
8702 calls to methods in Arm_relocate_functions for this change.
8703
1276bc89 87042009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8705
8706 PR 10925
8707 * reloc.cc: Instantiate
8708 Sized_relobj::initialize_input_to_output_maps and
8709 Sized_relobj:free_input_to_output_maps.
8710
e53ad1b5
ILT
87112009-11-06 Ian Lance Taylor <iant@google.com>
8712
8713 PR 10876
8714 * defstd.cc (in_segment): Set only_if_ref true for "end".
8715
eb44217c
DK
87162009-11-06 Doug Kwan <dougkwan@google.com>
8717
8718 * arm.cc (class Reloc_stub): Correct a comment.
8719 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8720 (Target_arm::scan_section_for_stubs): New method declaration.
8721 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8722 Change methods from private to protected.
8723 (Target_arm::do_may_relax): New method definition.
8724 (Target_arm::do_relax, Target_arm::group_sections,
8725 Target_arm::scan_reloc_for_stub,
8726 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8727 (Target_arm::arm_input_section_map_): New data member declaration.
8728 (Target_arm::scan_reloc_for_stub,
8729 Target_arm::scan_reloc_section_for_stubs,
8730 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8731 Target_arm::do_relax): New method definitions.
8732
5d329b7d
ILT
87332009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8734
8735 * configure.ac: Check for (struct stat)::st_mtim
8736 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8737 * config.in: Regenerate.
8738 * configure: Regenerate.
8739
96a0d71b
ILT
87402009-11-05 Ian Lance Taylor <iant@google.com>
8741
8742 PR 10910
8743 * output.cc (Output_segment::add_output_section): Add missing
8744 return statement.
8745
594c8e5e
ILT
87462009-11-04 Ian Lance Taylor <iant@google.com>
8747
8748 PR 10880
8749 * object.h (class Object): Add is_needed and set_is_needed
8750 methods. Add is_needed_ field. Make bool fields into bitfields.
8751 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8752 defined in a dynamic object and referenced by a regular object,
8753 set is_needed for the dynamic object.
8754 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8755 if the file is marked with as_needed and it is not needed.
8756
22b127cc
ILT
87572009-11-04 Ian Lance Taylor <iant@google.com>
8758
8759 PR 10887
8760 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8761 tags if data is discarded by linker script.
8762 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8763 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8764 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8765 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8766
f5c870d2
ILT
87672009-11-04 Ian Lance Taylor <iant@google.com>
8768
8769 * layout.cc (Layout::get_output_section): Add is_interp and
8770 is_dynamic_linker_section parameters. Change all callers.
8771 (Layout::choose_output_section): Likewise.
8772 (Layout::make_output_section): Likewise.
8773 (Layout::add_output_section_data): Add is_dynamic_linker_section
8774 parameter. Change all callers.
8775 * layout.h (class Layout): Update declarations.
8776 * output.h (class Output_section): Add is_interp, set_is_interp,
8777 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8778 Add is_interp_, is_dynamic_linker_section_ fields. Change
8779 generate_code_fills_at_write_ to a bitfield.
8780 * output.cc (Output_section::Output_sections): Initialize new
8781 fields.
8782 (Output_segment::add_output_section): Add do_sort parameter.
8783 Change all callers.
8784
1ae4d23b
ILT
87852009-11-03 Ian Lance Taylor <iant@google.com>
8786
8787 PR 10860
8788 * options.h (class General_options): Add --warn-common.
8789 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8790 merging two common symbols.
8791 (Symbol_table::should_override): Handle --warn-common when merging
8792 a common symbol with a defined symbol. Use report_resolve_problem
8793 for multiple definitions.
8794 (Symbol_table::report_resolve_problem): New function.
8795 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8796
55da9579
DK
87972009-11-03 Doug Kwan <dougkwan@google.com>
8798
8799 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8800 stub_factory_.
8801 (Target_arm::stub_factory): New method definition.
8802 (Target_arm::new_arm_input_section,
8803 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8804 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8805 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8806 New type definitions.
8807 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8808 member declarations.
8809 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8810 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8811 New method definitions.
8812
37a9ac43
ILT
88132009-11-03 Ian Lance Taylor <iant@google.com>
8814
8815 * options.h (class General_options): Add --warn_constructors.
8816
b3d6a3d4
ILT
88172009-11-03 Ian Lance Taylor <iant@google.com>
8818
8819 PR 10893
8820 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8821 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8822
934b01dd
ILT
88232009-11-03 Ian Lance Taylor <iant@google.com>
8824
8825 PR 10895
8826 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8827 --msgid-bugs-address.
8828 (install-pdf): New target.
8829 (install-data_yes): Look up one directory to find mkinstalldirs.
8830
03c1939b
L
88312009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8832
8833 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8834 tree.
8835
ebd95253
DK
88362009-10-30 Doug Kwan <dougkwan@google.com>
8837
8838 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8839
e9bbb538
DK
88402009-10-30 Doug Kwan <dougkwan@google.com>
8841
8842 * arm.cc (Stub_addend_reader): New struct template definition
8843 and partial specializations.
8844 (Stub_addend_reader::operator()): New method definition for a
8845 partially specialized template.
8846
d5b40221
DK
88472009-10-30 Doug Kwan <dougkwan@google.com>
8848
8849 * arm.cc (Arm_relobj::processor_specific_flags): New method
8850 definition.
8851 (Arm_relobj::do_read_symbols): New method declaration.
8852 (Arm_relobj::processor_specific_flags_): New data member declaration.
8853 (Arm_dynobj): New class definition.
8854 (Target_arm::do_finalize_sections): Add input_objects parameter.
8855 (Target_arm::do_adjust_elf_header): New method declaration.
8856 (Target_arm::are_eabi_versions_compatible,
8857 (Target_arm::merge_processor_specific_flags): New method declaration.
8858 (Target_arm::do_make_elf_object): New overloaded method definitions
8859 and declaration.
8860 (Arm_relobj::do_read_symbols): New method definition.
8861 (Arm_dynobj::do_read_symbols): Ditto.
8862 (Target_arm::do_finalize_sections): Add input_objects parameters.
8863 Merge processor-specific flags from all input objects.
8864 (Target_arm::are_eabi_versions_compatible,
8865 Target_arm::merge_processor_specific_flags,
8866 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8867 New method definitions.
8868 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8869 Input_objects pointer type parameter.
8870 * layout.cc (Layout::finalize): Pass input objects to target's.
8871 finalize_sections function.
8872 * output.cc (Output_file_header::do_sized_write): Set ELF file
8873 header's processor-specific flags.
8874 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8875 Input_objects pointer type parameter.
8876 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8877 * target.h (Input_objects): New forward class declaration.
8878 (Target::processor_specific_flags,
8879 Target::are_processor_specific_flags_sect): New method definitions.
8880 (Target::finalize_sections): Add input_objects parameter.
8881 (Target::Target): Initialize processor_specific_flags_ and
8882 are_processor_specific_flags_set_.
8883 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8884 parameter.
8885 (Target::set_processor_specific_flags): New method definition.
8886 (Target::processor_specific_flags_,
8887 Target::are_processor_specific_flags_set_): New data member
8888 declarations.
8889 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8890 Input_objects pointer type parameter.
8891
ebabffbd
DK
88922009-10-30 Doug Kwan <dougkwan@google.com>
8893
8894 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8895
ad0f2072
ILT
88962009-10-28 Ian Lance Taylor <iant@google.com>
8897
8898 * object.h (class Relobj): Drop options parameter from
8899 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8900 do_scan_relocs, do_relocate. Change all callers.
8901 (class Sized_relobj): Drop options parameters from
8902 do_gc_process_relocs, do_scan_relocs, do_relocate,
8903 do_relocate_sections, relocate_sections, emit_relocs_scan,
8904 emit_relocs_scan_reltype. Change all callers.
8905 (struct Relocate_info): Remove options field and all references to
8906 it.
8907 * reloc.h (class Read_relocs): Remove options constructor
8908 parameter and options_ field. Change all callers.
8909 (class Gc_process_relocs, class Scan_relocs): Likewise.
8910 (class Relocate_task): Likewise.
8911 * target-reloc.h (scan_relocs): Remove options parameter. Change
8912 all callers.
8913 (scan_relocatable_relocs): Likewise.
8914 * target.h (class Sized_target): Remove options parameter from
8915 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8916 all callers.
8917 * gc.h (gc_process_relocs): Remove options parameter. Change all
8918 callers.
8919 * arm.cc: Update functions to remove options parameters.
8920 * i386.cc: Likewise.
8921 * powerpc.cc: Likewise.
8922 * sparc.cc: Likewise.
8923 * x86_64.cc: Likewise.
8924 * testsuite/testfile.cc: Likewise.
8925
8ffa3667
DK
89262009-10-28 Doug Kwan <dougkwan@google.com>
8927
8928 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8929 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8930 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8931 New method definitions.
8932
40f36857
CC
89332009-10-28 Cary Coutant <ccoutant@google.com>
8934
8935 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8936 (Plugin::cleanup_done_): New member.
8937 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8938 (Plugin_manager::cleanup_done_): Remove.
8939 (Plugin_manager::add_input_file): Edit error message.
8940 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8941 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8942
2c849493
ILT
89432009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8944
8945 * fileread.cc: (File_read::View::~View): Use the new
8946 data_ownership_ filed.
8947 (File_read::~File_read): Dispose the new whole_file_view_.
8948 (File_read::open): Mmap the whole file if needed.
8949 (File_read::open): Use whole_file_view_ instead of contents_.
8950 (File_read::find_view): Use whole_file_view_ if applicable.
8951 (File_read::do_read): Use whole_file_view_ instead of contents_.
8952 (File_read::make_view): Use whole_file_view_ instead of contents_,
8953 update File_read::View::View call.
8954 (File_read::find_or_make_view): Update File_read::View::View
8955 call.
8956 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8957 remove contents_
8958 (File_read::View::Data_ownership): New enum.
8959 (File_read::View::View): Replace bool mapped_ with Data_ownership
8960 argument.
8961 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8962 (File_read::View::data_ownership_): New field.
8963 (File_read::contents_): Remove (replaced by whole_file_view_).
8964 (File_read::whole_file_view_): New field.
8965 * options.h (class General_options): Add --keep-files-mapped.
8966
24998053
CC
89672009-10-27 Cary Coutant <ccoutant@google.com>
8968
8969 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8970 * testsuite/Makefile.am (plugin_test_5): New test case.
8971 * testsuite/Makefile.in: Regenerate.
8972
72adc4fa
DK
89732009-10-25 Doug Kwan <dougkwan@google.com>
8974
8975 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8976 from private to protected to allow access by child class.
8977 (Sized_relobj::do_relocate_sections): New method declaration.
8978 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8979 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8980 Sized_relobj::relocate_sections. Instantiate template explicitly
8981 for different target sizes and endianity.
8982
07f508a2
DK
89832009-10-24 Doug Kwan <dougkwan@google.com>
8984
8985 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8986 (Arm_input_section::as_arm_input_section): New method.
8987 (Arm_output_section): New class definition.
8988 (Arm_output_section::create_stub_group,
8989 Arm_output_section::group_sections): New method definitions.
8990
10ad9fe5
DK
89912009-10-22 Doug Kwan <dougkwan@google.com>
8992
8993 * arm.cc (Arm_input_section): New class definition.
8994 (Arm_input_section::init, Arm_input_section:do_write,
8995 Arm_input_section::set_final_data_size,
8996 Arm_input_section::do_reset_address_and_file_offset): New method
8997 definitions.
8998
56ee5e00
DK
89992009-10-21 Doug Kwan <dougkwan@google.com>
9000
9001 * arm.cc (Stub_table, Arm_input_section): New forward class
9002 declarations.
9003 (Stub_table): New class defintion.
9004 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
9005 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
9006 New method definition.
9007
b569affa
DK
90082009-10-21 Doug Kwan <dougkwan@google.com>
9009
9010 * arm.cc: Update copyright comments.
9011 (Target_arm): New forward class template declaration.
9012 (Arm_address): New type.
9013 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
9014 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
9015 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
9016 constants.
9017 (Insn_template): Same.
9018 (DEF_STUBS): New macro.
9019 (Stub_type): New enum type.
9020 (Stub_template): New class definition.
9021 (Stub): Same.
9022 (Reloc_stub): Same.
9023 (Stub_factory): Same.
9024 (Target_arm::Target_arm): Initialize may_use_blx_ and
9025 should_force_pic_veneer_.
9026 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
9027 Target_arm::should_force_pic_veneer,
9028 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
9029 Target_arm::using_thumb_only, Target_arm:;default_target): New
9030 method defintions.
9031 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
9032 New data member declarations.
9033 (Insn_template::size, Insn_template::alignment): New method defintions.
9034 (Stub_template::Stub_template): New method definition.
9035 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
9036 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
9037 (Stub_factory::Stub_factory): New method definition.
9038 * gold.h (string_hash): New template.
9039 * output.h (Input_section_specifier::hash_value): Use
9040 gold::string_hash.
9041 (Input_section_specifier::string_hash): Remove.
9042 * stringpool.cc (Stringpool_template::string_hash): Use
9043 gold::string_hash.
9044
6c172549
DK
90452009-10-20 Doug Kwan <dougkwan@google.com>
9046
9047 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
9048 symbols of relaxed input sections.
9049 * output.h (Output_section::find_relaxed_input_section): Make
9050 method public.
9051
c5617f2f
DK
90522009-10-16 Doug Kwan <dougkwan@google.com>
9053
9054 * dynobj.cc (Versions::Versions): Initialize version_script_.
9055 Only insert base version symbol definition for a shared object
9056 if version script defines any version versions.
9057 (Versions::define_base_version): New method definition.
9058 (Versions::add_def): Check that base version is not needed.
9059 (Versions::add_need): Define base version lazily.
9060 * dynobj.h (Versions::define_base_version): New method declaration.
9061 (Versions::needs_base_version_): New data member declaration.
9062 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
9063 (check_DATA): Add no_version_test.stdout.
9064 (libno_version_test.so, no_version_test.o no_version_test.stdout):
9065 New make rules.
9066 * testsuite/Makefile.in: Regenerate.
9067 * testsuite/no_version_test.c: New file.
9068 * testsuite/no_version_test.sh: Ditto.
9069
3c12dcdb
DK
90702009-10-16 Doug Kwan <dougkwan@google.com>
9071
9072 * expression.cc (class Segment_start_expression): New class definition.
9073 (Segment_start_expression::value): New method definition.
9074 (script_exp_function_segment_start): Return a new
9075 Segment_start_expression.
9076 * gold/script-c.h (script_saw_segment_start_expression): New function
9077 prototype.
9078 * script-sections.cc (Script_sections::Script_sections): Initialize
9079 SAW_SEGMENT_START_EXPRESSION_ to false.
9080 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9081 and -Tbbs options to specify section addresses if given in
9082 command line and no SEGMENT_START expression is seen in a script.
9083 * script-sections.h (Script_sections::saw_segment_start_expression,
9084 Script_sections::set_saw_segment_start_expression): New method
9085 definition.
9086 (Script_sections::saw_segment_start_expression_): New data member
9087 declaration.
9088 * script.cc (script_saw_segment_start_expression): New function.
9089 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9090 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9091 script_test_7.sh and script_test_8.sh.
9092 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9093 script_test_8.stdout.
9094 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9095 (script_test_6, script_test_6.stdout, script_test_7,
9096 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9097 * Makefile.in: Regenerate.
9098 * testsuite/script_test_6.sh: New file.
9099 * testsuite/script_test_6.t: Same.
9100 * testsuite/script_test_7.sh: Same.
9101 * testsuite/script_test_7.t: Same.
9102 * testsuite/script_test_8.sh: Same.
9103
64b1ae37
DK
91042009-10-16 Doug Kwan <dougkwan@google.com>
9105
9106 * output.cc (Output_segment::set_section_list_address): Cast
9107 expressions to unsigned long long type to avoid format warnings.
9108
661be1e2
ILT
91092009-10-15 Ian Lance Taylor <iant@google.com>
9110
12edd763 9111 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9112 dot assignment to script_sections_.
12edd763
ILT
9113 * script-sections.cc (Script_sections::add_dot_assignment):
9114 Initialize if necessary.
9115
68b6574b
ILT
9116 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9117 program headers with no load segment if there is a linker script.
9118
661be1e2
ILT
9119 * layout.cc (Layout::set_segment_offsets): Align the file offset
9120 to the segment aligment for -N or -n with no load segment.
9121 * output.cc (Output_segment::add_output_section): Don't crash if
9122 the first section is a TLS section.
9123 (Output_segment::set_section_list_addresses): Print an error
9124 message if the address moves backward in a linker script.
9125 * script-sections.cc
9126 (Output_section_element_input::set_section_addresses): Don't
9127 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9128 (Orphan_output_section::set_section_addresses): Likewise.
9129
f15f61a7
DK
91302009-10-15 Doug Kwan <dougkwan@google.com>
9131
9132 * layout.cc (Layout::finish_dynamic_section): Generate tags
9133 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9134 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9135 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9136
82bb573a
ILT
91372009-10-14 Ian Lance Taylor <iant@google.com>
9138
9139 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9140 fields.
9141 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9142 data_shdr fields of relinfo.
9143 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9144 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9145 R_386_TLS_LDO_32, adjust based on section flags.
9146 (Target_i386::Relocate::fix_up_ldo): Remove.
9147
374ad285
ILT
91482009-10-13 Ian Lance Taylor <iant@google.com>
9149
9150 Add support for -pie.
9151 * options.h (class General_options): Add -pie and
9152 --pic-executable.
9153 (General_options::output_is_position_independent): Test -pie.
9154 (General_options::output_is_executable): Return true if not shared
9155 and not relocatable.
9156 (General_options::output_is_pie): Remove.
9157 * options.cc (General_options::finalize): Reject incompatible uses
9158 of -pie.
9159 * gold.cc (queue_middle_tasks): A -pie link is not static.
9160 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9161 * symtab.cc (Symbol::final_value_is_known): Return false if
9162 output_is_position_independent.
9163 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9164 output_is_position_independent.
9165 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9166 output_is_position_independent.
9167 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9168 output_is_position_independent.
9169 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9170 two_file_pie_test.
9171 (basic_pie_test.o, basic_pie_test): New targets.
9172 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9173 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9174 (two_file_pie_test): New target.
9175 * testsuite/Makefile.in: Rebuild.
9176 * README: Remove note saying that -pie is not supported.
9177
c6585162
ILT
91782009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9179
9180 * options.h (class General_options): Add -init and -fini.
9181 * layout.cc (Layout::finish_dynamic_section): Emit
9182 given init and fini functions.
9183
032ce4e9
ST
91842009-10-13 Sriraman Tallam <tmsriram@google.com>
9185
9186 * gc.h (gc_process_relocs): Check if icf is enabled using new
9187 function.
9188 * gold.cc (queue_initial_tasks): Likewise.
9189 (queue_middle_tasks): Likewise.
9190 * object.cc (do_layout): Likewise.
9191 * symtab.cc (is_section_folded): Likewise.
9192 * main.cc (main): Likewise.
9193 * reloc.cc (Read_relocs::run): Likewise.
9194 (Sized_relobj::do_scan_relocs): Likewise.
9195 * icf.cc (is_function_ctor_or_dtor): New function.
9196 (Icf::find_identical_sections): Check if function is ctor or dtor when
9197 safe icf is chosen.
9198 * options.h (General_options::icf): Change option to be an enum.
9199 (Icf_status): New enum.
9200 (icf_enabled): New method.
9201 (icf_safe_folding): New method.
9202 (set_icf_status): New method.
9203 (icf_status_): New variable.
9204 * (options.cc) (General_options::finalize): Set icf_status_.
9205 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9206 icf_test and icf_keep_unique_test to use the --icf enum flag.
9207 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9208 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9209
f345227a
ST
92102009-10-12 Sriraman Tallam <tmsriram@google.com>
9211
9212 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9213 includes to gc.h and icf.h.
9214 * arm.cc: Include gc.h.
9215 * gold.cc: Likewise.
9216 * i386.cc: Likewise.
9217 * powerpc.cc: Likewise.
9218 * sparc.cc: Likewise.
9219 * x86_64.cc: Likewise.
9220 * gc.h: Include icf.h.
9221
1c7814ed
ILT
92222009-10-11 Ian Lance Taylor <iant@google.com>
9223
9224 * plugin.cc: Include "gold.h" before other header files.
9225
ae3b5189
CD
92262009-10-10 Chris Demetriou <cgd@google.com>
9227
9228 * options.h (Input_file_argument::Input_file_type): New enum.
9229 (Input_file_argument::is_lib_): Replace with...
9230 (Input_file_argument::type_): New member.
9231 (Input_file_argument::Input_file_argument): Take Input_file_type
9232 'type' rather than boolean 'is_lib' as second argument.
9233 (Input_file_argument::is_lib): Use type_.
9234 (Input_file_argument::is_searched_file): New function.
9235 (Input_file_argument::may_need_search): Handle is_searched_file.
9236 * options.cc (General_options::parse_library): Support -l:filename.
9237 (General_options::parse_just_symbols): Update for Input_file_argument
9238 changes.
9239 (Command_line::process): Likewise.
9240 * archive.cc (Archive::get_file_and_offset): Likewise.
9241 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9242 * script.cc (read_script_file, script_add_file): Likewise.
9243 * fileread.cc (Input_file::Input_file): Likewise.
9244 (Input_file::will_search_for): Handle is_searched_file.
9245 (Input_file::open): Likewise.
9246 * readsyms.cc (Read_symbols::get_name): Likewise.
9247 * testsuite/Makefile.am (searched_file_test): New test.
9248 * testsuite/Makefile.in: Regenerate.
9249 * testsuite/searched_file_test.cc: New file.
9250 * testsuite/searched_file_test_lib.cc: New file.
9251
f3048a1d
ILT
92522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9253 Ian Lance Taylor <iant@google.com>
9254
9255 * descriptor.cc: Include <cstdio> and "binary-io.h".
9256 (Descriptors::open): Open the files in binary mode always.
9257 * script.cc (Lex::get_token): Treat \r as whitespace.
9258
d4780e57
ILT
92592009-10-09 Ian Lance Taylor <iant@google.com>
9260
9261 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9262
d9a893b8
ILT
92632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9264 Ian Lance Taylor <iant@google.com>
9265
9266 * configure.ac: Check for readv function also.
9267 * fileread.cc (readv): Define if not HAVE_READV.
9268 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9269 does not exist.
9270 * config.in: Regenerate.
9271 * configure: Regenerate.
9272
c0a62865
DK
92732009-10-09 Doug Kwan <dougkwan@google.com>
9274
9275 * layout.cc (Layout::make_output_section): Call target hook to make
9276 ordinary output section.
9277 (Layout::finalize): Adjust parameter list of call the
9278 Target::may_relax().
9279 * layout.h (class Layout::section_list): New method.
9280 * merge.h (Output_merge_base::entsize): Change visibility to public.
9281 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9282 New methods.
9283 (Output_merge_string::do_is_string): New method.
9284 * object.cc (Sized_relobj::do_setup): renamed from
9285 Sized_relobj::set_up.
9286 * object.h (Sized_relobj::adjust_shndx,
9287 Sized_relobj::initializ_input_to_output_maps,
9288 Sized_relobj::free_input_to_output_maps): Change visibilities to
9289 protected.
9290 (Sized_relobj::setup): Virtualize.
9291 (Sized_relobj::do_setup): New method declaration.
9292 (Sized_relobj::invalidate_section_offset,
9293 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9294 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9295 * options.cc (parse_int): New function.
9296 * options.h (parse_int): New declaration.
9297 (DEFINE_int): New macro.
9298 (stub_group_size): New option.
9299 * output.cc (Output_section::Output_section): Initialize memebers
9300 merge_section_map_, merge_section_by_properties_map_,
9301 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9302 (Output_section::add_input_section): Handled deferred code-fill
9303 generation and remove an old comment.
9304 (Output_section::add_relaxed_input_section): New method definition.
9305 (Output_section::add_merge_input_section): Use merge section by
9306 properties map to speed to search. Update merge section maps
9307 as appropriate.
9308 (Output_section::build_relaxation_map): New method definition.
9309 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9310 Same.
9311 (Output_section::relax_input_section): Renamed to
9312 Output_section::convert_input_sections_to_relaxed_sections and change
9313 interface to take a vector of pointers to relaxed sections.
9314 (Output_section::find_merge_section,
9315 Output_section::find_relaxed_input_section): New method definitions.
9316 (Output_section::is_input_address_mapped,
9317 Output_section::output_offset, Output_section::output_address):
9318 Use output section data maps to speed up searching.
9319 (Output_section::find_starting_output_address): Add comments.
9320 (Output_section::do_write,
9321 Output_section::write_to_postprocessing_buffer): Do code-fill
9322 generation as appropriate.
9323 (Output_section::get_input_sections): Invalidate relaxed input section
9324 map.
9325 (Output_section::restore_states): Adjust type of checkpoint .
9326 Invalidate relaxed input section map.
9327 * output.h (Output_merge_base): New class declaration.
9328 (Input_section_specifier): New class defintion.
9329 (class Output_relaxed_input_section) Change base class to
9330 Output_section_data_build.
9331 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9332 base class initializer.
9333 (Output_section::add_relaxed_input_section): New method declaration.
9334 (Output_section::Input_section): Change visibility to protected.
2e702c99 9335 (Output_section::Input_section::relobj,
c0a62865
DK
9336 Output_section::Input_section::shndx): Handle relaxed input sections.
9337 Output_section::input_sections) Change visibility to protected. Also
9338 define overload to return a non-const pointer.
9339 (Output_section::Merge_section_properties): New class defintion.
9340 (Output_section::Merge_section_by_properties_map,
9341 Output_section::Output_section_data_by_input_section_map,
9342 Output_section::Relaxation_map): New types.
9343 (Output_section::relax_input_section): Rename method to
9344 Output_section::convert_input_sections_to_relaxed_sections and change
9345 interface to take a vector of relaxed section pointers.
9346 (Output_section::find_merge_section,
9347 Output_section::find_relaxed_input_section,
9348 Output_section::build_relaxation_map,
9349 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9350 New method declarations.
9351 (Output_section::merge_section_map_
9352 Output_section::merge_section_by_properties_map_,
9353 Output_section::relaxed_input_section_map_,
9354 Output_section::is_relaxed_input_section_map_valid_,
9355 Output_section::generate_code_fills_at_write_): New data members.
9356 * script-sections.cc
9357 (Output_section_element_input::set_section_addresses): Call
9358 current_data_size and addralign methods of relaxed input sections.
9359 (Orphan_output_section::set_section_addresses): Call current_data_size
9360 and addralign methods of relaxed input sections.
9361 * symtab.cc (Symbol_table::compute_final_value): Extract template
9362 from the body of Symbol_table::sized_finalize_symbol.
9363 (Symbol_table::sized_finalized_symbol): Call
9364 Symbol_table::compute_final_value.
9365 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9366 (Symbol_table::compute_final_value): New templated method declaration.
9367 * target.cc (Target::do_make_output_section): New method defintion.
9368 * target.h (Target::make_output_section): New method declaration.
9369 (Target::relax): Add more parameters for input objects, symbol table
9370 and layout. Adjust call to do_relax.
9371 (Target::do_make_output_section): New method declaration.
9372 (Target::do_relax): Add parameters for input objects, symbol table
9373 and layout.
9374
d446d6c4
ILT
93752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9376
9377 * pread.c: Include stdio.h.
9378
bc06c745
ILT
93792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9380
9381 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9382 defined.
9383
75aea3d0
ILT
93842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9385
9386 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9387 Change read_shndx type to unsigned int.
9388 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9389 int.
9390 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9391 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9392 Change read_shndx type to unsigned int.
9393 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9394 int.
9395 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9396 * layout.cc (Layout::create_symtab_sections): Cast the result of
9397 local_symcount * symsize to off_t in the gold_assert.
9398
be8fcb75
ILT
93992009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9400
9401 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9402 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9403 R_ARM_BASE_ABS.
9404 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9405 (Arm_relocate_functions::thm_abs5): New function.
9406 (Arm_relocate_functions::abs12): New function.
9407 (Arm_relocate_functions::abs16): New function.
9408 (Arm_relocate_functions::base_abs): New function.
9409 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9410 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9411 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9412 R_ARM_BASE_ABS.
9413 (Scan::global): Likewise.
9414 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9415 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9416 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9417 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9418 R_ARM_BASE_ABS.
9419
c2a122b6
ILT
94202009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9421
9422 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9423 (Arm_relocate_functions::movt_prel): New function.
9424 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9425 (Arm_relocate_functions::thm_movt_prel): New function.
9426 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9427 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9428 (Scan::global, Relocate::relocate): Likewise.
9429 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9430
c4aa1e2d
ILT
94312009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9432
9433 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9434 Incremental_checker.
9435 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9436 unsigned int.
9437 (class Incremental_inputs_header): New class.
9438 (Incremental_inputs_header_writer): Edit comment.
9439 (Incremental_inputs_entry): New class.
9440 (Incremental_inputs_entry_writer): Edit comment.
9441 (Sized_incremental_binary::do_find_incremental_inputs_section):
9442 Add *strtab_shndx parameter, fill it.
9443 (Sized_incremental_binary::do_check_inputs): New method.
9444 (Incremental_checker::can_incrementally_link_output_file): Use
9445 Sized_incremental_binary::check_inputs.
9446 (Incremental_inputs::report_command_line): Save command line in
9447 command_line_.
9448 * incremental.h:
9449 (Incremental_binary::find_incremental_inputs_section): New
9450 method.
9451 (Incremental_binary::do_find_incremental_inputs_section): Add
9452 strtab_shndx parameter.
9453 (Incremental_binary::do_check_inputs): New pure virtual method.
9454 (Sized_incremental_binary::do_check_inputs): Declare.
9455 (Incremental_checker::Incremental_checker): Add incremental_inputs
9456 parameter, use it to initialize incremental_inputs_.
9457 (Incremental_checker::incremental_inputs_): New field.
9458 (Incremental_checker::command_line): New method.
9459 (Incremental_checker::inputs): New method.
9460 (Incremental_checker::command_line_): New field.
9461
c549a694
ILT
94622009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9463
9464 * incremental.cc: Include <cstdarg> and "target-select.h".
9465 (vexplain_no_incremental): New function.
9466 (explain_no_incremental): New function.
9467 (Incremental_binary::error): New method.
9468 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9469 method.
9470 (make_sized_incremental_binary): New function.
9471 (open_incremental_binary): New function.
9472 (can_incrementally_link_file): Add checks if output is ELF and has
9473 inputs section.
9474 * incremental.h: Include "elfcpp_file.h" and "output.h".
9475 (Incremental_binary): New class.
9476 (Sized_incremental_binary): New class.
9477 (open_incremental_binary): Declare.
9478 * object.cc (is_elf_object): Use
9479 elfcpp::Elf_recognizer::is_elf_file.
9480 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9481 * output.h (Output_file::filesize): New method.
9482
fd3c5f0b
ILT
94832009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9484
9485 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9486 New function.
9487 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9488 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9489 function.
9490 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9491 function.
9492 (Arm_relocate_functions::movw_abs_nc): New function.
9493 (Arm_relocate_functions::movt_abs): New function.
9494 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9495 (Arm_relocate_functions::thm_movt_abs): New function.
9496 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9497 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9498 (Scan::global): Likewise.
9499 (Relocate::relocate): Likewise.
9500 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9501
7f5309a5
ILT
95022009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9503
9504 * arm.cc (Arm_relocate_functions::got_prel) New function.
9505 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9506 (Relocate::relocate): Likewise.
9507 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9508
364c7fa5
ILT
95092009-10-06 Ian Lance Taylor <iant@google.com>
9510
9511 * options.h (class General_options): Define
9512 split_stack_adjust_size parameter.
9513 * object.h (class Object): Add uses_split_stack_ and
9514 has_no_split_stack_ fields. Add uses_split_stack and
9515 has_no_split_stack accessor functions. Declare
9516 handle_split_stack_section.
9517 (class Reloc_symbol_changes): Define.
9518 (class Sized_relobj): Define Function_offsets. Declare
9519 split_stack_adjust, split_stack_adjust_reltype, and
9520 find_functions.
9521 * object.cc (Object::handle_split_stack_section): New function.
9522 (Sized_relobj::do_layout): Call handle_split_stack_section.
9523 * dynobj.cc (Sized_dynobj::do_layout): Call
9524 handle_split_stack_section.
9525 * reloc.cc (Sized_relobj::relocate_sections): Call
9526 split_stack_adjust for executable sections in split_stack
9527 objects. Pass reloc_map to relocate_section.
9528 (Sized_relobj::split_stack_adjust): New function.
9529 (Sized_relobj::split_stack_adjust_reltype): New function.
9530 (Sized_relobj::find_functions): New function.
9531 * target-reloc.h: Include "object.h".
9532 (relocate_section): Add reloc_symbol_changes parameter. Change
9533 all callers.
9534 * target.h (class Target): Add calls_non_split method. Declare
9535 do_calls_non_split virtual method. Declare match_view and
9536 set_view_to_nop.
9537 * target.cc: Include "elfcpp.h".
9538 (Target::do_calls_non_split): New function.
9539 (Target::match_view): New function.
9540 (Target::set_view_to_nop): New function.
9541 * gold.cc (queue_middle_tasks): Give an error if mixing
9542 split-stack and non-split-stack objects with -r.
9543 * i386.cc (Target_i386::relocate_section): Add
9544 reloc_symbol_changes parameter.
9545 (Target_i386::do_calls_non_split): New function.
9546 * x86_64.cc (Target_x86_64::relocate_section): Add
9547 reloc_symbol_changes parameter.
9548 (Target_x86_64::do_calls_non_split): New function.
9549 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9550 parameter.
9551 * powerpc.cc (Target_powerpc::relocate_section): Add
9552 reloc_symbol_changes parameter.
9553 * sparc.cc (Target_sparc::relocate_section): Add
9554 reloc_symbol_changes parameter.
9555 * configure.ac: Call AM_CONDITIONAL for the default target.
9556 * configure: Rebuild.
9557 * testsuite/Makefile.am (TEST_AS): New variable.
9558 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9559 (check_DATA): Add split_i386 and split_x86_64 files.
9560 (SPLIT_DEFSYMS): Define.
9561 (split_i386_[1234n].o): New targets.
9562 (split_i386_[124]): New targets.
9563 (split_i386_[1234r].stdout): New targets.
9564 (split_x86_64_[1234n].o): New targets.
9565 (split_x86_64_[124]): New targets.
9566 (split_x86_64_[1234r].stdout): New targets.
9567 (MOSTLYCLEANFILES): Add new executables.
9568 * testsuite/split_i386.sh: New file.
9569 * testsuite/split_x86_64.sh: New file.
9570 * testsuite/split_i386_1.s: New file.
9571 * testsuite/split_i386_2.s: New file.
9572 * testsuite/split_i386_3.s: New file.
9573 * testsuite/split_i386_4.s: New file.
9574 * testsuite/split_i386_n.s: New file.
9575 * testsuite/split_x86_64_1.s: New file.
9576 * testsuite/split_x86_64_2.s: New file.
9577 * testsuite/split_x86_64_3.s: New file.
9578 * testsuite/split_x86_64_4.s: New file.
9579 * testsuite/split_x86_64_n.s: New file.
9580 * testsuite/testfile.cc (Target_test): Update relocation_section
9581 function.
9582 * testsuite/Makefile.in: Rebuild.
9583
e8a9fcda
ILT
95842009-10-06 Ian Lance Taylor <iant@google.com>
9585
9586 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9587 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9588 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9589 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9590 the address on ldo_addrs_.
9591 (Target_i386::Relocate::fix_up_ldo): New function.
9592
e99daf92
ILT
95932009-10-06 Rafael Espindola <espindola@google.com>
9594
9595 * plugin.cc (add_input_library): New.
9596 (Plugin::load): Add add_input_library to tv.
9597 (Plugin_manager::add_input_file): Add the is_lib argument.
9598 (add_input_file): Update call to Plugin_manager::add_input_file.
9599 (add_input_library): New.
9600 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9601
966d4097
DK
96022009-09-30 Doug Kwan <dougkwan@google.com>
9603
9604 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9605 symbol and call Symbol::may_need_copy_reloc to determine if
9606 a copy reloc is needed.
9607 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9608 nocopyreloc is given in command line.
9609 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9610 given in command line.
9611 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9612 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9613 of the removed Target_i386::may_need_copy_reloc.
9614 * options.h (copyreloc): New option with default value false.
9615 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9616 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9617 instead of the removed Target_powerpc::may_need_copy_reloc.
9618 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9619 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9620 instead of the removed Target_sparc::may_need_copy_reloc.
9621 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9622 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9623 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9624 instead of the removed Target_x86_64::may_need_copy_reloc.
9625
029ba973
ILT
96262009-09-30 Ian Lance Taylor <iant@google.com>
9627
9628 * object.h (class Object): Remove target_ field, and target,
9629 sized_target, and set_target methods.
9630 (Object::sized_target): Remove.
9631 (class Sized_relobj): Update declarations. Remove sized_target.
9632 * object.cc (Sized_relobj::setup): Remove target parameter.
9633 Change all callers.
9634 (Input_objects::add_object): Don't do anything with the target.
9635 (make_elf_sized_object): Add punconfigured parameter. Change all
9636 callers. Set or test parameter target.
9637 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9638 Change all callers.
9639 * parameters.cc (Parameters::set_target): Change parameter type to
9640 be non-const.
9641 (Parameters::default_target): Remove.
9642 (set_parameters_target): Change parameter type to be non-const.
9643 (parameters_force_valid_target): New function.
9644 (parameters_clear_target): New function.
9645 * parameters.h (class Parameters): Update declarations. Remove
9646 default_target method. Add sized_target and clear_target
9647 methods. Change target_ to be non-const.
9648 (set_parameters_target): Update declaration.
9649 (parameters_force_valid_target): Declare.
9650 (parameters_clear_target): Declare.
9651 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9652 as NULL if we aren't searching.
9653 (Add_symbols::run): Don't check for compatible target.
9654 * fileread.cc (Input_file::open_binary): Call
9655 parameters_force_valid_target.
9656 * gold.cc (queue_middle_tasks): Likewise.
9657 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9658 set_target on object.
9659 * dynobj.h (class Sized_dynobj): Update declarations.
9660 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9661 make_elf_object returns NULL.
9662 (Archive::include_member): Don't check whether object target is
9663 compatible.
9664 * output.cc (Output_section::add_input_section): Get target from
9665 parameters.
9666 (Output_section::relax_input_section): Likewise.
9667 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9668 parameters.
9669 (Sized_relobj::do_scan_relocs): Likewise.
9670 (Sized_relobj::relocate_sections): Likewise.
9671 * resolve.cc (Symbol_table::resolve): Likewise.
9672 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9673 parameter. Change all callers.
9674 (Symbol_table::add_from_object): Get target from parameters.
9675 (Symbol_table::add_from_relobj): Don't check object target.
9676 (Symbol_table::add_from_dynobj): Likewise.
9677 (Symbol_table::define_special_symbol): Get target from
9678 parameters.
9679 * symtab.h (class Symbol_table): Update declaration.
9680 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9681 parameter. Change all callers. Clear parameter target.
9682 (Binary_test): Test target here.
9683 * testsuite/object_unittest.cc (gold_testsuite): Remove
9684 target_test_pointer parameter. Change all callers.
9685 (Object_test): Test target here.
9686
a6a22b83
ILT
96872009-09-26 Ian Lance Taylor <iant@google.com>
9688
9689 * testsuite/initpri1.c: Don't try to use constructor priorities if
9690 compiling with gcc before 4.3.
9691
6a8f49fe
ILT
96922009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9693
9694 * testsuite/retain_symbols_file_test.sh (check_present): Change
9695 output file name to retain_symbols_file_test.stdout.
9696 (check_absent): Likewise.
9697
8c604651
CS
96982009-09-18 Craig Silverstein <csilvers@google.com>
9699
9700 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9701 * options.cc: Include <cerrno> and <fstream>.
9702 (General_options::finalize): Parse -retain-symbols-file tag.
9703 * options.h: New flag.
9704 (General_options): New method should_retain_symbol, new
9705 variable symbols_to_retain.
9706 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9707 should_retain_symbol map.
9708 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9709 * testsuite/Makefile.in: Regenerate.
9710 * testsuite/retain_symbols_file_test.sh: New file.
9711
ca58b19f
NC
97122009-09-18 Nick Clifton <nickc@redhat.com>
9713
9714 * po/es.po: Updated Spanish translation.
9715
20e6d0d6
DK
97162009-09-17 Doug Kwan <dougkwan@google.com>
9717
9718 * debug.h (DEBUG_RELAXATION): New constant.
9719 (DEBUG_ALL): Add DEBUG_RELAXATION.
9720 (debug_string_to_enum): Add relaxation debug option.
9721 * layout.cc
9722 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9723 Layout::Relaxation_debug_check::read_sections,
9724 Layout::Relaxation_debug_check::read_sections): New method definitions.
9725 (Layout::Layout): Initialize data members
9726 record_output_section_data_from_scrips_,
9727 script_output_section_data_list_ and relaxation_debug_check_.
9728 (Layout::save_segments, Layout::restore_segments,
9729 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9730 Layout::relaxation_loop_body): New method definitions.
9731 (Layout::finalize): Support relaxation. Move section layout code to
9732 Layout::relaxation_loop_body.
9733 (Layout::set_asection_address_from_script): Move code for orphan
9734 section placement out.
9735 (Layout::place_orphan_sections_in_script): New method definition.
9736 * layout.h (Output_segment_headers, Output_file_header):
9737 New forward class declarations.
9738 (Layout::~Layout): Define.
9739 (Layout::new_output_section_data_from_script): New method definition.
9740 (Layout::place_orphan_sections_in_script): New method declaration.
9741 (Layout::Segment_states): New type declaration.
9742 (Layout::save_segments, Layout::restore_segments,
9743 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9744 Layout::relaxation_loop_body): New method declarations.
9745 (Layout::Output_section_data_list): New type declaration.
9746 (Layout::Relaxation_debug_check): New class definition.
9747 (Layout::record_output_section_data_from_script_,
9748 Layout::script_output_section_data_list_, Layout::segment_states_,
9749 Layout::relaxation_debug_check_): New data members.
9750 * output.cc: (Output_section_headers::do_size): New method definition.
9751 (Output_section_headers::Output_section_headers): Move size
9752 computation to Output_section_headers::do_size.
9753 (Output_segment_headers::do_size): New method definition.
e1df38aa 9754 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9755 Output_file_header::do_size and call it.
9756 (Output_file_header::do_size): New method definition.
9757 (Output_data_group::Output_data_group): Adjust call to
9758 Output_section_data.
9759 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9760 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9761 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9762 RELAXED_INPUT_SECTION_CODE.
9763 (Output_section::Output_section): Initialize data member checkpoint_.
9764 (Output_section::~Output_section): Delete checkpoint object pointed
9765 by checkpoint_.
9766 (Output_section::add_input_section): Always add an Input_section if
9767 relaxing.
9768 (Output_section::add_merge_input_section): Add assert.
9769 (Output_section::relax_input_section): New method definition.
9770 (Output_section::set_final_data_size): Set load address to zero for
9771 an unallocated section.
9772 (Output_section::do_address_and_file_offset_have_reset_values):
9773 New method definition.
9774 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9775 Handle relaxed input section.
9776 (Output_section::sort_attached_input_sections): Checkpoint input
9777 section list lazily.
9778 (Output_section::get_input_sections): Change type of input_sections to
9779 list of Simple_input_section pointers. Checkpoint input section list
9780 lazily. Also handle relaxed input sections.
9781 (Output_section::add_input_section_for_script): Take a reference to
9782 a Simple_input_section object instead of Relobj pointer and section
9783 index as parameter. Handle relaxed input sections.
9784 (Output_section::save_states, Output_section::restore_states): New
9785 method definitions.
9786 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9787 (Output_data::is_data_size_fixed): New method definition.
9788 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9789 if it is fixed.
9790 (Output_data::address_and_file_offset_have_reset_values): New method
9791 definition.
9792 (Output_data::do_address_and_file_offset_have_reset_values): New method
9793 definition.
9794 (Output_data::set_data_size): Check that data size is not fixed.
9795 (Output_data::fix_data_size): New method definition.
9796 (Output_data::is_data_size_fixed_): New data member.
9797 (Output_section_headers::set_final_data_size): New method definition.
9798 (Output_section_headers::do_size): New method declaration.
9799 (Output_segment_headers::set_final_data_size): New method definition.
9800 (Output_segment_headers::do_size): New method declaration.
9801 (Output_file_header::set_final_data_size)::New method definition.
9802 (Output_file_header::do_size)::New method declaration.
9803 (Output_section_data::Output_section_data): Add new parameter
9804 is_data_size_fixed and use it to fix data size.
9805 (Output_data_const::Output_data_const): Adjust call to base class
9806 constructor and fix data size.
9807 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9808 base class constructor and fix data size.
9809 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9810 base class constructor and fix data size.
9811 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9812 class constructor and fix data size.
9813 (Output_data_group::set_final_data_size): New method definition.
9814 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9815 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9816 class constructor and fix data size.
9817 (Output_relaxed_input_section): New class definition.
9818 (Output_section::Simple_input_section): New class definition.
9819 (Output_section::get_input_sections): Adjust parameter list.
9820 (Output_section::add_input_section_for_script): Same.
9821 (Output_section::save_states, Output_section::restore_states,
9822 Output_section::do_address_and_file_offset_have_reset_values,
9823 (Output_section::Input_section::Input_section): Handle
9824 RELAXED_INPUT_SECTION_CODE. Add new overload for
9825 Output_relaxed_input_section.
9826 (Output_section::Input_section::is_input_section,
9827 Output_section::Input_section::set_output_section): Handle relaxed
9828 input section.
9829 (Output_section::Input_section::is_relaxed_input_section,
9830 Output_section::Input_section::output_section_data,
9831 Output_section::Input_section::relaxed_input_section): New method
9832 definitions.
9833 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9834 value.
9835 (Output_section::Input_section::u1_): Update comments.
9836 (Output_section::Input_section::u2_): Add new union member poris.
9837 (Output_section::Checkpoint_output_section): New classs definition.
9838 (Output_section::relax_input_section): New method declaration.
9839 (Output_section::checkpoint_): New data member.
9840 (Output_segment): Update comments.
9841 (Output_segment::Output_segment): Un-privatize copy constructor.
9842 (Output_segment::operator=): Un-privatize.
9843 * script-sections.cc (Output_section_element::Input_section_list):
9844 Change element type to Output_section::Simple_input_section.
9845 (Output_section_element_dot_assignment::set_section_addresses):
9846 Register output section data for relaxation clean up.
9847 (Output_data_exression::Output_data_expression): Adjust call to base
9848 constructor to fix data size.
9849 (Output_section_element_data::set_section_addresses): Register
9850 Output_data_expression object for relaxation clean up.
9851 (struct Input_section_info): Replace Relobj pointer and section index
9852 pair with Output_section::Simple_input_section and Convert struct to a
9853 class.
9854 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9855 Input_section_info data member to use accessors.
20e6d0d6
DK
9856 (Output_section_element_input::set_section_addresses): Use layout
9857 parameter. Adjust code to use Output_section::Simple_input_section
9858 and Input_secction_info classes. Register filler for relaxation
9859 clean up.
9860 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9861 and section index pair with Output_section::Simple_input_section
9862 class. Adjust code accordingly.
9863 (Phdrs_element::release_segment): New method definition.
9864 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9865 segment list.
9866 (Script_sections::release_segments): New method definition.
9867 * gold/script-sections.h (Script_sections::release_segments): New
9868 method declaration.
9869 * gold/target.h (Target::may_relax, Target::relax,
9870 Target::do_may_relax, Target::do_relax): New method definitions.
9871
5e445df6
ILT
98722009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9873
9874 * arm.cc (has_signed_unsigned_overflow): New function.
9875 (Arm_relocate_functions::abs8): New function.
9876 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9877 (Target_arm::Scan::global): Likewise.
9878 (Target_arm::relocate::relocate): Likewise.
9879 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9880 Likewise.
9881
8c604651 98822009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9883
9884 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9885 * testsuite/Makefile.in: Regenerate.
9886
1e9cc1c2
NC
98872009-09-11 Nick Clifton <nickc@redhat.com>
9888
9889 * po/gold.pot: Updated by the Translation project.
9890
6a89f575
CC
98912009-09-08 Cary Coutant <ccoutant@google.com>
9892
9893 * output.cc (Output_file::open): Add execute permission to empty file.
9894 * testsuite/Makefile.am (permission_test): New test.
9895 * testsuite/Makefile.in: Regenerate.
9896
fdcac5af
ILT
98972009-09-02 Ian Lance Taylor <iant@google.com>
9898
9899 * output.cc (Output_file::resize): Call map_no_anonymous rather
9900 than map.
9901
44453f85
ILT
99022009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9903
9904 * gold.cc: Include "incremental.h".
9905 (queue_initial_tasks): Call Incremental_checker methods.
9906 * incremental.cc: Include "output.h".
9907 (Incremental_checker::can_incrementally_link_output_file): New
9908 method.
9909 * incremental.h (Incremental_checker): New class.
9910
9911 * output.cc (Output_file::open_for_modification): New method.
9912 (Output_file::map_anonymous): Changed return type to bool. Record
9913 map in base_ field.
9914 (Output_file::map_no_anonymous): New method, broken out of map.
9915 (Output_file::map): Use map_no_anonymous and map_anonymous.
9916 * output.h (class Output_file): Update declarations.
9917
293c1386
CC
99182009-08-24 Cary Coutant <ccoutant@google.com>
9919
9920 * options.h (Command_line::Pre_options): New class.
9921 (Command_line::pre_options): New member.
9922 * options.cc (gold::options::ready_to_register): New variable.
9923 (One_option::register_option): Do nothing if not registering options.
9924 Assert if same short option registered twice.
9925 (General_options::General_options): Turn off option registration when
9926 done constructing.
9927 (Command_line::Pre_options::Pre_options): New constructor.
9928
f773f3d2
CC
99292009-08-24 Cary Coutant <ccoutant@google.com>
9930
06a73cfe
CC
9931 * options.h (General_options::no_keep_memory): Remove incorrect
9932 short option.
f773f3d2 9933
a15af8e2
RW
99342009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9935
9936 * Makefile.am (am__skiplex, am__skipyacc): New.
9937 * Makefile.in: Regenerate.
9938
c462b41b
RW
99392009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9940
14ec8efd
RW
9941 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9942 (INCLUDES): ... this.
9943 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9944 (AM_CPPFLAGS): Renamed from ...
9945 (INCLUDE): ... this.
9946 * Makefile.in, testsuite/Makefile.in: Regenerate.
9947
81ecdfbb
RW
9948 * Makefile.in: Regenerate.
9949 * aclocal.m4: Likewise.
9950 * config.in: Likewise.
9951 * configure: Likewise.
9952 * testsuite/Makefile.in: Likewise.
9953
c462b41b
RW
9954 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9955 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9956 * Makefile.in: Regenerate.
9957 * testsuite/Makefile.in: Regenerate.
9958
2da73f13
CC
99592009-08-19 Cary Coutant <ccoutant@google.com>
9960
9961 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9962 symbols in shared libraries overridden by hidden or internal symbols
9963 in the main program.
9964
2db70501
CD
99652009-08-19 Chris Demetriou <cgd@google.com>
9966
9967 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9968 checking source file names in error messages.
9969
f733487b
DK
99702009-08-18 Doug Kwan <dougkwan@google.com>
9971
9972 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9973 an elcpp::Ehdr as parameter. Adjust call to set_target.
9974 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9975 an elfcpp::Ehdr as parameter.
9976 * object.cc (Object::set_target): Remove the version that looks up
9977 a target and sets it.
9978 (Sized_relobj::setup): Take a Target object instead of
9979 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9980 (make_elf_sized_object): Find target and ask target to
9981 make an ELF object.
9982 * object.h: (Object::set_target): Remove the version that looks up
9983 a target and sets it.
9984 (Sized_relobj::setup): Take a Target object instead of
9985 an elfcpp:Ehdr as parameter.
9986 * target.cc: Include dynobj.h.
9987 (Target::do_make_elf_object_implementation): New.
2e702c99 9988 (Target::do_make_elf_object): New.
f733487b
DK
9989 * target.h (Target::make_elf_object): New template declaration.
9990 (Target::do_make_elf_object): New method declarations.
9991 (Target::do_make_elf_object_implementation): New template declaration.
9992
cc70f101
ILT
99932009-08-14 Ian Lance Taylor <iant@google.com>
9994
9995 * gold.h (FUNCTION_NAME): Define.
9996 (gold_unreachable): Use FUNCTION_NAME.
9997
ef5e0cb1
ST
99982009-08-12 Sriraman Tallam <tmsriram@google.com>
9999
10000 * icf.cc (Icf::find_identical_sections): Issue a warning when a
10001 symbol in the --keep-unique list is not found.
10002
48c187ce
ST
100032009-08-12 Sriraman Tallam <tmsriram@google.com>
10004
10005 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
10006 been maked as --keep-unique.
10007 (Icf::unfold_section): New function.
10008 * icf.h (Icf::unfold_section): New function.
10009 * options.h (General_options::keep_unique): New option.
10010 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
10011 * testsuite/Makefile.in: Regenerate.
10012 * testsuite/icf_keep_unique_test.sh: New file.
10013 * testsuite/icf_keep_unique_test.cc: New file.
10014
645afe0c
CC
100152009-08-12 Cary Coutant <ccoutant@google.com>
10016
10017 PR 10471
10018 * resolve.cc (Symbol_table::resolve): Check for references from
10019 dynamic objects to hidden and internal symbols.
10020 * testsuite/Makefile.am (hidden_test.sh): New test.
10021 * testsuite/Makefile.in: Regenerate.
10022 * testsuite/hidden_test.sh: New script.
10023 * testsuite/hidden_test_1.c: New test source.
10024 * testsuite/hidden_test_main.c: New test source.
10025
11af873f
DK
100262009-08-11 Doug Kwan <dougkwan@google.com>
10027
10028 * arm.cc: Update comments.
10029 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
10030 segment to locate the .ARM.exidx section if present.
10031
b9f7d72d
DK
100322009-08-09 Doug Kwan <dougkwan@google.com>
10033
10034 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
10035 patch.
10036
ddd3c53c
ST
100372009-08-07 Sriraman Tallam <tmsriram@google.com>
10038 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
10039 compiler warnings.
10040
27721062
ST
100412009-08-06 Sriraman Tallam <tmsriram@google.com>
10042
10043 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
10044 valid tls_segment only for non-debug-section relocations.
10045 * testsuite/Makefile.am: Add gc_tls_test.
10046 * testsuite/Makefile.in: Regenerate.
10047 * testsuite/gc_tls_test.cc: New file.
10048 * testsuite/gc_tls_test.sh: New file.
10049
ef15dade 100502009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 10051
ef15dade
ST
10052 * icf.cc: New file.
10053 * icf.h: New file.
10054 * Makefile.am (CCFILES): Add icf.cc.
10055 (HFILES): Add icf.h
10056 * Makefile.in: Regenerate.
10057 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
10058 * gc.h (gc_process_relocs): Populate lists used by icf to contain
10059 section, symbol and addend information for the relocs.
10060 * gold.cc (queue_middle_tasks): Call identical code folding.
10061 * gold.h: Add defines for multimap.
10062 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
10063 to the call of finalize_local_symbols.
10064 * main.cc (main): Create object of class Icf.
10065 * object.cc (Sized_relobj::do_layout): Allow this function to be
10066 called twice during icf.
10067 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
10068 to sections marked as identical by icf.
10069 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
10070 when available.
10071 (Sized_relobj::do_section_entsize): New function.
10072 * object.h (Object::section_entsize): New function.
10073 (Object::do_section_entsize): New pure virtual function.
10074 (Relobj::finalize_local_symbols): Add new parameter.
10075 (Relobj::do_section_entsize): New function.
10076 * options.h (General_options::icf): New option.
10077 (General_options::icf_iterations): New option.
10078 (General_options::print_icf_sections): New option.
10079 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10080 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10081 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10082 icf.
10083 * symtab.cc (Symbol_table::is_section_folded): New function.
10084 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10085 to sections marked as identical by icf.
10086 * symtab.h (Symbol_table::set_icf): New function.
10087 (Symbol_table::icf): New function.
10088 (Symbol_table::is_section_folded): New function.
10089 (Symbol_table::icf_): New data member.
10090 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10091 * testsuite/Makefile.am: Add commands to build icf_test.
10092 * testsuite/Makefile.in: Regenerate.
10093 * testsuite/icf_test.sh: New file.
10094 * testsuite/icf_test.cc: New file.
10095
c3b65ac4
CD
100962009-07-24 Chris Demetriou <cgd@google.com>
10097
10098 * layout.cc (is_compressible_debug_section): Fix incorrect
10099 comment about compressed section names.
10100
1caf2c51
ILT
101012009-07-20 Ian Lance Taylor <ian@airs.com>
10102
10103 PR 10419
10104 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10105
1ef4d87f
ILT
101062009-07-16 Ian Lance Taylor <iant@google.com>
10107
10108 PR 10400
10109 * layout.h: #include <map>.
10110 (class Kept_section): Change from struct to class. Add accessors
10111 and setters. Add section size to Comdat_group mapping. Change
10112 Comdat_group to std::map. Add is_comdat_ field. Add
10113 linkonce_size field in union.
10114 (class Layout): Update declaration of find_or_add_kept_section.
10115 Don't declare find_kept_object.
10116 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10117 parameter. Add object, shndx, is_comdat, and is_group_name
10118 parameters. Change all callers. Adjust for new Kept_section.
10119 (Layout::find_kept_object): Remove.
10120 * object.cc (Sized_relobj::include_section_group): Update use of
10121 Kept_section. Rename secnum to shndx. Only record
10122 Kept_comdat_section if sections are the same size.
10123 (Sized_relobj::include_linkonce_section): Update use of
10124 Kept_section. Only record Kept_comdat_section if sections are the
10125 same size. Set size of linkonce section.
10126 (Sized_relobj::map_to_kept_section): Update call to
10127 get_kept_comdat_section.
10128 * object.h (class Sized_relobj): Rename fields in
10129 Kept_comdat_section to drop trailing underscores; change object
10130 field to Relobj*. Change Kept_comdat_section_table to store
10131 struct rather than pointer.
10132 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10133 Add kept_object and kept_shndx parameters. Change all callers.
10134 (Sized_relobj::get_kept_comdat_section): Change return type to
10135 bool. Add kept_object and kept_shndx parameters. Change all
10136 callers.
10137 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10138 Layout::find_or_add_kept_section.
10139
37c3b7b0
ILT
101402009-07-09 Ian Lance Taylor <iant@google.com>
10141
10142 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10143 Reserve space in the hash table.
10144
98fa85cb
ILT
101452009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10146
10147 * fileread.cc (File_read::get_mtime): New method.
10148 * fileread.h (Timespec): New structure.
10149 (File_read::get_mtime): New method.
10150 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10151 Renamed from timestamp_nsec.
10152 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10153 Elf_Xword.
e1df38aa 10154 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10155 timestamp_nsec.
e1df38aa 10156 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10157 (Incremental_inputs::report_obejct): Save mtime; style fix.
10158 (Incremental_inputs::report_script): Save mtime; style fix.
10159 (Incremental_inputs::finalize_inputs): Style fix.
10160 (Incremental_inputs::finalize): Style fix.
10161 (Incremental_inputs::create_input_section_data): Store inputs
10162 mtime.
10163 * incremental.h (Incremental_inputs::report_script): Add mtime
10164 argument.
10165 (Incremental_inputs::Input_info::Input_info): Intialize only one
10166 union member.
10167 (Incremental_inputs::Input_info::archive): Move to nameless
10168 union.
10169 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10170 (Incremental_inputs::Input_info::script): Move to nameless union.
10171 (Incremental_inputs::mtime): New field.
10172 * script.cc (read_input_script): Pass file mtime to
10173 Incremental_input.
10174 * script.h (Script_info::inputs): Style fix.
10175
c9d70757
ILT
101762009-07-01 Ian Lance Taylor <ian@airs.com>
10177
10178 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10179 instead of 32.
10180
9c547ec3
ILT
101812009-06-24 Ian Lance Taylor <iant@google.com>
10182
10183 PR 10156
10184 * layout.cc (Layout::choose_output_section): If we find an
10185 existing section, update the flags.
10186 (Layout::create_notes): New function, broken out of
10187 Layout::finalize.
10188 (Layout::finalize): Don't create note sections.
10189 (Layout::create_note): Don't crash if linker script discards
10190 section.
10191 (Layout::create_gold_note): Likewise.
10192 (Layout::create_build_id): Likewise. Don't set
10193 after_input_sections on the section.
10194 (Layout::create_executable_stack_info): Remove target parameter.
10195 Change caller.
10196 * layout.h (class Layout): Declare create_notes. Update
10197 declaration of create_executable_stack_info.
10198 * gold.cc (queue_middle_tasks): Call create_notes.
10199 * output.cc (Output_section::update_flags_for_input_section): Move
10200 here from output.h. If SHF_ALLOC flag is newly set, mark address
10201 invalid.
10202 * output.h (Output_data::mark_address_invalid): New function.
10203 (class Output_section): Only declare, not define,
10204 update_flags_for_input_section. Remove set_flags.
10205
55458500
ILT
102062009-06-24 Ian Lance Taylor <iant@google.com>
10207
10208 * script-sections.cc (Output_section_definition::
10209 set_section_addresses): Rename shadowing local load_address to
10210 laddr.
10211
1307d6cd
ILT
102122009-06-24 Ian Lance Taylor <iant@google.com>
10213
10214 PR 10244
10215 * reloc.cc (relocate_sections): Skip empty relocation sections.
10216
ec3f783e
ILT
102172009-06-23 Ian Lance Taylor <iant@google.com>
10218
10219 PR 10156
10220 * layout.cc (Layout::create_note): Use choose_output_section
10221 rather than make_output_section.
10222
459c9f1c
ILT
102232009-06-23 Ian Lance Taylor <iant@google.com>
10224
10225 PR 10237
10226 * options.cc (General_options::parse_V): Set printed_version_.
10227 (General_options::General_options): Initialize printed_version_.
10228 * options.h (class General_options): Add printed_version_ field.
10229 * gold.cc (queue_initial_tasks): If there are no input files,
10230 don't give a fatal error if we printed the version information.
10231 (queue_middle_tasks): If using -r with a shared object, give a
10232 fatal error rather than an ordinary error.
10233
1518dc8f
ILT
102342009-06-23 Ian Lance Taylor <iant@google.com>
10235
10236 PR 10219
10237 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10238 (Layout::make_output_section): Set have_stabstr_section_ if we see
10239 a .stab*str section.
10240 (Layout::finalize): Call link_stabs_sections.
10241 (Layout::link_stabs_sections): New file.
10242 * layout.h (class Layout): Add have_stabstr_section_ field.
10243 Declare link_stabs_sections.
10244
3d857b98
DK
102452009-06-23 Doug Kwan <dougkwan@google.com>
10246
10247 * Makefile.am (libgold_a_LIBADD): New.
10248 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10249 * Makefile.in: Regenerate.
3d857b98
DK
10250 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10251 * configure: Regenerate.
10252 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10253 * fileread.cc: Include sys/state.h
10254 * gold.h: Declare memmem and strndup if found missing.
10255 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10256
0639a6f6
ILT
102572009-06-23 Ian Lance Taylor <iant@google.com>
10258
10259 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10260 * configure: Rebuild.
10261
8d63875c
ILT
102622009-06-23 Ian Lance Taylor <iant@google.com>
10263
10264 PR 10147
10265 * object.cc (Object::section_contents): Don't try to get a view if
10266 the section has length zero.
10267 (Object::handle_gnu_warning_section): If the section is empty, use
10268 the name of the section as the warning.
10269
f7c8a183
ILT
102702009-06-23 Ian Lance Taylor <iant@google.com>
10271
10272 PR 10133
10273 * stringpool.h (class Stringpool_template): Add optimize_ field.
10274 (Stringpool_template::set_optimize): New function.
10275 * stringpool.cc (Stringpool_template::Stringpool_template):
10276 Initialize optimize_ field.
10277 (Stringpool_template::set_string_offsets): Test local optimize
10278 fild rather than parameter.
10279 * layout.cc (Layout::Layout): Call set_optimize on the section
10280 name stringpool.
10281
e6a307ba
ILT
102822009-06-22 Ian Lance Taylor <iant@google.com>
10283
10284 PR 10030
10285 * yyscript.y: Parse TARGET.
10286 * script.cc (script_set_target): New function.
10287 * script-c.h (script_set_target): Declare.
10288 * options.cc (General_options::string_to_object_format): Rename
10289 from string_to_object_format in anonymous namespace. Change
10290 callers.
10291 * options.h (class General_options): Declare
10292 string_to_object_format.
10293
3ee173de
ILT
102942009-06-22 Ian Lance Taylor <iant@google.com>
10295
10296 * script-sections.cc (Script_sections::create_segments): Don't put
10297 program headers in a PT_LOAD segment if -n or -N.
10298
102992009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10300
10301 PR 10141
10302 * options.h (class General_options): Add -z lazy and -z now. Sort
10303 -z options into alphabetical order.
10304 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10305
cd6739a1 103062009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10307
10308 * layout.cc (Layout::make_output_section): Call
10309 Target::new_output_section.
10310 (Layout::attach_allocated_section_to_segment): Put large section
10311 sections in a separate load segment with the large segment flag
10312 set.
10313 (Layout::segment_precedes): Sort large data segments after other
10314 load segments.
10315 (align_file_offset): New static function.
10316 (Layout::set_segment_offsets): Use align_file_offset.
10317 * output.h (class Output_section): Add is_small_section_ and
10318 is_large_section_ fields.
10319 (Output_section::is_small_section): New function.
10320 (Output_section::set_is_small_section): New function.
10321 (Output_section::is_large_section): New function.
10322 (Output_section::set_is_large_section): New function.
10323 (Output_section::is_large_data_section): New function.
10324 (class Output_segment): Add is_large_data_segment_ field.
10325 (Output_segment::is_large_data_segment): New function.
10326 (Output_segment::set_is_large_data_segment): New function.
10327 * output.cc (Output_section::Output_section): Initialize new
10328 fields.
10329 (Output_segment::Output_segment): Likewise.
10330 (Output_segment::add_output_section): Add assertion that large
10331 data sections always go in large data segments. Force small data
10332 sections to the end of the list of data sections. Force small BSS
10333 sections to the start of the list of BSS sections. For large BSS
10334 sections to the end of the list of BSS sections.
10335 * symtab.h (class Symbol): Declare is_common_shndx.
10336 (Symbol::is_defined): Check Symbol::is_common_shndx.
10337 (Symbol::is_common): Likewise.
10338 (class Symbol_table): Define enum Commons_section_type. Update
10339 declarations. Add small_commons_ and large_commons_ fields.
10340 * symtab.cc (Symbol::is_common_shndx): New function.
10341 (Symbol_table::Symbol_table): Initialize new fields.
10342 (Symbol_table::add_from_object): Put small and large common
10343 symbols in the right list.
10344 (Symbol_table::sized_finalized_symbol): Check
10345 Symbol::is_common_shndx.
10346 (Symbol_table::sized_write_globals): Likewise.
10347 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10348 common symbol lists. Don't call do_allocate_commons_list if the
10349 list is empty.
10350 (Symbol_table::do_allocate_commons_list): Remove is_tls
10351 parameter. Add comons_section_type parameter. Change all
10352 callers. Handle small and large common symbols.
10353 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10354 Symbol::is_common_shndx.
10355 * resolve.cc (symbol_to_bits): Likewise.
10356 * target.h (Target::small_common_shndx): New function.
10357 (Target::small_common_section_flags): New function.
10358 (Target::large_common_shndx): New function.
10359 (Target::large_common_section_flags): New function.
10360 (Target::new_output_section): New function.
10361 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10362 small_common_section_flags, and large_common_section_flags
10363 fields.
10364 (Target::do_new_output_section): New virtual function.
10365 * arm.cc (Target_arm::arm_info): Initialize new fields.
10366 * i386.cc (Target_i386::i386_info): Likewise.
10367 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10368 Likewise.
10369 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10370 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10371 (Target_x86_64::do_new_output_section): New function.
10372 * configure.ac: Define conditional MCMODEL_MEDIUM.
10373 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10374 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10375 (large_LDFLAGS): Define.
10376 * testsuite/large.c: New file.
10377 * testsuite/testfile.cc (Target_test::test_target_info):
10378 Initialize new fields.
10379 * configure, testsuite/Makefile.in: Rebuild.
10380
bb04269c
DK
103812009-06-05 Doug Kwan <dougkwan@google.com>
10382
10383 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10384 * Makefile.in: Regenerate.
bb04269c
DK
10385 * i386.cc (class Target_i386): Define new virtual method to
10386 override do_is_local_label_name in parent.
10387 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10388 local symbols if --discard-locals or -X is given.
10389 * options.h (class General_options): Declare new options
10390 '--discard-locals' and '-X' for discarding locals.
10391 * target.h (class Target): Define new methods is_local_label_name.
10392 Declare new virtual method do_is_local_label_name.
10393 * target.cc: New file.
10394 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10395 (check_SCRIPTS): Add discard_locals_test.sh.
10396 (check_DATA): Add discard_local_tests.syms.
10397 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10398 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10399 * testsuite/Makefile.in: Regenerate.
10400 * testsuite/discard_locals_test.c: New file.
10401 * testsuite/discard_locals_test.sh: Same.
10402
805bb01c
DK
104032009-06-05 Doug Kwan <dougkwan@google.com>
10404
10405 * object.cc (Sized_relobj::Sized_relobj): Initialize
10406 discarded_eh_frame_shndx_ to -1U.
10407 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10408 section.
10409 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10410 a discarded .eh_frame section.
10411 (Sized_relobj::do_finalize_local_symbols): Ditto.
10412 * object.h (class Sized_relobj): Declare new member
10413 discarded_eh_frame_shndx_.
10414 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10415 (local_labels_test.o, local_labels_test): New rules.
10416 * testsuite/Makefile.in: Regenerate.
10417
1dcd334d
DK
104182009-06-04 Doug Kwan <dougkwan@google.com>
10419
10420 * layout.cc (Layout::section_name_mapping): Add mapping for
10421 special ARM sections.
10422
96d49306
DK
104232009-06-03 Doug Kwan <dougkwan@google.com>
10424
10425 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10426 (utils::has_overflow): Same.
10427
dff16297
ILT
104282009-06-03 Ian Lance Taylor <iant@google.com>
10429
10430 * layout.cc (Layout::section_name_mapping): New array, replacing
10431 Layout::linkonce_mapping.
10432 (Layout::section_name_mapping_count): New variable, replacing
10433 Layout::linkonce_mapping_count.
10434 (Layout::linkonce_output_name): Remove.
10435 (Layout::output_section_name): Rewrite.
10436 * layout.h (class Layout): Rename Linkonce_mapping to
10437 Section_name_mapping, linkonce_mapping to section_name_mapping,
10438 linkonce_mapping_count to section_name_mapping_count. Don't
10439 declare linkonce_output_name.
10440
c121c671
DK
104412009-06-03 Doug Kwan <dougkwan@google.com>
10442
10443 * gold/arm.cc (namespace utils): New.
10444 (Target_arm::reloc_is_non_pic): Define new method.
10445 (class Arm_relocate_functions): New.
10446 (Target_arm::Relocate::relocate): Handle relocation types used by
10447 Android.
10448
07800fab
ILT
104492009-06-03 Ian Lance Taylor <iant@google.com>
10450
10451 * arm.cc (Target_arm::scan::global): Use || instead of |.
10452
c121c671
DK
104532009-06-02 Doug Kwan <dougkwan@google.com>
10454
10455 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10456 issued_non_pic_error_.
10457 (class Target_arm::Scan): Declare new method check_non_pic.
10458 Define new method symbol_needs_plt_entry.
10459 Declare new data member issued_non_pic_error_.
10460 (class Target_arm::Relocate): Declare new method
10461 should_apply_static_reloc.
10462 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10463 (Target_arm::Scan::check_non_pic): Define new method.
10464 (Target_arm::Scan::local): Handle a small subset of reloc types used
10465 by Android.
10466 (Target_arm::Scan::local): Same.
10467 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10468
b19b0c6d
ILT
104692009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10470
10471 * incremental.cc (Incremental_inputs::report_command_line): Filter
10472 out --incremental-* options.
10473
94cdfcff
DK
104742009-05-29 Doug Kwan <dougkwan@google.com>
10475
10476 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10477 template class.
10478 (class Target_arm): Update comment.
10479 (Target_arm::Target_arm): Initialize new data members GOT_,
10480 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10481 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10482 and Target_arm::rel_dyn_section.
10483 Declare new_enum Target_arm::Got_type.
10484 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10485 and DYNBSS_.
10486 Update commments for member do_dynsym_value.
10487 (Target_arm::got_size, Target_arm::plt_section,
10488 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10489 new methods inside class defintion.
10490 (Target_arm::got_section): Define new method.
10491 (Target_arm::rel_dyn_section): Same.
10492 (Output_data_plt_arm): New template class.
10493 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10494 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10495 (Output_data_plt_arm::add_entry): Same.
10496 (Output_data_plt_arm::first_plt_entry): Define new
10497 static data member for PLT instruction template.
10498 (Output_data_plt_arm::plt_entry): Same.
10499 (Output_data_plt_arm::do_write): Define new method.
10500 (Target_arm::make_plt_entry): Same.
10501 (Target_arm::do_finalize_sections): Same.
10502 (Target_arm::do_dynsym_value): Same.
10503
4a657b0d
DK
105042009-05-28 Doug Kwan <dougkwan@google.com>
10505
10506 * Makefile.am (TARGETSOURCES): Add arm.cc.
10507 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10508 * Makefile.in: Regenerate.
10509 * arm.cc: New file.
10510 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10511
e7ae8c36
DK
105122009-05-26 Doug Kwan <dougkwan@google.com>
10513
10514 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10515 (General_options::check_excluded_libs): Strip off directories in
10516 archive name before matching like GNU ld does.
10517 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10518 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10519 (exclude_libs_test_LDFLAGS): Add linker option
10520 -Wl,--exclude-libs,libexclude_libs_test_3
10521 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10522 an explicit archive without using -l.
10523 (alt/libexclude_libs_test_3.a): New make rule.
10524 * testsuite/Makefile.in: Regenerate.
10525 * testsuite/exclude_libs_test.c : Declare lib3_default().
10526 (main): Call it.
10527 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10528 * exclude_libs_test_3.c: New file.
10529
f12e7348
NC
105302009-05-26 Nick Clifton <nickc@redhat.com>
10531
10532 * po/id.po: New Indonesian translation.
10533 * po/gold.pot: Updated template file.
10534
4daadc0d
ST
105352009-05-22 Sriraman Tallam <tmsriram@google.com>
10536
e1df38aa 10537 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10538 gc_comdat_test files. Add -Wl,--gc-sections to build
10539 gc_comdat_test.
10540 * testsuite/Makefile.in: Regenerate.
10541 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10542
531813ad
ST
105432009-05-21 Sriraman Tallam <tmsriram@google.com>
10544
10545 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10546 kept comdat section was garbage collected.
10547 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10548 * testsuite/Makefile.in: Regenerate.
10549 * testsuite/gc_comdat_test.sh: New file.
10550 * testsuite/gc_comdat_test_1.cc: New file.
10551 * testsuite/gc_comdat_test_2.cc: New file.
10552
65514900
CC
105532009-05-19 Doug Kwan <dougkwan@google.com>
10554
10555 * archive.cc (Archive::Archive): Move constructor from archive.h
10556 to here. Initialize no_export_.
10557 (Archive::get_elf_object_for_member): Set no_export flag of object.
10558 * archive.h (Archive::Archive): Move constructor body to
10559 archive.cc.
10560 (Archive::no_export): New method.
10561 (Archive::no_export_): New field.
10562 * object.h (Object::Object): Initialize no_export_ to false.
10563 (Object::no_export, Object::set_no_export): New methods.
10564 (Object::no_export_): New field.
10565 * options.cc (General_options::parse_exclude_libs): New method.
10566 (General_options::check_excluded_libs) Same.
10567 * options.h (exclude_libs): New option.
10568 (General_options::check_excluded_libs): New method declaration.
10569 (General_options::excluded_libs_): New field.
10570 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10571 default or protected visibility if an object has no-export flag set.
10572 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10573 (check_SCRIPTS): Add exclude_libs_test.sh.
10574 (check_DATA): Add exclude_libs_test.syms.
10575 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10576 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10577 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10578 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10579 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10580 libexclude_libs_test_2.a): New rules.
10581 * testsuite/Makefile.in: Regenerate.
10582 * testsuite/exclude_libs_test.c: New file.
10583 * testsuite/exclude_libs_test.sh: Ditto.
10584 * testsuite/exclude_libs_test_1.c: Ditto.
10585 * testsuite/exclude_libs_test_2.c: Ditto.
10586
1b77ea50
ILT
105872009-05-15 Ian Lance Taylor <iant@google.com>
10588
10589 * configure.ac: Check for declarations for cases where libiberty.h
10590 checks HAVE_DECL_xxx.
10591 * configure, config.in: Rebuild.
10592
072fe7ce
ILT
105932009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10594
10595 * gold.h (Incremental_argument_list): Remove (invalid) forward
10596 declaration.
10597 * incremental.cc (Incremental_inputs::report_achive): New method.
10598 (Incremental_inputs::report_object): New method.
10599 (Incremental_inputs::report_script): New method.
10600 (Incremental_inputs::finalize_inputs): New method.
10601 (Incremental_inputs::finalize): Call finalize_inputs().
10602 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10603 Create inputs entries.
10604 * incremental.h (Incremental_input_type): New enum.
10605 (Incremental_inputs::Incremental_input): Initialize new fields.
10606 (Incremental_inputs::report_inputs): New method.
10607 (Incremental_inputs::report_achive): New method.
10608 (Incremental_inputs::report_object): New method.
10609 (Incremental_inputs::report_script): New method.
10610 (Incremental_inputs::finalize_inputs): New method.
10611 (Incremental_inputs::Input_info): New struct.
10612 (Incremental_inputs::Input_info_map): New typedef.
10613 (Incremental_inputs::lock_): New field.
10614 (Incremental_inputs::Inputs_): New field.
10615 (Incremental_inputs::Inputs_map): New field.
10616 * main.cc (main): Call Incremental_input::report_inputs.
10617 * options.h (Input_argument_list): Typedef moved from
10618 Input_arguments.
10619 (Input_file_group::Files): Remove, use ::Input_argument_list.
10620 (Input_file_group::Input_argument_list): Remove, use
10621 ::Input_argument_list.
10622 * plugin.cc (Plugin_manager::add_input_file): Add error in
10623 incremental build.
10624 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10625 functions.
10626 * script.cc (read_input_script): Call
10627 Incremental_input::report_script.
10628 * script.h (Script_info): New class.
10629
b0481b0b
ILT
106302009-04-27 Ian Lance Taylor <iant@google.com>
10631
10632 * x86_64.cc (do_adjust_output_section): Set entsize to
10633 plt_entry_size.
10634
b22a5a41 106352009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10636
10637 * output.cc (Output_file::close): After short writes, continue
10638 writing from the correct offset in the buffer being written.
10639
40fde488
CD
106402009-04-23 Chris Demetriou <cgd@google.com>
10641
10642 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10643 * configure: Regenerate.
10644 * config.in: Regenerate.
10645 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10646 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10647
3ce2c28e
ILT
106482009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10649
10650 * incremental.cc (Incremental_inputs_header_data): Renamed from
10651 Incremental_input_header_data.
10652 (Incremental_inputs_header_data::data_size): New field.
10653 (Incremental_inputs_header_data::put_input_file_count): Renamed
10654 from input_file_count.
10655 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10656 from command_line_offset.
10657 (Incremental_inputs_header_data::put_reserved): Renamed from
10658 put_reserved.
10659 (Incremental_inputs_entry_data): Renamed from
10660 Incremental_input_entry_data.
10661 (Incremental_inputs_entry_data::data_size): New field.
10662 (Incremental_inputs::report_command_line): New method.
10663 (Incremental_inputs::finalize): New method.
10664 (Incremental_inputs::create_incremental_inputs_data): New method.
10665 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10666 * incremental.h: New file.
10667 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10668 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10669 incremental builds.
703d02da 10670 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10671 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10672 (Layout::create_incremental_info_sections): New method.
10673 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10674 * main.cc (main): Notify Incremental_input of the command line.
10675
e55bde5e
ILT
106762009-04-01 Ian Lance Taylor <iant@google.com>
10677 Mikolaj Zalewski <mikolajz@google.com>
10678
10679 * gold.h (reserve_unordered_map): Define, three versions, one for
10680 each version of Unordered_map.
10681 * layout.cc (Layout::Layout): Remove options parameter. Add
10682 number_of_input_files parameter. Don't initialize options_.
10683 Initialize number_of_input_files_ and resized_signatures_. Move
10684 sections_are_attached_.
10685 (Layout::layout_group): Reserve space for group_signatures_.
10686 (Layout::find_or_add_kept_section): Change name parameter to be a
10687 reference. Resize signatures_ map when it gets large enough.
10688 (Layout::layout_eh_frame): Use parameters->options() instead of
10689 this->options_.
10690 (Layout::make_output_section): Likewise.
10691 (Layout::attach_allocated_section_to_segment): Likewise.
10692 (Layout::finalize, Layout::create_executable_stack): Likewise.
10693 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10694 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10695 * layout.h (class Layout): Update declarations. Remove options_
10696 field. Add number_of_input_files_ and resized_signatures_
10697 fields. Move sections_are_attached_ field.
10698 * main.cc (main): Pass number of input files to Layout
10699 constructor. Don't pass options.
10700
154b857c
ILT
107012009-03-30 Ian Lance Taylor <iant@google.com>
10702
10703 * ffsll.c (ffsll): Correct implementation.
10704
2f35ab9b
ILT
107052009-03-27 Ian Lance Taylor <iant@google.com>
10706
fd03461a
ILT
10707 * ffsll.c: New file.
10708 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10709 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10710 * ftruncate.c (ftruncate): Declare before definition.
10711 * mremap.c (mremap): Likewise.
10712 * pread.c (pread): Likewise.
10713 * configure, Makefile.in, config.in: Rebuild.
10714
2f35ab9b
ILT
10715 * mremap.c: New file.
10716 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10717 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10718 (mremap): Declare if HAVE_MREMAP is not defined.
10719 * configure, Makefile.in, config.in: Rebuild.
10720
33aea2fd
CC
107212009-03-27 Cary Coutant <ccoutant@google.com>
10722
10723 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10724 position independent.
10725 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10726 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10727
6d479619
CC
107282009-03-24 Cary Coutant <ccoutant@google.com>
10729
10730 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10731 an executable.
10732 (needs_dynamic_reloc): Likewise.
10733
afc06bb8
ILT
107342009-03-24 Ian Lance Taylor <iant@google.com>
10735
10736 * yyscript.y (file_cmd): Recognize EXTERN.
10737 (extern_name_list, extern_name_list_body): New nonterminals.
10738 * script.cc (script_add_extern): Define.
10739 * script-c.h (script_add_extern): Declare.
10740
f6060a4d
ILT
107412009-03-24 Rafael Avila de Espindola <espindola@google.com>
10742
10743 * object.cc (is_elf_object): Define.
10744 * object.h (is_elf_object): Declare.
10745 * archive.cc (Archive::get_elf_object_for_member): Call
10746 is_elf_object.
33aea2fd 10747 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10748
26736d8e
ILT
107492009-03-24 Elliott Hughes <enh@google.com>
10750
10751 * output.cc (Output_file::map_anonymous): Define.
10752 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10753 try an anonymous one. Report the size if the mmap fails.
10754 * output.h (class Output_file): Declare map_anonymous.
10755
22fd9730
ILT
107562009-03-24 Ian Lance Taylor <iant@google.com>
10757
10758 * target-select.cc (instantiate_target): Don't acquire the lock if
10759 the instantiated_target_ field has already been set.
10760
cb010894
ILT
107612009-03-23 Ian Lance Taylor <iant@google.com>
10762
7f055c20
ILT
10763 * gold-threads.h (class Initialize_lock): Define.
10764 * gold-threads.cc (class Initialize_lock_once): Define.
10765 (initialize_lock_control): New static variable.
10766 (initialize_lock_pointer): New static variable.
10767 (initialize_lock_once): New static function.
10768 (Initialize_lock::Initialize_lock): Define.
10769 (Initialize_lock::initialize): Define.
10770 * target-select.h: Include "gold-threads.h".
10771 (class Target_selector): Add lock_ and initialize_lock_ fields.
10772 Don't define instantiate_target, just declare it.
10773 * target-select.cc (Target_selector::Target_selector): Initialize
10774 new fields.
10775 (Target_selector::instantiate_target): Define.
10776 * descriptors.h: Include "gold-threads.h".
10777 (class Descriptors): Add initialize_lock_ field.
10778 * descriptors.cc (Descriptors::Descriptors): Initialize new
10779 field.
10780 (Descriptors::open): Use initialize_lock_ field
10781 * errors.h (class Errors): Add initialize_lock_ field.
10782 * errors.cc (Errors::Errors): Initialize new field.
10783 (Errors::initialize_lock): Use initialize_lock_ field.
10784 * powerpc.cc (class Target_selector_powerpc): Remove
10785 instantiated_target_ field. In do_recognize call
10786 instantiate_target rather than do_instantiate_target. In
10787 do_instantiate_target just allocate a new target.
10788 * sparc.cc (class Target_selector_sparc): Likewise.
10789
36959681
ILT
10790 * freebsd.h: New file.
10791 * i386.cc: Include "freebsd.h".
10792 (Target_i386): Derive from Target_freebsd rather than
10793 Sized_target.
10794 (Target_selector_i386): Derive from Target_selector_freebsd rather
10795 than Target_selector.
10796 * x86_64.cc: Include "freebsd.h".
10797 (Target_x86_64): Derive from Target_freebsd rather than
10798 Sized_target.
10799 (Target_selector_x86_64): Derive from Target_selector_freebsd
10800 rather than Target_selector.
10801 * target.h (class Target): Add adjust_elf_header and
10802 do_adjust_elf_header.
10803 * output.cc (Output_file_header:: do_sized_write): Call target
10804 adjust_elf_header routine.
10805 * configure.tgt: Set targ_osabi.
10806 * configure.ac: Define GOLD_DEFAULT_OSABI.
10807 * parameters.cc (Parameters::default_target): Pass
10808 GOLD_DEFAULT_OSABI to select_target.
10809 * target-select.h (class Target_selector): Make instantiate_target
10810 protected rather than private.
10811 * Makefile.am (HFILES): Add freebsd.h.
10812 * configure, Makefile.in, config.in: Rebuild.
10813
cb010894
ILT
10814 * merge.cc (do_add_input_section): Correct pend value. Change
10815 message about last entry not being null terminated from error to
10816 warning.
10817
0e879927
ILT
108182009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10819
10820 * incremental.cc: New file.
10821 * Makefile.am (CCFILES): Add incremental.cc.
10822 * Makefile.in: Rebuild.
10823
41105937
PP
108242009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10825
10826 * layout.cc (Layout::output_section_name): Preserve names
10827 of '.note.' sections.
e1df38aa 10828
60439920
ILT
108292009-03-19 Ian Lance Taylor <iant@google.com>
10830
10831 * descriptors.cc (Descriptors::open): Check that the options are
10832 valid before using them.
10833
0d371ad3
ILT
108342009-03-18 Ian Lance Taylor <iant@google.com>
10835
10836 * script-sections.h: Include <list>.
10837 (class Script_sections): Change Sections_elements from std::vector
10838 to std::list. Typedef public Elements_iterator. Add
10839 orphan_section_placement_, data_segment_align_start_, and
10840 saw_data_segment_align_ fields. Remove data_segment_align_index_
10841 field.
10842 * script-sections.cc (class Orphan_section_placement): New class.
10843 (class Sections_element): Add virtual functions is_relro and
10844 orphan_section_init. Remove virtual function place_orphan_here.
10845 (class Output_section_definition): Add is_relro and
10846 orphan_section_init. Remove place_orphan_here.
10847 (class Orphan_output_section): Likewise.
10848 (Script_sections::Script_sections): Update for field changes.
10849 (Script_sections::data_segment_align): Set saw_data_segment_align_
10850 and data_segment_align_start_, not data_segment_align_index.
10851 (Script_sections::data_segment_relro_end): Check
10852 saw_data_segment_align_. Use data_segment_align_start_ rather
10853 than data_segment_align_index_.
10854 (Script_sections::place_orphan): Rewrite to use
10855 Orphan_section_placement.
10856
9201d894
ILT
108572009-03-17 Ian Lance Taylor <iant@google.com>
10858
9c5b8369
ILT
10859 * archive.cc (Archive::add_symbols): Check for a version attached
10860 to the symbol name in the archive map.
10861 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10862 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10863 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10864 (ver_test_11.a): New target.
10865 * testsuite/Makefile.in: Rebuild.
10866
9201d894
ILT
10867 * configure.ac: Check for chsize and posix_fallocate. Replace
10868 ftruncate.
10869 * ftruncate.c: New file, from gnulib.
10870 * output.cc (posix_fallocate): Define dummy version if not
10871 HAVE_POSIX_FALLOCATE.
10872 (Output_file::map): Call posix_fallocate rather than lseek and
10873 write.
10874 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10875 * configure, Makefile.in, config.in: Rebuild.
10876
ef4ab7a8 108772009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10878
ef4ab7a8
PP
10879 * layout.h (Layout::create_note): Add section_name parameter.
10880 * layout.cc (Layout::create_note): Likewise.
10881 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10882
8c500701
ILT
108832009-03-17 Ian Lance Taylor <iant@google.com>
10884
e85b18e1
ILT
10885 * descriptors.cc: Include "options.h".
10886 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10887 (Descriptors::open): Always use O_CLOEXEC when opening a new
10888 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10889 then set FD_CLOEXEC.
10890
9efe6174
ILT
10891 * sparc.cc (class Target_sparc): Add has_got_section.
10892 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10893 make sure we have a GOT section.
10894
10895 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10896 (Target_sparc::Scan::local): Likewise.
10897 (Target_sparc::Scan::global): Likewise.
10898 (Target_sparc::Relocate::relocate): Likewise.
10899 (Target_sparc::Relocate::relocate_tls): Likewise.
10900
8c500701
ILT
10901 * symtab.cc (Symbol_table::define_default_version): New function,
10902 broken out of add_from_object.
10903 (Symbol_table::add_from_object): Call define_default_version.
10904 (Symbol_table::define_special_symbol): Add resolve_oldsym
10905 parameter. Change all callers. If the version for a symbol comes
10906 from a version script, resolve it with the symbol with the same
10907 name with no version. Also add the symbol without a version if
10908 appropriate.
10909 (do_define_in_output_data): If resolving with oldsym, don't delete
10910 sym.
10911 (do_define_in_output_segment): Likewise.
10912 (do_define_as_constant): Likewise.
10913 * symtab.h (class Symbol_table): Update declarations.
10914
f1ed28fb
ILT
109152009-03-13 Ian Lance Taylor <iant@google.com>
10916
15f8229b
ILT
10917 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10918 (Read_symbols::requeue): New function.
10919 (Read_symbols::do_read_symbols): If make_elf_object fails because
10920 the target type is not configured, and the file was searched for,
10921 issue a warning and retry with the next directory.
10922 (Add_symbols::run): If the file has an incompatible format, and
10923 it was searched for, requeue the Read_symbols task. On error,
10924 release the object.
10925 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10926 dirindex parameter to constructor. Change all callers. Declare
10927 incompatible_warning and requeue.
10928 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10929 input_argument_ and input_group_ fields. Add them to
10930 constructor. Change all callers.
10931 (class Read_script): Add dirindex_ field. Add it to constructor.
10932 Change all callers.
10933 * archive.cc (Archive::setup): Remove input_objects parameter.
10934 Change all callers.
10935 (Archive::get_file_and_offset): Likewise.
10936 (Archive::read_all_symbols): Likewise.
10937 (Archive::read_symbols): Likewise.
10938 (Archive::get_elf_object_for_member): Remove input_objects
10939 parameter. Add punconfigured parameter. Change all callers.
10940 (Archive::add_symbols): Change return type to bool. Check return
10941 value of include_member.
10942 (Archive::include_all_members): Likewise.
10943 (Archive::include_member): Change return type to bool. Return
10944 false if first included object has incompatible target. Set
10945 included_member_ field.
10946 (Add_archive_symbols::run): If add_symbols returns false, requeue
10947 Read_symbols task.
10948 * archive.h (class Archive): Add included_member_ field.
10949 Initialize it in constructor. Add input_file and searched_for
10950 methods. Update declarations.
10951 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10952 input_argument_ fields. Add them to constructor. Change all
10953 callers.
10954 * script.cc: Include "target-select.h".
10955 (class Parser_closure): Add skip_on_incompatible_target_ and
10956 found_incompatible_target_ fields. Add
10957 skip_on_incompatible_target parameter to constructor. Change all
10958 callers. Add methods skip_on_incompatible_target,
10959 clear_skip_on_incompatible_target, found_incompatible_target, and
10960 set_found_incompatible_target.
10961 (read_input_script): Add dirindex parameter. Change all callers.
10962 If parser finds an incompatible target, requeue Read_symbols
10963 task.
10964 (script_set_symbol): Clear skip_on_incompatible_target in
10965 closure.
10966 (script_add_assertion, script_parse_option): Likewise.
10967 (script_start_sections, script_add_phdr): Likewise.
10968 (script_check_output_format): New function.
10969 * script.h (read_input_script): Update declaration.
10970 * script-c.h (script_check_output_format): Declare.
10971 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10972 (ignore_cmd): Remove OUTPUT_FORMAT.
10973 * fileread.cc (Input_file::Input_file): Add explicit this.
10974 (Input_file::will_search_for): New function.
10975 (Input_file::open): Add pindex parameter. Change all callers.
10976 * fileread.h (class Input_file): Add input_file_argument method.
10977 Declare will_search_for. Update declarations.
10978 * object.cc (make_elf_object): Add punconfigured parameter.
10979 Change all callers.
10980 * object.h (class Object): Make input_file public. Add
10981 searched_for method.
10982 (make_elf_object): Update declaration.
10983 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10984 restart search.
10985 * dirsearch.h (class Dirsearch): Update declaration.
10986 * options.h (class General_options): Add --warn-search-mismatch.
10987 * parameters.cc (Parameters::is_compatible_target): New function.
10988 * parameters.h (class Parameters): Declare is_compatible_target.
10989 * workqueue.cc (Workqueue::add_blocker): New function.
10990 * workqueue.h (class Workqueue): Declare add_blocker.
10991
f1ed28fb
ILT
10992 * fileread.cc (Input_file::open): Remove options parameter.
10993 Change all callers.
10994 (Input_file::open_binary): Likewise.
10995 * script.cc (read_input_script): Likewise.
10996 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10997 options parameter from constructor. Change all callers.
10998 (class Read_script): Likewise.
10999 * fileread.h (class Input_file): Update declarations.
11000 * script.h (read_input_script): Update declaration.
11001
34dd024a
NC
110022009-03-10 Nick Clifton <nickc@redhat.com>
11003
11004 * po/es.po: New Spanish translation.
11005
6d71b17c
CC
110062009-03-06 Cary Coutant <ccoutant@google.com>
11007
11008 * options.cc (parse_short_option): Keep dash_z from registering itself.
11009
031cdbed
ILT
110102009-03-03 Ian Lance Taylor <iant@google.com>
11011
11012 PR 9918
11013 * target-reloc.h (relocate_section): Pass output_section to
11014 relocate.
11015 * i386.cc (Target_i386::should_apply_static_reloc): Add
11016 output_section parameter. Change all callers.
11017 (Target_i386::Relocate::relocate): Add output_section parameter.
11018 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11019 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
11020 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
11021 * testsuite/two_file_shared.sh: New script.
11022 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
11023 (check_DATA): Add two_file_shared.dbg.
11024 (two_file_shared.dbg): New target.
11025 * testsuite/Makefile.in: Rebuild.
11026
15d5fa16
ILT
110272009-03-01 Ian Lance Taylor <iant@google.com>
11028
11029 * configure.ac: Check for byteswap.h.
11030 * configure: Rebuild.
11031 * config.in: Rebuild.
11032
8a4c0b0d
ILT
110332009-03-01 Mikolaj Zalewski <mikolajz@google.com>
11034
11035 * layout.cc (Layout::find_or_add_kept_section): New function.
11036 (Layout::add_comdat): Removed.
11037 * layout.h (struct Kept_section): Move out of class Layout.
11038 Remove trailing underscores from field names. Add group_sections
11039 field. Rename group_ field to is_group. Change all uses.
11040 (class Layout): Declare find_or_add_kept_section, not add_comdat.
11041 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
11042 comdat_groups_ field.
11043 (Sized_relobj::include_section_group): Use
11044 find_or_add_kept_section and Kept_section::group_sections.
11045 (Sized_relobj::include_linkonce_section): Likewise.
11046 * object.cc (class Sized_relobj): Don't define Comdat_group or
11047 Comdat_group_table. Remove find_comdat_group and
11048 add_comdat_group. Remove comdat_groups_ field.
11049 * plugin.cc (include_comdat_group): Use
11050 Layout::find_or_add_kept_section.
11051
b4ecf66b
ILT
110522009-02-28 Ian Lance Taylor <iant@google.com>
11053
14359ca0
ILT
11054 * README: --gc-sections and map files are now supported. Document
11055 some build requirements.
11056
b4ecf66b
ILT
11057 PR 6992
11058 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
11059 relocatable link set the value of the section symbol to zero.
11060 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
11061 relocatable link don't include the section address in the local
11062 symbol value.
11063
0602e05a
ILT
110642009-02-27 Ian Lance Taylor <iant@google.com>
11065
fd9d194f
ILT
11066 PR 6811
11067 * options.h (class Search_directory): Add is_system_directory.
11068 (class General_options): Declare is_in_system_directory.
11069 * options.cc (get_relative_sysroot): Make static.
11070 (get_default_sysroot): Make static.
11071 (General_optoins::is_in_system_directory): New function.
11072 * fileread.cc (Input_file::is_in_system_directory): New function.
11073 * fileread.h (class Input_file): Declare is_in_system_directory.
11074 * object.h (class Object): Add is_in_system_directory.
11075 (class Input_objects): Remove system_library_directory_ field.
11076 * object.cc (Input_objects::add_object): Don't set
11077 system_library_directory_.
11078 (input_objects::found_in_system_library_directory): Remove.
11079 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11080 parameter. Change all callers.
11081 (Symbol_table::sized_write_globals): Likewise.
11082 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11083 Call Object::is_in_system_directory.
11084 * symtab.h (class Symbol_table): Update declarations.
11085
61edd21f
ILT
11086 PR 5990
11087 * descriptors.h (Open_descriptor): Add is_on_stack field.
11088 * descriptors.cc (Descriptors::open): If the descriptor is on the
11089 top of the stack, remove it. Initialize is_on_stack field.
11090 (Descriptors::release): Only add pod to stack if it is not on the
11091 stack already.
11092 (Descriptors::close_some_descriptor): Clear stack_next and
11093 is_on_stack fields.
11094
e29e076a
ILT
11095 PR 7091
11096 * output.cc (Output_section::find_starting_output_address): Rename
11097 from starting_output_address; add PADDR parameter; change return
11098 type.
11099 * output.h (class Output_section): Declare
11100 find_starting_output_address instead of starting_output_address.
11101 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11102 section symbol for which we can't find a merge section.
11103
0602e05a
ILT
11104 PR 9836
11105 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11106 hidden or internal, force the symbol to be local.
11107 * resolve.cc (Symbol::override_visibility): Define.
11108 (Symbol::override_base): Use override_visibility.
11109 (Symbol_table::resolve): Likewise.
11110 (Symbol::override_base_with_special): Likewise.
11111 (Symbol_table::override_with_special): If the visibility is hidden
11112 or internal, force the symbol to be local.
11113 * symtab.h (class Symbol): Add set_visibility and
11114 override_visibility.
11115 * testsuite/ver_test_1.sh: New file.
11116 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11117 (check_DATA): Add ver_test_1.syms.
11118 (ver_test_1.syms): New target.
11119 * testsuite/Makefile.in: Rebuild.
11120
401a9a73
CC
111212009-02-25 Cary Coutant <ccoutant@google.com>
11122
11123 * layout.cc (Layout::choose_output_section): Don't rename sections
11124 when using a linker script that has a SECTIONS clause.
11125 * Makefile.in: Regenerate.
11126
11127 * testsuite/Makefile.am (script_test_5.sh): New test case.
11128 * testsuite/Makefile.in: Regenerate.
11129 * testsuite/script_test_5.cc: New file.
11130 * testsuite/script_test_5.sh: New file.
11131 * testsuite/script_test_5.t: New file.
11132
f488e4b0
CC
111332009-02-13 Rafael Avila de Espindola <espindola@google.com>
11134
11135 * archive.cc (Archive::include_member): Update calls to add_symbols.
11136 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11137 the Layout argument.
11138 * dynobj.h (do_add_symbols): Add the Layout argument.
11139 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11140 Layout argument.
11141 * object.h (Object::add_symbols): Add the Layout argument.
11142 (Object::do_add_symbols): Add the Layout argument.
11143 (Sized_relobj::do_add_symbols): Add the Layout argument.
11144 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11145 Unify the two versions.
11146 (Add_plugin_symbols): Remove.
11147 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11148 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11149 (Add_plugin_symbols): Remove.
11150 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11151 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11152 (Add_symbols::run): Make it work with Pulginobj.
11153
89dd1680
ILT
111542009-02-06 Ian Lance Taylor <iant@google.com>
11155
11156 * object.cc (Sized_relobj::do_layout): Make info message start
11157 with lower case letter.
11158
266d0a74
ILT
111592009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11160
602b464e
ILT
11161 * binary.cc: Fix file comment.
11162
266d0a74
ILT
11163 * options.h (enum Incremental_disposition): Define.
11164 (class General_options): Add new options: --incremental,
11165 --incremental_changed, --incremental_unchanged,
11166 --incremental_unknown. Add incremental_disposition_ and
11167 implicit_incremental_ fields.
11168 (General_options::incremental_disposition): New function.
11169 (class Position_dependent_options): Add incremental_disposition
11170 option.
11171 (Position_dependent_options::copy_from_options): Set incremental
11172 dispositions.
11173 * options.cc (General_options::parse_incremental_changed): New
11174 function.
2e702c99
RM
11175 (General_options::parse_incremental_unchanged): New function.
11176 (General_options::parse_incremental_unknown): New function.
11177 (General_options::General_options): Initialize new fields
266d0a74 11178 incremental_disposition_ and implicit_incremental_.
2e702c99 11179 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11180 without --incremental.
11181
f073bbf7
CD
111822009-02-06 Chris Demetriou <cgd@google.com>
11183
11184 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11185 pointer and to report location as the file name associated with
11186 the symbol.
11187 (gold_undefined_symbol_at_location): New function to replace the
11188 old gold_undefined_symbol functionality.
11189 * target-reloc.h (relocate_section): Update to use
11190 gold_undefined_symbol_at_location.
11191 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11192 Call gold_undefined_symbol function rather than gold_error.
11193 * errors.h (Errors::undefined_symbol): Take location as a
11194 string, rather than calculating it from a relocation.
11195 * errors.cc (Errors::fatal): Print "fatal error:" before the
11196 formatted message.
11197 (Errors::error, Errors::error_at_location): Print "error: "
11198 before the formatted message.
11199 (Errors::undefined_symbol): Take location as a string, rather
11200 than calculating it from a relocation.
11201 (gold_undefined_symbol_at_location): New function akin to
11202 old gold_undefined_symbol, calculates location from relocation.
11203 (gold_undefined_symbol): Change to take only a Symbol pointer
11204 and to report location as the file name associated with the symbol.
11205 * testsuite/debug_msg.sh: Update for changed error messages.
11206 * testsuite/undef_symbol.sh: Likewise.
11207
8e94a90c
ILT
112082009-02-04 Duncan Sands <baldrick@free.fr>
11209
11210 PR 9812
11211 * reduced_debug_output.h
11212 (Output_reduced_debug_abbrev_section::failed): Use format for
11213 gold_warning.
11214 (Output_reduced_debug_info_section::faild): Likewise.
11215
88a0e15b
ILT
112162009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11217
11218 * script.cc (Lazy_demangler): New class.
2e702c99 11219 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11220 symbol only once.
11221
5efc7cd2
CC
112222009-01-29 Cary Coutant <ccoutant@google.com>
11223
11224 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11225 to __tls_get_addr.
11226 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11227
e0ebcf42
ILT
112282009-01-28 Ian Lance Taylor <iant@google.com>
11229
5efc7cd2 11230 * version.cc (version_string): Bump to 1.9.
75fe7426 11231
e0ebcf42
ILT
11232 * gold.h: Include <cstring> and <stdint.h>.
11233 * version.cc: Include <cstdio>.
11234 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11235 warning.
11236 * reduced_debug_output.cc (insert_into_vector): Rename from
11237 Insert_into_vector; change all callers. Use Swap_unaligned to
11238 avoid aliasing issue; remove union since it is unnecessary.
11239
8e2813be 112402009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11241
11242 * Makefile.am (CCFILES): Add gc.cc.
11243 (HFILES): Add gc.h.
11244 * Makefile.in: Regenerate.
11245 * gold.cc (Gc_runner): New class.
11246 (queue_initial_tasks): Call garbage collection related tasks
11247 when corresponding options are invoked.
11248 (queue_middle_gc_tasks): New function.
11249 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11250 processed early before laying out sections during garbage collection.
11251 * gold.h (queue_middle_gc_tasks): New function.
11252 (is_prefix_of): Move from "layout.cc".
11253 * i386.cc (Target_i386::gc_process_relocs): New function.
11254 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11255 * main.cc (main): Create object of class "Garbage_collection".
11256 * object.cc (Relobj::copy_symbols_data): New function.
11257 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11258 (Sized_relobj::do_layout): Allow this function to be called twice
11259 during garbage collection and defer layout of section during the
6d03d481
ST
11260 first call.
11261 * object.h (Relobj::get_symbols_data): New function.
11262 (Relobj::is_section_name_included): New function.
11263 (Relobj::copy_symbols_data): New function.
11264 (Relobj::set_symbols_data): New function.
11265 (Relobj::get_relocs_data): New function.
11266 (Relobj::set_relocs_data): New function.
11267 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11268 (Relobj::gc_process_relocs): New function.
11269 (Relobj::do_gc_process_relocs): New pure virtual function.
11270 (Relobj::sd_): New data member.
11271 (Sized_relobj::is_output_section_offset_invalid): New function.
11272 (Sized_relobj::do_gc_process_relocs): New function.
11273 * options.h (General_options::gc_sections): Modify to not be a no-op.
11274 (General_options::print_gc_sections): New option.
11275 * plugin.cc (Plugin_finish::run): Remove function call to
11276 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11277 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11278 * reloc.cc (Read_relocs::run): Add task to process relocs and
11279 determine unreferenced sections when doing garbage collection.
11280 (Gc_process_relocs): New class.
11281 (Sized_relobj::do_gc_process_relocs): New function.
11282 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11283 sections that are garbage collected.
11284 * reloc.h (Gc_process_relocs): New class.
11285 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11286 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11287 symbols whose corresponding sections are garbage collected.
11288 (Symbol_table::Symbol_table): Add new parameter for the garbage
11289 collection object.
11290 (Symbol_table::gc_mark_undef_symbols): New function.
11291 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11292 (Symbol_table::gc_mark_dyn_syms): New function.
11293 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11294 as garbage.
11295 (Symbol_table::add_from_object): Likewise.
11296 (Symbol_table::add_from_relobj): When building shared objects, do not
11297 treat externally visible symbols as garbage.
11298 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11299 table information for static and relocatable links.
11300 * symtab.h (Symbol_table::set_gc): New function.
11301 (Symbol_table::gc): New function.
11302 (Symbol_table::gc_mark_undef_symbols): New function.
11303 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11304 (Symbol_table::gc_mark_dyn_syms): New function.
11305 (Symbol_table::gc_): New data member.
e1df38aa 11306 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11307 function.
11308 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11309 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11310
3b293544
CF
113112009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11312
11313 * options.h (General_options::gc_sections): Define as a no-op for now.
11314 (General_options::no_keep_memory): Ditto.
11315 (General_options::Bshareable): Define.
11316 * options.cc (General_options::finalize): Honor -Bshareable.
11317
83d22aa8
AS
113182009-01-20 Andreas Schwab <schwab@suse.de>
11319
11320 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11321 read the value in the contents, since we don't use it. Use the
11322 template endianness when writing.
11323 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11324
cd536b21
AS
113252009-01-19 Andreas Schwab <schwab@suse.de>
11326
11327 * configure.tgt (powerpc64-*): Fix targ_obj.
11328
99e9a495
ILT
113292009-01-15 Ian Lance Taylor <iant@google.com>
11330
11331 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11332 local symbols when stripping all symbols.
11333
bbbfea06
CC
113342009-01-14 Cary Coutant <ccoutant@google.com>
11335
99e9a495 11336 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11337
0f7c0701
CC
113382009-01-14 Cary Coutant <ccoutant@google.com>
11339
11340 * archive.cc (Archive::get_elf_object_for_member): Remove call
11341 to File_read::claim_for_plugin.
11342 * descriptors.cc (Descriptors::open): Remove reference to
11343 is_claimed.
11344 (Descriptors::claim_for_plugin): Remove.
11345 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11346 (Descriptors::is_claimed): Remove.
11347 (claim_descriptor_for_plugin): Remove.
11348 * fileread.cc (File_read::claim_for_plugin): Remove.
11349 * fileread.h (File_read::claim_for_plugin): Remove.
11350 (File_read::descriptor): Reopen descriptor if necessary.
11351 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11352 (Plugin_manager::all_symbols_read): Add task parameter. Change
11353 all callers.
11354 (Plugin_manager::get_input_file): New function.
11355 (Plugin_manager::release_input_file): New function.
11356 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11357 corresponding data member.
11358 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11359 and pass to base constructor. Change all callers.
11360 (get_input_file, release_input_file): New functions.
11361 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11362 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11363 (Plugin_manager::all_symbols_read): Add task parameter.
11364 (Plugin_manager::get_input_file): New function.
11365 (Plugin_manager::release_input_file): New function.
11366 (Plugin_manager::task_): New data member.
11367 (Pluginobj::Pluginobj): Add filesize parameter.
11368 (Pluginobj::filename): New function.
11369 (Pluginobj::descriptor): New function.
11370 (Pluginobj::filesize): New function.
11371 (Pluginobj::filesize_): New data member.
11372 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11373 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11374 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11375
11376 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11377 with archive libraries.
11378 * testsuite/Makefile.in: Regenerate.
11379 * testsuite/plugin_test.c (struct sym_info): New type.
11380 (get_input_file, release_input_file): New static variables.
11381 (onload): Capture new transfer vector entries.
11382 (claim_file_hook): Stop reading at end of file according to filesize.
11383 Factor out parsing of readelf output into separate function.
11384 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11385 APIs and get the source file name from the symbol table. Convert
11386 source file name to corresponding object file name. Print info
11387 message when adding new input files.
11388 (parse_readelf_line): New function.
11389 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11390 * testsuite/plugin_test_2.sh: Likewise.
11391 * testsuite/plugin_test_3.sh: Likewise.
11392 * testsuite/plugin_test_4.sh: New test case.
11393
62a6d109
ILT
113942009-01-07 Ian Lance Taylor <iant@google.com>
11395
11396 * version.cc (version_string): Bump to 1.8.
11397
483620e8
CC
113982008-12-23 Cary Coutant <ccoutant@google.com>
11399
11400 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11401 * plugin.cc (Plugin_manager::finish): Rename as
11402 layout_deferred_objects. Move cleanup to separate function.
11403 (Plugin_manager::cleanup): New function.
11404 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11405 separately.
11406 * plugin.h (Plugin_manager::finish): Rename as
11407 layout_deferred_objects.
11408 (Plugin_manager::cleanup): New function.
11409 (Plugin_manager::cleanup_done): New field.
11410
d66a9eb3
CC
114112008-12-23 Cary Coutant <ccoutant@google.com>
11412
11413 * plugin.cc (is_visible_from_outside): New function.
11414 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11415 so we don't return "IR only" status for exported symbols or -r links.
11416
11417 * testsuite/Makefile.am (plugin_test_3): New test case.
11418 * testsuite/Makefile.in: Regenerate.
11419 * testsuite/plugin_test_3.sh: New file.
11420
5995b570
CC
114212008-12-22 Cary Coutant <ccoutant@google.com>
11422
11423 * object.cc (Sized_relobj::layout_section): New function.
11424 (Sized_relobj::do_layout): Defer layout of input sections until after
11425 plugin has provided replacement files.
11426 (Sized_relobj::do_layout_deferred_sections): New function.
11427 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11428 (Relobj::layout_deferred_sections): New function.
11429 (Relobj::do_layout_deferred_sections): New function.
11430 (Sized_relobj::do_layout_deferred_sections): New function.
11431 (Sized_relobj::layout_section): New function.
11432 (Sized_relobj::Deferred_layout): New structure.
11433 (Sized_relobj::deferred_layout_): New field.
11434 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11435 Change all callers. Layout deferred sections.
11436 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11437 references.
11438 (Plugin_hook::run): Move code from do_plugin_hook inline.
11439 (Plugin_hook::do_plugin_hook): Remove.
11440 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11441 (Plugin_manager::finish): Renamed, was cleanup.
11442 (Plugin_manager::should_defer_layout): New function.
11443 (Plugin_manager::add_deferred_layout_object): New function.
11444 (Plugin_manager::Deferred_layout_list): New type.
11445 (Plugin_manager::deferred_layout_objects_): New field.
11446 (Plugin_hook::do_plugin_hook): Remove.
11447
ee769c88
ILT
114482008-12-17 Ian Lance Taylor <iant@google.com>
11449
11450 * options.h (class General_options): Add --no case for
11451 --export-dynamic.
11452
abc8dcba
CC
114532008-12-16 Cary Coutant <ccoutant@google.com>
11454
11455 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11456 vector.
11457 (Plugin_manager::claim_file): Create plugin object even if
11458 plugin did not call the add_symbols callback.
11459 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11460 asking for more symbols than were added.
11461 * testsuite/Makefile.am (plugin_test_1): Add test case with
11462 no global symbols.
11463 (empty.syms): New target.
11464 * testsuite/Makefile.in: Regenerate.
11465 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11466 message. Don't call add_symbols if no globals.
11467 (all_symbols_read_hook): Don't provide replacement for empty
11468 claimed file.
11469
b0074644
ILT
114702008-12-12 Ian Lance Taylor <iant@google.com>
11471
68943102
ILT
11472 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11473 r_type == 0 for a local symbol with r_sym == 0.
11474 (scan_relocatable_relocs): Pass r_sym to
11475 local_non_section_strategy.
11476 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11477 r_sym parameter.
11478
b0074644
ILT
11479 * configure.ac: Update test for TLS descriptors: they are
11480 supported as of glibc 2.9.
11481 * configure: Rebuild.
11482
c2508178
ILT
114832008-12-11 Ian Lance Taylor <iant@google.com>
11484
11485 PR 7091
11486 * target-reloc.h (Default_scan_relocatable_relocs): For each
11487 function, map r_type == 0 to RELOC_DISCARD.
11488
2756a258
CC
114892008-12-10 Cary Coutant <ccoutant@google.com>
11490
11491 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11492 object to override a kept COMDAT group from a plugin object.
11493
bb6f53d3
ILT
114942008-12-09 Ian Lance Taylor <iant@google.com>
11495
fbc558e1
ILT
11496 PR 7088
11497 * yyscript.y (file_cmd): Handle INPUT.
11498
bb6f53d3
ILT
11499 * testsuite/initpri1.c: Change all declarations to be full
11500 prototypes by adding void, to avoid compiler warnings.
11501
4674ecfc
CC
115022008-12-05 Rafael Avila de Espindola <espindola@google.com>
11503
11504 * options.cc (General_options::parse_plugin_opt): New.
11505 (General_options::add_plugin): The argument now is just the filename.
11506 (General_options::add_plugin_option): New.
11507 * options.h (plugin_opt): New.
11508 (add_plugin): Change argument name.
11509 (add_plugin_option): New.
11510 * plugin.cc (Plugin::load): Don't parse the plugin option.
11511 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11512 (Plugin::add_option): New.
11513 (Plugin::args_): Change type.
11514 (Plugin::filename_): New.
11515 (Plugin_manager::add_plugin_option): New.
11516 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11517 * testsuite/Makefile.in: Regenerate.
11518
fd06b4aa
CC
115192008-12-05 Cary Coutant <ccoutant@google.com>
11520
11521 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11522 Handle --strip-lto-sections option.
11523 * options.h (strip_lto_sections): New option.
11524
6c52134c
CC
115252008-12-01 Cary Coutant <ccoutant@google.com>
11526
11527 * plugin.cc (ld_plugin_message): Change format parameter to const.
11528 Fix mismatch between new[] and delete.
11529
a45248e0
CC
115302008-11-14 Cary Coutant <ccoutant@google.com>
11531
11532 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11533 instead of -1U.
11534
c82fbeee
CS
115352008-11-05 Craig Silverstein <csilvers@google.com>
11536
11537 * options.cc (General_options::parse_dynamic_list): New function.
11538 * options.h (General_options): New flags dynamic_list,
11539 dynamic_list_data, dynamic_list_cpp_new, and
11540 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11541 (General_options::in_dynamic_list): New function.
11542 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11543 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11544 (Lex::can_continue_name): Likewise.
11545 (yylex): Likewise.
11546 (read_script_file): New parameter script_options.
11547 (read_dynamic_list): New function.
11548 (Script_options::define_dynamic_list): New function.
11549 (dynamic_list_keyword_parsecodes): New variable.
11550 (dynamic_list_keywords): New variable.
11551 * script.h (Script_options::define_dynamic_list): New function
11552 prototype.
11553 (read_dynamic_list): New function prototype.
11554 * symtab.cc (strprefix): New macro.
11555 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11556 dynamic_list_data, dynamic_list_cpp_new, and
11557 dynamic_list_cpp_typeinfo.
11558 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11559 (dynamic_list_expr): New rule.
11560 (dynamic_list_nodes): Likewise.
11561 (dynamic_list_node): Likewise.
11562 * testsuite/Makefile.am (dynamic_list): New test.
11563 * testsuite/Makefile.in: Regenerated.
11564 * testsuite/dynamic_list.t: New file.
11565 * testsuite/dynamic_list.sh: New file.
11566
e0bb29a5
CS
115672008-11-05 Craig Silverstein <csilvers@google.com>
11568
11569 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11570 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11571 (t11_last): Likewise.
11572 * testsuite/ver_test_6.c (main): Likewise.
11573
4e1e25e0
CC
115742008-10-07 Cary Coutant <ccoutant@google.com>
11575
11576 * options.c (General_options::finalize): Add check for -static and
11577 -shared.
11578 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11579 is not empty.
11580
92f03fcb
CC
115812008-10-02 Cary Coutant <ccoutant@google.com>
11582
11583 * plugin.cc (make_sized_plugin_object): Fix conditional
11584 compilation to work when not all targets are enabled.
11585
fbd8a257
CC
115862008-09-29 Cary Coutant <ccoutant@google.com>
11587
11588 * archive.cc (Archive::get_file_and_offset): Use filename instead
11589 of name to get library path.
11590 (Archive::include_member): Unlock external member of a thin archive.
11591
11592 * testsuite/Makefile.am (TEST_AR): New variable.
11593 (thin_archive_test_1): New test.
11594 (thin_archive_test_2): New test.
81636b3f
CC
11595 * testsuite/Makefile.in: Regenerate.
11596 * testsuite/thin_archive_main.cc: New file.
11597 * testsuite/thin_archive_test_1.cc: New file.
11598 * testsuite/thin_archive_test_2.cc: New file.
11599 * testsuite/thin_archive_test_3.cc: New file.
11600 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11601
eff45813
CC
116022008-09-29 Cary Coutant <ccoutant@google.com>
11603
11604 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11605 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11606 instead of -1U.
11607 (Sized_relobj::do_finalize_local_symbols): Likewise.
11608 (Sized_relobj::map_to_kept_section): Likewise.
11609 * object.h (Sized_relobj::invalid_address): New constant.
11610 (Sized_relobj::do_output_section_offset): Check for invalid_address
11611 and return -1ULL.
11612 * output.cc (Output_reloc::local_section_offset): Use constant
11613 invalid_address instead of -1U.
11614 (Output_reloc::get_address): Likewise.
11615 (Output_section::output_address): Change -1U to -1ULL.
11616 * output.h (Output_reloc::invalid_address): New constant.
11617 * reloc.cc (Sized_relobj::write_sections): Use constant
11618 invalid_address instead of -1U.
11619 (Sized_relobj::relocate_sections): Likewise.
11620 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11621 values for merge sections.
11622 * target-reloc.h (relocate_for_relocatable): Use constant
11623 invalid_address instead of -1U.
11624
89fc3421
CC
116252008-09-19 Cary Coutant <ccoutant@google.com>
11626
11627 Add plugin functionality for link-time optimization (LTO).
11628 * configure.ac (plugins): Add --enable-plugins option.
11629 * configure: Regenerate.
11630 * config.in: Regenerate.
11631 * Makefile.am (LIBDL): New variable.
11632 (CCFILES): Add plugin.cc.
11633 (HFILES): Add plugin.h.
11634 (ldadd_var): Add LIBDL.
11635 * Makefile.in: Regenerate.
11636
11637 * archive.cc: Include "plugin.h".
11638 (Archive::setup): Don't preread archive symbols when using a plugin.
11639 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11640 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11641 files.
11642 (Archive::include_member): Add symbols from plugin objects.
11643 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11644 * descriptors.cc (Descriptors::open): Check for file descriptors
11645 abandoned by plugins.
11646 (Descriptors::claim_for_plugin): New function.
11647 * descriptors.h (Descriptors::claim_for_plugin): New function.
11648 (Open_descriptor::is_claimed): New field.
11649 (claim_descriptor_for_plugin): New function.
11650 * fileread.cc (File_read::claim_for_plugin): New function.
11651 * fileread.h (File_read::claim_for_plugin): New function.
11652 (File_read::descriptor): New function.
11653 * gold.cc: Include "plugin.h".
11654 (queue_initial_tasks): Add task to call plugin hooks for generating
11655 new object files.
11656 * main.cc: Include "plugin.h".
11657 (main): Load plugin libraries.
11658 * object.h (Pluginobj): Declare.
11659 (Object::pluginobj): New function.
11660 (Object::do_pluginobj): New function.
11661 (Object::set_target): New function.
11662 * options.cc: Include "plugin.h".
11663 (General_options::parse_plugin): New function.
11664 (General_options::General_options): Initialize plugins_ field.
11665 (General_options::add_plugin): New function.
11666 * options.h (Plugin_manager): Declare.
11667 (General_options): Add --plugin option.
11668 (General_options::has_plugins): New function.
11669 (General_options::plugins): New function.
11670 (General_options::add_plugin): New function.
11671 (General_options::plugins_): New field.
11672 * plugin.cc: New file.
11673 * plugin.h: New file.
11674 * readsyms.cc: Include "plugin.h".
11675 (Read_symbols::do_read_symbols): Check for archive before checking
11676 for ELF file. Call plugin hooks to claim files.
11677 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11678 from a real object file; force override when processing replacement
11679 files.
11680 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11681 (Symbol::init_base_object): Likewise.
11682 (Symbol::init_base_output_data): Likewise.
11683 (Symbol::init_base_output_segment): Likewise.
11684 (Symbol::init_base_constant): Likewise.
11685 (Symbol::init_base_undefined): Likewise.
11686 (Symbol::output_section): Assert that object is not a plugin.
11687 (Symbol_table::add_from_pluginobj): New function.
11688 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11689 undefined.
11690 (Symbol_table::sized_write_globals): Likewise.
11691 (Symbol_table::add_from_pluginobj): Instantiate template.
11692 * symtab.h (Sized_pluginobj): Declare.
11693 (Symbol::in_real_elf): New function.
11694 (Symbol::set_in_real_elf): New function.
11695 (Symbol::in_real_elf_): New field.
11696 (Symbol_table::add_from_pluginobj): New function.
11697
11698 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11699 (LIBDL): New variable.
11700 (LDADD): Add LIBDL.
11701 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11702 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11703 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11704 (MOSTLYCLEANFILES): Likewise.
11705 * testsuite/Makefile.in: Regenerate.
11706 * testsuite/plugin_test.c: New file.
11707 * testsuite/plugin_test_1.sh: New file.
11708 * testsuite/plugin_test_2.sh: New file.
11709
de31bda5
ILT
117102008-09-16 Ian Lance Taylor <iant@google.com>
11711
9c2d0ef9
ILT
11712 * target-reloc.h (relocate_section): Check whether a symbol is
11713 defined by the ABI before reporting an undefined symbol error.
11714 * target.h (Target::is_defined_by_abi): Make parameter const.
11715 (Target::do_is_defined_by_abi): Likewise.
11716 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11717 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11718 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11719 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11720 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11721 * testsuite/Makefile.in: Rebuild.
11722
de31bda5
ILT
11723 * fileread.cc (make_view): Add casts to avoid warning.
11724
9fa33bee
AO
117252008-09-16 Alexandre Oliva <aoliva@redhat.com>
11726
11727 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11728 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11729
183fd0e3
AO
117302008-09-16 Alexandre Oliva <aoliva@redhat.com>
11731
11732 * options.h (General_options::output_is_executable): New.
11733 (General_options::output_is_pie): New.
11734 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11735 for shared libraries.
11736 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11737
7be8330a
CD
117382008-09-11 Chris Demetriou <cgd@google.com>
11739
11740 * options.h (origin): New -z option.
11741 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11742 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11743 in DT_FLAGS_1.
11744
a9caad02
CC
117452008-09-05 Cary Coutant <ccoutant@google.com>
11746
11747 * fileread.cc (File_read::make_view): Add check for attempt to map
11748 beyond end of file.
11749
ae6dce4d
CC
117502008-09-05 Cary Coutant <ccoutant@google.com>
11751
11752 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11753 explicit instantiations.
11754
d7ab2a47
KVH
117552008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11756
11757 PR gold/6858
11758 * options.cc (General_options::finalize): Allow undefined symbols
11759 in shlibs if linking -shared.
11760
11761 PR gold/6859
11762 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11763 symbols as not needing a dynsym entry.
11764
1e52a9c1
CS
117652008-08-20 Craig Silverstein <csilvers@google.com>
11766
11767 * fileread.cc (File_read::open): Do not lock the file unless it
11768 was successfully opened.
11769
d85c80a3
CC
117702008-08-14 Cary Coutant <ccoutant@google.com>
11771
11772 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11773 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11774 * testsuite/tls_test.cc (struct int128): 128-bit struct
11775 for testing TLS relocs with non-zero addend.
11776 (v12): New TLS variable.
11777 (t12): New test.
11778 (t_last): Add check for v12.
11779 * testsuite/tls_test.h (t12): New function.
11780 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11781
2d924fd9
ILT
117822008-08-13 Ian Lance Taylor <iant@google.com>
11783
11784 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11785 set tls_segment_ or relro_segment_.
11786 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11787 when appropriate.
11788 * output.h (Output_section::clear_is_relro): New function.
11789 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11790 sections specially even when output_data_ is empty.
11791 (Output_segment::maximum_alignment): When first section is relro,
11792 only force alignment for PT_LOAD segments.
11793 * script.cc (script_data_segment_align): New function.
11794 (script_data_segment_relro_end): New function.
11795 * script-c.h (script_data_segment_align): Declare.
11796 (script_data_segment_relro_end): Declare.
11797 * script-sections.h (class Script_sections): Declare
11798 data_segment_align and data_segment_relro_end. Add fields
11799 segment_align_index_ and saw_relro_end_.
11800 * script-sections.cc (class Sections_element): Add set_is_relro
11801 virtual function. Add new bool* parameter to place_orphan_here.
11802 Add get_output_section virtual function.
11803 (class Output_section_definition): Add set_is_relro. Add new
11804 bool* parameter to place_orphan_here. Add get_output_section.
11805 Add is_relro_ field.
11806 (Output_section_definition::Output_section_definition): Initialize
11807 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11808 and is_relro_ fields.
11809 (Output_section_definition::place_orphan_here): Add is_relro
11810 parameter.
11811 (Output_section_definition::set_section_addresses): Set relro for
11812 output section.
11813 (Output_section_definition::alternate_constraint): Likewise.
11814 (class Orphan_output_section): Add new bool* parameter to
11815 place_orphan_here. Add get_output_section.
11816 (Orphan_output_section::place_orphan_here): Add is_relro
11817 parameter.
11818 (Script_sections::Script_sections): Initialize
11819 data_segment_align_index_ and saw_relro_end_.
11820 (Script_sections::data_segment_align): New function.
11821 (Script_sections::data_segment_relro_end): New function.
11822 (Script_sections::place_orphan): Set or clear is_relro.
11823 (Script_sections::set_section_addresses): Force alignment of first
11824 TLS section.
11825 * yyscript.y (exp): Call script_data_segment_align and
11826 script_data_segment_relro_end.
11827 * testsuite/relro_script_test.t: New file.
11828 * testsuite/relro_test.cc (using_script): Declare.
11829 (t1, t2): Test using_script.
11830 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11831 (relro_script_test_SOURCES): Define.
11832 (relro_script_test_DEPENDENCIES): Define.
11833 (relro_script_test_LDFLAGS): Define.
11834 (relro_script_test_LDADD): Define.
11835 (relro_script_test.so): New target.
11836 * testsuite/Makefile.in: Rebuild.
11837
f827c9a9
CC
118382008-08-06 Cary Coutant <ccoutant@google.com>
11839
11840 * archive.cc (Archive::total_archives, Archive::total_members)
11841 (Archive::total_members_loaded): New variables.
11842 (Archive::setup): Add parameter. Add option to preread
11843 archive symbols.
11844 (Archive::read_armap): Add counter.
11845 (Archive::get_file_and_offset): New function.
11846 (Archive::get_elf_object_for_member): New function.
11847 (Archive::read_all_symbols): New function.
11848 (Archive::read_symbols): New function.
11849 (Archive::add_symbols): Add counters.
11850 (Archive::include_all_members): Use armap to find members if it's
11851 already built.
11852 (Archive::include_member): Skip reading symbols if already read.
11853 Factored code into Archive::get_file_and_offset and
11854 Archive::get_elf_object_for_member. Changed call to
11855 Mapfile::report_include_archive_member.
11856 (Archive::print_stats): New function.
11857 * archive.h: Declare Object and Read_symbols_data classes.
11858 (Archive::Archive): Add initializers for new members.
11859 (Archive::setup): Add parameter.
11860 (Archive::print_stats): New function.
11861 (Archive::total_archives, Archive::total_members)
11862 (Archive::total_members_loaded): New variables.
11863 (Archive::get_file_and_offset): New function.
11864 (Archive::get_elf_object_for_member): New function.
11865 (Archive::read_all_symbols): New function.
11866 (Archive::read_symbols): New function.
11867 (Archive::Archive_member): New class.
11868 (Archive::members_): New member.
11869 (Archive::num_members_): New member.
11870 * main.cc: Include archive.h.
11871 (main): Call Archive::print_stats.
11872 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11873 archive parameter; member_name is now the fully-decorated name.
11874 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11875 * options.h: (General_options): Add --preread-archive-symbols option.
11876 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11877 Archive::setup.
11878
de4c45bd
ILT
118792008-08-04 Ian Lance Taylor <iant@google.com>
11880
11881 * symtab.h (Symbol::use_plt_offset): New function.
11882 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11883 * powerpc.cc (Relocate::relocate): Likewise.
11884 * sparc.cc (Relocate::relocate): Likewise.
11885 * x86_64.cc (Relocate::relocate): Likewise.
11886 * testsuite/weak_plt.sh: New test.
11887 * testsuite/weak_plt_main.cc: New test.
11888 * testsuite/weak_plt_shared.cc: New test.
11889 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11890 (check_PROGRAMS): Add weak_plt.
11891 (check_DATA): Add weak_plt_shared.so.
11892 (weak_plt_main_pic.o, weak_plt): New targets.
11893 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11894 * testsuite/Makefile.in: Rebuild.
11895
11896 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11897 gcctestdir/ld.
11898 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11899 * testsuite/Makefile.in: Rebuild.
11900
323ee3f4
AM
119012008-08-04 Alan Modra <amodra@bigpond.net.au>
11902
11903 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11904 * Makefile.in: Regenerate.
11905 * po/POTFILES.in: Regenerate.
11906
7c07ecec
ILT
119072008-07-29 Ian Lance Taylor <iant@google.com>
11908
11909 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11910 symbols before other symbols.
11911 * testsuite/script_test_2.cc (test_addr): Declare.
11912 (test_addr_alias): Declare.
11913 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11914 values.
7c07ecec
ILT
11915 * testsuite/script_test_2.t: Define test_addr_alias and
11916 test_addr.
11917
5778530e
ILT
119182008-07-24 Ian Lance Taylor <iant@google.com>
11919
2a00e4fb
ILT
11920 PR 5990
11921 * descriptors.cc: New file.
11922 * descriptors.h: New file.
11923 * gold-threads.h (class Hold_optional_lock): New class.
11924 * fileread.cc: Include "descriptors.h".
11925 (File_read::~File_read): Release descriptor rather than closing
11926 it.
11927 (File_read::open) [file]: Call open_descriptor rather than open.
11928 Set is_descriptor_opened_.
11929 (File_read::open) [memory]: Assert that descriptor is not open.
11930 (File_read::reopen_descriptor): New function.
11931 (File_read::release): Release descriptor.
11932 (File_read::do_read): Make non-const. Reopen descriptor.
11933 (File_read::read): Make non-const.
11934 (File_read::make_view): Reopen descriptor.
11935 (File_read::do_readv): Likewise.
11936 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11937 Update declarations.
11938 * layout.cc: Include "descriptors.h".
11939 (Layout::create_build_id): Use open_descriptor rather than open.
11940 * output.cc: Include "descriptors.h".
11941 (Output_file::open): Use open_descriptor rather than open.
11942 * archive.cc (Archive::const_iterator): Change Archive to be
11943 non-const.
11944 (Archive::begin, Archive::end): Make non-const.
11945 (Archive::count_members): Likewise.
11946 * archive.h (class Archive): Update declarations.
11947 * object.h (Object::read): Make non-const.
11948 * Makefile.am (CCFILES): Add descriptors.cc.
11949 (HFILES): Add descriptors.h.
11950 * Makefile.in: Rebuild.
11951
801647d1
ILT
11952 PR 6716
11953 * gold.h: Always include <clocale>. Add Solaris workarounds
11954 following code in binutils/sysdep.h.
11955
5edd166e
ILT
11956 PR 6048
11957 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11958 this->eh_frame_hdr_ is NULL before using it.
11959
c89ad728
ILT
11960 * dynobj.cc (Versions::Versions): Update comment.
11961
aa86f06b
ILT
11962 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11963 the base version name.
11964
5778530e
ILT
11965 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11966 array size plus one.
11967 (Stringpool_template::set_string_offsets): Subtract one from key
11968 before using it as an array index.
11969 (Stringpool_template::get_offset_with_length): Likewise.
11970 (Stringpool_template::write_to_buffer): Likewise.
11971 * stringpool.h (Stringpool_template::get_offset_from_key):
11972 Likewise.
11973
057ead22
ILT
119742008-07-23 Ian Lance Taylor <iant@google.com>
11975
7f649c59
ILT
11976 PR 6658
11977 * object.h (Merged_symbol_value::value): Do our best to handle a
11978 negative addend.
11979
057ead22
ILT
11980 PR 6647
11981 * script.cc (Version_script_info::get_versions): Don't add empty
11982 version tag to return value.
11983 (Version_script_info::get_symbol_version_helper): Change return
11984 type to bool. Add pversion parameter. Change all callers.
11985 (script_register_vers_node): Don't require a non-NULL tag.
11986 * script.h (class Version_script_info): Update declarations.
11987 (Version_script_info::get_symbol_version): Change return type to
11988 bool. Add version parameter. Change all callers.
11989 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11990 handling. Handle an empty version from a version script.
11991 (Symbol_table::define_special_symbol): Likewise.
11992 * testsuite/ver_test_10.script: New file.
11993 * testsuite/ver_test_10.sh: New file.
11994 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11995 (check_DATA): Add ver_test_10.syms.
11996 (ver_test_10.syms, ver_test_10.so): New target.
11997 * testsuite/Makefile.in: Rebuild.
11998
58e54ac2
CD
119992008-07-23 Simon Baldwin <simonb@google.com>
12000
12001 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
12002 to zero for undefined symbols from dynamic libraries.
12003
95d14cd3
ILT
120042008-07-23 Ian Lance Taylor <iant@google.com>
12005
12006 * symtab.cc (Symbol_table::resolve): Remove version parameter.
12007 Change all callers.
12008 * symtab.h (class Symbol_table): Update declaration.
12009 * testsuite/ver_test_9.cc: New file.
12010 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
12011 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
12012 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
12013 (ver_test_9.so, ver_test_9.o): New targets.
12014 * testsuite/Makefile.in: Rebuild.
12015
92de84a6
ILT
120162008-07-22 Ian Lance Taylor <iant@google.com>
12017
34810851
ILT
12018 * options.h (class General_options): Define --check-sections.
12019 * layout.cc (Layout::set_segment_offsets): Handle
12020 --check-sections.
12021
af6156ef
ILT
12022 * options.h (class General_options): Define -n/--nmagic and
12023 -N/--omagic.
12024 * options.cc (General_options::finalize): For -n/--nmagic or
12025 -N/--omagic, set -static.
12026 * layout.cc (Layout::attach_allocated_section_to_segment): If
12027 -N/--omagic, don't put read-only and read-write sections in
12028 different segments.
12029 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
12030 finding a read-only segment.
12031 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
12032 don't set the minimum segment alignment to the common page size,
12033 and don't set the file offset to the address modulo the page size.
12034 * script-sections.cc (Script_sections::create_segments): If
12035 -n/--omagic, don't put read-only and read-write sections in
12036 different segments.
12037
92de84a6
ILT
12038 * cref.cc: New file.
12039 * cref.h: New file.
12040 * options.h (class General_options): Add --print-symbol-counts.
12041 * main.cc (main): Issue defined symbol report if requested.
12042 * archive.cc (Archive::interpret_header): Make into a const member
12043 function.
12044 (Archive::add_symbols): Call Input_objects::archive_start and
12045 archive_stop.
12046 (Archive::const_iterator): Define new class.
12047 (Archive::begin, Archive::end): New functions.
12048 (Archive::include_all_members): Rewrite to use iterator.
12049 (Archive::count_members): New function.
12050 * archive.h (class Archive): Update declarations.
12051 (Archive::filename): New function.
12052 * object.cc: Include "cref.h".
12053 (Sized_relobj::Sized_relobj): Initialize defined_count_.
12054 (Sized_relobj::do_get_global_symbol_counts): New function.
12055 (Input_objects::add_object): Add object to cross-referencer.
12056 (Input_objects::archive_start): New function.
12057 (Input_objects::archive_stop): New function.
12058 (Input_objects::print_symbol_counts): New function.
12059 * object.h: Declare Cref and Archive.
12060 (Object::get_global_symbol_counts): New function.
12061 (Object::do_get_global_symbol_counts): New pure virtual function.
12062 (class Sized_relobj): Add defined_count_ field. Update
12063 declarations.
12064 (class Input_objects): Add cref_ field. Update constructor.
12065 Update declarations.
12066 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
12067 defined_count_.
12068 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
12069 symbol counts.
12070 (Sized_dynobj::do_get_global_symbol_counts): New function.
12071 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
12072 defined_count_. Update declarations. Define Symbols typedef.
12073 * symtab.cc (Symbol_table::add_from_relobj): Add defined
12074 parameter. Change all callers.
12075 (Symbol_table::add_from_dynobj): Add sympointers and defined
12076 parameters. Change all callers.
12077 * symtab.h (class Symbol_table): Update declarations.
12078 * Makefile.am (CCFILES): Add cref.cc.
12079 (HFILES): Add cref.h.
12080 * Makefile.in: Rebuild.
12081
3f7c5e1d
CD
120822008-07-22 Simon Baldwin <simonb@google.com>
12083
12084 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12085 to zero when writing undefined symbols.
12086
e0b64032
ILT
120872008-07-22 Ian Lance Taylor <iant@google.com>
12088
12089 * output.cc (Output_section::add_input_section): Don't try to
12090 merge empty merge sections.
12091
096b02cf
CS
120922008-07-21 Craig Silverstein <csilvers@google.com>
12093
12094 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12095 Include symbol version in error message.
cd536b21 12096
1d1f116d
CD
120972008-07-20 Chris Demetriou <cgd@google.com>
12098
cd536b21 12099 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12100 (RANDOM_SEED_CFLAGS): New substituted variable.
12101 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12102 * configure: Rebuild.
12103 * Makefile.in: Likewise.
12104 * testsuite/Makefile.in: Likewise.
12105
a18f591e
ILT
121062008-07-18 Ian Lance Taylor <iant@google.com>
12107
12108 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12109 where we see NAME/NULL and NAME/VERSION as separate symbols.
12110 * testsuite/ver_test_main.cc (main): Call t4.
12111 (t4, t4_2a): Define.
12112 * testsuite/ver_test_2.cc (t4_2): Define.
12113 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12114 * testsuite/ver_test_4.cc (t4_2a): Define.
12115 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12116 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12117
c6e3f6ed
ILT
121182008-07-17 Ian Lance Taylor <iant@google.com>
12119
12120 * dynobj.cc (Versions::add_def): If we give an error about a
12121 missing version, go ahead and create the version anyhow.
12122
ef9beddf
ILT
121232008-07-10 Ian Lance Taylor <iant@google.com>
12124
12125 Handle output sections with more than 0x7fffffff bytes.
12126 * object.h (class Relobj): Change map_to_output_ to
12127 output_sections_, and just keep a section pointer. Change all
12128 uses. Move comdat group support to Sized_relobj.
12129 (Relobj::is_section_specially_mapped): Remove.
12130 (Relobj::output_section): Remove poff parameter. Change all
12131 callers.
12132 (Relobj::output_section_offset): New function.
12133 (Relobj::set_section_offset): Rewrite.
12134 (Relobj::map_to_output): Remove.
12135 (Relobj::output_sections): New function.
12136 (Relobj::do_output_section_offset): New pure virtual function.
12137 (Relobj::do_set_section_offset): Likewise.
12138 (class Sized_relobj): Add section_offsets_ field. Add comdat
12139 group support from Relobj. Update declarations.
12140 (Sized_relobj::get_output_section_offset): New function.
12141 (Sized_relobj::do_output_section_offset): New function.
12142 (Sized_relobj::do_set_section_offset): New function.
12143 * object.cc (Relobj::output_section_address): Remove.
12144 (Sized_relobj::Sized_relobj): Initialize new fields.
12145 (Sized_relobj::include_section_group): Cast find_kept_object to
12146 Sized_relobj.
12147 (Sized_relobj::include_linkonce_section): Likewise.
12148 (Sized_relobj::do_layout): Use separate arrays for output section
12149 and output offset.
12150 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12151 output_sections.
12152 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12153 output_sections and section_offsets.
12154 (Sized_relobj::write_local_symbols): Likewise.
12155 (map_to_kept_section): Compute output address directly.
12156 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12157 output_sections and section_offsets.
12158 (Sized_relobj::write_sections): Likewise.
12159 (Sized_relobj::relocate_sections): Likewise.
12160 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12161 * output.h (class Output_reloc): Update declarations. Change
12162 u2_.relobj to Sized_relobj*.
12163 (class Output_data_reloc): Change add functions to use
12164 Sized_relobj*.
12165 * output.cc (Output_reloc::Output_reloc): Change relobj to
12166 Sized_relobj*.
12167 (Output_reloc::local_section_offset): Change return type to
12168 Elf_Addr. Use get_output_section_offset.
12169 (Output_reloc::get_address): Likewise.
12170 (Output_section::is_input_address_mapped): Don't call
12171 is_section_specially_mapped.
12172 (Output_section::output_offset): Likewise.
12173 (Output_section::output_address): Likewise.
12174 (Output_section::starting_output_address): Likewise.
12175 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12176 parameter to Sized_relobj*.
12177 (Copy_relocs::need_copy_reloc): Likewise.
12178 (Copy_relocs::save): Likewise.
12179 * copy-relocs.h (class Copy_relocs): Update declarations.
12180 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12181 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12182 * target-reloc.h (relocate_for_relocatable): Change
12183 offset_in_output_section type to Elf_Addr. Change code that uses
12184 it as well.
12185 * layout.cc (Layout::layout): Always set *off.
12186 * mapfile.cc (Mapfile::print_input_section): Use
12187 output_section_offset.
12188 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12189 Sized_relobj*.
12190 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12191 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12192 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12193
5cb66f97
ILT
121942008-07-03 Ian Lance Taylor <iant@google.com>
12195
12196 * layout.cc (Layout::include_section): Do not discard unrecognized
12197 SHT_STRTAB sections.
12198
afe47622
CS
121992008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12200
12201 * script.cc (Lex::can_continue_name): Make '?' allowable in
12202 version-script names.
12203 * testsuite/version_script.map: Change glob pattern to use '?'
12204
5adf9721
ILT
122052008-06-30 Manish Singh <yosh@gimp.org>
12206
12207 PR 6585
12208 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12209 Correct typo.
12210
e6fde208
ILT
122112008-06-30 Ian Lance Taylor <iant@google.com>
12212
12213 PR 6660
12214 PR 6682
12215 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12216 versions]: Don't try to read the value in the contents, since we
12217 don't use it. Use the template endianness when writing.
12218
3f2e6a2d
CC
122192008-06-25 Cary Coutant <ccoutant@google.com>
12220
12221 * fileread.cc (File_read::make_view): Assert on zero-length view.
12222 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12223 symbol table when there are no symbols to read.
12224
c43d3a48
CS
122252008-06-23 Craig Silverstein <csilvers@google.com>
12226
12227 * version.cc (version_string): Bump to 1.7
12228
5f494ea0
CS
122292008-06-18 Craig Silverstein <csilvers@google.com>
12230
12231 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12232 constant 0xFFFF to type Valtype.
12233 (Powerpc_relocate_functions::rel16_ha): Likewise.
12234
c42e122e
ILT
122352008-06-17 Ian Lance Taylor <iant@google.com>
12236
f34787f8
ILT
12237 * output.h (Output_section::Input_section): Initialize p2align_ to
12238 zero for Output_section_data constructors.
12239 (Output_section::Input_section::addralign): If not an input
12240 section, return the alignment of the Output_section_data.
12241 * testsuite/copy_test.cc: New file.
12242 * testsuite/copy_test_1.cc: New file.
12243 * testsuite/copy_test_2.cc: New file.
12244 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12245 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12246 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12247 (copy_test_1_pic.o, copy_test_1.so): New targets.
12248 (copy_test_2_pic.o, copy_test_2.so): New targets.
12249 * testsuite/Makefile.in: Rebuild.
12250
c42e122e
ILT
12251 * script-sections.cc (Script_sections::place_orphan): Initialize
12252 local variable exact.
12253
ce3ac18a
DE
122542008-06-13 David Edelsohn <edelsohn@gnu.org>
12255
12256 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12257
42cacb20
DE
122582008-06-12 David Edelsohn <edelsohn@gnu.org>
12259 David S. Miller <davem@davemloft.net>
12260
12261 * powerpc.cc: New file.
12262 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12263 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12264 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12265 * Makefile.in: Rebuild.
12266
7b308235
ILT
122672008-06-09 Ian Lance Taylor <iant@google.com>
12268
12269 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12270 <exception>.
12271 (throwing, orig_terminate): New static variables.
12272 (terminate_handler): New static function.
12273 (t2): Set terminate handler.
12274
f0b886e3
ILT
122752008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12276
12277 PR 6584
cd536b21 12278 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12279 alignment.
12280
3e90f135
CC
122812008-05-30 Cary Coutant <ccoutant@google.com>
12282
12283 * archive.cc (Archive::include_all_members) Correct to step
12284 over symbol table and extended name table in thin archives.
12285
e09ad04a
ILT
122862008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12287
12288 PR 6407
12289 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12290 calculation.
12291
62b01cb5
ILT
122922008-05-28 Caleb Howe <cshowe@google.com>
12293
12294 * reduced_debug_output.cc: New file.
12295 * reduced_debug_output.h: New file.
92de84a6 12296 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12297 * options.cc (General_options::finalize): Add strip_debug_non_line
12298 to the strip heirarchy.
12299 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12300 fields.
12301 * layout.cc: Include "reduced_debug_output.h".
12302 (Layout::Layout): Initialize new fields.
12303 (line_only_debug_sections): New static array.
12304 (is_lines_only_debug_sections): New static inline function.
12305 (Layout::include_section): Handle --strip-debug-non-line.
12306 (Layout::make_output_section): If --strip-debug-non-line, build
12307 new output sections for .debug_abbrev and .debug_info.
12308 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12309 gold. Warn about possible overflow.
12310 (read_signed_LEB_128): Likewise.
12311 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12312 (read_signed_LEB_128): Declare.
12313 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12314 (HFILES): Add reduced_debug_output.h.
12315 * Makefile.in: Rebuild.
12316
7d9e3d98
ILT
123172008-05-21 Ian Lance Taylor <iant@google.com>
12318
12319 * mapfile.cc: New file.
12320 * mapfile.h: New file.
12321 * options.h (class General_options): Add -M/--print-map and -Map.
12322 * options.cc (General_options::finalize): Make -M equivalent to
12323 -Map -.
12324 * main.cc: Include <cstdio> and "mapfile.h".
12325 (main): Open mapfile if requested.
12326 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12327 constructor. Change caller.
12328 (queue_initial_tasks): Add mapfile parameter. Change caller.
12329 (queue_middle_tasks): Likewise.
12330 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12331 declarations.
12332 * archive.cc: Include "mapfile.h".
12333 (Archive::add_symbols): Add mapfile parameter. Change all
12334 callers. Pass mapfile, symbol, and reason to include_member.
12335 (Archive::include_all_members): Add mapfile parameter. Change all
12336 callers.
12337 (Archive::include_member): Add mapfile, sym, and why parameters.
12338 Change all callers. Report inclusion to map file.
12339 * archive.h: Include "fileread.h".
12340 (class Archive): Update declarations.
12341 (Archive::file): New const method.
12342 (class Add_archive_symbols): Add mapfile_ field. Update
12343 constructor. Change all callers.
12344 * readsyms.h (class Read_symbols): Likewise.
12345 (class Finish_group): Likewise.
12346 (class Read_script): Likewise.
12347 * common.cc: Include "mapfile.h".
12348 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12349 all callers.
12350 (Symbol_table::do_allocate_commons): Likewise.
12351 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12352 symbol allocation to mapfile.
12353 * common.h (class Allocate_commons_task): Add mapfile_ field.
12354 Update constructor. Change all callers.
12355 * symtab.h (class Symbol_table): Update declarations.
12356 * layout.cc: Include "mapfile.h".
12357 (Layout_task_runner::run): Print information to mapfile.
12358 (Layout::create_gold_note): Change Output_data_fixed_space to
12359 Output_data_zero_fill.
12360 (Layout::create_build_id): Likewise.
12361 (Layout::print_to_mapfile): New function.
12362 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12363 constructor. Change caller.
12364 (class Layout): Declare print_to_mapfile.
12365 * output.cc (Output_section::Input_section::print_to_mapfile): New
12366 function.
12367 (Output_section::add_input_section): If producing a map, always
12368 add to input_sections_ list.
12369 (Output_section::do_print_to_mapfile): New function.
12370 (Output_segment::print_sections_to_mapfile): New function.
12371 (Output_segment::print_section_list_to_mapfile): New function.
12372 * output.h: Include "mapfile.h".
12373 (Output_data::print_to_mapfile): New function.
12374 (Output_data::do_print_to_mapfile): New virtual function.
12375 (Output_segment_headers::do_print_to_mapfile): New function.
12376 (Output_file_header::do_print_to_mapfile): New function.
12377 (Output_data_const::do_print_to_mapfile): New function.
12378 (class Output_data_const_buffer): Add map_name_ field. Update
12379 constructor. Change all callers. Add do_print_to_mapfile
12380 function.
12381 (class Output_data_fixed_space): Likewise.
12382 (class Output_data_space): Likewise.
12383 (class Output_data_zero_fill): New class.
12384 (Output_data_strtab::do_print_to_mapfile): New function.
12385 (Output_data_reloc_base::do_print_to_mapfile): New function.
12386 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12387 (Output_data_group::do_print_to_mapfile): New function.
12388 (Output_data_got::do_print_to_mapfile): New function.
12389 (Output_data_dynamic::do_print_to_mapfile): New function.
12390 (Output_symtab_xindex::do_print_to_mapfile): New function.
12391 (class Output_section): Declare do_print_to_mapflie. Declare
12392 print_to_mapfile in Input_section.
12393 (class Output_segment): Declare new functions.
12394 * object.h (Sized_relobj::symbol_count): New function.
12395 * script-sections.cc
12396 (Output_section_element_dot_assignment::set_section_addresses):
12397 Change Output_data_fixed_space to Output_data_zero_fill.
12398 (Output_data_expression::do_print_to_mapfile): New function.
12399 * script.cc (read_input_script): Add mapfile parameter. Change
12400 all callers.
12401 * script.h (read_input_script): Update declaration.
12402 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12403 (Eh_frame::do_print_to_mapfile): New function.
12404 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12405 (Output_merge_string::do_print_to_mapfile): New function.
12406 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12407 function.
12408 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12409 function.
12410 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12411 function.
12412 * Makefile.am (CCFILES): Add mapfile.cc.
12413 (HFILES): Add mapfile.h.
12414 * Makefile.in: Rebuild.
12415
9f1d377b
ILT
124162008-05-19 Ian Lance Taylor <iant@google.com>
12417
12418 * options.h (class General_options): Add -z relro.
12419 * layout.cc (Layout::Layout): Initialize relro_segment_.
12420 (Layout::add_output_section_data): Return the output section.
12421 (Layout::make_output_section): Rcognize relro sections and mark
12422 them appropriately.
12423 (Layout::attach_allocated_section_to_segment): Put relro sections
12424 in a PT_GNU_RELRO segment.
12425 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12426 section as relro.
12427 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12428 PT_TLS segments.
12429 (Layout::linkonce_mapping): Map d.rel.ro.local to
12430 .data.rel.ro.local.
12431 (Layout::output_section_name): Us .data.rel.ro.local for any
12432 section which begins with that.
12433 * layout.h (class Layout): Update add_output_section_data
12434 declaration. Add relro_segment_ field.
12435 * output.cc (Output_section::Output_section): Initialize is_relro_
12436 and is_relro_local_ fields.
12437 (Output_segment::add_output_section): Group relro sections.
12438 (Output_segment::is_first_section_relro): New function.
12439 (Output_segment::maximum_alignment): If there is a relro section,
12440 align the segment to the common page size.
12441 (Output_segment::set_section_addresses): Track whether we are
12442 looking at relro sections. If the last section is a relro
12443 section, align to the common page size.
12444 (Output_segment::set_section_list_addresses): Add in_relro
12445 parameter. Change all callers. Align to the page size when
12446 moving from relro to non-relro section.
12447 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12448 segment.
12449 * output.h (class Output_section): Add is_relro_ and
12450 is_relro_local_ fields.
12451 (Output_section::is_relro): New function.
12452 (Output_section::set_is_relro): New function.
12453 (Output_section::is_relro_local): New function.
12454 (Output_section::set_is_relro_local): New function.
12455 (class Output_segment): Update declarations.
12456 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12457 * sparc.cc (Target_sparc::got_section): Likewise.
12458 * x86_64.cc (Target_x86_64::got_section): Likewise.
12459 * testsuite/relro_test_main.cc: New file.
12460 * testsuite/relro_test.cc: New file.
12461 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12462 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12463 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12464 (relro_test.so, relro_test_pic.o): New targets.
12465 * testsuite/Makefile.in: Rebuild.
12466
a984ee1d
ILT
124672008-05-16 Ian Lance Taylor <iant@google.com>
12468
01676dcd
ILT
12469 * output.cc (Output_segment::add_output_section): Remove front
12470 parameter.
12471 * output.h (class Output_segment): Remove
12472 add_initial_output_section and overloaded add_output_section.
12473 Update declaration of remaining add_output_section.
12474 * layout.cc (Layout::create_interp): Call add_output_section
12475 rather than add_initial_output_section.
12476 (Layout::finish_dynamic_section): Likewise.
12477
497897f9
ILT
12478 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12479 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12480 know the dynamic type.
12481 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12482 field. Initialize it in constructor.
12483 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12484 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12485 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12486 reloc.
12487
a984ee1d
ILT
12488 * output.cc (Output_reloc::get_address): Change return type to
12489 Elf_Addr.
12490 * output.h (class Output_reloc): Update get_address declaration.
12491 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12492 for section addresses.
12493
55ba0940
ILT
124942008-05-09 Ian Lance Taylor <iant@google.com>
12495
12496 PR 6493
12497 * gold.cc (gold_nomem): Use return value of write.
12498
75517b77
ILT
124992008-05-08 Ian Lance Taylor <iant@google.com>
12500
12501 * symtab.c (Symbol::init_base_output_data): Add version
12502 parameter. Change all callers.
12503 (Symbol::init_base_output_segment): Likewise.
12504 (Symbol::init_base_constant): Likewise.
12505 (Symbol::init_base_undefined): Likewise.
12506 (Sized_symbol::init_output_data): Likewise.
12507 (Sized_symbol::init_output_segment): Likewise.
12508 (Sized_symbol::init_constant): Likewise.
12509 (Sized_symbol::init_undefined): Likewise.
12510 (Symbol_table::do_define_in_output_data): If the new symbol has a
12511 version, mark it as the default.
12512 (Symbol_table::do_define_in_output_segment): Likewise.
12513 (Symbol_table::do_define_as_constant): Likewise.
12514 * symtab.h (class Symbol): Update declarations.
12515 (class Sized_symbol): Likewise.
12516 * resolve.cc (Symbol::override_version): New function.
c42e122e 12517 (Symbol::override_base): Call override_version.
75517b77
ILT
12518 (Symbol::override_base_with_special): Likewise.
12519 * testsuite/ver_script_8.script: New file.
12520 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12521 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12522 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12523 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12524
f1f70eae
ILT
125252008-05-06 Ian Lance Taylor <iant@google.com>
12526
f3e9c5c5
ILT
12527 PR 6049
12528 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12529 functions.
12530 (class General_options): Remove existing --undefined, and add
12531 --no-undefined instead. Add new --undefined as synonym for -u.
12532 * archive.cc (Archive::add_symbols): Check whether symbol was
12533 named with -u.
12534 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12535 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12536 all uses. Add IS_UNDEFINED. Update declarations to split
12537 different versions of init_base. Declare init_base_undefined.
12538 (Symbol::is_defined): Handle IS_UNDEFINED.
12539 (Symbol::is_undefined): Likewise.
12540 (Symbol::is_weak_undefined): Call is_undefined.
12541 (Symbol::is_absolute): Handle IS_CONSTANT.
12542 (class Sized_symbol): Update declarations to split different
12543 versions of init. Declare init_undefined.
12544 (class Symbol_table): Declare new functions.
12545 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12546 Change all callers.
12547 (Symbol::init_base_output_data): Likewise.
12548 (Symbol::init_base_output_segment): Likewise.
12549 (Symbol::init_base_constant): Likewise.
12550 (Symbol::init_base_undefined): New function.
12551 (Sized_symbol::init_object): Rename from init. Change all
12552 callers.
12553 (Sized_symbol::init_output_data): Likewise.
12554 (Sized_symbol::init_output_segment): Likewise.
12555 (Sized_symbol::init_constant): Likewise.
12556 (Sized_symbol::init_undefined): New function.
12557 (Symbol_table::add_undefined_symbols_from_command_line): New
12558 function.
12559 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12560 function.
12561 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12562 (Symbol::output_section): Likewise.
12563 (Symbol::set_output_section): Likewise.
12564 (Symbol_table::sized_finalize_symbol): Likewise.
12565 (Symbol_table::sized_write_globals): Likewise.
12566 * resolve.cc (Symbol_table::should_override): Likewise.
12567 (Symbol::override_base_with_special): Likewise.
12568
8bdcdf2c
ILT
12569 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12570 symbol, change it to have default visibility.
12571 * testsuite/protected_1.cc: New file.
12572 * testsuite/protected_2.cc: New file.
12573 * testsuite/protected_3.cc: New file.
12574 * testsuite/protected_main_1.cc: New file.
12575 * testsuite/protected_main_2.cc: New file.
12576 * testsuite/protected_main_3.cc: New file.
12577 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12578 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12579 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12580 (protected_1.so): New target.
12581 (protected_1_pic.o, protected_2_pic.o): New targets.
12582 (protected_3_pic.o): New target.
12583 (check_PROGRAMS): Add protected_2.
12584 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12585 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12586 * testsuite/Makefile.in: Rebuild.
12587
2b706932
ILT
12588 * options.h (DEFINE_var): Add set_user_set_##varname__.
12589 (DEFINE_bool_alias): New macro.
12590 (class General_options): Define -Bstatic using DEFINE_bool_alias
12591 rather than DEFINE_special. Add --undefined as an alias for -z
12592 defs.
12593 * options.cc (General_options::parse_Bstatic): Remove.
12594
d82a5bcc
ILT
12595 * options.h (class General_options): Add --fatal-warnings.
12596 * main.cc (main): Implement --fatal-warnings.
12597 * errors.h (Errors::warning_count): New function.
12598
f1f70eae
ILT
12599 * options.h (class General_options): Add -Bsymbolic-functions.
12600 * symtab.h (Symbol::is_preemptible): Check for
12601 -Bsymbolic-functions.
12602
8825ac63
ILT
126032008-05-05 Ian Lance Taylor <iant@google.com>
12604
d98bc257
ILT
12605 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12606 as noVARNAME rather than no-VARNAME.
12607 (class General_options): Add option -z combreloc.
12608 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12609 get_address.
12610 (Output_reloc::sort_before) [SHT_REL]: New function.
12611 (Output_reloc::sort_before) [SHT_RELA]: New function.
12612 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12613 Sort_relocs_comparison.
12614 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12615 parameter. Change all callers.
12616 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12617 sort_relocs parameter. Change all callers.
12618 * output.cc (Output_reloc::get_address): New function, broken out
12619 of write_rel.
12620 (Output_reloc::write_rel): Call it.
12621 (Output_reloc::compare): New function.
12622 (Output_data_reloc_base::do_write): Optionally sort relocs.
12623
60b2b4e7
ILT
12624 * configure.ac: If targ_extra_obj is set, link it in.
12625 * configure.tgt: Initialize all variables.
12626 (x86_64*): Set targ_extra_obj and targ_extra_size.
12627 * configure: Rebuild.
12628
8825ac63
ILT
12629 * object.cc (Sized_relobj::include_section_group): Adjust section
12630 indexes read from group data. Build vector to pass to
12631 layout_group.
12632 * layout.cc (Layout::layout_group): Add flags and shndxes
12633 parameters. Remove contents parameter. Change caller. Update
12634 explicit instantiations.
12635 * layout.h (class Layout): Update layout_group declaration.
12636 * output.cc (Output_data_group::Output_data_group): Add flags and
12637 input_shndxes parameters. Remove contents parameter. Change
12638 caller.
12639 (Output_data_group::do_write): Change input_sections_ to
12640 input_shndxes_.
12641 * output.h (class Output_data_group): Update constructor
12642 declaration. Rename input_sections_ to input_shndxes_.
12643 * testsuite/many_sections_test.cc: Add template.
12644
e94cf127
CC
126452008-04-30 Cary Coutant <ccoutant@google.com>
12646
4418b2d5
CC
12647 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12648
e94cf127
CC
12649 * layout.cc (Layout::include_section): Refactored check for debug
12650 info section.
12651 (Layout::add_comdat): Add new parameters. Change type
12652 of signature parameter. Add object and shndx to signatures table.
12653 (Layout::find_kept_object): New function.
12654 * layout.h: Include <cstring>.
12655 (Layout::is_debug_info_section): New function.
12656 (Layout::add_comdat): Add new parameters.
12657 (Layout::find_kept_object): New function.
12658 (Layout::Kept_section): New struct.
12659 (Layout::Signatures): Change type of map range.
12660 * object.cc (Relobj::output_section_address): New function.
12661 (Sized_relobj::include_section_group): Add new parameters. Change
12662 calls to Layout::add_comdat. Change to build table of kept comdat
12663 groups and table mapping discarded sections to kept sections.
12664 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12665 (Sized_relobj::do_layout): Change calls to include_section_group and
12666 include_linkonce_section.
12667 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12668 value to zero when section is discarded.
12669 (Sized_relobj::map_to_kept_section): New function.
12670 * object.h (Relobj::output_section_address): New function.
12671 (Relobj::Comdat_group): New type.
12672 (Relobj::find_comdat_group): New function.
12673 (Relobj::Comdat_group_table): New type.
12674 (Relobj::Kept_comdat_section): New type.
12675 (Relobj::Kept_comdat_section_table): New type.
12676 (Relobj::add_comdat_group): New function.
12677 (Relobj::set_kept_comdat_section): New function.
12678 (Relobj::get_kept_comdat_section): New function.
12679 (Relobj::comdat_groups_): New field.
12680 (Relobj::kept_comdat_sections_): New field.
12681 (Symbol_value::input_value): Update comment.
12682 (Sized_relobj::map_to_kept_section) New function.
12683 (Sized_relobj::include_linkonce_section): Add new parameter.
12684 * target-reloc.h (Comdat_behavior): New type.
12685 (get_comdat_behavior): New function.
12686 (relocate_section): Add code to map a discarded section to the
12687 corresponding kept section when applying a relocation.
12688
e4e5049b
CS
126892008-04-30 Craig Silverstein <csilvers@google.com>
12690
12691 * dwarf_reader.cc (next_generation_count): New static var.
12692 (Addr2line_cache_entry): New struct.
12693 (addr2line_cache): New static var.
12694 (Dwarf_line_info::one_addr2line): Added caching.
12695 (Dwarf_line_info::clear_addr2line_cache): New function.
12696 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12697 cache-size parameter.
12698 (Dwarf_line_info::one_addr2line_cache): New function.
12699 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12700 new cache-size argument to one_addr2line(), and clear cache.
12701
d09e9154
CC
127022008-04-28 Cary Coutant <ccoutant@google.com>
12703
12704 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12705 R_386_PC8 relocations.
12706
7ef73768
ILT
127072008-04-23 Ian Lance Taylor <iant@google.com>
12708
55438702
ILT
12709 * object.cc (Sized_relobj::include_section_group): Check for
12710 invalid section group.
12711
c165fb93
ILT
12712 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12713 header size.
12714
7ef73768
ILT
12715 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12716 than read for file header.
12717 * archive.cc (Archive::include_member): Likewise.
12718
6194aaab
L
127192008-04-23 Paolo Bonzini <bonzini@gnu.org>
12720
12721 * aclocal.m4: Regenerate.
12722 * configure: Regenerate.
12723
d491d34e
ILT
127242008-04-19 Ian Lance Taylor <iant@google.com>
12725
5ea2bac6
ILT
12726 * version.cc (version_string): Bump to 1.6.
12727
7bc3e21a
ILT
12728 * testsuite/Makefile.am (many_sections_r_test): New target.
12729 (many_sections_r_test_SOURCES): Remove.
12730 (many_sections_r_test_DEPENDENCIES): Remove.
12731 (many_sections_r_test_LDFLAGS): Remove.
12732 (many_sections_r_test_LDADD): Remove.
12733
7fcd3aa9
ILT
12734 * object.cc (Sized_relobj::do_add_symbols): Always pass
12735 local_symbol_count_ to add_from_relobj.
12736
4c94d6ae
ILT
12737 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12738 every thousand variables.
12739 * testsuite/Makefile.in: Rebuild.
12740
d491d34e
ILT
12741 * object.cc (Xindex::initialize_symtab_xindex): New function.
12742 (Xindex::read_symtab_xindex): New function.
12743 (Xindex::sym_xindex_to_shndx): New function.
12744 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12745 available.
12746 (Sized_relobj::do_initialize_xindex): New function.
12747 (Sized_relobj::do_read_symbols): Adjust section links.
12748 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12749 parameter. Change all callers.
12750 (Sized_relobj::include_section_group): Adjust section links and
12751 symbol section indexes.
12752 (Sized_relobj::do_layout): Adjust section links.
12753 (Sized_relobj::do_count_local_symbols): Adjust section links and
12754 symbol section indexes.
12755 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12756 ordinary and special symbols.
12757 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12758 dynsym_xindex parameters. Change all callers. Adjust section
12759 links. Use SHN_XINDEX when needed.
12760 (Sized_relobj::get_symbol_location_info): Adjust section links.
12761 Don't get fooled by special symbols.
12762 * object.h (class Xindex): Define.
12763 (class Object): Add xindex_ parameter. Declare virtual functoin
12764 do_initialize_xindex.
12765 (Object::adjust_sym_shndx): New function.
12766 (Object::set_xindex): New protected function.
12767 (class Symbol_value): Add is_ordinary_shndx_ field.
12768 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12769 (Symbol_value::value): Assert ordinary section.
12770 (Symbol_value::initialize_input_to_output_map): Likewise.
12771 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12772 Change all callers.
12773 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12774 all callers.
12775 (class Sized_relobj): Update declarations.
12776 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12777 parameter. Change all callers.
12778 (Sized_relobj::adjust_shndx): New function.
12779 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12780 field.
12781 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12782 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12783 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12784 (Sized_dynobj::read_dynsym_section): Adjust section links.
12785 (Sized_dynobj::read_dynamic): Likewise.
12786 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12787 section links.
12788 (Sized_dynobj::do_initialize_xindex): New function.
12789 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12790 do_initialize_xindex.
12791 (Sized_dynobj::adjust_shndx): New function.
12792 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12793 dynsym_xindex_ fields.
12794 (Layout::finalize): Add a call to set_section_indexes before
12795 creating the symtab sections.
12796 (Layout::set_section_indexes): Don't do anything if the section
12797 already has a section index.
12798 (Layout::create_symtab_sections): Add shnum parameter. Change
12799 caller. Create .symtab_shndx section if needed.
12800 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12801 caller.
12802 (Layout::allocated_output_section_count): New function.
12803 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12804 needed.
12805 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12806 fields. Update declarations.
12807 (Layout::symtab_xindex): New function.
12808 (Layout::dynsym_xindex): New function.
12809 (class Write_symbols_task): Add layout_ field.
12810 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12811 Change caller.
12812 * output.cc (Output_section_headers::Output_section_headers): Add
12813 shstrtab_section parameter. Change all callers.
12814 (Output_section_headers::do_sized_write): Store overflow values
12815 for section count and section string table section index in
12816 section header zero.
12817 (Output_file_header::do_sized_write): Check for overflow of
12818 section count and section string table section index.
12819 (Output_symtab_xindex::do_write): New function.
12820 (Output_symtab_xindex::endian_do_write): New function.
12821 * output.h (class Output_section_headers): Add shstrtab_section_.
12822 Update declarations.
12823 (class Output_symtab_xindex): Define.
12824 (Output_section::has_out_shndx): New function.
12825 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12826 field.
12827 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12828 Change all callers.
12829 (Sized_symbol::init): Likewise.
12830 (Symbol::output_section): Check for ordinary symbol.
12831 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12832 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12833 callers.
12834 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12835 Change all callers. Simplify handling of symbols from sections
12836 not included in the link.
12837 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12838 distinction.
12839 (Weak_alias_sorter::operator()): Assert that symbols are
12840 ordinary.
12841 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12842 distinction.
12843 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12844 parameters. Change all callers.
12845 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12846 symbol distinction. Use SHN_XINDEX when needed.
12847 (Symbol_table::write_section_symbol): Add symtab_xindex
12848 parameter. Change all callers.
12849 (Symbol_table::sized_write_section_symbol): Likewise. Use
12850 SHN_XINDEX when needed.
12851 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12852 declarations.
12853 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12854 (Symbol::is_defined): Check is_ordinary.
12855 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12856 (Symbol::is_absolute, Symbol::is_common): Likewise.
12857 (class Sized_symbol): Update declarations.
12858 (class Symbol_table): Update declarations.
12859 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12860 parameters. Change all callers.
12861 (Sized_symbol::override): Likewise.
12862 (Symbol_table::override): Likewise.
12863 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12864 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12865 is_ordinary, and orig_st_shndx parameters. Change all callers.
12866 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12867 to be in an ordinary section.
12868 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12869 object and is_ordinary parameters. Change all callers.
12870 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12871 Change all callers. Don't add undefined or non-ordinary symbols
12872 to reloc_map_.
12873 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12874 Change all callers.
12875 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12876 declarations.
12877 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12878 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12879 (Sized_relobj::relocate_sections): Likewise.
12880 * target-reloc.h (scan_relocs): Adjust section symbol index.
12881 (scan_relocatable_relocs): Likewise.
12882 * i386.cc (Scan::local): Check for ordinary symbols.
12883 * sparc.cc (Scan::local): Likewise.
12884 * x86_64.cc (Scan::local): Likewise.
12885 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12886 to symbol_section_and_value.
12887 * testsuite/many_sections_test.cc: New file.
12888 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12889 (check_PROGRAMS): Add many_sections_test.
12890 (many_sections_test_SOURCES): Define.
12891 (many_sections_test_DEPENDENCIES): Define.
12892 (many_sections_test_LDFLAGS): Define.
12893 (BUILT_SOURCES): Add many_sections_define.h.
12894 (many_sections_define.h): New target.
12895 (BUILT_SOURCES): Add many_sections_check.h.
12896 (many_sections_check.h): New target.
12897 (check_PROGRAMS): Add many_sections_r_test.
12898 (many_sections_r_test_SOURCES): Define.
12899 (many_sections_r_test_DEPENDENCIES): Define.
12900 (many_sections_r_test_LDFLAGS): Define.
12901 (many_sections_r_test_LDADD): Define.
12902 (many_sections_r_test.o): New target.
12903 * testsuite/Makefile.in: Rebuild.
12904
c5818ff1
CC
129052008-04-17 Cary Coutant <ccoutant@google.com>
12906
12907 * errors.cc (Errors::info): New function.
12908 (gold_info): New function.
12909 * errors.h (Errors::info): New function.
12910 * gold.h (gold_info): New function.
12911 * object.cc (Input_objects::add_object): Print trace output.
12912 * options.cc (options::parse_set): New function.
12913 (General_options::parse_wrap): Deleted.
12914 (General_options::General_options): Deleted initializer.
12915 * options.h (options::String_set): New typedef.
12916 (options::parse_set): New function.
12917 (DEFINE_set): New macro.
12918 (General_options::wrap): Changed to use DEFINE_set. Changed
12919 callers of any_wrap_symbols and is_wrap_symbol.
12920 (General_options::trace, General_options::trace_symbol):
12921 New options.
12922 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12923 (General_options::wrap_symbols_): Deleted.
12924 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12925
b5be4a7c
DM
129262008-04-17 David S. Miller <davem@davemloft.net>
12927
12928 * options.cc (General_options::parse_V): New function.
12929 * options.h: Add entries for -V and -Qy.
12930
155a0dd7
ILT
129312008-04-17 Ian Lance Taylor <iant@google.com>
12932
12933 * common.cc (Symbol_table::allocate_commons): Remove options
12934 parameter. Change caller.
12935 (Symbol_table::do_allocate_commons): Remove options parameter.
12936 Change caller. Just call do_allocate_commons_list twice.
12937 (Symbol_table::do_allocate_commons_list): New function, broken out
12938 of do_allocate_commons.
12939 * common.h (class Allocate_commons_task): Remove options_ field.
12940 Update constructor.
12941 * symtab.cc (Symbol_table::Symbol_table): Initialize
12942 tls_commons_.
12943 (Symbol_table::add_from_object): Put TLS common symbols on
12944 tls_commons_ list.
12945 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12946 which are IN_OUTPUT_DATA.
12947 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12948 allocate_commons and do_allocate_commons declarations. Declare
12949 do_allocate_commons_list.
12950 * gold.cc (queue_middle_tasks): Update creation of
12951 Allocate_commons_task to not pass options.
12952 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12953 (TLS_TEST_C_FLAGS): New variable.
12954 (tls_test_c_pic.o): New target.
12955 (tls_test_shared.so): Link in tls_test_c_pic.o.
12956 (tls_test_c_pic_ie.o): New target.
12957 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12958 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12959 (tls_test_c.o): New target.
12960 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12961 (tls_pic_test_LDADD): Likewise.
12962 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12963 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12964 (tls_test_c_gnu2.o): New target.
12965 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12966 tls_test_c_gnu2.o.
12967 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12968 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12969 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12970 * testsuite/tls_test.cc: Include "config.h".
12971 (t_last): Call t11_last.
12972 * testsuite/tls_test.h (t11, t11_last): Declare.
12973 * testsuite/tls_test_c.c: New file.
12974 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12975 * configure.ac: Check for OpenMP support.
12976 * configure, config.in, Makefile.in: Rebuild.
12977 * testsuite/Makefile.in: Rebuild.
12978
edfbb029
CC
129792008-04-16 Cary Coutant <ccoutant@google.com>
12980
12981 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12982 (Target_i386::tls_base_symbol_defined_): New field.
12983 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12984 (Target_i386::Scan::global): Likewise.
12985 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12986 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12987 (Target_x86_64::tls_base_symbol_defined_): New field.
12988 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12989 (Target_x86_64::Scan::global): Likewise.
12990
f3c69fca
CC
129912008-04-16 Cary Coutant <ccoutant@google.com>
12992
12993 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12994 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12995 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12996 building shared libraries.
12997 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12998 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12999 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
13000 * testsuite/Makefile.in: Rebuild.
13001 * testsuite/weak_undef.h: New file.
13002 * testsuite/weak_undef_file1.cc: Add extra test cases.
13003 * testsuite/weak_undef_file2.cc: Likewise.
13004 * testsuite/weak_undef_test.cc: Likewise.
13005
7c414435
DM
130062008-04-16 David S. Miller <davem@davemloft.net>
13007
32b769e1
DM
13008 * sparc.cc (Target_sparc::Scan): Change from struct to class.
13009 Add issued_non_pic_error_ field. Declare check_non_pic.
13010 (Target_sparc::Scan::check_non_pic): New function.
13011 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
13012 (Target_sparc::Scan::global): Likewise.
13013
11936fb1
DM
13014 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
13015 * configure: Rebuild.
13016
7c414435
DM
13017 * options.h (DEFINE_enable): New macro.
13018 (new_dtags): New enable option.
13019 (initfirst, interpose, loadfltr, nodefaultlib,
13020 nodelete, nodlopen, nodump): New -z options.
13021 * layout.cc (Layout:finish_dynamic_section): If new
13022 dtags enabled, emit DT_RUNPATH. Also, emit a
13023 DT_FLAGS_1 containing any specified -z flags.
13024
85c7bf8b
ILT
130252008-04-16 Ian Lance Taylor <iant@google.com>
13026
12c0daef
ILT
13027 * copy-relocs.cc: New file.
13028 * copy-relocs.h: New file.
13029 * reloc.cc: Remove Copy_relocs code.
13030 * reloc.h: Likewise.
13031 * reloc-types.h (struct Reloc_types) [both versions]: Add
13032 get_reloc_addend_noerror.
13033 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
13034 variants of add_global which take an addend which must be zero.
13035 * i386.cc: Include "copy-relocs.h".
13036 (class Target_i386): Change type of copy_relocs_ to variable,
13037 update initializer.
13038 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
13039 Change all callers.
13040 (Target_i386::do_finalize_sections): Change handling of
13041 copy_relocs_.
13042 * sparc.cc: Include "copy-relocs.h".
13043 (class Target_sparc): Change type of copy_relocs_ to variable,
13044 update initializer.
13045 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
13046 Change all callers.
13047 (Target_sparc::do_finalize_sections): Change handling of
13048 copy_relocs_.
13049 * x86_64.cc: Include "copy-relocs.h".
13050 (class Target_x86_64): Change type of copy_relocs_ to variable,
13051 update initializer.
13052 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
13053 class. Change all callers.
13054 (Target_x86_64::do_finalize_sections): Change handling of
13055 copy_relocs_.
13056 * Makefile.am (CCFILES): Add copy-relocs.cc.
13057 (HFILES): Add copy-relocs.h.
13058
4f4995b6
ILT
13059 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
13060
85c7bf8b
ILT
13061 * testsuite/script_test_4.sh: Permit leading zeroes.
13062
4f2a9edd
ILT
130632008-04-15 Ian Lance Taylor <iant@google.com>
13064
e6188289
ILT
13065 * script-sections.cc (Script_sections::create_segments): Use
13066 header_size_adjustment even when there is enough room for the
13067 headers.
13068 * testsuite/script_test_4.sh: New file.
13069 * testsuite/script_test_4.t: New file.
13070 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
13071 (check_DATA): Add script_test_4.stdout.
13072 (MOSTLYCLEANFILES): Likewise.
13073 (script_test_4): New target.
13074 (script_test_4.stdout): New target.
13075 * testsuite/Makefile.in: Rebuild.
13076
4f2a9edd
ILT
13077 * sparc.cc: Add definitions for Output_data_plt_sparc class
13078 constants.
13079
f5314dd5
DM
130802008-04-14 David S. Miller <davem@davemloft.net>
13081
13082 * sparc.cc: New file.
13083 * Makefile.am (TARGETSOURCES): Add sparc.cc
13084 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13085 * configure.tgt: Document targ_extra_size and
13086 targ_extra_big_endian. Add entries for sparc-* and
13087 sparc64-*.
13088 * configure.ac: Handle targ_extra_size and
13089 targ_extra_big_endian.
13090 * Makefile.in: Rebuild.
13091 * configure: Likewise.
13092 * po/POTFILES.in: Likewise.
13093 * po/gold.pot: Likewise.
13094
154e0e9a
ILT
130952008-04-14 Ian Lance Taylor <iant@google.com>
13096
13097 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13098 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13099 in the name/type/flags to section mapping. Don't call
13100 allocate_output_section.
13101 (Layout::choose_output_section): Change parameter from adjust_name
13102 to is_input_section. Don't permit input sections after sections
13103 are attached to segments. Don't call allocate_output_section.
13104 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13105 not write_enable_output_section.
13106 (Layout::make_output_section): Don't push to
13107 unattached_section_list_ nor call attach_to_segment. Call
13108 attach_section_to_segment if sections are attached.
13109 (Layout::attach_sections_to_segments): New function.
13110 (Layout::attach_section_to_segment): New function.
13111 (Layout::attach_allocated_section_to_segment): Rename from
13112 attach_to_segment. Remove flags parameter.
13113 (Layout::allocate_output_section): Remove function.
13114 (Layout::write_enable_output_section): Remove function.
13115 * layout.h (class Layout): Update for above changes. Add new
13116 field sections_are_attached_.
13117 * output.h (Output_section::update_flags_for_input_section): New
13118 function.
13119 * output.cc (Output_section::add_input_section): Call
13120 update_flags_for_input_section.
13121 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13122
009a67a2
CC
131232008-04-11 Cary Coutant <ccoutant@google.com>
13124
13125 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13126 thought unnecessary.
13127 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13128
759b1a24
ILT
131292008-04-11 Ian Lance Taylor <iant@google.com>
13130
13131 * output.h (class Output_section_data): Remove inline definition
13132 of set_addralign.
13133 * output.cc (Output_section_data::set_addralign): New function.
13134
c2b45e22
CC
131352008-04-11 Cary Coutant <ccoutant@google.com>
13136
13137 Add support for TLS descriptors for i386 and x86_64.
13138 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13139 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13140 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13141 GOT_TYPE_TLS_DESC.
13142 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13143 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13144 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13145 relocations.
13146 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13147 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13148 Fix problem with initial-exec relocations.
13149 (Target_i386::Relocate::relocate_tls): Likewise.
13150 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13151 relaxation.
13152 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13153 support for section-plus-offset dynamic table entries.
13154 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13155 (Output_data_dynamic::Dynamic_entry): Add support for
13156 section-plus-offset dynamic table entries.
13157 (Output_data_dynamic::Classification): Likewise.
13158 (Output_data_dynamic::classification_): Renamed offset_.
13159 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13160 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13161 (Target_x86_64::make_plt_section): New function.
13162 (Target_x86_64::reserve_tlsdesc_entries): New function.
13163 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13164 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13165 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13166 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13167 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13168 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13169 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13170 add extra PLT entry for TLS descriptors.
13171 (Output_data_plt_x86_64::got_): New field.
13172 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13173 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13174 fields.
13175 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13176 descriptors.
13177 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13178 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13179 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13180 R_386_TLS_DESC_CALL relocations.
13181 (Target_x86_64::Scan::global): Likewise.
13182 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13183 for TLS descriptors.
13184 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13185 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13186 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13187 GD-to-IE relaxation.
13188 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13189 and TLS_DESCRIPTORS.
13190 * Makefile.in: Rebuild.
13191 * configure: Rebuild.
13192 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13193 (tls_test_shared2.so): New target.
13194 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13195 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13196 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13197 (tls_shared_gd_to_ie_test_LDADD): New variable.
13198 (tls_shared_gnu2_gd_to_ie_test): New target.
13199 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13200 New targets.
13201 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13202 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13203 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13204 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13205 (tls_shared_gnu2_test): New target.
13206 (tls_test_gnu2_shared.so): New target.
13207 (tls_shared_gnu2_test_SOURCES): New variable.
13208 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13209 (tls_shared_gnu2_test_LDFLAGS): New variable.
13210 (tls_shared_gnu2_test_LDADD): New variable.
13211 * testsuite/Makefile.in: Rebuild.
13212 * testsuite/Makefile.
13213
83bfb6b7
ILT
132142008-04-11 Ian Lance Taylor <iant@google.com>
13215
13216 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13217 justsyms.t.
13218 * testsuite/Makefile.in: Rebuild.
13219
13220 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13221 long.
13222 * testsuite/script_test_2.cc (main): Adjust test.
13223
706e1f5e
ILT
132242008-04-11 David S. Miller <davem@davemloft.net>
13225 Ian Lance Taylor <iant@google.com>
13226
13227 * options.h (General_options): Add entries for '-Y' and
13228 '-relax'.
13229 * options.cc (General_options:finalize): If -Y was used, add those
13230 entries to the library path instead of the default "/lib" and
13231 "/usr/lib".
13232
7c98e6bb
DM
132332008-04-11 David S. Miller <davem@davemloft.net>
13234
13235 * testsuite/justsyms.t: Start at 0x100.
13236 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13237 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13238 long.
13239 * testsuite/script_test_2.cc: Adjust string and section length
13240 checks.
7c98e6bb 13241
99a37bfd
ILT
132422008-04-09 Ian Lance Taylor <iant@google.com>
13243
2cefc357
ILT
13244 PR gold/5996
13245 * script-sections.cc (Sections_element::allocate_to_segment): Add
13246 orphan parameter.
13247 (Output_section_definition::allocate_to_segment): Likewise.
13248 (Orphan_output_section::allocate_to_segment): Likewise.
13249 (Script_sections::attach_sections_using_phdrs_clause): Don't
13250 propagate non-PT_LOAD segments to orphan sections.
13251 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13252 readelf rather than objdump.
13253 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13254 .interp section and PT_INTERP segment are the same size.
13255 * testsuite/Makefile.in: Rebuild.
13256
99a37bfd
ILT
13257 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13258 aliases for symbols defined in the same object.
13259 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13260 (weak_alias_test_SOURCES): New variable.
13261 (weak_alias_test_DEPENDENCIES): New variable.
13262 (weak_alias_test_LDFLAGS): New variable.
13263 (weak_alias_test_LDADD): New variable.
13264 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13265 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13266 (weak_alias_test_3.o): New target.
13267 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13268 * testsuite/weak_alias_test_main.cc: New file.
13269 * testsuite/weak_alias_test_1.cc: New file.
13270 * testsuite/weak_alias_test_2.cc: New file.
13271 * testsuite/weak_alias_test_3.cc: New file.
13272
780e49c5
ILT
132732008-04-08 Ian Lance Taylor <iant@google.com>
13274
cdb0b8f5
ILT
13275 * options.h (class General_options): Add --noinhibit-exec option.
13276 * main.cc (main): Check --noinhibit-exec.
13277
0864d551
ILT
13278 * options.h (class General_options): Define --wrap as a special
13279 option. Add wrap_symbols_ field.
13280 (General_options::any_wrap_symbols): New function.
13281 (General_options::is_wrap_symbol): New function.
13282 * options.cc (General_options::parse_wrap): New function.
13283 (General_options::General_options): Initialize wrap_symbols_.
13284 * symtab.cc (Symbol_table::wrap_symbol): New function.
13285 (Symbol_table::add_from_object): Handle --wrap.
13286 * symtab.h (class Symbol_table): Declare wrap_symbol.
13287 * target.h (Target::wrap_char): New function.
13288 (Target::Target_info): Add wrap_char field.
13289 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13290 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13291 * testsuite/testfile.cc (Target_test::test_target_info):
13292 Likewise.
13293
789aa6de
ILT
13294 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13295 there is one.
13296
2c38906f
ILT
13297 * layout.h (class Layout): Add added_eh_frame_data_ field.
13298 * layout.cc (Layout::Layout): Initialize new field.
13299 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13300 output section until we find a section we merged successfully.
13301 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13302 that the size be non-zero.
13303
780e49c5
ILT
13304 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13305 qualifier.
13306
7fcd0256
ILT
133072008-04-08 Craig Silverstein <csilvers@google.com>
13308
13309 * configure.ac: Export new conditional variable HAVE_ZLIB.
13310 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13311 on HAVE_ZLIB.
13312 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13313 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13314
6835af53
ILT
133152008-04-07 Ian Lance Taylor <iant@google.com>
13316
e24f324c
ILT
13317 * version.cc (version_string): Set to "1.5".
13318
a036edd8
ILT
13319 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13320 Add issued_non_pic_error_ field. Declare check_non_pic.
13321 (Target_x86_64::Scan::check_non_pic): New function.
13322 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13323 (Target_x86_64::Scan::global): Likewise.
13324
624f8810
ILT
13325 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13326 addend parameter. Change caller. Handle merge sections.
13327 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13328 Address to Addend. Don't add in the result of
13329 local_section_offset, pass down the addend and use the returned
13330 value.
13331 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13332 Update declarations of local_section_offset and symbol_value.
13333 * testsuite/two_file_test_1.cc (t18): New function.
13334 * testsuite/two_file_test_2.cc (f18): New function.
13335 * testsuite/two_file_test_main.cc (main): Call t18.
13336 * testsuite/two_file_test.h (t18, f18): Declare.
13337
6835af53
ILT
13338 * configure.ac: Don't test for objdump, c++filt, or readelf.
13339 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13340 conditionals.
13341 (TEST_READELF): New variable.
13342 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13343 (check_PROGRAMS): Add two_file_strip_test.
13344 (two_file_strip_test): New target.
13345 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13346 (two_file_same_shared_strip_test_SOURCES): New variable.
13347 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13348 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13349 (two_file_same_shared_strip_test_LDADD): New variable.
13350 (two_file_shared_strip.so): New target.
13351 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13352 (ver_test_5.syms, ver_test_7.syms): Likewise.
13353 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13354 (strip_test_3.stdout): Use TEST_OBJDUMP.
13355 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13356
86925eef
CC
133572008-04-04 Cary Coutant <ccoutant@google.com>
13358
13359 * symtab.h (Symbol::is_weak_undefined): New function.
13360 (Symbol::is_strong_undefined): New function.
13361 (Symbol::is_absolute): New function.
13362 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13363 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13364 absolute symbols.
13365 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13366 (weak_undef_test): New target.
13367 * testsuite/Makefile.in: Rebuild.
13368 * testsuite/weak_undef_file1.cc: New file.
13369 * testsuite/weak_undef_file2.cc: New file.
13370 * testsuite/weak_undef_test.cc: New file.
13371
126f3ece
ILT
133722008-04-03 Craig Silverstein <csilvers@google.com>
13373
13374 * compressed_output.h (class Output_compressed_section): Use
13375 unsigned buffer.
13376 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13377 add zlib header.
13378 (zlib_compressed_suffix): Removed.
13379 (Output_compressed_section::set_final_data_size): Use unsigned
13380 buffers.
13381 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13382 Fix linker invocation.
13383 (flagstest_o_specialfile_and_compress_debug_sections):
13384 Likewise.
13385 * testsuite/Makefile.in: Regenerated.
13386
deae2a14
DM
133872008-04-02 David S. Miller <davem@davemloft.net>
13388
13389 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13390 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13391
70752818
ILT
133922008-04-02 Craig Silverstein <csilvers@google.com>
13393
13394 * TODO: New file.
13395
39d0cb0e
ILT
133962008-04-02 Ian Lance Taylor <iant@google.com>
13397
13398 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13399 parameters. Update for new key type to views_. Change all
13400 callers.
13401 (File_read::read): Adjust for byteshift in returned view.
13402 (File_read::add_view): New function, broken out of
13403 find_and_make_view.
13404 (File_read::make_view): New function, broken out of
13405 find_and_make_view.
13406 (File_read::find_or_make_view): Add offset and aligned
13407 parameters. Rewrite accordingly. Change all callers.
13408 (File_read::get_view): Add offset and aligned parameters. Adjust
13409 for byteshift in return value.
13410 (File_read::get_lasting_view): Likewise.
13411 * fileread.h (class File_read): Update declarations.
13412 (class File_read::View): Add byteshift_ field. Add byteshift to
13413 constructor. Add byteshift method.
13414 * archive.h (Archive::clear_uncached_views): New function.
13415 (Archive::get_view): Add aligned parameter. Change all callers.
13416 * object.h (Object::get_view): Add aligned parameter. Change all
13417 callers.
13418 (Object::get_lasting_view): Likewise.
13419
13420 * fileread.cc (File_read::release): Don't call clear_views if
13421 there are multiple objects.
13422 * fileread.h (File_read::clear_uncached_views): New function.
13423 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13424 on the archive.
13425
a1207466
CC
134262008-03-31 Cary Coutant <ccoutant@google.com>
13427
13428 Add thin archive support.
13429 * archive.cc (Archive::armagt): New const.
13430 (Archive::setup): Remove task parameter and calls to unlock.
13431 (Archive::unlock_nested_archives): New function.
13432 (Archive::read_header): Add nested_off parameter. Change
13433 all callers.
13434 (Archive::interpret_header): Likewise.
13435 (Archive::include_all_members): Change to handle thin
13436 archives.
13437 (Archive::include_member): Likewise.
13438 * archive.h (Archive::Archive): Add new parameters and
13439 initializers.
13440 (Archive::armagt): New const.
13441 (Archive::setup): Remove task parameter.
13442 (Archive::unlock_nested_archives): New function.
13443 (Archive::read_header): Add nested_off parameter.
13444 (Archive::interpret_header): Likewise.
13445 (Archive::Nested_archive_table): New typedef.
13446 (Archive::is_thin_archive_): New field.
13447 (Archive::nested_archives_): New field.
13448 (Archive::options_): New field.
13449 (Archive::dirpath_): New field.
13450 (Archive::task_): New field.
13451 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13452 for thin archives. Pass additional parameters to
13453 Archive::Archive. Unlock the archive file after calling
13454 Archive::setup.
cd536b21 13455
479f6503
ILT
134562008-03-29 Ian Lance Taylor <iant@google.com>
13457
686c8caf
ILT
13458 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13459 version symbol to be local.
13460 * testsuite/ver_test_4.sh: New file.
13461 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13462 (check_DATA): Add ver_test_4.syms.
13463 (ver_test_4.syms): New target.
13464 * testsuite/Makefile.in: Rebuild.
13465
ab794b6b
ILT
13466 * output.cc
13467 (Output_section::Input_section_sort_entry::has_priority): New
13468 function.
13469 (Output_section::Input_section_sort_entry::match_file_name): New
13470 function.
13471 (Output_section::Input_section_sort_entry::match_section_name):
13472 Remove.
13473 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13474 Remove.
13475 (Output_section::Input_section_sort_entry::match_section_file):
13476 Remove.
13477 (Output_section::Input_section_sort_compare::operator()): Rewrite
13478 using new Input_section_sort_entry functions. Sort crtbegin and
13479 crtend first. Sort sections with no priority before sections with
13480 a priority.
13481 * testsuite/initpri1.c (d3): Check j != 4.
13482 (cd5): New constructor/destructor function.
13483 (main): Check j != 2.
13484
479f6503
ILT
13485 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13486 new symbol when resolving, don't call set_is_default.
13487 * testsuite/ver_test_7.cc: New file.
13488 * testsuite/ver_test_7.sh: New file.
13489 * testsuite/Makefile.am (ver_test_7.so): New target.
13490 (ver_test_7.o): New target.
13491 (check_SCRIPTS): Add ver_test_7.sh.
13492 (check_DATA): Add ver_test_7.syms.
13493 (ver_test_7.syms): New target.
13494
2fd32231
ILT
134952008-03-28 Ian Lance Taylor <iant@google.com>
13496
13497 * layout.cc (Layout::layout): If we see an input section with a
13498 name that needs sorting, set the must_sort flag for the output
13499 section.
13500 (Layout::make_output_section): If the name of the output section
13501 indicates that it might require sorting, set the may_sort flag.
13502 * output.h (Output_section::may_sort_attached_input_sections): New
13503 function.
13504 (Output_section::set_may_sort_attached_input_sections): New
13505 function.
13506 (Output_section::must_sort_attached_input_sections): New
13507 function.
13508 (Output_section::set_must_sort_attached_input_sections): New
13509 function.
13510 (class Output_section): Declare Input_section_sort_entry. Define
13511 Input_section_sort_compare. Declare
13512 sort_attached_input_sections. Add new fields:
13513 may_sort_attached_input_sections_,
13514 must_sort_attached_input_sections_,
13515 attached_input_sections_are_sorted_.
13516 * output.cc (Output_section::Output_section): Initialize new
13517 fields.
13518 (Output_section::add_input_section): Add an entry to
13519 input_sections_ if may_sort or must_sort are true.
13520 (Output_section::set_final_data_size): Call
13521 sort_attached_input_sections if necessary.
13522 (Output_section::Input_section_sort_entry): Define new class.
13523 (Output_section::Input_section_sort_compare::operator()): New
13524 function.
13525 (Output_section::sort_attached_input_sections): New function.
13526 * configure.ac: Check whether the compiler supports constructor
13527 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13528 * testsuite/initpri1.c: New file.
13529 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13530 CONSTRUCTOR_PRIORITY.
13531 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13532 (initpri1_LDFLAGS): New variable.
13533 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13534
18e6b24e
ILT
135352008-03-27 Ian Lance Taylor <iant@google.com>
13536
49bdd526
ILT
13537 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13538 * testsuite/common_test_1.c: New file.
13539 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13540 (common_test_1_SOURCES): New variable.
13541 (common_test_1_DEPENDENCIES): New variable.
13542 (common_test_1_LDFLAGS): New variable.
13543
18e6b24e
ILT
13544 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13545 and commons_ correctly when NAME/VERSION does not override
13546 NAME/NULL.
13547 * testsuite/ver_test_6.c: New file.
13548 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13549 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13550 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13551
04bf7072
ILT
135522008-03-26 Ian Lance Taylor <iant@google.com>
13553
5871526f
ILT
13554 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13555 of an undefined symbol from a version script.
13556 * testsuite/Makefile.am (ver_test_5.so): New target.
13557 (ver_test_5.o): New target.
13558 (check_SCRIPTS): Add ver_test_5.sh.
13559 (check_DATA): Add ver_test_5.syms.
13560 (ver_test_5.syms): New target.
13561 * testsuite/ver_test_5.cc: New file.
13562 * testsuite/ver_test_5.script: New file.
13563 * testsuite/ver_test_5.sh: New file.
13564 * Makefile.in, testsuite/Makefile.in: Rebuild.
13565
04bf7072
ILT
13566 PR gold/5986
13567 Fix problems building gold with gcc 4.3.0.
13568 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13569 (gold_error_at_location, gold_warning_at_location): Use it.
13570 * configure.ac: Check whether we can compile and use a template
13571 function with a printf attribute.
13572 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13573 when jumping over bytes.
13574 * object.cc: Instantiate Object::read_section_data.
13575 * debug.h: Include <cstring>
13576 * dwarf_reader.cc: Include <algorithm>
13577 * main.cc: Include <cstring>.
13578 * options.cc: Include <cstring>.
13579 * output.cc: Include <cstring>.
13580 * script.cc: Include <cstring>.
13581 * script.h: Include <string>.
13582 * symtab.cc: Include <cstring> and <algorithm>.
13583 * target-select.cc: Include <cstring>.
13584 * version.cc: Include <string>.
13585 * testsuite/testmain.cc: Include <cstdlib>.
13586 * configure, config.in: Rebuild.
13587
874c5b28
ILT
135882008-03-25 Ian Lance Taylor <iant@google.com>
13589
819d6c3a
ILT
13590 * options.cc: Include "../bfd/bfdver.h".
13591 (options::help): Print bug reporting address.
13592
f4b2c6f5
ILT
13593 * version.cc (print_version): Adjust output for current value of
13594 BFD_VERSION_STRING.
13595
13596 * NEWS: New file.
13597
e96caa79
ILT
13598 * options.cc (options::help): Print list of supported targets.
13599 * target-select.h: Include <vector>.
13600 (class Target_selector): Make machine_, size_, and is_big_endian_
13601 fields const. Add bfd_name_ and instantiated_target_ fields.
13602 (Target_selector::Target_selector): Add bfd_name parameter.
13603 (Target_selector::recognize): Make non-virtual, call
13604 do_recognize.
13605 (Target_selector::recognize_by_name): Make non-virtual, call
13606 do_recognize_by_name.
13607 (Target_selector::supported_names): New function.
13608 (Target_selector::bfd_name): New function.
13609 (Target_selector::do_instantiate_target): New pure virtual
13610 function.
13611 (Target_selector::do_recognize): New virtual function.
13612 (Target_selector::do_recognize_by_name): New virtual function.
13613 (Target_selector::instantiate_target): New private function.
13614 (supported_target_names): Declare.
13615 * target-select.cc (Target_selector::Target_selector): Update for
13616 new parameter and fields.
13617 (select_target_by_name): Check that the name matches before
13618 calling recognize_by_name.
13619 (supported_target_names): New function.
13620 * i386.cc (class Target_selector_i386): Update Target_selector
13621 constructor call. Remove recognize and recognize_by_name. Add
13622 do_instantiate_target.
13623 * x86_64.cc (class Target_selector_x86_64): Likewise.
13624 * testsuite/testfile.cc (class Target_selector_test): Update for
13625 changes to Target_selector.
13626
874c5b28
ILT
13627 * README: Rewrite, with some notes on unsupported features.
13628
0a65a3a7
CC
136292008-03-24 Cary Coutant <ccoutant@google.com>
13630
13631 * i386.cc (Target_i386::Got_type): New enum declaration.
13632 (Target_i386::Scan::local): Updated callers of Output_data_got
13633 member functions.
13634 (Target_i386::Scan::global): Likewise.
13635 (Target_i386::Relocate::relocate): Likewise.
13636 (Target_i386::Relocate::relocate_tls): Likewise.
13637 * object.h (Got_offset_list): New class.
13638 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13639 (Sized_relobj::local_got_offset): Likewise.
13640 (Sized_relobj::set_local_got_offset): Likewise.
13641 (Sized_relobj::local_has_tls_got_offset): Removed.
13642 (Sized_relobj::local_tls_got_offset): Removed.
13643 (Sized_relobj::set_local_tls_got_offset): Removed.
13644 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13645 * output.cc (Output_data_got::add_global): Added got_type parameter.
13646 (Output_data_got::add_global_with_rel): Likewise.
13647 (Output_data_got::add_global_with_rela): Likewise.
13648 (Output_data_got::add_global_pair_with_rel): New function.
13649 (Output_data_got::add_global_pair_with_rela): New function.
13650 (Output_data_got::add_local): Added got_type parameter.
13651 (Output_data_got::add_local_with_rel): Likewise.
13652 (Output_data_got::add_local_with_rela): Likewise.
13653 (Output_data_got::add_local_pair_with_rel): New function.
13654 (Output_data_got::add_local_pair_with_rela): New function.
13655 (Output_data_got::add_global_tls): Removed.
13656 (Output_data_got::add_global_tls_with_rel): Removed.
13657 (Output_data_got::add_global_tls_with_rela): Removed.
13658 (Output_data_got::add_local_tls): Removed.
13659 (Output_data_got::add_local_tls_with_rel): Removed.
13660 (Output_data_got::add_local_tls_with_rela): Removed.
13661 * output.h (Output_data_got::add_global): Added got_type parameter.
13662 (Output_data_got::add_global_with_rel): Likewise.
13663 (Output_data_got::add_global_with_rela): Likewise.
13664 (Output_data_got::add_global_pair_with_rel): New function.
13665 (Output_data_got::add_global_pair_with_rela): New function.
13666 (Output_data_got::add_local): Added got_type parameter.
13667 (Output_data_got::add_local_with_rel): Likewise.
13668 (Output_data_got::add_local_with_rela): Likewise.
13669 (Output_data_got::add_local_pair_with_rel): New function.
13670 (Output_data_got::add_local_pair_with_rela): New function.
13671 (Output_data_got::add_global_tls): Removed.
13672 (Output_data_got::add_global_tls_with_rel): Removed.
13673 (Output_data_got::add_global_tls_with_rela): Removed.
13674 (Output_data_got::add_local_tls): Removed.
13675 (Output_data_got::add_local_tls_with_rel): Removed.
13676 (Output_data_got::add_local_tls_with_rela): Removed.
13677 * resolve.cc (Symbol::override_base_with_special): Removed
13678 reference to has_got_offset_ field.
13679 * symtab.cc (Symbol::init_fields): Replaced initialization
13680 of got_offset_ with got_offsets_. Removed initialization
13681 of has_got_offset_
53fcba31 13682 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13683 (Symbol::got_offset): Likewise.
13684 (Symbol::set_got_offset): Likewise.
13685 (Symbol::has_tls_got_offset): Removed.
13686 (Symbol::tls_got_offset): Removed.
13687 (Symbol::set_tls_got_offset): Removed.
13688 (Symbol::got_offset_): Removed.
13689 (Symbol::tls_mod_got_offset_): Removed.
13690 (Symbol::tls_pair_got_offset_): Removed.
13691 (Symbol::got_offsets_): New field.
13692 (Symbol::has_got_offset): Removed.
13693 (Symbol::has_tls_mod_got_offset): Removed.
13694 (Symbol::has_tls_pair_got_offset): Removed.
13695 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13696 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13697 member functions.
13698 (Target_x86_64::Scan::global): Likewise.
13699 (Target_x86_64::Relocate::relocate): Likewise.
13700 (Target_x86_64::Relocate::relocate_tls): Likewise.
13701
bd52eafb
BE
137022008-03-25 Ben Elliston <bje@au.ibm.com>
13703
13704 * yyscript.y: Fix spelling error in comment.
13705
8b105e34
ILT
137062008-03-24 Ian Lance Taylor <iant@google.com>
13707
8ed814a9
ILT
13708 * options.h (class General_options): Define build_id option.
13709 * layout.h (class Layout): Declare write_build_id, create_note,
13710 create_build_id. Add build_id_note_ member.
13711 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13712 "libiberty.h", "md5.h", "sha1.h".
13713 (Layout::Layout): Initialize eh_frame_data_,
13714 eh_frame_hdr_section_, and build_id_note_.
13715 (Layout::finalize): Call create_build_id.
13716 (Layout::create_note): New function, broken out of
13717 Layout::create_gold_note.
13718 (Layout::create_gold_note): Call create_note.
13719 (Layout::create_build_id): New function.
13720 (Layout::write_build_id): New function.
13721 (Close_task_runner::run): Call write_build_id.
13722
8b105e34
ILT
13723 * x86_64.cc: Correct license to GPLv3.
13724
086a1841
ILT
137252008-03-23 Ian Lance Taylor <iant@google.com>
13726
13727 * options.cc: Include "demangle.h".
13728 (parse_optional_string): New function.
13729 (parse_long_option): Handle takes_optional_argument.
13730 (parse_short_option): Update dash_z initializer. Handle
13731 takes_optional_argument.
13732 (General_options::General_options): Initialize do_demangle_.
13733 (General_options::finalize): Set do_demangle_. Handle demangling
13734 style.
13735 * options.h (parse_optional_string): Declare.
13736 (struct One_option): Add optional_arg field. Update constructor.
13737 Update call constructor calls. Add takes_optional_argument
13738 function.
13739 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13740 (DEFINE_optional_string): Define.
13741 (General_options::demangle): Change from DEFINE_bool to
13742 DEFINE_optional_string.
13743 (General_options::no_demangle): New function.
13744 (General_options::do_demangle): New function.
13745 (General_options::set_do_demangle): New function.
13746 (General_options::execstack_status_): Move definition to end of
13747 class definition.
13748 (General_options::static_): Likewise.
13749 (General_options::do_demangle_): New field.
13750 * object.cc (big_endian>::get_symbol_location_info): Call
13751 Options::do_demangle, not Options::demangle.
13752 * symtab.cc (demangle): Likewise.
13753
cbb93e63
ILT
137542008-03-22 Ian Lance Taylor <iant@google.com>
13755
13756 * gold.h: Include <cstddef> and <sys/types.h>
13757 * options.h: Include <cstring>.
13758
ec531623
ILT
137592008-03-21 Ian Lance Taylor <iant@google.com>
13760
13761 * Added source code to GNU binutils.
This page took 0.826214 seconds and 4 git commands to generate.