* output.h (Output_data_got::add_global_tls, add_local_tls,
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
bd73a62d
AM
12012-09-11 Alan Modra <amodra@gmail.com>
2
3 * output.h (Output_data_got::add_global_tls, add_local_tls,
4 add_local_tls_pair): New functions.
5 (Output_data_got::add_local_pair_with_rel): Remove second
6 reloc param. Expand comment.
7 (Output_data_got::Got_entry): Rename use_plt_offset_ to
8 use_plt_or_tls_offset_, similarly for constructor param.
9 (Output_data_got::Got_entry::write): Add got_index param.
10 * output.cc (Output_data_got::add_global_tls, add_local_tls,
11 add_local_tls_pair): New functions.
12 (Output_data_got::Got_entry::write): Handle tls symbols
13 with use_plt_or_tls_offset_ set specially.
14 (Output_data_got::add_local_pair_with_rel): Only one reloc.
15 (Output_data_got::do_write): Replace iterator with index, pass
16 index to entry write function.
17 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
18 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
19 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
20 call.
21 * i386.cc (Target_i386::Scan::local): Likewise.
22 * sparc.cc (Target_sparc::Scan::local): Likewise.
23 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
24 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
25 do_tls_offset_for_global): New functions.
26 (Target_powerpc::Scan::local): Correct TLS relocations and got
27 entry values.
28 (Target_powerpc::Scan::global): Don't emit unnecessary
29 dynamic relocations on TLS GOT entries.
30
00716ab1
AM
312012-09-10 Matthias Klose <doko@ubuntu.com>
32
33 * config.in: Disable sanity check for kfreebsd.
34
c891b3f9
SA
352012-09-10 Sterling Augustine <saugustine@google.com>
36
37 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
38 (Gdb_index::pubtypes_read): New parameter.
39 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
40 to calls.
41 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
42 pubtypes_object_.
43
e81fea4d
AM
442012-09-09 Alan Modra <amodra@gmail.com>
45
46 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
47 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
48 * gc.h (gc_process_relocs): Call target gc_add_reference.
49 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
50 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
51 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
52 unnecessary cast.
53 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
54 to cater for when we don't need code offset. Update use.
55 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
56 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
57 set_opd_valid): New functions.
58 (Target_powerpc::do_gc_add_reference): New function.
59 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
60 stashed refs.
61 (Target_powerpc::do_gc_mark_symbol): New function.
62
d2d60eef
CC
632012-09-06 Cary Coutant <ccoutant@google.com>
64
65 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
66 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
67 (Dwarf_die::skip_attributes): Likewise.
68 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
69 * testsuite/gdb_index_test.cc (inline_func_1): New function.
70 (main): Call it.
71 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
72
32ed4573
L
732012-09-05 H.J. Lu <hongjiu.lu@intel.com>
74
75 * testsuite/script_test_3.t: Add .got.plt output section
76 statement.
77 * testsuite/script_test_4.t: Likewise.
78
f4baf0d4
AM
792012-09-05 Alan Modra <amodra@gmail.com>
80
81 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
82 update all uses and lose "enum" when using type.
83
864a1b56
AM
842012-09-05 Alan Modra <amodra@gmail.com>
85
86 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
87 * configure: Regenerate.
88 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
89 (plugin_final_layout.stdout): Likewise.
90 (memory_test): Set page sizes to 0x1000.
91 * testsuite/Makefile.in: Regenerate.
92 * testsuite/discard_locals_test.sh: Add FIXME comment.
93 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
94 * testsuite/pr14265.t: Add .got output section statement.
95 * testsuite/script_test_2.t: Likewise.
96 * testsuite/script_test_3.t: Likewise.
97 * testsuite/script_test_4.t: Likewise.
98 * testsuite/script_test_5.t: Likewise.
99 * testsuite/script_test_6.t: Likewise.
100 * testsuite/script_test_7.t: Likewise.
101 * testsuite/script_test_9.t: Likewise.
102
3ea0a085
AM
1032012-09-05 Alan Modra <amodra@gmail.com>
104
105 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
106 (Powerpc_relocate_functions::Status): New typedef.
107 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
108 (Target_powerpc::Scan::local): Handle REL64.
109 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
110 for REL32 and REL64.
111 (Target_powerpc::symval_for_branch): New function, extracted from..
112 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
113 checks. Report overflow errors.
114
7404fe1b
AM
1152012-09-05 Alan Modra <amodra@gmail.com>
116
117 * object.h (Sized_relobj_file::emit_relocs): Delete.
118 (Sized_relobj_file::emit_relocs_reltype): Delete.
119 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
120 relocate_relocs for --emit-relocs.
121 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
122 * output.h: Update comment.
123 (Output_segment::first_section): New function.
124 (Output_segment::first_section_load_address): Use first_section.
125 * output.cc (Output_segment::first_section): New function extracted..
126 (Output_segment::first_section_load_address): ..from here. Delete.
127 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
128 * target.h (Sized_target::relocate_for_relocatable): Likewise.
129 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
130 adjust call to target.h function.
131 * i386.cc (Target_i386): Likewise.
132 * sparc.cc (Target_sparc): Likewise.
133 * x86_64.cc (Target_x86_64): Likewise.
134 * powerpc.cc (Target_powerpc): Likewise.
135 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
136 first tls section has section symbol for optimised local dynamic
137 output relocs.
138 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
139 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
140 optimised tls code.
141 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
142 Rename to relocate_relocs. Update error message.
143
957564c9
AS
1442012-09-04 Andreas Schwab <schwab@linux-m68k.org>
145
146 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
147 --just-symbols.
148
dd93cd0a
AM
1492012-08-31 Alan Modra <amodra@gmail.com>
150
151 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
152 (Powerpc_relobj::toc_base_offset): New stub function.
153 (Target_powerpc): Add tp_offset, dtp_offset. Rename
154 got_mod_index_offset to tlsld_got_offset. Update all refs.
155 (Target_powerpc::Relocate::enum skip_tls): New.
156 (Target_powerpc::call_tls_get_addr_): New var.
157 (Target_powerpc::is_branch_reloc): Move to file scope.
158 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
159 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
160 New functions.
161 (Target_powerpc::enum Got_type): Delete old values, add new ones.
162 (powerpc_info): Correct common_pagesize for ppc64.
163 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
164 (Powerpc_relocate_functions): Add overflow check enums and functions.
165 Add non-shift version of rela, rela_ua. Delete all rel public
166 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
167 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
168 addr16_ha3, addr14 functions.
169 (Output_data_got_powerpc::add_constant_pair): New function.
170 (Output_data_got_powerpc::got_base_offset): Likewise.
171 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
172 (instruction constants): Sort, add some more.
173 (Output_data_glink::do_write): Add and use Address typedef. Use
174 object->toc_base_offset() stub for 64-bit.
175 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
176 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
177 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
178 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
179 Always treat .opd relocs as against locally defined symbol.
180 Correct condition for RELATIVE relocs.
181 (Target_powerpc::do_finalize_sections): Test for NULL sections.
182 (Target_powerpc::Relocate::relocate): Use plt call stub as value
183 for 32-bit syms with a plt entry. Correct ppc64 toc base
184 calculations. Handle TLS relocs, and more. Add overflow
185 checking and adjust for Powerpc_relocate_functions changes.
186 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
187 Reinstate --emit-relocs code with FIXME.
188
a1373b60
AM
1892012-08-30 Alan Modra <amodra@gmail.com>
190
191 * layout.cc (Layout::set_segment_offsets): Set p_align to
192 abi_pagesize, not common_pagesize.
193 (Layout::relaxation_loop_body): Similarly use abi_pagesize
194 to determine whether file header can go in segment.
195
703d02da
AM
1962012-08-30 Alan Modra <amodra@gmail.com>
197
198 * output.h (Output_reloc::Output_reloc <output section>): Add
199 is_relative param. Adjust calls.
200 (Output_reloc::add_output_section_relative): New functions.
201 * output.cc (Output_reloc::Output_reloc <output section>): Handle
202 is_relative.
203 (Output_reloc::symbol_value): Handle SECTION_CODE.
204
16164a6b
ST
2052012-08-24 Sriraman Tallam <tmsriram@google.com>
206
207 * gold.cc (queue_middle_tasks): Call layout again when unique
208 segments for sections is desired.
209 * layout.cc (Layout::Layout): Initialize new members.
210 (Layout::get_output_section_flags): New function.
211 (Layout::choose_output_section): Call get_output_section_flags.
212 (Layout::layout): Make output section for mapping to a unique segment.
213 (Layout::insert_section_segment_map): New function.
214 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 215 output sections marked so.
16164a6b
ST
216 (Layout::segment_precedes): Check for unique segments when sorting.
217 * layout.h (Layout::Unique_segment_info): New struct.
218 (Layout::Section_segment_map): New typedef.
219 (Layout::insert_section_segment_map): New function.
220 (Layout::get_output_section_flags): New function.
221 (Layout::is_unique_segment_for_sections_specified): New function.
222 (Layout::set_unique_segment_for_sections_specified): New function.
223 (Layout::unique_segment_for_sections_specified_): New member.
224 (Layout::section_segment_map_): New member.
225 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
226 Rename is_gc_pass_one to is_pass_one.
227 Rename is_gc_pass_two to is_pass_two.
228 Rename is_gc_or_icf to is_two_pass.
229 Check for which pass based on whether symbols data is present.
230 Make it two pass when unique segments for sections is desired.
231 * output.cc (Output_section::Output_section): Initialize new
232 members.
233 * output.h (Output_section::is_unique_segment): New function.
234 (Output_section::set_is_unique_segment): New function.
235 (Output_section::is_unique_segment_): New member.
236 (Output_section::extra_segment_flags): New function.
237 (Output_section::set_extra_segment_flags): New function.
238 (Output_section::extra_segment_flags_): New member.
239 (Output_section::segment_alignment): New function.
240 (Output_section::set_segment_alignment): New function.
241 (Output_section::segment_alignment_): New member.
242 (Output_segment::Output_segment): Initialize is_unique_segment_.
243 (Output_segment::is_unique_segment): New function.
244 (Output_segment::set_is_unique_segment): New function.
245 (Output_segment::is_unique_segment_): New member.
246 * plugin.cc (allow_unique_segment_for_sections): New function.
247 (unique_segment_for_sections): New function.
248 (Plugin::load): Add new functions to transfer vector.
249 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
250 * Makefile.in: Regenerate.
251 * testsuite/plugin_final_layout.sh: Check if unique segment
252 functionality works.
253 * testsuite/plugin_section_order.c (onload): Check if new interfaces
254 are available.
255 (allow_unique_segment_for_sections): New global.
256 (unique_segment_for_sections): New global.
257 (claim_file_hook): Call allow_unique_segment_for_sections.
258 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 259
1e2bee4f
CC
2602012-08-22 Cary Coutant <ccoutant@google.com>
261
262 * layout.cc (Layout::include_section): Don't assert on GROUP
263 sections with --emit-relocs.
264
1d5dfe78
CC
2652012-08-21 Cary Coutant <ccoutant@google.com>
266
267 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
268 if --export-dynamic-symbol names an undef symbol.
269
c9269dff
AM
2702012-08-18 Alan Modra <amodra@gmail.com>
271
272 * powerpc.cc: Formatting and white space.
273 (Powerpc_relobj): Rename got2_section_ to special_.
274 Add opd_ent_shndx_ and opd_ent_off_ vectors.
275 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
276 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
277 (Target_powerpc): Add Address typedef and invalid_address. Use
278 throughout.
279 (Target_powerpc::is_branch_reloc): New function.
280 (Powerpc_relocate_functions): Add Address typedef, use throughout.
281 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
282 for dst_mask, value and addend.
283 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
284 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
285 (Output_data_glink::do_write): Correct toc base. Don't try to use
286 uint16_t for 24-bit offset. Use get_output_section_offset and
287 check return.
288 (Target_powerpc::Scan::local): Handle more relocs.
289 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
290 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
291 Plug in toc restoring insn after plt calls. Translate branches
292 to function descriptor symbols to corresponding entry point.
293 (Target_powerpc::relocate_for_relocatable): Check return from
294 get_output_section_offset.
295 * symtab.h: Comment typo.
296
b1759dce
ILT
2972012-08-14 Ian Lance Taylor <iant@google.com>
298
299 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
300 unsupported_relocal_local to call unsupported_reloc_global.
301
b9b2ae8b
NC
3022012-08-14 Nick Clifton <nickc@redhat.com>
303
304 PR ld/14265
305 * script-sections.cc (Sections_element::output_section_name): Add
306 keep return parameter.
307 (Output_section_element::match_name): Add keep return parameter.
308 Return the value of the keep_ member.
309 * script-sections.h (class Output_section): Update
310 output_section_name prototype.
311 * layout.cc (Layout::keep_input_section): New public member
312 function.
313 (Layout::choose_output_section): Pass keep parameter to
314 output_section_name.
315 * layout.h (class Layout): Add keep_input_section.
316 * object.cc (Sized_relobj_file::do_layout): Check for kept input
317 sections.
318 * testsuite/Makefile.am: Add a test.
319 * testsuite/Makefile.in: Regenerate.
320 * testsuite/pr14265.c: Source file for the test.
321 * testsuite/pr14265.t: Linker script for the test.
322 * testsuite/pr14265.sh: Shell script for the test.
323
921b5322
AM
3242012-08-14 Alan Modra <amodra@gmail.com>
325
326 * target.h (Target::output_section_name): New function.
327 (Target::do_output_section_name): New function.
328 * layout.cc (Layout::choose_output_section): Call the above.
329 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
330
6ce78956
AM
3312012-08-14 Alan Modra <amodra@gmail.com>
332
333 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
334 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
335 for replace_constant call.
336 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
337 (Output_data_glink::do_print_to_mapfile): New function.
338 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
339 (Target_powerpc::Relocate::relocate): Likewise.
340
d1a8cabd
AM
3412012-08-14 Alan Modra <amodra@gmail.com>
342
343 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
344 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
345 (Output_data_glink::add_entry,find_entry): Remove shndx param.
346 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
347 all references to shndx_. Handle special case for R_PPC_PLTREL24
348 here.
349 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
350 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
351 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
352 here.
353 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
354 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
355
d83ce4e3
AM
3562012-08-12 Alan Modra <amodra@gmail.com>
357
358 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
359 (glink insn constants): Use uint32_t.
360 (Output_data_glink::add_entry): Use insert, not [] operator.
361
cf43a2fe
AM
3622012-08-11 Alan Modra <amodra@gmail.com>
363
364 * object.h (Sized_relobj_file::find_shdr): New function.
365 (Sized_relobj_file::find_special_sections): New function.
366 * object.cc (Sized_relobj_file::find_shdr): New function.
367 (Sized_relobj_file::find_eh_frame): Use find_shdr.
368 (Sized_relobj_file::find_special_sections): New function, split out..
369 (Sized_relobj_file::do_read_symbols): ..from here.
370 * output.h (Output_data_got::replace_constant): New function.
371 (Output_data_got::num_entries): New function.
372 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
373 (Output_data_got::got_offset): Protected rather than private.
374 (Output_data_got::replace_got_entry): New function.
375 * output.cc (Output_data_got::replace_got_entry): New function.
376 * powerpc.cc (class Powerpc_relobj): New.
377 (class Powerpc_relocate_functions): Delete all psymval variants or
378 convert to value,addend type. Delete pcrela, pcrela_unaligned.
379 Implement _ha functions using corresponding _hi function.
380 (Powerpc_relobj::find_special_sections): New function.
381 (Target_powerpc::do_make_elf_object): New function.
382 (class Output_data_got_powerpc): New.
383 (class Output_data_glink): New.
384 (class Powerpc_scan_relocatable_reloc): New.
385 Many more changes througout file.
386
3c892704
NC
3872012-08-09 Nick Clifton <nickc@redhat.com>
388
389 * po/vi.po: Updated Vietnamese translation.
390
82435b3b
ILT
3912012-08-07 Ian Lance Taylor <iant@google.com>
392
393 * layout.cc (Layout::add_target_dynamic_tags): If
394 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
395 plt_rel.
396
a6dc81d2
NC
3972012-07-30 Nick Clifton <nickc@redhat.com>
398
399 * po/gold.pot: Updated template.
400 * po/es.po: Updated Spanish translation.
401
f1415016
CC
4022012-07-18 Cary Coutant <ccoutant@google.com>
403
404 PR gold/14344
405 * configure.ac: Add check for -gpubnames support.
406 * configure: Regenerate.
407 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
408 support; force -gno-pubnames.
409 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
410 support.
411 (gdb_index_test_4): New test.
412 * testsuite/Makefile.in: Regenerate.
413 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
414 * testsuite/gdb_index_test_2.sh: Likewise.
415 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
416 * testsuite/gdb_index_test_4.sh: New script.
417 * testsuite/gdb_index_test_comm.sh: New script with common code;
418 don't look for space after colon.
419
b7fd7c37
ST
4202012-07-16 Sriraman Tallam <tmsriram@google.com>
421
422 * gold.cc (queue_middle_tasks): Update function order only after
423 deferred objects due to plugins are processed.
424
1f3212db
ILT
4252012-07-11 Ian Lance Taylor <iant@google.com>
426
427 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
428 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
429 (Target_arm::scan_reloc_for_stub): Likewise.
430 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
431 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
432 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
433 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
434 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
435
81c82a68
ILT
4362012-07-10 Dodji Seketeli <dodji@redhat.com>
437 Ian Lance Taylor <iant@google.com>
438
439 PR gold/14309
440 * configure.ac: Test whether std::tr1::hash<off_t> works.
441 * gold.h: Add a specialization for std::tr1::hash<off_t> if
442 needed.
443 * output.h (class Output_fill): Add virtual destructor.
444 * configure, config.in: Rebuild.
445
eabc84f4
RM
4462012-06-22 Roland McGrath <mcgrathr@google.com>
447
448 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
449
370e30b6
RÁE
4502012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
451
452 * plugin.cc (Plugin::load): Handle position independent executables.
453
fb1b895d
CC
4542012-06-06 Cary Coutant <ccoutant@google.com>
455
456 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
457 add .debug_macro.
458 (lines_only_debug_sections): Likewise.
459 (gdb_fast_lookup_sections): New static array.
460 (is_gdb_debug_section): Rename formal parameter.
461 (is_lines_only_debug_section): Likewise.
462 (is_gdb_fast_lookup_section): New function.
463 (Layout::include_section): Check for ".zdebug_" prefix; pass
464 section name suffix to is_gdb_debug_section, et al.; check for
465 fast-lookup sections when building .gdb_index.
466 * options.h (--strip-debug-gdb): Update GDB version number.
467
7c0640fa
CC
4682012-06-06 Cary Coutant <ccoutant@google.com>
469
470 * configure.ac: Add check for fallocate.
471 * configure: Regenerate.
472 * config.in: Regenerate.
473
474 * options.h (class General_options): Add --mmap-output-file and
475 --posix-fallocate options.
476 * output.cc: (posix_fallocate): Remove; replace with...
477 (gold_fallocate): New function.
478 (Output_file::map_no_anonymous): Call gold_fallocate.
479 (Output_file::map): Check --mmap-output-file option.
480
2a49eb69
DK
4812012-06-05 Jing Yu <jingyu@google.com>
482
483 * gold.h (textdomain): Add do {} to empty while(0).
484 (bindtextdomain): Likewise.
485
fad072ac
CC
4862012-06-04 Cary Coutant <ccoutant@google.com>
487
488 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
489 has_dynsym_index.
490
8cc69fb6
ST
4912012-05-25 Sriraman Tallam <tmsriram@google.com>
492
493 * symtab.cc (Symbol_table::define_special_symbol):
494 Initialize *poldsym to prevent uninitialized variable errors.
495
1be75daa
CC
4962012-05-23 Cary Coutant <ccoutant@google.com>
497
498 * layout.cc (Layout::section_name_mapping): Add rules to handle
499 exact match on .data.rel.ro.local or .data.rel.ro.
500 (Layout::output_section_name): Check for exact matches.
501
9b689de0
CC
5022012-05-23 Cary Coutant <ccoutant@google.com>
503
504 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
505 more carefully.
506
b24fdbf5
CC
5072012-05-22 Cary Coutant <ccoutant@google.com>
508
509 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
510 object before exporting symbol.
511
e550e1a2
L
5122012-05-21 H.J. Lu <hongjiu.lu@intel.com>
513
514 * testsuite/tls_test.cc: Include "config.h" first.
515 * testsuite/tls_test_c.c: Likewise.
516
df7b86aa
NC
5172012-05-17 Daniel Richard G. <skunk@iskunk.org>
518 Nick Clifton <nickc@redhat.com>
519
520 PR 14072
521 * configure.in: Add check that sysdep.h has been included before
522 any system header files.
523 * configure: Regenerate.
524 * config.in: Regenerate.
525
1007b503
CC
5262012-05-14 Cary Coutant <ccoutant@google.com>
527
528 * layout.cc (Layout::make_output_section): Mark .tdata section
529 as RELRO.
530 * testsuite/relro_test.cc: Add a TLS variable.
531
fd885f3a
L
5322012-05-10 H.J. Lu <hongjiu.lu@intel.com>
533
534 PR gold/14091
535 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
536 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
537 R_X86_64_64.
538
80f5885c
CC
5392012-05-08 Cary Coutant <ccoutant@google.com>
540
541 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
542 (lines_only_debug_sections): Likewise.
543
2e702c99
RM
5442012-05-02 Roland McGrath <mcgrathr@google.com>
545
546 * nacl.cc: New file.
547 * nacl.h: New file.
548 * Makefile.am (CCFILES, HFILES): Add them.
549 * Makefile.in: Regenerate.
550 * i386.cc (Output_data_plt_i386_nacl): New class.
551 (Output_data_plt_i386_nacl_exec): New class.
552 (Output_data_plt_i386_nacl_dyn): New class.
553 (Target_i386_nacl): New class.
554 (Target_selector_i386_nacl): New class.
555 (target_selector_i386): Use it instead of Target_selector_i386.
556 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
557 (Target_x86_64_nacl): New class.
558 (Target_selector_x86_64_nacl): New class.
559 (target_selector_x86_64, target_selector_x32): Use it instead of
560 Target_selector_x86_64.
561 * arm.cc (Output_data_plt_arm_nacl): New class.
562 (Target_arm_nacl): New class.
563 (Target_selector_arm_nacl): New class.
564 (target_selector_arm, target_selector_armbe): Use it instead of
565 Target_selector_arm.
566
567 * target-select.cc (select_target): Take new Input_file* and off_t
568 arguments, pass them on to recognize method of selector.
569 * object.cc (make_elf_sized_object): Update caller.
570 * parameters.cc (parameters_force_valid_target): Likewise.
571 * incremental.cc (make_sized_incremental_binary): Likewise.
572 * target-select.h: Update decl.
573 (Target_selector::recognize): Take new Input_file* argument,
574 pass it on to do_recognize.
575 (Target_selector::do_recognize): Take new Input_file* argument.
576 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
577 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
578 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
579 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
580
581 * target.h (Target::Target_info): New members isolate_execinstr
582 and rosegment_gap.
583 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
584 * arm.cc (Target_arm::arm_info): Update initializer.
585 * i386.cc (Target_i386::i386_info): Likewise.
586 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
587 * sparc.cc (Target_sparc::sparc_info): Likewise.
588 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
589 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
590 * layout.cc (Layout::attach_allocated_section_to_segment):
591 Take new const Target* argument. If target->isolate_execinstr(), act
592 like --rosegment.
593 (Layout::find_first_load_seg): Take new const Target* argument;
594 if target->isolate_execinstr(), reject PF_X segments.
595 (Layout::relaxation_loop_body): Update caller.
596 (Layout::set_segment_offsets): If target->isolate_execinstr(),
597 reset file offset to zero when we hit LOAD_SEG, and then do a second
598 loop over the segments before LOAD_SEG to reassign offsets after
599 addresses have been determined. Handle target->rosegment_gap().
600 (Layout::attach_section_to_segment): Take new const Target* argument;
601 pass it to attach_allocated_section_to_segment.
602 (Layout::make_output_section): Update caller.
603 (Layout::attach_sections_to_segments): Take new const Target* argument;
604 pass it to attach_section_to_segment.
605 * gold.cc (queue_middle_tasks): Update caller.
606 * layout.h (Layout): Update method decls with new arguments.
607
608 * arm.cc (Target_arm::Target_arm): Take optional argument for the
609 Target_info pointer to use.
610 (Target_arm::do_make_data_plt): New virtual method.
611 (Target_arm::make_data_plt): New method that calls it.
612 (Target_arm::make_plt_entry): Use it.
613 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
614 for the section alignment.
615 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
616 method.
617 (Output_data_plt_arm::first_plt_entry_offset): Call it.
618 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
619 method.
620 (Output_data_plt_arm::get_plt_entry_size): Call it.
621 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
622 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
623 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
624 method.
625 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
626 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
627 method instead of sizeof(plt_entry).
628 (Output_data_plt_arm::add_entry): Likewise.
629 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
630 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
631 than static method.
632 (Target_arm::plt_entry_size): Likewise.
633 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
634 Move to ...
635 (Output_data_plt_arm_standard): ... here, new class.
636 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
637 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
638 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
639
640 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
641 Take additional argument for the PLT entry size.
642 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
643 Use get_plt_entry_size method rather than plt_entry_size variable.
644 (Output_data_plt_x86_64::reserve_slot): Likewise.
645 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
646 (Output_data_plt_x86_64::add_entry): Likewise.
647 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
648 (Output_data_plt_x86_64::address_for_global): Likewise.
649 (Output_data_plt_x86_64::address_for_local): Likewise.
650 (Output_data_plt_x86_64::set_final_data_size): Likewise.
651 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
652 Make method non-static.
653 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
654 method.
655 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
656 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
657 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
658 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
659 virtual method.
660 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
661 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
662 virtual method.
663 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
664 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
665 virtual method.
666 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
667 (Output_data_plt_x86_64::plt_entry_size)
668 (Output_data_plt_x86_64::first_plt_entry)
669 (Output_data_plt_x86_64::plt_entry)
670 (Output_data_plt_x86_64::tlsdesc_plt_entry)
671 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
672 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
673 (Output_data_plt_x86_64_standard): ... here, new class.
674 (Target_x86_64::Target_x86_64): Take optional argument for the
675 Target_info pointer to use.
676 (Target_x86_64::do_make_data_plt): New virtual method.
677 (Target_x86_64::make_data_plt): New method to call it.
678 (Target_x86_64::init_got_plt_for_update): Use that.
679 Call this->plt_->add_eh_frame method here.
680 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
681 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
682 rather than static method.
683 (Target_x86_64::plt_entry_size): Likewise.
684 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
685 rather than plt_entry_size variable. Move guts of PLT filling to...
686 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
687 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
688 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
689
690 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
691 additional argument for the section alignment.
692 Don't do add_eh_frame_for_plt here.
693 (Output_data_plt_i386::first_plt_entry_offset): Make the method
694 non-static. Use get_plt_entry_size method rather than plt_entry_size
695 variable.
696 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
697 method.
698 (Output_data_plt_i386::get_plt_entry_size): Call it.
699 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
700 (Output_data_plt_i386::add_eh_frame): New method to call it.
701 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
702 method.
703 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
704 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
705 method.
706 (Output_data_plt_i386::fill_plt_entry): New method to call it.
707 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
708 method instead of plt_entry_size.
709 (Output_data_plt_i386::plt_entry_size)
710 (Output_data_plt_i386::plt_eh_frame_fde_size)
711 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
712 (Output_data_plt_i386_standard): ... here, new class.
713 (Output_data_plt_i386_exec): New class.
714 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
715 (Output_data_plt_i386_exec::first_plt_entry): ... here.
716 (Output_data_plt_i386::exec_plt_entry): Move to ...
717 (Output_data_plt_i386_exec::plt_entry): ... here.
718 (Output_data_plt_i386_dyn): New class.
719 (Output_data_plt_i386::first_plt_entry): Move to ...
720 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
721 (Output_data_plt_i386::dyn_plt_entry): Move to ...
722 (Output_data_plt_i386_dyn::plt_entry): ... here.
723 (Target_i386::Target_i386): Take optional argument for the Target_info
724 pointer to use.
725 (Target_i386::do_make_data_plt): New virtual method.
726 (Target_i386::make_data_plt): New method to call it.
727 (Target_i386::make_plt_section): Use that.
728 Call this->plt_->add_eh_frame method here.
729 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
730 rather than plt_entry_size variable.
731 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
732 (Output_data_plt_i386::address_for_local): Likewise.
733 (Output_data_plt_i386::do_write): Likewise.
734 Move guts of PLT filling to...
735 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
736 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
737 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
738 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
739
b9b9f2ee
CC
7402012-05-01 Cary Coutant <ccoutant@google.com>
741
742 * dwarf_reader.cc (Dwarf_die::read_attributes)
743 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
744 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
745 * reduced_debug_output.cc
746 (Output_reduced_debug_info_section::get_die_end): Remove
747 DW_FORM_GNU_ref_index. Add default case.
748
57923f48
MW
7492012-04-26 Mark Wielaard <mjw@redhat.com>
750
751 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
752 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
753 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
754 DW_AT_high_pc as offset from DW_AT_low_pc.
755
756 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
757 * testsuite/Makefile.in: Regenerate.
758 * testsuite/gdb_index_test_3.c: New test source file.
759 * testsuite/gdb_index_test_3.sh: New test source file.
760
2c54b4f4
ILT
7612012-04-25 Ian Lance Taylor <iant@google.com>
762
763 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
764 pointer.
765 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
766 as a class, not a struct.
767 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
768 (Target_arm::apply_cortex_a8_workaround): Likewise.
769 * gc.h: Declare Reloc_types as a struct, not a class.
770 * object.h: Declare Symbols_data as a struct.
771 * reloc.h: Declare Read_relocs_data as a struct.
772 * target.h: Declare Relocate_info as a struct.
773
a5a5f7a3
DM
7742012-04-24 David S. Miller <davem@davemloft.net>
775
776 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
777 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
778 and R_SPARC_WPLT30.
779
f038d496
CC
7802012-04-24 Cary Coutant <ccoutant@google.com>
781
782 * incremental-dump.cc (find_input_containing_global): Replace
783 magic number with symbolic constant.
784 (dump_incremental_inputs): Update version number.
785 * incremental.cc (Output_section_incremental_inputs): Update version
786 number; import symbolic constants from Incremental_inputs_reader.
787 (Incremental_inputs::create_data_sections): Align relocations
788 section correctly for 64-bit targets.
789 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
790 constants; add padding.
791 (Output_section_incremental_inputs::write_header): Add assert for
792 header_size.
793 (Output_section_incremental_inputs::write_input_files): Add assert
794 for input_entry_size.
795 (Output_section_incremental_inputs::write_info_blocks): Add padding;
796 add assert for object_info_size, input_section_entry_size,
797 global_sym_entry_size.
798 * incremental.h (Incremental_inputs_reader): Add symbolic constants
799 for data structure sizes; use them.
800 (Incremental_input_entry_reader): Import symbolic constants from
801 Incremental_inputs_reader; use them.
802
a4d85145
DM
8032012-04-23 David S. Miller <davem@davemloft.net>
804
805 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
806 and elf_flags_set_.
807 (Target_sparc::Target_sparc): Initialize new fields.
808 (Target_sparc::do_make_elf_object): New function.
809 (Target_sparc::do_adjust_elf_header): New function.
810
1d509098
CC
8112012-04-23 Cary Coutant <ccoutant@google.com>
812
813 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
814 CU range table of gdb index.
815
7ebeff7f
DM
8162012-04-20 David S. Miller <davem@davemloft.net>
817
818 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
819 instead of false.
820
13cf9988
DM
8212012-04-16 David S. Miller <davem@davemloft.net>
822
2a1079e8
DM
823 * sparc.cc (Target_sparc::got_address): New function.
824 (Sparc_relocate_functions::gdop_hix22): New function.
825 (Sparc_relocate_functions::gdop_lox10): New function.
826 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
827 relocs.
828 (Target_sparc::Scan::local): Likewise if the global symbol is not
829 preemptible and is not IFUNC.
830 (Target_sparc::Relocate::relocate): Perform GOTDATA code
831 transformations for local and non-preemptible non-IFUNC global
832 symbols.
833
0bc964fc
DM
834 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
835 writing out 64-bit part of ranges.
836
661d7a80
DM
837 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
838 -fpic and -fpie respectively.
839 * Makefile.in: Regenerate.
840
8c2bf391
DM
841 * sparc.cc (class Target_sparc): Add rela_ifunc_.
842 (Target_sparc::Target_sparc): Initialize new field.
843 (Target_sparc::do_plt_section_for_global): New function.
844 (Target_sparc::do_plt_section_for_local): New function.
845 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
846 (Target_sparc::make_plt_section): New function, broken out of
847 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
848 (Target_sparc::make_plt_entry): Call make_plt_section.
849 (Target_sparc::make_local_ifunc_plt_entry): New function.
850 (Target_sparc::rela_ifunc_section): New function.
851 (Target_sparc::plt_section): Remove const.
852 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
853 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
854 and ifunc_count_ fields.
855 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
856 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
857 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
858 (Output_data_plt_sparc::rela_ifunc): New function.
859 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
860 (Output_data_plt_sparc::has_ifunc_section): New function.
861 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
862 (Output_data_plt_sparc::address_for_global): New function.
863 (Output_data_plt_sparc::address_for_local): New function.
864 (Output_data_plt_sparc::plt_index_to_offset): New function.
865 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
866 and entry_count.
867 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
868 entry_count.
869 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
870 R_SPARC_JMP_IREL to switch.
871 (Target_sparc::Scan::check_non_pic): Likewise.
872 (Target_sparc::Scan::local): Handle IFUNC symbols.
873 (Target_sparc::Scan::local): Likewise.
874 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
875 and plt_address_for_local.
876 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
877 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
878
13cf9988
DM
879 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
880 (class Output_data_reloc): Adjust calls to Output_reloc_type.
881 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
882 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
883 global relocs too.
884 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
885 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
886 calls.
887 * sparc.cc (Target_sparc::Scan::global): Likewise.
888 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
889
31821be0
CC
8902012-04-16 Cary Coutant <ccoutant@google.com>
891
892 * archive.cc (Library_base::should_include_member): Check for
893 --export-dynamic-symbol.
894 * options.h (class General_options): Add --export-dynamic-symbol.
895 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
896 --export-dynamic-symbol.
897 (Symbol_table::gc_mark_undef_symbols): Likewise.
898 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
899
2615994e
DM
9002012-04-12 David S. Miller <davem@davemloft.net>
901
902 * sparc.cc (Reloc::wdisp10): New relocation method.
903 (Reloc::h34): Likewise.
904 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
905 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
906 R_SPARC_WDISP10.
907 (Target_sparc::Scan::local): Likewise.
908 (Target_sparc::Scan::global): Likewise.
909 (Target_sparc::Relocate::relocate): Likewise.
910
6782735d
CC
9112012-04-09 Cary Coutant <ccoutant@google.com>
912
913 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
914 low_pc == 0.
915
8c7a0b00
ILT
9162012-04-06 Ian Lance Taylor <iant@google.com>
917
918 * timer.cc: #include <unistd.h>.
919
58797674
RM
9202012-04-06 Roland McGrath <mcgrathr@google.com>
921
922 * configure.in (AC_CHECK_HEADERS): Add locale.h.
923 * config.in: Regenerate.
924 * configure: Regenerate.
925
44350750
NC
9262012-04-05 Nick Clifton <nickc@redhat.com>
927
928 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
929 (AM_LC_MESSAGES): Add.
930 * aclocal.m4: Regenerate.
931 * config.in: Regenerate.
932 * configure: Regenerate.
933
c1027032
CC
9342012-03-21 Cary Coutant <ccoutant@google.com>
935
936 * Makefile.am: Add gdb-index.cc, gdb-index.h.
937 * Makefile.in: Regenerate.
938 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
939 (Sized_elf_reloc_mapper::symbol_section): New function.
940 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
941 (make_elf_reloc_mapper): New function.
942 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
943 (Dwarf_abbrev_table::do_read_abbrevs): New function.
944 (Dwarf_abbrev_table::do_get_abbrev): New function.
945 (Dwarf_ranges_table::read_ranges_table): New function.
946 (Dwarf_ranges_table::read_range_list): New function.
947 (Dwarf_pubnames_table::read_section): New function.
948 (Dwarf_pubnames_table::read_header): New function.
949 (Dwarf_pubnames_table::next_name): New function.
950 (Dwarf_die::Dwarf_die): New function.
951 (Dwarf_die::read_attributes): New function.
952 (Dwarf_die::skip_attributes): New function.
953 (Dwarf_die::set_name): New function.
954 (Dwarf_die::set_linkage_name): New function.
955 (Dwarf_die::attribute): New function.
956 (Dwarf_die::string_attribute): New function.
957 (Dwarf_die::int_attribute): New function.
958 (Dwarf_die::uint_attribute): New function.
959 (Dwarf_die::ref_attribute): New function.
960 (Dwarf_die::child_offset): New function.
961 (Dwarf_die::sibling_offset): New function.
962 (Dwarf_info_reader::check_buffer): New function.
963 (Dwarf_info_reader::parse): New function.
964 (Dwarf_info_reader::do_parse): New function.
965 (Dwarf_info_reader::do_read_string_table): New function.
966 (Dwarf_info_reader::lookup_reloc): New function.
967 (Dwarf_info_reader::get_string): New function.
968 (Dwarf_info_reader::visit_compilation_unit): New function.
969 (Dwarf_info_reader::visit_type_unit): New function.
970 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
971 Sized_elf_reloc_mapper.
972 (Sized_dwarf_line_info::symbol_section): Remove function.
973 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
974 (Sized_dwarf_line_info::read_line_mappings): Remove object
975 parameter, adjust callers.
976 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
977 * dwarf_reader.h: Include <sys/types.h>.
978 (class Track_relocs): Remove forward declaration.
979 (class Elf_reloc_mapper): New class.
980 (class Sized_elf_reloc_mapper): New class.
981 (class Dwarf_abbrev_table): New class.
982 (class Dwarf_range_list): New class.
983 (class Dwarf_ranges_table): New class.
984 (class Dwarf_pubnames_table): New class.
985 (class Dwarf_die): New class.
986 (class Dwarf_info_reader): New class.
987 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
988 (Sized_dwarf_line_info::symbol_section): Remove member function.
989 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
990 base class.
991 * gdb-index.cc: New source file.
992 * gdb-index.h: New source file.
993 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
994 and .debug_types sections, call Layout::add_to_gdb_index.
995 (Sized_relobj_incr::do_section_name): Implement.
996 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
997 return type; Implement.
998 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
999 return type.
1000 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1001 parameter list and return type.
1002 (Sized_incr_dynobj::do_section_contents): Likewise.
1003 * layout.cc: Include gdb-index.h.
1004 (Layout::Layout): Initialize gdb_index_data_.
1005 (Layout::init_fixed_output_section): Check for .gdb_index section.
1006 (Layout::add_to_gdb_index): New function. Instantiate.
1007 * layout.h: Add forward declaration for class Gdb_index.
1008 (Layout::add_to_gdb_index): New member function.
1009 (Layout::gdb_index_data_): New data member.
1010 * main.cc: Include gdb-index.h.
1011 (main): Print statistics for gdb index.
1012 * object.cc (Object::section_contents): Move code into
1013 do_section_contents.
1014 (need_decompressed_section): Check for sections needed when building
1015 gdb index.
1016 (build_compressed_section_map): Likewise.
1017 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1018 gdb index.
1019 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1020 sections; call Layout::add_to_gdb_index.
1021 (Sized_relobj_file::do_decompressed_section_contents): Call
1022 do_section_contents directly.
1023 * object.h (Object::do_section_contents): Adjust parameter list and
1024 return type.
1025 (Object::do_decompressed_section_contents): Call do_section_contents
1026 directly.
1027 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1028 return type.
1029 * options.h (class General_options): Add --gdb-index option.
1030 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1031 list and return type.
1032 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1033 * reloc.h (Track_relocs::checkpoint): New function.
1034 (Track_relocs::reset): New function.
1035
1036 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1037 New test cases.
1038 * testsuite/Makefile.in: Regenerate.
1039 * testsuite/gdb_index_test.cc: New test source file.
1040 * testsuite/gdb_index_test_1.sh: New test source file.
1041 * testsuite/gdb_index_test_2.sh: New test source file.
1042
647f1574
DK
10432012-03-19 Doug Kwan <dougkwan@google.com>
1044
1045 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1046 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1047 __exidx_start and __exidx_end. Make symbol table parameter
1048 anonymous as it is not used.
1049 * gold.cc (queue_middle_tasks): Call target hook to define any
1050 target-specific symbols.
1051 * target.h (Target::define_standard_symbols): New method.
1052 (Target::do_define_standard_symbols): Same.
1053 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1054 * testsuite/Makefile.in: Regenerate.
1055 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1056 and __exidx_end.
1057 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1058 relocations are generated for __exidx_start and __exidx_end.
1059
7c6109da
DK
10602012-03-16 Doug Kwan <dougkwan@google.com>
1061
1062 * testsuite/Makefile.am: Disable test initpri3b.
1063 * testsuite/Makefile.in: Regenerate.
1064
7b8957f8
DK
10652012-03-15 Doug Kwan <dougkwan@google.com>
1066
1067 * arm.cc (Target_arm::got_section): Make .got section read-only
1068 if -z now is given.
1069
14dc9ef7
ILT
10702012-03-15 Ian Lance Taylor <iant@google.com>
1071
1072 PR gold/13850
1073 * layout.cc (Layout::make_output_section): Correctly mark
1074 SHT_INIT_ARRAY, et. al., as relro.
1075
fa40b62a
DK
10762012-03-14 Doug Kwan <dougkwan@google.com>
1077
1078 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1079 dynamic relocations for protected symbols in shared objects.
1080
fd325007
ILT
10812012-03-13 Ian Lance Taylor <iant@google.com>
1082
1083 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1084 keep the larger alignment.
1085
e8dd54e1
CC
10862012-03-12 Cary Coutant <ccoutant@google.com>
1087
1088 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1089 handling of DW_LNE_define_file.
1090
feb5f3b0
CC
10912012-03-12 Cary Coutant <ccoutant@google.com>
1092
1093 * reduced_debug_output.cc
1094 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1095 codes to switch.
1096
a1fb4256
CC
10972012-02-29 Cary Coutant <ccoutant@google.com>
1098
1099 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1100
5dd8762a
CC
11012012-02-29 Cary Coutant <ccoutant@google.com>
1102
1103 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1104 Call Object::decompressed_section_contents.
1105 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1106 New dtor.
1107 (Sized_dwarf_line_info::buffer_start_): New data member.
1108 * merge.cc (Output_merge_data::do_add_input_section): Call
1109 Object::decompressed_section_contents.
1110 (Output_merge_string::do_add_input_section): Likewise.
1111 * object.cc (need_decompressed_section): New function.
1112 (build_compressed_section_map): Decompress sections needed later.
1113 (Sized_relobj_file::do_decompressed_section_contents): New function.
1114 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1115 * object.h (Object::decompressed_section_contents): New function.
1116 (Object::discard_decompressed_sections): New function.
1117 (Object::do_decompressed_section_contents): New function.
1118 (Object::do_discard_decompressed_sections): New function.
1119 (Compressed_section_info): New type.
1120 (Compressed_section_map): Include decompressed section contents.
1121 (Sized_relobj_file::do_decompressed_section_contents): New function.
1122 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1123
7b5de7ee
CC
11242012-02-16 Cary Coutant <ccoutant@google.com>
1125
1126 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1127 * testsuite/Makefile.in: Regenerate.
1128
f9fa4a63
CC
11292012-02-14 Cary Coutant <ccoutant@google.com>
1130
1131 * options.cc (General_options::finalize): Disallow -pie and -static.
1132
2c175ebc
DK
11332012-02-03 Doug Kwan <dougkwan@google.com>
1134
1135 * arm.cc (Arm_relocate_functions::abs8,
1136 Arm_relocate_functions::abs16): Use
1137 Bits::has_signed_unsigned_overflow32.
1138 (Arm_relocate_functions::thm_abs8): Correct range of
1139 overflow check.
1140 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1141 in assertions.
1142
90cff06f
DK
11432012-02-02 Doug Kwan <dougkwan@google.com>
1144
1145 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1146 position independent outputs, not just shared objects.
1147
63887f3d
L
11482012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1149
1150 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1151 * configure: Regenerated.
1152
bef2b434
ILT
11532012-01-27 Ian Lance Taylor <iant@google.com>
1154
1155 * reloc.h (Bits): New class with static functions, copied from
1156 namespace utils in arm.cc.
1157 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1158 instead.
1159
c335b55d
L
11602012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1161
1162 * incremental.cc (write_info_blocks): Correct relocation offset.
1163
41194d9f
L
11642012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1165
1166 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1167 (Relocate::tls_gd_to_le): Likewise.
1168
1bae613c
L
11692012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1170
1171 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1172
24482ca0
L
11732012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1174
1175 * configure.ac: Check if -mcmodel=medium works.
1176 * configure: Regenerated.
1177
c2c7840a
CC
11782012-01-24 Cary Coutant <ccoutant@google.com>
1179
1180 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1181 definition and ...
1182 (read_unsigned_LEB_128_x): ... this new function.
1183 (read_signed_LEB_128): Replaced with inline definition and ...
1184 (read_signed_LEB_128_x): ... this new function.
1185 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1186 (read_unsigned_LEB_128): Add inline definition.
1187 (read_signed_LEB_128_x): New function.
1188 (read_signed_LEB_128): Add inline definition.
1189 * testsuite/Makefile.am (leb128_unittest): New unit test.
1190 * testsuite/Makefile.in: Regenerate.
1191 * testsuite/leb128_unittest.cc: New unit test.
1192
833de760 11932012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1194
1195 PR gold/13617
1196 * i386.cc (Target_i386::do_code_fill): When using a jmp
1197 instruction, pad with nop instructions.
1198 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1199
618d6666
L
12002012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1201
1202 * x86_64.cc (gc_process_relocs): Add typename on types used in
1203 template.
1204 (scan_relocs): Likewise.
1205 (relocate_section): Likewise.
1206 (apply_relocation): Likewise.
1207
3660ff06
L
12082012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1209
1210 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1211 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1212 under x32.
1213
fc51264f
L
12142012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1215
1216 * x86_64.cc: Initial support for x32.
1217
dd74ae06
CC
12182012-01-03 Cary Coutant <ccoutant@google.com>
1219
1220 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1221 Use abstract base class for GOT.
1222 * gold/output.h (class Output_data_got_base): New abstract base class.
1223 (class Output_data_got): Derive from new base class, adjust ctors.
1224 (Output_data_got::reserve_slot): Make virtual; rename to
1225 do_reserve_slot; Adjust callers.
1226 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1227 pointer to abstract base class.
1228 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1229
83896202
ILT
12302011-12-18 Ian Lance Taylor <iant@google.com>
1231
1232 * object.h (Relobj::local_symbol_value): New function.
1233 (Relobj::local_plt_offset): New function.
1234 (Relobj::local_has_got_offset): New function.
1235 (Relobj::local_got_offset): New function.
1236 (Relobj::set_local_got_offset): New function.
1237 (Relobj::do_local_symbol_value): New pure virtual function.
1238 (Relobj::do_local_plt_offset): Likewise.
1239 (Relobj::do_local_has_got_offset): Likewise.
1240 (Relobj::do_local_got_offset): Likewise.
1241 (Relobj::do_set_local_got_offset): Likewise.
1242 (Sized_relobj::do_local_has_got_offset): Rename from
1243 local_has_got_offset.
1244 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1245 (Sized_relobj::do_set_local_got_offset): Rename from
1246 set_local_got_offset.
1247 (Sized_relobj_file::do_local_plt_offset): Rename from
1248 local_plt_offset.
1249 (Sized_relobj_file::do_local_symbol_value): New function.
1250 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1251 local_plt_offset.
1252 * output.cc (Output_data_got::Got_entry::write): Change object to
1253 Relobj. Use local_symbol_value.
1254 (Output_data_got::add_global_with_rel): Change rel_dyn to
1255 Output_data_reloc_generic*. Use add_global_generic.
1256 (Output_data_got::add_global_with_rela): Remove. Change all
1257 callers to use add_global_with_rel.
1258 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1259 Output_data_reloc_generic*. Use add_global_generic.
1260 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1261 callers to use add_global_pair_with_rel.
1262 (Output_data_got::add_local): Change object to Relobj*.
1263 (Output_data_got::add_local_plt): Likewise.
1264 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1265 change rel_dyn to Output_data_reloc_generic*. Use
1266 add_local_generic.
1267 (Output_data_got::add_local_with_rela): Remove. Change all
1268 callers to use all_local_with_rel.
1269 (Output_data_got::add_local_pair_with_rel): Change object to
1270 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1271 add_output_section_generic.
1272 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1273 callers to use add_local_pair_with_rel.
1274 (Output_data_got::reserve_local): Change object to Relobj*.
1275 * output.h: (class Output_data_reloc_generic): Add pure virtual
1276 declarations for add_global_generic, add_local_generic,
1277 add_output_section_generic.
1278 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1279 functions for Output_data_reloc_generic. Update declarations for
1280 changes listed in output.cc.
1281 (class Output_data_got): Change template parameter to got_size.
1282 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1283 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1284 function.
1285 (Sized_relobj_incr::do_local_plt_offset): New function.
1286 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1287 add_global_generic.
1288
76677ad0
CC
12892011-12-17 Cary Coutant <ccoutant@google.com>
1290
1291 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1292 * resolve.cc (Symbol_table::resolve): Likewise.
1293 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1294 arrays.
1295 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1296
8b8dd8d5
ILT
12972011-12-16 Ian Lance Taylor <iant@google.com>
1298
1299 * output.h (Output_data_reloc_generic::add): Only call
1300 add_dynamic_reloc if this is a dynamic reloc section.
1301
d55525b9
L
13022011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1303
1304 PR gold/13505
1305 * target-reloc.h (apply_relocation): Replace <64, false> with
1306 <size, big_endian>.
1307
ff81c7c1
NC
13082011-11-25 Nick Clifton <nickc@redhat.com>
1309
1310 * po/it.po: New Italian translation.
1311
628f39be
SA
13122011-11-17 Sterling Augustine <saugustine@google.com>
1313
1314 * script.cc (script_include_directive): Implement.
1315 (read_script_file): New local variables name and search_path. Update
1316 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1317 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1318 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1319
98ef3ea4
SA
13202011-11-11 Sterling Augustine <saugustine@google.com>
1321
1322 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1323 (file_or_sections_cmd): Likewise.
1324
f4a8b6d7
DK
13252011-11-11 Doug Kwan <dougkwan@google.com>
1326
1327 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1328 if --just-symbols is given.
1329
29ab395d
DK
13302011-11-10 Doug Kwan <dougkwan@google.com>
1331
1332 PR gold/13362
1333 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1334 when processing data relocs.
1335 * reloc.h (Relocate_functions::rel_unaligned): New method.
1336 (Relocate_functions::pcrel_unaligned): Ditto.
1337 (Relocate_functions::rel32_unaligned): Ditto.
1338 (Relocate_functions::pcrel32_unaligned): Ditto.
1339
2c339f71
DK
13402011-11-09 Doug Kwan <dougkwan@google.com>
1341
1342 PR gold/13362
1343 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1344 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1345 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1346 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1347 (Relocate_functions::rel_unaligned): New.
1348 (Relocate_functions::rel32_unaligned): New.
1349 * target-reloc.h (relocate_for_relocatable): Add code to handle
1350 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1351 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1352 arm_unaligned_reloc_r): New targets.
1353 * testsuite/Makefile.in: Regenerate.
1354 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1355 linking.
1356
3f3cddf1
ILT
13572011-11-02 Ian Lance Taylor <iant@google.com>
1358
1359 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1360 NATIVE_LINKER.
1361 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1362 * options.cc (General_options::finalize): Use library search path
1363 from configure script if specified. If not native and no sysroot,
1364 only search TOOLLIBDIR.
1365 * options.h (Search_directory::Search_directory): Change name to
1366 const std::string&.
1367 (General_options::add_to_library_path_with_sysroot): Change arg to
1368 const std::string&.
1369 * configure, Makefile.in, config.in: Rebuild.
1370
a8e2273b
ILT
13712011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1372
1373 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1374 we are working around the ARM1176 Erratum.
1375 * options.h (General_options::fix_arm1176): Add option.
1376 * testsuite/Makefile.am: Add testcases, and keep current ones
1377 working.
1378 * testsuite/Makefile.in: Regenerate.
1379 * testsuite/arm_fix_1176.s: New file.
1380 * testsuite/arm_fix_1176.sh: Likewise.
1381
cd6eab1c
ILT
13822011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1383
1384 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1385 may_use_blx_.
1386 (Target_arm::may_use_blx): Remove method.
1387 (Target_arm::set_may_use_blx): Likewise.
1388 (Target_arm::may_use_v4t_interworking): New method.
1389 (Target_arm::may_use_v5t_interworking): Likewise.
1390 (Target_arm::may_use_blx_): Remove member variable.
1391 (Arm_relocate_functions::arm_branch_common): Check for v5T
1392 interworking.
1393 (Arm_relocate_functions::thumb_branch_common): Likewise.
1394 (Reloc_stub::stub_type_for_reloc): Likewise.
1395 (Target_arm::do_finalize_sections): Correct interworking checks.
1396 * testsuite/Makefile.am: Add new tests.
1397 * testsuite/Makefile.in: Regenerate.
1398 * testsuite/arm_farcall_arm_arm.s: New test.
1399 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1400 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1401 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1402 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1403 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1404 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1405 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1406
286adcf4
CC
14072011-10-31 Cary Coutant <ccoutant@google.com>
1408
1409 PR gold/13023
1410 * expression.cc (Expression::eval_with_dot): Add
1411 is_section_dot_assignment parameter.
1412 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1413 absolute and assigning to dot within a section.
1414 * script-sections.cc
1415 (Output_section_element_assignment::set_section_addresses): Pass
1416 dot_section to set_if_absolute.
1417 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1418 as is_section_dot_assignment flag to eval_with_dot.
1419 (Output_section_element_dot_assignment::set_section_addresses):
1420 Likewise.
1421 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1422 parameter. Also set value if relative to dot_section; set the
1423 symbol's output_section.
1424 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1425 parameter. Adjust all callers.
1426 (Expression::eval_maybe_dot): Likewise.
1427 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1428 Adjust all callers.
1429 * testsuite/script_test_2.t: Test assignment of an absolute value
1430 to dot within an output section element.
1431
9634ed06
CC
14322011-10-31 Cary Coutant <ccoutant@google.com>
1433
1434 * options.h (class General_options): Add --[no-]gnu-unique options.
1435 * symtab.cc (Symbol_table::sized_write_globals): Convert
1436 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1437
de4101c7
CC
14382011-10-31 Cary Coutant <ccoutant@google.com>
1439
1440 PR gold/13359
1441 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1442 unnecessary assertion.
1443 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1444
7257cc92
ST
14452011-10-31 Sriraman Tallam <tmsriram@google.com>
1446
1447 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1448 gc_mark_symbol.
1449 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1450 gc_mark_symbol.
1451 Change to just keep the section associated with symbol.
1452 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1453 they are externally visible and --export-dynamic is turned on.
1454 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1455
bfc34b3f
ILT
14562011-10-19 Ian Lance Taylor <iant@google.com>
1457
1458 PR gold/13163
1459 * script-sections.cc
1460 (Output_section_element_dot_assignment::needs_output_section): New
1461 function.
1462
ea0d8c47
ILT
14632011-10-19 Ian Lance Taylor <iant@google.com>
1464
1465 PR gold/13204
1466 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1467 --section-start option was seen.
1468 * options.h (General_options::any_section_start): New function.
1469
abd242a9
DM
14702011-10-18 David S. Miller <davem@davemloft.net>
1471
1472 PR binutils/13301
1473 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1474 member to track relocation locations that have moved during TLS
1475 reloc optimizations.
1476 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1477 (Target_sparc::Relocate::relocate): Adjust view down by 4
1478 bytes if it matches reloc_adjust_addr_.
1479 (Target_sparc::Relocate::relocate_tls): Always move the
1480 __tls_get_addr call delay slot instruction forward 4 bytes when
1481 performing relaxation.
1482
bab9090f
CC
14832011-10-18 Cary Coutant <ccoutant@google.com>
1484
1485 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1486 (Output_file::map_no_anonymous): Check for non-zero
1487 return code from posix_fallocate.
1488
f7c5b166
CC
14892011-10-17 Cary Coutant <ccoutant@google.com>
1490
1491 PR gold/13245
1492 * plugin.cc (is_visible_from_outside): Check for symbols
1493 referenced from dynamic objects.
1494 * resolve.cc (Symbol_table::resolve): Don't count references
1495 from dynamic objects as references from real ELF files.
1496 * testsuite/plugin_test_2.sh: Adjust expected result.
1497
b490c0bb
CC
14982011-10-17 Cary Coutant <ccoutant@google.com>
1499
1500 * gold.cc: Include timer.h.
1501 (queue_middle_tasks): Stamp time.
1502 (queue_final_tasks): Likewise.
1503 * main.cc (main): Store timer in parameters. Print timers
1504 for each pass.
1505 * parameters.cc (Parameters::Parameters): Initialize timer_.
1506 (Parameters::set_timer): New function.
1507 (set_parameters_timer): New function.
1508 * parameters.h (Parameters::set_timer): New function.
1509 (Parameters::timer): New function.
1510 (Parameters::timer_): New data member.
1511 (set_parameters_timer): New function.
1512 * timer.cc (Timer::stamp): New function.
1513 (Timer::get_pass_time): New function.
1514 * timer.h (Timer::stamp): New function.
1515 (Timer::get_pass_time): New function.
1516 (Timer::pass_times_): New data member.
1517
f475cf7b
CC
15182011-10-17 Cary Coutant <ccoutant@google.com>
1519
1520 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1521 task for members of lib groups.
1522
cdd7e244
CC
15232011-10-17 Cary Coutant <ccoutant@google.com>
1524
1525 PR gold/13288
4f95c8b4 1526 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1527 (File_read::make_view): Move bounds check (replace with assert)...
1528 (File_read::find_or_make_view): ... to here.
1529
dfb45471
CC
15302011-10-12 Cary Coutant <ccoutant@google.com>
1531
4f95c8b4 1532 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1533 ::read returns less than requested size.
1534
53bbcc1b
CC
15352011-10-10 Cary Coutant <ccoutant@google.com>
1536
4f95c8b4 1537 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1538 Initialize defined_count_.
1539 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1540 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1541 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1542 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1543 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1544 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1545 member.
1546 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1547 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1548 Return zeroes instead of internal error.
1549
397b129b
CC
15502011-10-10 Cary Coutant <ccoutant@google.com>
1551
1552 PR gold/13249
4f95c8b4 1553 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1554 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1555 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1556 (Output_reloc::type_): Adjust size of bit field.
1557 (Output_reloc::use_plt_offset_): New bit field.
1558 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1559 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1560 flag. Adjust all callers.
4f95c8b4 1561 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1562 creating RELATIVE relocations.
1563
d5698657
NC
15642011-10-10 Nick Clifton <nickc@redhat.com>
1565
1566 * po/es.po: Updated Spanish translation.
1567 * po/fi.po: Updated Finnish translation.
1568
6a59a5c2
DN
15692011-10-03 Diego Novillo <dnovillo@google.com>
1570
1571 * options.cc (parse_uint): Fix dereference of RETVAL.
1572
f0558624
ST
15732011-09-29 Sriraman Tallam <tmsriram@google.com>
1574
1575 * layout.h (section_order_map_): New member.
1576 (get_section_order_map): New member function.
1577 * output.cc (Output_section::add_input_section): Check for patterns
1578 only when --section-ordering-file is specified.
1579 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1580 output_sections have been formed.
1581 * layout.cc (Layout_Layout): Initialize section_order_map_.
1582 * plugin.cc (update_section_order): Store order in order_map. Do not
1583 update the order.
1584 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1585 * testsuite/Makefile.in: Regenerate.
1586 * testsuite/plugin_section_order.c: New file.
1587 * testsuite/plugin_final_layout.cc: New file.
1588 * testsuite/plugin_final_layout.sh: New file.
1589
a7dac153
CC
15902011-09-29 Cary Coutant <ccoutant@google.com>
1591
4f95c8b4 1592 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1593 Check for NULL.
4f95c8b4 1594 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1595 symbols during incremental update.
1596 (Symbol_table::add_from_dynobj): Likewise.
1597
eebd87a5
ILT
15982011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1599 Ian Lance Taylor <iant@google.com>
1600
1601 * symtab.cc (Symbol_table::define_special_symbol): Always
1602 canonicalize version string.
1603
403a3331
CC
16042011-09-26 Cary Coutant <ccoutant@google.com>
1605
4f95c8b4
CC
1606 * gold.cc (queue_initial_tasks): Move option checks ...
1607 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1608 some options; make others fatal.
1609
235061c2
CC
16102011-09-26 Cary Coutant <ccoutant@google.com>
1611
1612 gcc PR lto/47247
1613 * plugin.cc (get_symbols_v2): New function.
1614 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1615 (is_referenced_from_outside): New function.
1616 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1617 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1618 (get_symbols): Pass version parameter.
1619 (get_symbols_v2): New function.
1620 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1621 parameter.
1622 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1623 (onload): Add LDPT_GET_SYMBOLS_V2.
1624 (all_symbols_read_hook): Use get_symbols_v2; check for
1625 LDPR_PREVAILING_DEF_IRONLY_EXP.
1626 * testsuite/plugin_test_3.sh: Update expected results.
1627
dc87f620
ILT
16282011-09-23 Simon Baldwin <simonb@google.com>
1629
1630 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1631 configuration options.
1632 * configure: Regenerate.
1633 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1634 * Makefile.in: Regenerate.
1635 * testsuite/Makefile.in: Regenerate.
1636
a8279f82
ST
16372011-09-19 Sriraman Tallam <tmsriram@google.com>
1638
1639 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1640
0c9350c8
CC
16412011-09-19 Cary Coutant <ccoutant@google.com>
1642
1643 * incremental.cc (can_incremental_update): Fix typo in comment.
1644 * incremental.h (can_incremental_update): Likewise.
1645
aa06ae28
CC
16462011-09-18 Cary Coutant <ccoutant@google.com>
1647
1648 * incremental.cc (can_incremental_update): New function.
1649 * incremental.h (can_incremental_update): New function.
1650 * layout.cc (Layout::init_fixed_output_section): Call it.
1651 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1652 * object.cc (Sized_relobj_file::do_layout): Call
1653 can_incremental_update.
1654
ebb300b2
CC
16552011-09-13 Cary Coutant <ccoutant@google.com>
1656
1657 * configure.ac: Check for glibc support for gnu_indirect_function
1658 support with static linking, setting automake conditional
1659 IFUNC_STATIC.
1660 * Makefile.in: Regenerate.
1661 * configure: Regenerate.
1662
1663 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1664 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1665 for IFUNC_STATIC.
1666 * testsuite/Makefile.in: Regenerate.
1667
1206d0d5
CC
16682011-09-13 Cary Coutant <ccoutant@google.com>
1669
1670 * incremental.cc (Sized_relobj_incr::do_layout): Call
1671 report_comdat_group for kept comdat sections.
1672 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1673 * testsuite/Makefile.in: Regenerate.
1674 * testsuite/incr_comdat_test_1.cc: New source file.
1675 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1676 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1677 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1678
40b29874
ILT
16792011-09-13 Ian Lance Taylor <iant@google.com>
1680
1681 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1682 variable external_symbols_offset.
1683
1b045aac
ILT
16842011-09-12 Ian Lance Taylor <iant@google.com>
1685
1686 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1687 triggered if object has no symbols.
1688
24c6c55a
DM
16892011-09-09 David S. Miller <davem@davemloft.net>
1690
1691 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1692 (Output_fill_debug_line::do_write): Likewise.
1693
66570254
CC
16942011-08-29 Cary Coutant <ccoutant@google.com>
1695
1696 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1697 casts to match formatting specs.
1698 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1699
8ea8cd50
CC
17002011-08-26 Cary Coutant <ccoutant@google.com>
1701
1702 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1703 remaining hole size when allocating.
1704 (Layout::make_output_section): Set fill methods for debug sections.
1705 * layout.h (Free_list::Free_list_node): Move from private to
1706 public.
1707 (Free_list::set_min_hole_size): New function.
1708 (Free_list::begin, Free_list::end): New functions.
1709 (Free_list::min_hole_): New data member.
1710 * output.cc: Include dwarf.h.
1711 (Output_fill_debug_info::do_minimum_hole_size): New function.
1712 (Output_fill_debug_info::do_write): New function.
1713 (Output_fill_debug_line::do_minimum_hole_size): New function.
1714 (Output_fill_debug_line::do_write): New function.
1715 (Output_section::Output_section): Initialize new data member.
1716 (Output_section::set_final_data_size): Ensure patch space is larger
1717 than minimum hole size.
1718 (Output_section::do_write): Fill holes in debug sections.
1719 * output.h (Output_fill): New class.
1720 (Output_fill_debug_info): New class.
1721 (Output_fill_debug_line): New class.
1722 (Output_section::set_free_space_fill): New function.
1723 (Output_section::free_space_fill_): New data member.
1724 * testsuite/Makefile.am (incremental_test_3): Add
1725 --incremental-patch option.
1726 (incremental_test_4): Likewise.
1727 (incremental_test_5): Likewise.
1728 (incremental_test_6): Likewise.
1729 (incremental_copy_test): Likewise.
1730 (incremental_common_test_1): Likewise.
1731 * testsuite/Makefile.in: Regenerate.
1732
7cf80422
NC
17332011-08-26 Nick Clifton <nickc@redhat.com>
1734
1735 * po/es.po: Updated Spanish translation.
1736
c3f7b0e5
CC
17372011-08-01 Cary Coutant <ccoutant@google.com>
1738
1739 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1740 * gold/testsuite/Makefile.in: Regenerate.
1741 * gold/testsuite/justsyms_exec.c: New source file.
1742 * gold/testsuite/justsyms_lib.c: New source file.
1743
9590bf25
CC
17442011-08-01 Cary Coutant <ccoutant@google.com>
1745
1746 * layout.cc (Layout::set_segment_offsets): Don't realign text
1747 segment if -Ttext was specified.
1748 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1749 file type.
1750 * object.h (Sized_relobj_file::e_type): New function.
1751 (Sized_relobj_file::e_type_): New data member.
1752 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1753 base address for ET_EXEC files.
1754 * target.cc (Target::do_make_elf_object_implementation): Allow
1755 ET_EXEC files with --just-symbols option.
1756
dcd8d12e
CC
17572011-07-28 Cary Coutant <ccoutant@google.com>
1758
1759 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1760 Add thread_number parameter.
1761 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1762 * workqueue-threads.cc
1763 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1764 current thread if its thread number is greater than desired thread
1765 count.
1766 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1767 Add thread_number parameter.
1768 (Workqueue::should_cancel_thread): Likewise.
1769 (Workqueue::find_runnable_or_wait): Pass thread_number to
1770 should_cancel_thread.
1771 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1772 parameter.
1773
804eb480
ST
17742011-07-22 Sriraman Tallam <tmsriram@google.com>
1775
1776 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1777 only after checking if it cannot be forced local.
1778 * symtab.h (is_externally_visible): Check if the symbol is not forced
1779 local.
1780
f1ddb600
ILT
17812011-07-15 Ian Lance Taylor <iant@google.com>
1782
1783 * options.h (class General_options): Add --print-output-format.
1784 Move -EL next to -EB, for better --help output.
1785 * target-select.cc: Include <cstdio>, "options.h", and
1786 "parameters.h".
1787 (Target_selector::do_target_bfd_name): New function.
1788 (print_output_format): New function.
1789 * target-select.h (class Target_selector): Update declarations.
1790 (Target_selector::target_bfd_name): New function.
1791 (print_output_format): Declare.
1792 * main.cc: Include "target-select.h".
1793 (main): Handle --print-output-format.
1794 * gold.cc: Include "target-select.h".
1795 (queue_initial_tasks): Handle --print-output-format when there are
1796 no input files.
1797 * parameters.cc (parameters_force_valid_target): Give a better
1798 error message if -EB/-EL does not match target.
1799 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1800 function.
1801
7d172687
ILT
18022011-07-15 Ian Lance Taylor <iant@google.com>
1803
1804 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1805 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1806 (Output_data_plt_i386::do_write): Write address of .dynamic
1807 section to first entry in .got.plt section.
1808 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1809 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1810 Initialize layout_.
1811 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1812 section to first entry in .got.plt section.
1813 * layout.h (Layout::dynamic_section): New function.
1814
e9552f7e
ST
18152011-07-13 Sriraman Tallam <tmsriram@google.com>
1816
1817 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1818 to claim_file call.
1819 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1820 input_section_position_, and input_section_glob_.
1821 (read_layout_from_file): Call function section_ordering_specified.
1822 * layout.h (is_section_ordering_specified): New function.
1823 (section_ordering_specified): New function.
1824 (section_ordering_specified_): New boolean member.
1825 * main.cc(main): Call load_plugins after layout object is defined.
1826 * output.cc (Output_section::add_input_section): Use
1827 function section_ordering_specified to check if section ordering is
1828 needed.
1829 * output.cc (Output_section::add_relaxed_input_section): Use
1830 function section_ordering_specified to check if section ordering is
1831 needed.
1832 (Output_section::update_section_layout): New function.
1833 (Output_section::sort_attached_input_sections): Check if input section
1834 must be reordered.
1835 * output.h (Output_section::update_section_layout): New function.
1836 * plugin.cc (get_section_count): New function.
1837 (get_section_type): New function.
1838 (get_section_name): New function.
1839 (get_section_contents): New function.
1840 (update_section_order): New function.
58797674 1841 (allow_section_ordering): New function.
e9552f7e
ST
1842 (Plugin::load): Add the new interfaces to the transfer vector.
1843 (Plugin_manager::load_plugins): New parameter.
1844 (Plugin_manager::all_symbols_read): New parameter.
1845 (Plugin_manager::claim_file): New parameter. Save the elf object for
1846 unclaimed objects.
1847 (Plugin_manager::get_elf_object): New function.
1848 (Plugin_manager::get_view): Change to directly use the bool to check
1849 if get_view is called from claim_file_hook.
1850 * plugin.h (input_objects): New function
1851 (Plugin__manager::load_plugins): New parameter.
1852 (Plugin_manager::claim_file): New parameter.
1853 (Plugin_manager::get_elf_object): New function.
1854 (Plugin_manager::in_claim_file_handler): New function.
1855 (Plugin_manager::in_claim_file_handler_): New member.
1856 (layout): New function.
1857 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1858 handler with an extra parameter. Make the elf object before calling
1859 claim_file handler.
1860 * testsuite/plugin_test.c (get_section_count): New function pointer.
1861 (get_section_type): New function pointer.
1862 (get_section_name): New function pointer.
1863 (get_section_contents): New function pointer.
1864 (update_section_order): New function pointer.
1865 (allow_section_ordering): New function pointer.
1866 (onload): Check if the new interfaces exist.
1867
9446efde
ILT
18682011-07-13 Ian Lance Taylor <iant@google.com>
1869
1870 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1871 relro section.
1872 * x86_64.cc (Target_x86_64::got_section): Likewise.
1873 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1874 (relro_now_test_SOURCES): New variable.
1875 (relro_now_test_DEPENDENCIES): New variable.
1876 (relro_now_test_LDFLAGS): New variable.
1877 (relro_now_test_LDADD): New variable.
1878 (relro_now_test.so): New target.
1879 * testsuite/Makefile.in: Rebuild.
1880
07aa62f2
ILT
18812011-07-12 Ian Lance Taylor <iant@google.com>
1882
1883 PR gold/12980
1884 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1885 GLOB_DAT relocation rather than a RELATIVE relocation for a
1886 protected symbol when creating a shared library.
1887 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1888 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1889 * testsuite/protected_main_1.cc (main): Test that protected
1890 function has same address.
1891
e2153196
ILT
18922011-07-11 Ian Lance Taylor <iant@google.com>
1893
1894 PR gold/12979
1895 * options.h (class General_options): Add -Bgroup.
1896 * options.cc (General_options::finalize): If -Bgroup is set,
1897 default to --unresolved-symbols=report-all.
1898 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1899 * target-reloc.h (issue_undefined_symbol_error): Handle
1900 --unresolved-symbols=report-all.
1901
6daf5215
ILT
19022011-07-08 Ian Lance Taylor <iant@google.com>
1903
1904 PR gold/11985
1905 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1906 if linker script discards key sections.
1907 (Layout::create_dynamic_symtab): Likewise.
1908 (Layout::assign_local_dynsym_offsets): Likewise.
1909 (Layout::sized_create_version_sections): Likewise.
1910 (Layout::create_interp): Likewise.
1911 (Layout::finish_dynamic_section): Likewise.
1912 (Layout::set_dynamic_symbol_size): Likewise.
1913
beabb2c6
ILT
19142011-07-08 Ian Lance Taylor <iant@google.com>
1915
1916 PR gold/12386
1917 * options.h (class General_options): Add --unresolved-symbols.
1918 * target-reloc.h (issue_undefined_symbol_error): Check
1919 --unresolved-symbols. Add comments.
1920
9c16daf1
ILT
19212011-07-08 Ian Lance Taylor <iant@google.com>
1922
1923 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1924 expression more complex.
1925
191f1a2d
ILT
19262011-07-08 Ian Lance Taylor <iant@google.com>
1927
1928 PR gold/11317
1929 * target-reloc.h (issue_undefined_symbol_error): New inline
1930 function, broken out of relocate_section.
1931 (relocate_section): Call issue_undefined_symbol_error.
1932 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1933 there is no TLS segment if we are about to issue an undefined
1934 symbol error.
1935 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1936
62855347
ILT
19372011-07-08 Ian Lance Taylor <iant@google.com>
1938
1939 PR gold/12279
1940 * resolve.cc (Symbol_table::should_override): Add fromtype
1941 parameter. Change all callers. Give error when linking together
1942 TLS and non-TLS symbol.
1943 (Symbol_table::should_override_with_special): Add fromtype
1944 parameter. Change all callers.
1945 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1946 there is no TLS segment if we have reported some errors.
1947 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1948
67181c72
ILT
19492011-07-08 Ian Lance Taylor <iant@google.com>
1950
1951 PR gold/12372
1952 * target.h (Target::plt_address_for_global): New function.
1953 (Target::plt_address_for_local): New function.
1954 (Target::plt_section_for_global): Remove.
1955 (Target::plt_section_for_local): Remove.
1956 (Target::do_plt_address_for_global): New virtual function.
1957 (Target::do_plt_address_for_local): New virtual function.
1958 (Target::do_plt_section_for_global): Remove.
1959 (Target::do_plt_section_for_local): Remove.
1960 (Target::register_global_plt_entry): Add Symbol_table and Layout
1961 parameters.
1962 * output.cc (Output_data_got::Got_entry::write): Use
1963 plt_address_for_global and plt_address_for_local.
1964 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1965 address of output section.
1966 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1967 got_irelative_, and irelative_count_ fields. Update
1968 declarations.
1969 (Output_data_plt_i386::has_irelative_section): New function.
1970 (Output_data_plt_i386::entry_count): Add irelative_count_.
1971 (Output_data_plt_i386::set_final_data_size): Likewise.
1972 (class Target_i386): Add got_irelative_ and rel_irelative_
1973 fields. Update declarations.
1974 (Target_i386::Target_i386): Initialize new fields.
1975 (Target_i386::do_plt_address_for_global): New function replacing
1976 do_plt_section_for_global.
1977 (Target_i386::do_plt_address_for_local): New function replacing
1978 do_plt_section_for_local.
1979 (Target_i386::got_section): Create got_irelative_.
1980 (Target_i386::rel_irelative_section): New function.
1981 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1982 fields. Don't define __rel_iplt_{start,end}.
1983 (Output_data_plt_i386::add_entry): Add symtab and layout
1984 parameters. Change all callers. Use different PLT and GOT for
1985 IFUNC symbols.
1986 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1987 layout parameters. Change all callers. Use different PLT and
1988 GOT.
1989 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1990 (Output_data_plt_i386::rel_irelative): New function.
1991 (Output_data_plt_i386::address_for_global): New function.
1992 (Output_data_plt_i386::address_for_local): New function.
1993 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1994 IRELATIVE GOT when changing IFUNC GOT entries.
1995 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1996 reloc.
1997 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1998 if we didn't create an IRELATIVE GOT.
1999 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2000 plt_address_for_local.
2001 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2002 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2003 got_irelative_, and irelative_count_ fields. Update
2004 declarations.
2005 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2006 Initialize new fields. Remove symtab parameter. Change all
2007 callers.
2008 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2009 irelative_count_.
2010 (Output_data_plt_x86_64::has_irelative_section): New function.
2011 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2012 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2013 fields. Update declarations.
2014 (Target_x86_64::Target_x86_64): Initialize new fields.
2015 (Target_x86_64::do_plt_address_for_global): New function replacing
2016 do_plt_section_for_global.
2017 (Target_x86_64::do_plt_address_for_local): New function replacing
2018 do_plt_section_for_local.
2019 (Target_x86_64::got_section): Create got_irelative_.
2020 (Target_x86_64::rela_irelative_section): New function.
2021 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2022 all callers. Don't create __rel_iplt_{start,end}.
2023 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2024 parameters. Change all callers. Use different PLT and GOT for
2025 IFUNC symbols.
2026 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2027 layout parameters. Change all callers. Use different PLT and
2028 GOT.
2029 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2030 parameters. Change all callers. Use different PLT and GOT for
2031 IFUNC symbols.
2032 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2033 (Output_data_plt_x86_64::rela_irelative): New function.
2034 (Output_data_plt_x86_64::address_for_global): New function.
2035 (Output_data_plt_x86_64::address_for_local): New function.
2036 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2037 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2038 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2039 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2040 parameters.
2041 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2042 reloc.
2043 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2044 symbols if we didn't create an IRELATIVE GOT.
2045 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2046 plt_address_for_local.
2047 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2048 * testsuite/ifuncvar1.c: New test file.
2049 * testsuite/ifuncvar2.c: New test file.
2050 * testsuite/ifuncvar3.c: New test file.
2051 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2052 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2053 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2054 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2055 * testsuite/Makefile.in: Rebuild.
2056
33c15b45
CC
20572011-07-07 Cary Coutant <ccoutant@google.com>
2058
2059 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2060 (two_file_test_1_ndebug.o): Likewise.
2061 (two_file_test_1b_ndebug.o): Likewise.
2062 (two_file_test_2_ndebug.o): Likewise.
2063 (two_file_test_main_ndebug.o): Likewise.
2064 (incremental_test_2): Link with no-debug versions.
2065
f48b5fb7
CC
20662011-07-06 Cary Coutant <ccoutant@google.com>
2067
2068 * gold/incremental.cc
2069 (Output_section_incremental_inputs::write_info_blocks): Check for
2070 hidden and internal symbols.
2071
221597a5
CC
20722011-07-06 Cary Coutant <ccoutant@google.com>
2073
2074 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2075 Check disposition for startup file.
2076 (Incremental_inputs::report_command_line): Ignore
2077 --incremental-startup-unchanged option.
2078 * options.cc (General_options::parse_incremental_startup_unchanged):
2079 New function.
2080 (General_options::General_options): Initialize new data member.
2081 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2082 (General_options): Add --incremental-startup-unchanged option.
2083 (General_options::incremental_startup_disposition): New function.
2084 (General_options::incremental_startup_disposition_): New data member.
2085
e24719f6
CC
20862011-07-06 Cary Coutant <ccoutant@google.com>
2087
2088 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2089 input file index to Script_info ctor.
2090 (Sized_incremental_binary::do_file_has_changed): Find the
2091 command-line argument for files named in scripts.
2092 * incremental.h (Script_info::Script_info): New ctor
2093 with input file index.
2094 (Script_info::input_file_index): New function.
2095 (Script_info::input_file_index_): New data member.
2096 (Incremental_binary::get_library): Add const.
2097 (Incremental_binary::get_script_info): Add const.
2098 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2099 * testsuite/Makefile.am (incremental_test_5): New test case.
2100 (incremental_test_6): New test case.
2101 * testsuite/Makefile.in: Regenerate.
2102
8f7c81e8
CC
21032011-07-06 Cary Coutant <ccoutant@google.com>
2104
2105 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2106 debug output when command lines differ.
2107
9fbd3822
CC
21082011-07-06 Cary Coutant <ccoutant@google.com>
2109
2110 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2111 --incremental-patch option.
2112 * layout.cc (Free_list::allocate): Extend allocation beyond original
2113 end if enabled.
2114 (Layout::make_output_section): Mark sections that should get
2115 patch space.
2116 * options.cc (parse_percent): New function.
2117 * options.h (parse_percent): New function.
2118 (DEFINE_percent): New macro.
2119 (General_options): Add --incremental-patch option.
2120 * output.cc (Output_section::Output_section): Initialize new data
2121 members.
2122 (Output_section::add_input_section): Print section name when out
2123 of patch space.
2124 (Output_section::add_output_section_data): Likewise.
2125 (Output_section::set_final_data_size): Add patch space when
2126 doing --incremental-full.
2127 (Output_section::do_reset_address_and_file_offset): Remove patch
2128 space.
2129 (Output_segment::set_section_list_addresses): Print debug output
2130 only if --incremental-update.
2131 * output.h (Output_section::set_is_patch_space_allowed): New function.
2132 (Output_section::is_patch_space_allowed_): New data member.
2133 (Output_section::patch_space_): New data member.
2134 * parameters.cc (Parameters::incremental_full): New function.
2135 * parameters.h (Parameters::incremental_full): New function
2136 * testsuite/Makefile.am (incremental_test_2): Add test for
2137 --incremental-patch option.
2138 * testsuite/Makefile.in: Regenerate.
2139 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2140 (t18): Remove function body.
2141
f6cccc2c
DK
21422011-07-05 Doug Kwan <dougkwan@google.com>
2143
2144 PR gold/12771
2145 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2146 Arm_Address type for relocation result.
2147 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2148 overflow check.
2149 (Arm_relocate_functions::abs32): Use unaligned access.
2150 (Arm_relocate_functions::rel32): Ditto.
2151 (Arm_relocate_functions::prel31): Ditto.
2152 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2153 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2154 static data relocations.
2155 * testsuite/Makefile.in: Regnerate.
2156 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2157
28a13fec
ILT
21582011-07-05 Ian Lance Taylor <iant@google.com>
2159
2160 PR gold/12392
2161 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2162 symbols if necessary.
2163 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2164
24d47b34
ILT
21652011-07-05 Ian Lance Taylor <iant@google.com>
2166
2167 PR gold/12952
2168 * resolve.cc (Symbol::override_base_with_special): Simply override
2169 version with special symbol version, ignoring previous version.
2170
41f9cbbe
ILT
21712011-07-05 Ian Lance Taylor <iant@google.com>
2172
2173 * object.cc (Sized_relobj_file::include_section_group): Add
2174 information to comment about signature location.
2175
886288f1
ILT
21762011-07-02 Ian Lance Taylor <iant@google.com>
2177
2178 PR gold/12957
2179 * options.h (class General_options): Add -f and -F.
2180 * options.cc (General_options::finalize): Fatal error if -f/-F
2181 are used without -shared.
2182 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2183
ae3a6d4f
ILT
21842011-07-02 Ian Lance Taylor <iant@google.com>
2185
2186 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2187
21131061
ILT
21882011-07-01 Ian Lance Taylor <iant@google.com>
2189
2190 PR gold/12525
2191 PR gold/12952
2192 * resolve.cc (Symbol::override_base_with_special): Don't override
2193 the version if the overriding symbol has a different name.
2194 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2195 all callers. If we give an error about an undefined version,
2196 define the base version if necessary.
2197 * dynobj.h (class Versions): Update declaration.
2198 * testsuite/weak_alias_test_5.cc: New file.
2199 * testsuite/weak_alias_test.script: New file.
2200 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2201 and versioned_alias have the right value, and call t2.
2202 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2203 weak_alias_test_5.so.
2204 (weak_alias_test_LDADD): Likewise.
2205 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2206 * testsuite/Makefile.in: Rebuild.
2207
611062c0
ILT
22082011-07-01 Ian Lance Taylor <iant@google.com>
2209
2210 PR gold/12525
2211 * options.h (class General_options): Support -z notext.
2212 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2213 -Wl,-z,notext.
2214 (two_file_shared_nonpic.so): Likewise.
2215 (two_file_shared_mixed.so): Likewise.
2216 (two_file_shared_mixed_1.so): Likewise.
2217 (weak_undef_lib_nonpic.so): Likewise.
2218 (alt/weak_undef_lib_nonpic.so): Likewise.
2219 (tls_test_shared_nonpic.so): Likewise.
2220 * testsuite/Makefile.in: Rebuild.
2221
328c7c2f
ILT
22222011-07-01 Ian Lance Taylor <iant@google.com>
2223
2224 PR gold/12525
2225 * configure.ac: Test whether static linking works, setting
2226 the automake conditional HAVE_STATIC.
2227 * testsuite/Makefile.am: Disable tests using -static if
2228 HAVE_STATIC is not true.
2229 * configure, testsuite/Makefile.in: Rebuild.
2230
02d7cd44
ILT
22312011-07-01 Ian Lance Taylor <iant@google.com>
2232
2233 PR gold/12525
2234 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2235 Assert if we see DW_EH_PE_indirect.
2236 * target.h (Target::ehframe_datarel_base): New function.
2237 (Target::do_ehframe_datarel_base): New target function.
2238 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2239 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2240 function.
2241
07a60597
ILT
22422011-07-01 Ian Lance Taylor <iant@google.com>
2243
2244 PR gold/12571
2245 * options.h (class General_options): Add
2246 --ld-generated-unwind-info.
2247 * ehframe.cc (Fde::write): Add address parameter. Change all
2248 callers. If associated with PLT, fill in address and size.
2249 (Cie::set_output_offset): Only add merge mapping if there is an
2250 object.
2251 (Cie::write): Add address parameter. Change all callers.
2252 (Eh_frame::add_ehframe_for_plt): New function.
2253 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2254 input_offset_ fields into union u_, with new plt field.
2255 (Fde::Fde): Adjust for new union field.
2256 (Fde::Fde) [Output_data version]: New constructor.
2257 (Fde::add_mapping): Only add merge mapping if there is an object.
2258 (class Cie): Update declarations.
2259 (class Eh_frame): Declare add_ehframe_for_plt.
2260 * layout.cc (Layout::layout_eh_frame): Break out code into
2261 make_eh_frame_section, and call it.
2262 (Layout::make_eh_frame_section): New function.
2263 (Layout::add_eh_frame_for_plt): New function.
2264 * layout.h (class Layout): Update declarations.
2265 * merge.cc (Merge_map::add_mapping): Add assertion.
2266 * i386.cc: Include "dwarf.h".
2267 (class Output_data_plt_i386): Make first_plt_entry,
2268 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2269 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2270 and plt_eh_frame_fde.
2271 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2272 boundary. Call add_eh_frame_for_plt if appropriate.
2273 * x86_64.cc: Include "dwarf.h".
2274 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2275 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2276 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2277 and plt_eh_frame_fde.
2278 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2279 appropriate.
2280
14788a3f
ILT
22812011-06-29 Ian Lance Taylor <iant@google.com>
2282
2283 PR gold/12629
2284 * object.cc (Sized_relobj_file::layout_section): Change shdr
2285 parameter to be const.
2286 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2287 out of do_layout.
2288 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2289 appropriate. Call layout_eh_frame_section.
2290 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2291 sections.
2292 * object.h (class Sized_relobj_file): Update declarations.
2293
6c21fce1
ILT
22942011-06-29 Ian Lance Taylor <iant@google.com>
2295
37e41b03 2296 PR gold/12652
6c21fce1
ILT
2297 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2298 modifier.
2299 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2300
4d5e4e62
ILT
23012011-06-29 Ian Lance Taylor <iant@google.com>
2302
2303 PR gold/12675
2304 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2305 SHT_X86_64_UNWIND.
2306 * layout.cc (Layout::layout_eh_frame): Likewise.
2307
886f533a
ILT
23082011-06-29 Ian Lance Taylor <iant@google.com>
2309
2310 PR gold/12695
2311 * layout.cc (Layout::symtab_section_shndx): New function.
2312 * layout.h (class Layout): Declare symtab_section_shndx.
2313 * output.cc (Output_section::write_header): Call it.
2314
f3ae1b28
ILT
23152011-06-29 Ian Lance Taylor <iant@google.com>
2316
2317 PR gold/12818
2318 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2319 symbols which are not used in a relocation.
2320
aecf301f
ILT
23212011-06-28 Ian Lance Taylor <iant@google.com>
2322
2323 PR gold/12898
2324 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2325 script create indistinguishable segments.
2326 (Layout::set_segment_offsets): Use stable_sort when sorting
2327 segments. Pass this to Compare_segments constructor.
2328 * layout.h (class Layout): Make segment_precedes non-static.
2329 (class Compare_segments): Change from struct to class. Add
2330 layout_ field. Add constructor.
2331 * script-sections.cc
2332 (Script_sections::attach_sections_using_phdrs_clause): Rename
2333 local orphan to is_orphan. Don't report failure to put empty
2334 section in segment. On attachment failure, report name of
2335 section, and attach to first PT_LOAD segment.
2336
03ef7571
ILT
23372011-06-28 Ian Lance Taylor <iant@google.com>
2338
2339 PR gold/12934
2340 * target-select.cc (Target_selector::Target_selector): Add
2341 emulation parameter. Change all callers.
2342 (select_target_by_bfd_name): Rename from select_target_by_name.
2343 Change all callers.
2344 (select_target_by_emulation): New function.
2345 (supported_emulation_names): New function.
2346 * target-select.h (class Target_selector): Add emulation_ field.
2347 Update declarations.
2348 (Target_selector::recognize_by_bfd_name): Rename from
2349 recognize_by_name. Change all callers.
2350 (Target_selector::supported_bfd_names): Rename from
2351 supported_names. Change all callers.
2352 (Target_selector::recognize_by_emulation): New function.
2353 (Target_selector::supported_emulations): New function.
2354 (Target_selector::emulation): New function.
2355 (Target_selector::do_recognize_by_bfd_name): Rename from
2356 do_recognize_by_name. Change all callers.
2357 (Target_selector::do_supported_bfd_names): Rename from
2358 do_supported_names. Change all callers.
2359 (Target_selector::do_recognize_by_emulation): New function.
2360 (Target_selector::do_supported_emulations): New function.
2361 (select_target_by_bfd_name): Change name in declaration.
2362 (select_target_by_emulation): Declare.
2363 (supported_emulation_names): Declare.
2364 * parameters.cc (parameters_force_valid_target): Try to find
2365 target based on emulation from -m option.
2366 * options.h (class General_options): Change doc string for -m.
2367 * options.cc (help): Print emulations.
2368 (General_options::parse_V): Likewise.
2369 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2370 Add emulation parameter. Change all callers.
2371
200b2bb9
ILT
23722011-06-28 Ian Lance Taylor <iant@google.com>
2373
2374 * target.h (class Target): Add osabi_ field.
2375 (Target::osabi): New function.
2376 (Target::set_osabi): New function.
2377 (Target::Target): Initialize osabi_.
2378 (Target::do_adjust_elf_header): Make pure virtual.
2379 (Sized_target::do_adjust_elf_header): Declare.
2380 * target.cc (Sized_target::do_adjust_elf_header): New function.
2381 (class Sized_target): Instantiate all versions.
2382 * freebsd.h (class Target_freebsd): Remove.
2383 (Target_selector_freebsd::do_recognize): Call set_osabi on
2384 Target.
2385 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2386 (Target_selector_freebsd::set_osabi): Remove.
2387 * i386.cc (class Target_i386): Inherit from Sized_target rather
2388 than Target_freebsd.
2389 * x86_64.cc (class Target_x86_64): Likewise.
2390
b3ce541e
ILT
23912011-06-28 Ian Lance Taylor <iant@google.com>
2392
2393 * target.h (Target::can_check_for_function_pointers): Rewrite.
2394 Make non-virtual.
2395 (Target::can_icf_inline_merge_sections): Likewise.
2396 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2397 (Target::Target_info): Add can_icf_inline_merge_sections field.
2398 (Target::do_can_check_for_function_pointers): New virtual
2399 function.
2400 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2401 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2402 from can_check_for_function_pointers, move in file.
2403 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2404 section_may_have_icf_unsafe_poineters, move in file.
2405 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2406 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2407 Rename from can_check_for_function_pointers, move in file.
2408 (Target_i386::can_icf_inline_merge_sections): Remove.
2409 (Target_i386::i386_info): Initialize
2410 can_icf_inline_merge_sections.
2411 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2412 Initialize can_icf_inline_merge_sections.
2413 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2414 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2415 Rename from can_check_for_function_pointers, move in file.
2416 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2417 (Target_x86_64::x86_64_info): Initialize
2418 can_icf_inline_merge_sections.
2419 * testsuite/testfile.cc (Target_test::test_target_info):
2420 Likewise.
2421 * icf.cc (get_section_contents): Correct formatting.
2422
6d1c4efb
ILT
24232011-06-27 Ian Lance Taylor <iant@google.com>
2424
2425 * symtab.cc (Symbol::versioned_name): New function.
2426 (Symbol_table::add_to_final_symtab): Use versioned_name when
2427 appropriate.
2428 (Symbol_table::sized_write_symbol): Likewise.
2429 * symtab.h (class Symbol): Declare versioned_name.
2430 * stringpool.h (class Stringpool_template): Add variant of add
2431 which takes a std::basic_string.
2432 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2433 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2434 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2435 (ver_test_12.o): New target.
2436 * testsuite/Makefile.in: Rebuild.
2437
57eb9b50
DK
24382011-06-27 Doug Kwan <dougkwan@google.com>
2439
2440 * arm.cc (Arm_relocate_functions::thm_jump8,
2441 Arm_relocate_functions::thm_jump11): Use a wider signed
2442 type to compute offset.
2443 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2444 arm_thm_jump8.
2445 * testsuite/Makefile.in: Regenerate.
2446 * testsuite/arm_branch_in_range.sh: Check test results of
2447 arm_thm_jump11 and arm_thm_jump8.
2448 * testsuite/arm_thm_jump11.s: New test source file.
2449 * testsuite/arm_thm_jump11.t: New linker script.
2450 * testsuite/arm_thm_jump8.s: New test source file.
2451 * testsuite/arm_thm_jump8.t: New linker script.
2452
487b39df
ILT
24532011-06-24 Ian Lance Taylor <iant@google.com>
2454
2455 * layout.cc: Include "object.h".
2456 (ctors_sections_in_init_array): New static variable.
2457 (Layout::is_ctors_in_init_array): New function.
2458 (Layout::layout): Add entry to ctors_sections_in_init_array if
2459 appropriate.
2460 * layout.h (class Layout): Declare is_ctors_in_init_array.
2461 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2462 is_ctors_reverse_view is set.
2463 (Sized_relobj_file::write_sections): Add layout parameter. Change
2464 all callers. Set is_ctors_reverse_view field of View_size.
2465 (Sized_relobj_file::reverse_words): New function.
2466 * object.h (Sized_relobj_file::View_size): Add
2467 is_ctors_reverse_view field.
2468 (class Sized_relobj_file): Update declarations.
2469 * testsuite/initpri3.c: New test.
2470 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2471 initpri3b.
2472 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2473 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2474 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2475 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2476 * testsuite/Makefile.in: Rebuild.
2477
472076e4
CC
24782011-06-24 Cary Coutant <ccoutant@google.com>
2479
2480 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2481 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2482 (debug_msg_cdebug.err): New targets.
2483 * testsuite/Makefile.in: Regenerate.
2484 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2485 Fix checks for link with shared library.
2486
a60af0db
DK
24872011-06-24 Doug Kwan <dougkwan@google.com>
2488
2489 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2490 skip empty text sections.
2491 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2492
5393d741
ILT
24932011-06-22 Ian Lance Taylor <iant@google.com>
2494
2495 PR gold/12910
2496 * options.h (class General_options): Add --ctors-in-init-array.
2497 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2498 friends as SHT_PROGBITS for merging sections.
2499 (Layout::layout): Remove special handling of .init_array and
2500 friends. Don't sort if doing relocatable link. Sort for .ctors
2501 and .dtors if ctors_in_init_array.
2502 (Layout::make_output_section): Force correct section types for
2503 .init_array and friends. Don't sort if doing relocatable link,
2504 Don't sort .ctors and .dtors if ctors_in_init_array.
2505 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2506 (Layout::output_section_name): Add relobj parameter. Change all
2507 callers. Handle .ctors. and .dtors. in code rather than table.
2508 Handle .ctors and .dtors if ctors_in_init_array.
2509 (Layout::match_file_name): New function, moved from output.cc.
2510 * layout.h (class Layout): Update declarations.
2511 * output.cc: Include "layout.h".
2512 (Input_section_sort_entry::get_priority): New function.
2513 (Input_section_sort_entry::match_file_name): Just call
2514 Layout::match_file_name.
2515 (Output_section::Input_section_sort_init_fini_compare::operator()):
2516 Handle .ctors and .dtors. Sort by explicit priority rather than
2517 by name.
2518 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2519 * testsuite/initpri2.c: New test.
2520 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2521 (check_PROGRAMS): Add initpri2.
2522 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2523 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2524 * configure, testsuite/Makefile.in: Rebuild.
2525
e1f74f98
ILT
25262011-06-19 Ian Lance Taylor <iant@google.com>
2527
2528 PR gold/12880
2529 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2530 .interp section to a PT_INTERP segment even if we have seen a
2531 --dynamic-linker option. Don't do it if we have seen a PHDRS
2532 clause in a linker script.
2533 (Layout::finalize): Don't create a .interp section if we've
2534 already create a PT_INTERP segment.
2535 (Layout::create_interp): Always call choose_output_section (revert
2536 patch of 2011-06-17). Don't create PT_INTERP segment.
2537 * script-sections.cc
2538 (Script_sections::create_note_and_tls_segments): Add a .interp
2539 section to a PT_INTERP segment even if we have seen a
2540 --dynamic-linker option.
2541
766f91bb
ILT
25422011-06-18 Ian Lance Taylor <iant@google.com>
2543
2544 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2545 merely because a non-PT_LOAD segment has a dynamic reloc.
2546
0d212c3a
ILT
25472011-06-18 Ian Lance Taylor <iant@google.com>
2548
2549 * layout.cc (Layout::finish_dynamic_section): Don't create
2550 DT_FLAGS entry if not needed.
2551
911a5072
ILT
25522011-06-18 Ian Lance Taylor <iant@google.com>
2553
2554 PR gold/12745
2555 * layout.cc (Layout::layout_eh_frame): Correct handling of
2556 writable .eh_frame section.
2557
534b4e5f
ILT
25582011-06-17 Ian Lance Taylor <iant@google.com>
2559
2560 PR gold/12893
2561 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2562 symbol is redefined with the exact same object and value.
2563
10b4f102
ILT
25642011-06-17 Ian Lance Taylor <iant@google.com>
2565
2566 PR gold/12880
2567 * layout.h (class Layout): Add interp_segment_ field.
2568 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2569 (Layout::attach_allocated_section_to_segment): If making shared
2570 library, put .interp section in PT_INTERP segment.
2571 (Layout::finalize): Also call create_interp if -dynamic-linker
2572 option was used.
2573 (Layout::create_interp): Assert that there is no PT_INTERP
2574 segment. If not using a SECTIONS clause, use make_output_section.
2575 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2576 * script-sections.cc
2577 (Script_sections::create_note_and_tls_segments): If making shared
2578 library, put .interp section in PT_INTERP segment.
2579
a29b0dad
ILT
25802011-06-17 Ian Lance Taylor <iant@google.com>
2581
e588ea8d
ILT
2582 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2583 when making a shared library.
2584
25852011-06-17 Ian Lance Taylor <iant@google.com>
2586
2587 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2588 parameter. Change all callers. Don't issue warning about PC32
2589 against locally defined symbol.
a29b0dad 2590
9d3b0698
ILT
25912011-06-16 Ian Lance Taylor <iant@google.com>
2592
2593 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2594 occurs in same object.
2595
85b0f90c
AM
25962011-06-14 Alan Modra <amodra@gmail.com>
2597
2598 * po/POTFILES.in: Regenerate.
2599
a94907d9
ILT
26002011-06-09 Ian Lance Taylor <iant@google.com>
2601
2602 * script-sections.cc
2603 (Orphan_output_section::set_section_addresses): For a relocatable
2604 link set address to 0.
2605
4fb3a1c3
CC
26062011-06-09 Cary Coutant <ccoutant@google.com>
2607
2608 PR gold/12804
2609 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2610 used with --compress-debug-sections.
2611 * gold/object.cc (Sized_relobj_file::do_layout): Report
2612 uncompressed size of compressed input sections.
2613
61220854
CC
26142011-06-08 Cary Coutant <ccoutant@google.com>
2615
2616 PR gold/12804
2617 * testsuite/two_file_test_2_v1.cc: Change initialization of
2618 v2 to keep it in .data.
2619
e6455dfb
CC
26202011-06-07 Cary Coutant <ccoutant@google.com>
2621
2622 * common.cc (Symbol_table::do_allocate_commons_list): Call
2623 gold_fallback.
2624 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2625 (Errors::fallback): New function.
2626 (gold_fallback): New function.
2627 * errors.h (Errors::fallback): New function.
2628 * gold.cc (gold_exit): Change status parameter to enum; adjust
2629 all callers.
2630 (queue_initial_tasks): Call gold_fallback.
2631 * gold.h: Include cstdlib.
2632 (Exit_status): New enum type.
2633 (gold_exit): Change status parameter to enum.
2634 (gold_fallback): New function.
2635 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2636 (Layout::create_symtab_sections): Likewise.
2637 (Layout::create_shdrs): Likewise.
2638 * main.cc (main): Adjust call to gold_exit.
2639 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2640 (Output_data_got::add_got_entry_pair): Likewise.
2641 (Output_section::add_input_section): Likewise.
2642 (Output_section::add_output_section_data): Likewise.
2643 (Output_segment::set_section_list_addresses): Likewise.
2644 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2645
fb0e076f
CC
26462011-06-07 Cary Coutant <ccoutant@google.com>
2647
2648 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2649 for incremental links.
2650 * output.cc (Output_segment::set_section_list_addresses): Remove
2651 FIXME and test for TLS or BSS.
2652
a5ee4d5d
CC
26532011-06-07 Cary Coutant <ccoutant@google.com>
2654
2655 * testsuite/Makefile.am: Add incremental_copy_test,
2656 incremental_common_test_1.
2657 * testsuite/Makefile.in: Regenerate.
2658 * testsuite/common_test_1_v1.c: New source file.
2659 * testsuite/common_test_1_v2.c: New source file.
2660 * testsuite/copy_test_v1.cc: New source file.
2661
5146f448
CC
26622011-06-07 Cary Coutant <ccoutant@google.com>
2663
2664 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2665 update, allocate common from bss section's free list.
2666 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2667 linker-defined symbols.
2668 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2669 Skip GOT and PLT entries that are no longer referenced.
2670 (Output_section_incremental_inputs::write_info_blocks): Mark
2671 linker-defined symbols.
2672 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2673 * output.cc (Output_section::allocate): New function.
2674 * output.h (Output_section::allocate): New function.
2675 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2676 linker-defined symbols.
2677 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2678 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2679 (Symbol::init_base_output_data): Likewise.
2680 (Symbol::init_base_output_segment): Likewise.
2681 (Symbol::init_base_constant): Likewise.
2682 (Sized_symbol::init_output_data): Likewise.
2683 (Sized_symbol::init_output_segment): Likewise.
2684 (Sized_symbol::init_constant): Likewise.
2685 (Symbol_table::do_define_in_output_data): Likewise.
2686 (Symbol_table::do_define_in_output_segment): Likewise.
2687 (Symbol_table::do_define_as_constant): Likewise.
2688 * symtab.h (Symbol::is_predefined): New function.
2689 (Symbol::init_base_output_data): Add is_predefined parameter.
2690 (Symbol::init_base_output_segment): Likewise.
2691 (Symbol::init_base_constant): Likewise.
2692 (Symbol::is_predefined_): New data member.
2693 (Sized_symbol::init_output_data): Add is_predefined parameter.
2694 (Sized_symbol::init_output_segment): Likewise.
2695 (Sized_symbol::init_constant): Likewise.
2696 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2697
26d3c67d
CC
26982011-06-07 Cary Coutant <ccoutant@google.com>
2699
2700 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2701 instead of emit_copy_reloc.
2702 (Copy_relocs::emit_copy_reloc): Refactor.
2703 (Copy_relocs::make_copy_reloc): New function.
2704 (Copy_relocs::add_copy_reloc): Remove.
2705 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2706 section.
2707 (Copy_relocs::make_copy_reloc): New function.
2708 (Copy_relocs::add_copy_reloc): Remove.
2709 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2710 unchanged input files.
2711 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2712 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2713 Reserve BSS space for COPY relocations.
2714 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2715 (Output_section_incremental_inputs::write_info_blocks): Record
2716 whether a symbol is copied from a shared object.
2717 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2718 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2719 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2720 (Incremental_input_entry_reader::get_output_symbol_index): Add
2721 is_copy parameter.
2722 (Incremental_binary::emit_copy_relocs): New function.
2723 (Incremental_binary::do_emit_copy_relocs): New function.
2724 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2725 new data member.
2726 (Sized_incremental_binary::add_copy_reloc): New function.
2727 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2728 (Sized_incremental_binary::Copy_reloc): New struct.
2729 (Sized_incremental_binary::Copy_relocs): New typedef.
2730 (Sized_incremental_binary::copy_relocs_): New data member.
2731 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2732 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2733 * target.h (Sized_target::emit_copy_reloc): New function.
2734 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2735
7cdb37d9
CC
27362011-06-02 Cary Coutant <ccoutant@google.com>
2737
2738 PR gold/12163
2739 * gold/archive.cc (Archive::Archive): Initialize new data member.
2740 (Archive::include_all_members): Return if archive has already been
2741 included.
2742 * gold/archive.h (Archive::include_all_members_): New data member.
2743
cc643b88
NC
27442011-06-02 Nick Clifton <nickc@redhat.com>
2745
2746 * dynobj.h: Fix spelling mistake in comment.
2747 * output.cc: Likewise.
2748
f62a3ca7 27492011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2750 Asier Llano
f62a3ca7
DK
2751
2752 PR gold/12826
cc643b88 2753 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2754 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2755 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2756 redundant arm_exidx_test.so.
2757 * testsuite/Makefile.in: Regenerate.
2758 (check_SCRIPTS): Add pr12826.sh
2759 (check_DATA): Add pr12826.stdout
2760 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2761 * testsuite/pr12826.sh: New file.
2762 * testsuite/pr12826_1.s: Ditto.
2763 * testsuite/pr12826_1.s: Ditto.
2764
8dbe1edc
ILT
27652011-05-30 Ian Lance Taylor <iant@google.com>
2766
2767 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2768 sections.
2769
c49875be
ILT
27702011-05-29 Ian Lance Taylor <iant@google.com>
2771
2772 PR gold/12804
2773 * testsuite/Makefile.am: Use different file name for two_file_test
2774 temporary file for each incremental test.
2775 * testsuite/Makefile.in: Rebuild.
2776
69d53f7a
ILT
27772011-05-29 Ian Lance Taylor <iant@google.com>
2778
2779 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2780 binary input file is empty.
2781
41d0ab5f
ILT
27822011-05-27 Ian Lance Taylor <iant@google.com>
2783
2784 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2785 (ver_test_9.so): Likewise.
2786 * testsuite/Makefile.in: Rebuild.
2787
89d8a36b
CC
27882011-05-26 Cary Coutant <ccoutant@google.com>
2789
2790 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2791 * incremental.cc (Incremental_inputs::report_input_section): Fix
2792 comment, indentation.
2793 (Incremental_inputs::report_comdat_group): New function.
2794 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2795 of data for incremental input file entry.
2796 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2797 group count, COMDAT group signatures.
2798 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2799 an unchanged input file.
2800 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2801 Initialize new data member.
2802 (Incremental_object_entry::add_comdat_group): New function.
2803 (Incremental_object_entry::get_comdat_group_count): New function.
2804 (Incremental_object_entry::get_comdat_signature_key): New function.
2805 (Incremental_object_entry::groups_): New data member.
2806 (Incremental_inputs::report_comdat_group): New function.
2807 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2808 data for incremental input file entry.
2809 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2810 (Incremental_input_entry_reader::get_input_section): Adjust size of
2811 data for incremental input file entry.
2812 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2813 (Incremental_input_entry_reader::get_comdat_group_signature): New
2814 function.
2815 * object.cc (Sized_relobj::include_section_group): Report kept
2816 COMDAT groups for incremental links.
2817
1706a06f
ILT
28182011-05-24 David Meyer <pdox@google.com>
2819
2820 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2821 with name parameter. Add found_name parameter.
2822 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2823 * dirsearch.h (class Dirsearch): Update declaration.
2824
a10ae760
ILT
28252011-05-24 Ian Lance Taylor <iant@google.com>
2826
2827 * archive.cc (Library_base::should_include_member): Pull in object
2828 from archive if it defines the entry symbol.
2829 * parameters.cc (Parameters::entry): New function.
2830 * parameters.h (class Parameters): Declare entry.
2831 * output.h (class Output_file_header): Remove entry_ field.
2832 * output.cc (Output_file_header::Output_file_header): Remove entry
2833 parameter. Change all callers.
2834 (Output_file_header::entry): Use parameters->entry.
2835 * gold.cc (queue_middle_tasks): Likewise.
2836 * plugin.cc (Plugin_hook::run): Likewise.
2837
aa92d6ed
CC
28382011-05-24 Cary Coutant <ccoutant@google.com>
2839
2840 * gold.cc (queue_initial_tasks): Pass incremental base filename
2841 to Output_file::open_base_file; don't print error message.
2842 * incremental-dump.cc (main): Adjust call to
2843 Output_file::open_for_modification.
2844 * incremental-dump.cc (main): Likewise.
2845 * incremental.cc (Incremental_inputs::report_command_line):
2846 Ignore --incremental-base option when comparing command lines.
2847 Ignore parameter when given as separate argument.
2848 * options.h (class General_options): Add --incremental-base.
2849 * output.cc (Output_file::Output_file):
2850 (Output_file::open_base_file): Add base_name and writable parameters;
2851 read base file into new file; print error message here.
2852 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2853 callers.
2854 * output.h (Output_file::open_for_modification): Rename to...
2855 (Output_file::open_base_file): ...this; add base_name and
2856 writable parameters; adjust all callers.
2857 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2858 callers.
2859 * testsuite/Makefile.am (incremental_test_4): Test
2860 --incremental-base.
2861 * testsuite/Makefile.in: Regenerate.
2862
2eedd706
CC
28632011-05-24 Cary Coutant <ccoutant@google.com>
2864
2865 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2866 incremental_test_4.
2867 * testsuite/Makefile.in: Regenerate.
2868 * testsuite/two_file_test_1_v1.cc: New test source file.
2869 * testsuite/two_file_test_1b_v1.cc: New test source file.
2870 * testsuite/two_file_test_2_v1.cc: New test source file.
2871
0f1c85a6
CC
28722011-05-24 Cary Coutant <ccoutant@google.com>
2873
2874 * dynobj.h (Dynobj::do_dynobj): New function.
2875 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2876 flag and soname for shared objects.
2877 * incremental.cc (Incremental_inputs::report_object): Make
2878 either Incremental_object_entry or Incremental_dynobj_entry; add
2879 soname to string table.
2880 (Incremental_inputs::report_input_section): Add assertion.
2881 (Output_section_incremental_inputs::set_final_data_size): Adjust
2882 type of input file entry for shared libraries; adjust size of
2883 shared library info entry.
2884 (Output_section_incremental_inputs::write_input_files): Write
2885 as_needed flag for shared libraries.
2886 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2887 of input file entry for shared libraries; write soname.
2888 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2889 soname from incremental info.
2890 * incremental.h (enum Incremental_input_flags): Add
2891 INCREMENTAL_INPUT_AS_NEEDED.
2892 (Incremental_input_entry::Incremental_input_entry): Initialize new
2893 data member.
2894 (Incremental_input_entry::set_as_needed): New function.
2895 (Incremental_input_entry::as_needed): New function.
2896 (Incremental_input_entry::do_dynobj_entry): New function.
2897 (Incremental_input_entry::as_needed_): New data member.
2898 (Incremental_object_entry::Incremental_object_entry): Don't check
2899 for shared library.
2900 (Incremental_object_entry::do_type): Likewise.
2901 (class Incremental_dynobj_entry): New class.
2902 (Incremental_input_entry_reader::as_needed): New function.
2903 (Incremental_input_entry_reader::get_soname): New function.
2904 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2905 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2906 size of shared library info entry.
58797674 2907 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2908 incremental link when adding DT_NEEDED entries.
2909 * object.h (Object::Object): Initialize new data member.
2910 (Object::dynobj): New function.
2911 (Object::set_as_needed): New function.
2912 (Object::as_needed): New function.
2913 (Object::do_dynobj): New function.
2914 (Object::as_needed_): New data member.
2915
6fa2a40b
CC
29162011-05-24 Cary Coutant <ccoutant@google.com>
2917
2918 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2919 info; adjust display of GOT entries.
2920 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2921 vector of input objects; remove file_status_.
2922 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2923 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2924 got_plt reader; call target hooks to reserve GOT entries.
2925 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2926 of input file info header and GOT info entry.
2927 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2928 relocation info.
2929 (Got_plt_view_info::got_descriptor): Remove.
2930 (Got_plt_view_info::sym_index): New data member.
2931 (Got_plt_view_info::input_index): New data member.
2932 (Local_got_offset_visitor::visit): Write input file index.
2933 (Global_got_offset_visitor::visit): Write 0 for input file index.
2934 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2935 with sym_index and input_index.
2936 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2937 incremental info GOT entry; replace got_descriptor with input_index.
2938 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2939 map from input file index to object.
2940 (Sized_relobj_incr::do_layout): Replace direct data member reference
2941 with accessor function.
2942 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2943 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2944 Adjust size of input file info header.
2945 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2946 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2947 (Incremental_input_entry_reader::get_input_section): Adjust size of
2948 input file info header.
2949 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2950 of incremental info GOT entry.
2951 (Incremental_got_plt_reader::get_got_desc): Remove.
2952 (Incremental_got_plt_reader::get_got_symndx): New function.
2953 (Incremental_got_plt_reader::get_got_input_index): New function.
2954 (Sized_incremental_binary::Sized_incremental_binary): Remove
2955 file_status_; add input_objects_.
2956 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2957 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2958 (Sized_incremental_binary::file_is_unchanged): Remove.
2959 (Sized_incremental_binary::set_input_object): New function.
2960 (Sized_incremental_binary::input_object): New function.
2961 (Sized_incremental_binary::file_status_): Remove.
2962 (Sized_incremental_binary::input_objects_): New data member.
2963 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2964 references.
2965 (Sized_relobj_incr::invalid_address): Move to base class.
2966 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2967 class.
2968 (Sized_relobj_incr::do_output_section_offset): Likewise.
2969 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2970 (Sized_relobj_incr::section_offsets_): Likewise.
2971 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2972 function.
2973 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2974 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2975 with accessor function.
2976 (Sized_relobj_file::do_layout): Likewise.
2977 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2978 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2979 (Sized_relobj_file::compute_final_local_value): Replace refs to
2980 section_offsets_ with accessor function.
2981 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2982 * object.h (Relobj::Relobj): Initialize new data members.
2983 (Relobj::add_dyn_reloc): New function.
2984 (Relobj::first_dyn_reloc): New function.
2985 (Relobj::dyn_reloc_count): New function.
2986 (Relobj::first_dyn_reloc_): New data member.
2987 (Relobj::dyn_reloc_count_): New data member.
2988 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2989 references.
2990 (Sized_relobj::Address): New typedef.
2991 (Sized_relobj::invalid_address): Move here from child class.
2992 (Sized_relobj::Sized_relobj): Initialize new data members.
2993 (Sized_relobj::sized_relobj): New function.
2994 (Sized_relobj::is_output_section_offset_invalid): Move here from
2995 child class.
2996 (Sized_relobj::get_output_section_offset): Likewise.
2997 (Sized_relobj::local_has_got_offset): Likewise.
2998 (Sized_relobj::local_got_offset): Likewise.
2999 (Sized_relobj::set_local_got_offset): Likewise.
3000 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3001 (Sized_relobj::clear_got_offsets): New function.
3002 (Sized_relobj::section_offsets): Move here from child class.
3003 (Sized_relobj::do_output_section_offset): Likewise.
3004 (Sized_relobj::do_set_section_offset): Likewise.
3005 (Sized_relobj::Local_got_offsets): Likewise.
3006 (Sized_relobj::local_got_offsets_): Likewise.
3007 (Sized_relobj::section_offsets_): Likewise.
3008 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3009 references.
3010 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3011 class.
3012 (Sized_relobj_file::sized_relobj): New function
3013 (Sized_relobj_file::local_has_got_offset): Move to base class.
3014 (Sized_relobj_file::local_got_offset): Likewise.
3015 (Sized_relobj_file::set_local_got_offset): Likewise.
3016 (Sized_relobj_file::get_output_section_offset): Likewise.
3017 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3018 (Sized_relobj_file::do_output_section_offset): Likewise.
3019 (Sized_relobj_file::do_set_section_offset): Likewise.
3020 (Sized_relobj_file::Local_got_offsets): Likewise.
3021 (Sized_relobj_file::local_got_offsets_): Likewise.
3022 (Sized_relobj_file::section_offsets_): Likewise.
3023 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3024 (all constructors).
3025 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3026 (Output_reloc::get_symbol_index): Likewise.
3027 (Output_reloc::local_section_offset): Likewise.
3028 (Output_reloc::get_address): Likewise.
3029 (Output_reloc::symbol_value): Likewise.
3030 (Output_data_got::reserve_slot): Move to class definition.
3031 (Output_data_got::reserve_local): New function.
3032 (Output_data_got::reserve_slot_for_global): Remove.
3033 (Output_data_got::reserve_global): New function.
3034 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3035 (all constructors, two instantiations).
3036 (Output_reloc::get_relobj): New function (two instantiations).
3037 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3038 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3039 (Output_data_reloc::add_global): Adjust type of relobj.
3040 (Output_data_reloc::add_global_relative): Likewise.
3041 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3042 (Output_data_reloc::add_local): Likewise.
3043 (Output_data_reloc::add_local_relative): Likewise.
3044 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3045 (Output_data_reloc::add_local_section): Likewise.
3046 (Output_data_reloc::add_output_section): Likewise.
3047 (Output_data_reloc::add_absolute): Likewise.
3048 (Output_data_reloc::add_target_specific): Likewise.
3049 (Output_data_got::reserve_slot): Move definition here.
3050 (Output_data_got::reserve_local): New function.
3051 (Output_data_got::reserve_global): New function.
3052 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3053 section_offsets_ with accessor function.
3054 (Sized_relobj_file::write_sections): Likewise.
3055 (Sized_relobj_file::do_relocate_sections): Likewise.
3056 * target.h (Sized_target::reserve_local_got_entry): New function.
3057 (Sized_target::reserve_global_got_entry): New function.
3058 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3059 (Target_x86_64::reserve_global_got_entry): New function.
3060 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3061
4829d394
CC
30622011-05-23 Cary Coutant <ccoutant@google.com>
3063
3064 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3065 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3066 bit when checking got_type.
3067 * incremental.cc (Sized_incremental_binary::setup_readers):
3068 Store symbol table and string table locations; initialize bit vector
3069 of file status flags.
3070 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3071 unchanged files.
3072 (Sized_incremental_binary::do_process_got_plt): New function.
3073 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3074 (Output_section_incremental_inputs::set_final_data_size): Record
3075 file index for each input file.
3076 (Output_section_incremental_inputs::write_got_plt): Store file index
3077 instead of input entry offset for each GOT entry.
3078 * incremental.h
3079 (Incremental_input_entry::Incremental_input_entry): Initialize new
3080 data member.
3081 (Incremental_input_entry::set_offset): Store file index.
3082 (Incremental_input_entry::get_file_index): New function.
3083 (Incremental_input_entry::file_index_): New data member.
3084 (Incremental_binary::process_got_plt): New function.
3085 (Incremental_binary::do_process_got_plt): New function.
3086 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3087 data members.
3088 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3089 (Sized_incremental_binary::set_file_is_unchanged): New function.
3090 (Sized_incremental_binary::file_is_unchanged): New function.
3091 (Sized_incremental_binary::do_process_got_plt): New function.
3092 (Sized_incremental_binary::file_status_): New data member.
3093 (Sized_incremental_binary::main_symtab_loc_): New data member.
3094 (Sized_incremental_binary::main_strtab_loc_): New data member.
3095 * output.cc (Output_data_got::Got_entry::write): Add case
3096 RESERVED_CODE.
3097 (Output_data_got::add_global): Call add_got_entry.
3098 (Output_data_got::add_global_plt): Likewise.
3099 (Output_data_got::add_global_with_rel): Likewise.
3100 (Output_data_got::add_global_with_rela): Likewise.
3101 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3102 (Output_data_got::add_global_pair_with_rela): Likewise.
3103 (Output_data_got::add_local): Call add_got_entry.
3104 (Output_data_got::add_local_plt): Likewise.
3105 (Output_data_got::add_local_with_rel): Likewise.
3106 (Output_data_got::add_local_with_rela): Likewise.
3107 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3108 (Output_data_got::add_local_pair_with_rela): Likewise.
3109 (Output_data_got::reserve_slot): New function.
3110 (Output_data_got::reserve_slot_for_global): New function.
3111 (Output_data_got::add_got_entry): New function.
3112 (Output_data_got::add_got_entry_pair): New function.
3113 (Output_section::add_output_section_data): Edit FIXME.
3114 * output.h
3115 (Output_section_data_build::Output_section_data_build): New
3116 constructor with size parameter.
3117 (Output_data_space::Output_data_space): Likewise.
3118 (Output_data_got::Output_data_got): Initialize new data member; new
3119 constructor with size parameter.
3120 (Output_data_got::add_constant): Call add_got_entry.
3121 (Output_data_got::reserve_slot): New function.
3122 (Output_data_got::reserve_slot_for_global): New function.
3123 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3124 (Output_data_got::add_got_entry): New function.
3125 (Output_data_got::add_got_entry_pair): New function.
3126 (Output_data_got::free_list_): New data member.
3127 * target.h (Sized_target::init_got_plt_for_update): New function.
3128 (Sized_target::register_global_plt_entry): New function.
3129 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3130 Initialize new data member; call init; add constructor with PLT count.
3131 (Output_data_plt_x86_64::init): New function.
3132 (Output_data_plt_x86_64::add_relocation): New function.
3133 (Output_data_plt_x86_64::reserve_slot): New function.
3134 (Output_data_plt_x86_64::free_list_): New data member.
3135 (Target_x86_64::init_got_plt_for_update): New function.
3136 (Target_x86_64::register_global_plt_entry): New function.
3137 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3138 incremental updates.
3139 (Output_data_plt_x86_64::add_relocation): New function.
3140 * testsuite/object_unittest.cc (Object_test): Set default options.
3141
ec69d6da
ILT
31422011-05-16 Ian Lance Taylor <iant@google.com>
3143
3144 * options.h (class General_options): Make -i a synonym for -r.
3145
732e31de
ILT
31462011-05-16 Ian Lance Taylor <iant@google.com>
3147
3148 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3149
403676b5
CC
31502011-05-10 Cary Coutant <ccoutant@google.com>
3151
3152 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3153 strip_all (-s).
3154
5b7b7d6e
ILT
31552011-05-06 Ian Lance Taylor <iant@google.com>
3156
3157 * layout.cc (Layout::layout): If the output section flags change,
3158 update the ordering.
3159
f0f9babf
CC
31602011-04-25 Cary Coutant <ccoutant@google.com>
3161
3162 * incremental-dump.cc (dump_incremental_inputs): Print local
3163 symbol info for each input file.
3164 * incremental.cc
3165 (Output_section_incremental_inputs::set_final_data_size): Add local
3166 symbol info to input file entries in incremental info.
3167 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3168 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3169 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3170 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3171 implementation.
3172 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3173 (Sized_incr_relobj::do_relocate): Write the local symbols.
3174 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3175 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3176 Adjust size of input file header.
3177 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3178 (Incremental_inputs_reader::get_local_symbol_count): New function.
3179 (Incremental_inputs_reader::get_input_section): Adjust size of input
3180 file header.
3181 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3182 (Sized_incr_relobj::This): New typedef.
3183 (Sized_incr_relobj::sym_size): New const data member.
3184 (Sized_incr_relobj::Local_symbol): New struct.
3185 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3186 (Sized_incr_relobj::do_local_symbol_offset): New function.
3187 (Sized_incr_relobj::local_symbol_count_): New data member.
3188 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3189 (Sized_incr_relobj::local_symbol_index_): New data member.
3190 (Sized_incr_relobj::local_symbol_offset_): New data member.
3191 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3192 (Sized_incr_relobj::local_symbols_): New data member.
3193 * object.h (Relobj::output_local_symbol_count): New function.
3194 (Relobj::local_symbol_offset): New function.
3195 (Relobj::do_output_local_symbol_count): New function.
3196 (Relobj::do_local_symbol_offset): New function.
3197 (Sized_relobj::do_output_local_symbol_count): New function.
3198 (Sized_relobj::do_local_symbol_offset): New function.
3199
d0a9ace3
ILT
32002011-04-22 Vladimir Simonov <sv@sw.ru>
3201
3202 * descriptors.cc (set_close_on_exec): New function.
3203 (Descriptors::open): Use set_close_on_exec.
3204 * output.cc (S_ISLNK): Define if not defined.
3205
94a3fc8b
CC
32062011-04-22 Cary Coutant <ccoutant@google.com>
3207
3208 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3209 global symbol map.
3210 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3211 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3212 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3213 relocations.
3214 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3215 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3216 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3217 * incremental.h
3218 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3219 function.
3220 (Incremental_binary::apply_incremental_relocs): New function.
3221 (Incremental_binary::do_apply_incremental_relocs): New function.
3222 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3223 data member.
3224 (Sized_incremental_binary::add_global_symbol): New function.
3225 (Sized_incremental_binary::global_symbol): New function.
3226 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3227 (Sized_incremental_binary::symbol_map_): New data member.
3228 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3229 * target.h (Sized_target::apply_relocation): New function.
3230 * target-reloc.h (apply_relocation): New function.
3231 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3232
c87e4302
DK
32332011-04-22 Doug Kwan <dougkwan@google.com>
3234
3235 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3236 flag of a SHT_ARM_EXIDX section.
2e702c99 3237 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3238 * testsuite/Makefile.in: Regenerate.
3239 * testsuite/arm_exidx_test.s: New file.
3240 * testsuite/arm_exidx_test.sh: Same.
3241
e7782cf6
CC
32422011-04-20 Cary Coutant <ccoutant@google.com>
3243
3244 PR gold/12689
3245 * archive.h (Incremental_archive_entry::Archive_member):
3246 Initialize arg_serial_ (second constructor).
3247
308ecdc7
ILT
32482011-04-17 Ian Lance Taylor <iant@google.com>
3249
3250 * object.cc (Relocate_info::location): Simplify location string.
3251 * errors.cc (Errors::error_at_location): Don't print program
3252 name.
3253 (Errors::warning_at_location): Likewise.
3254 (Errors::undefined_symbol): Likewise.
3255 * testsuite/debug_msg.sh: Update accordingly.
3256
bec5b579
CC
32572011-04-14 Cary Coutant <ccoutant@google.com>
3258
3259 * gold/layout.cc (Layout::symtab_section_offset): New function.
3260 * gold/layout.h (Layout::symtab_section_offset): New function.
3261 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3262
88597d34
ILT
32632011-04-12 Ian Lance Taylor <iant@google.com>
3264
3265 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3266 with MREMAP_MAYMOVE.
3267 * output.h (class Output_file): Add map_is_allocated_ field.
3268 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3269 not available, provide stubs. If mremap is not available, #define
3270 it to gold_mremap.
3271 (MREMAP_MAYMOVE): Define if not defined.
3272 (Output_file::Output_file): Initialize map_is_allocated_.
3273 (Output_file::resize): Check map_is_allocated_.
3274 (Output_file::map_anonymous): If mmap fails, use malloc.
3275 (Output_file::unmap): Don't do anything for an anonymous map.
3276 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3277 is not available, provide stubs.
3278 (File_read::View::~View): Use free rather than delete[].
3279 (File_read::make_view): Use malloc rather than new[]. If mmap
3280 fails, use malloc.
3281 (File_read::find_or_make_view): Use malloc rather than new[].
3282 * gold.h: Remove HAVE_REMAP code.
3283 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3284 exists. Rename mremap to gold_mremap. If mmap is not available
3285 don't do anything.
3286 * configure, config.in: Rebuild.
3287
11e361bc
ILT
32882011-04-11 Ian Lance Taylor <iant@google.com>
3289
3290 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3291 initialize local variable v.
3292
cdc29364
CC
32932011-04-11 Cary Coutant <ccoutant@google.com>
3294
3295 * archive.cc (Archive::include_member): Adjust call to
3296 report_object.
3297 (Add_archive_symbols::run): Track argument serial numbers.
3298 (Lib_group::include_member): Likewise.
3299 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3300 * archive.h (Incremental_archive_entry::Archive_member):
3301 Initialize arg_serial_.
3302 (Archive_member::arg_serial_): New data member.
3303 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3304 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3305 incremental link.
3306 (Sized_dynobj::do_for_all_local_got_entries): New function.
3307 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3308 function.
3309 * fileread.cc (get_mtime): New function.
3310 * fileread.h (get_mtime): New function.
3311 * gold.cc (queue_initial_tasks): Check for incremental update.
3312 (process_incremental_input): New function.
3313 (queue_middle_tasks): Don't force valid target for incremental
3314 update.
3315 * incremental-dump.cc (find_input_containing_global): Adjust
3316 size of symbol info entry.
3317 (dump_incremental_inputs): Dump argument serial number and
3318 in_system_directory flag; bias shndx by 1; print symbol names
3319 when dumping per-file symbol lists; use new symbol info readers.
3320 * incremental.cc
3321 (Output_section_incremental_inputs:update_data_size): New function.
3322 (Sized_incremental_binary::setup_readers): Setup input readers
3323 for each input file; build maps for files added from libraries
3324 and scripts.
3325 (Sized_incremental_binary::check_input_args): New function.
3326 (Sized_incremental_binary::do_check_inputs): Build map of argument
3327 serial numbers to input arguments.
3328 (Sized_incremental_binary::do_file_has_changed): Rename
3329 do_file_is_unchanged to this; compare file modification times.
3330 (Sized_incremental_binary::do_init_layout): New function.
3331 (Sized_incremental_binary::do_reserve_layout): New function.
3332 (Sized_incremental_binary::do_get_input_reader): Remove.
3333 (Sized_incremental_binary::get_symtab_view): New function.
3334 (Incremental_checker::can_incrementally_link_output_file): Remove.
3335 (Incremental_inputs::report_command_line): Exclude --debug options.
3336 (Incremental_inputs::report_archive_begin): Add parameter; track
3337 argument serial numbers; don't put input file entry for archive
3338 before archive members.
3339 (Incremental_inputs::report_archive_end): Put input file entry
3340 for archive after archive members.
3341 (Incremental_inputs::report_object): Add parameter; track argument
3342 serial numbers and in_system_directory flag.
3343 (Incremental_inputs::report_script): Add parameter; track argument
3344 serial numbers.
3345 (Output_section_incremental_inputs::set_final_data_size): Adjust
3346 size of symbol info entry; check for forwarding symbols.
3347 (Output_section_incremental_inputs::write_input_files): Write
3348 in_system_directory flag and argument serial number.
3349 (Output_section_incremental_inputs::write_info_blocks): Map section
3350 indices between incremental info and original input file; store
3351 input section index for each symbol.
3352 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3353 change operator() to visit().
3354 (class Global_got_offset_visitor): Likewise.
3355 (class Global_symbol_visitor_got_plt):
3356 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3357 classes.
3358 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3359 (Sized_incr_relobj::do_read_symbols): New function.
3360 (Sized_incr_relobj::do_layout): New function.
3361 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3362 (Sized_incr_relobj::do_add_symbols): New function.
3363 (Sized_incr_relobj::do_should_include_member): New function.
3364 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3365 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3366 (Sized_incr_relobj::do_section_size): New function.
3367 (Sized_incr_relobj::do_section_name): New function.
3368 (Sized_incr_relobj::do_section_contents): New function.
3369 (Sized_incr_relobj::do_section_flags): New function.
3370 (Sized_incr_relobj::do_section_entsize): New function.
3371 (Sized_incr_relobj::do_section_address): New function.
3372 (Sized_incr_relobj::do_section_type): New function.
3373 (Sized_incr_relobj::do_section_link): New function.
3374 (Sized_incr_relobj::do_section_info): New function.
3375 (Sized_incr_relobj::do_section_addralign): New function.
3376 (Sized_incr_relobj::do_initialize_xindex): New function.
3377 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3378 (Sized_incr_relobj::do_read_relocs): New function.
3379 (Sized_incr_relobj::do_gc_process_relocs): New function.
3380 (Sized_incr_relobj::do_scan_relocs): New function.
3381 (Sized_incr_relobj::do_count_local_symbols): New function.
3382 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3383 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3384 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3385 (Sized_incr_relobj::do_relocate): New function.
3386 (Sized_incr_relobj::do_set_section_offset): New function.
3387 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3388 (Sized_incr_dynobj::do_read_symbols): New function.
3389 (Sized_incr_dynobj::do_layout): New function.
3390 (Sized_incr_dynobj::do_add_symbols): New function.
3391 (Sized_incr_dynobj::do_should_include_member): New function.
3392 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3393 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3394 (Sized_incr_dynobj::do_section_size): New function.
3395 (Sized_incr_dynobj::do_section_name): New function.
3396 (Sized_incr_dynobj::do_section_contents): New function.
3397 (Sized_incr_dynobj::do_section_flags): New function.
3398 (Sized_incr_dynobj::do_section_entsize): New function.
3399 (Sized_incr_dynobj::do_section_address): New function.
3400 (Sized_incr_dynobj::do_section_type): New function.
3401 (Sized_incr_dynobj::do_section_link): New function.
3402 (Sized_incr_dynobj::do_section_info): New function.
3403 (Sized_incr_dynobj::do_section_addralign): New function.
3404 (Sized_incr_dynobj::do_initialize_xindex): New function.
3405 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3406 (make_sized_incremental_object): New function.
3407 (Incremental_library::copy_unused_symbols): New function.
3408 (Incremental_library::do_for_all_unused_symbols): New function.
3409 * incremental.h (enum Incremental_input_flags): New type.
3410 (class Incremental_checker): Remove.
3411 (Incremental_input_entry::Incremental_input_entry): Add argument
3412 serial number.
3413 (Incremental_input_entry::arg_serial): New function.
3414 (Incremental_input_entry::set_is_in_system_directory): New function.
3415 (Incremental_input_entry::is_in_system_directory): New function.
3416 (Incremental_input_entry::arg_serial_): New data member.
3417 (Incremental_input_entry::is_in_system_directory_): New data member.
3418 (class Script_info): Move here from script.h.
3419 (Script_info::Script_info): Add filename parameter.
3420 (Script_info::filename): New function.
3421 (Script_info::filename_): New data member.
3422 (Incremental_script_entry::Incremental_script_entry): Add argument
3423 serial number.
3424 (Incremental_object_entry::Incremental_object_entry): Likewise.
3425 (Incremental_object_entry::add_input_section): Build list of input
3426 sections with map to original shndx.
3427 (Incremental_object_entry::get_input_section_index): New function.
3428 (Incremental_object_entry::shndx_): New data member.
3429 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3430 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3431 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3432 serial number.
3433 (Incremental_inputs::report_archive_begin): Likewise.
3434 (Incremental_inputs::report_object): Likewise.
3435 (Incremental_inputs::report_script): Likewise.
3436 (class Incremental_global_symbol_reader): New class.
3437 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3438 and store flags and input file type.
3439 (Incremental_input_entry_reader::arg_serial): New function.
3440 (Incremental_input_entry_reader::type): Extract type from flags.
3441 (Incremental_input_entry_reader::is_in_system_directory): New function.
3442 (Incremental_input_entry_reader::get_input_section_count): Call
3443 accessor function for type.
3444 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3445 function for type; adjust size of global symbol entry.
3446 (Incremental_input_entry_reader::get_global_symbol_count): Call
3447 accessor function for type.
3448 (Incremental_input_entry_reader::get_object_count): Likewise.
3449 (Incremental_input_entry_reader::get_object_offset): Likewise.
3450 (Incremental_input_entry_reader::get_member_count): Likewise.
3451 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3452 (Incremental_input_entry_reader::get_member_offset): Likewise.
3453 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3454 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3455 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3456 (Incremental_input_entry_reader::get_global_symbol_reader): New
3457 function.
3458 (Incremental_input_entry_reader::get_output_symbol_index): New
3459 function.
3460 (Incremental_input_entry_reader::type_): Remove.
3461 (Incremental_input_entry_reader::flags_): New data member.
3462 (Incremental_inputs_reader::input_file_offset): New function.
3463 (Incremental_inputs_reader::input_file_index): New function.
3464 (Incremental_inputs_reader::input_file): Call input_file_offset.
3465 (Incremental_inputs_reader::input_file_at_offset): New function.
3466 (Incremental_relocs_reader::get_r_type): Reformat.
3467 (Incremental_relocs_reader::get_r_shndx): Reformat.
3468 (Incremental_relocs_reader::get_r_offset): Reformat.
3469 (Incremental_relocs_reader::data): New function.
3470 (Incremental_binary::Incremental_binary): Initialize new data members.
3471 (Incremental_binary::check_inputs): Add cmdline parameter.
3472 (Incremental_binary::file_is_unchanged): Remove.
3473 (Input_reader::arg_serial): New function.
3474 (Input_reader::get_unused_symbol_count): New function.
3475 (Input_reader::get_unused_symbol): New function.
3476 (Input_reader::do_arg_serial): New function.
3477 (Input_reader::do_get_unused_symbol_count): New function.
3478 (Input_reader::do_get_unused_symbol): New function.
3479 (Incremental_binary::input_file_count): New function.
3480 (Incremental_binary::get_input_reader): Change signature to use
3481 index instead of filename.
3482 (Incremental_binary::file_has_changed): New function.
3483 (Incremental_binary::get_input_argument): New function.
3484 (Incremental_binary::get_library): New function.
3485 (Incremental_binary::get_script_info): New function.
3486 (Incremental_binary::init_layout): New function.
3487 (Incremental_binary::reserve_layout): New function.
3488 (Incremental_binary::output_file): New function.
3489 (Incremental_binary::do_check_inputs): New function.
3490 (Incremental_binary::do_file_is_unchanged): Remove.
3491 (Incremental_binary::do_file_has_changed): New function.
3492 (Incremental_binary::do_init_layout): New function.
3493 (Incremental_binary::do_reserve_layout): New function.
3494 (Incremental_binary::do_input_file_count): New function.
3495 (Incremental_binary::do_get_input_reader): Change signature.
3496 (Incremental_binary::input_args_map_): New data member.
3497 (Incremental_binary::library_map_): New data member.
3498 (Incremental_binary::script_map_): New data member.
3499 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3500 new data members.
3501 (Sized_incremental_binary::output_section): New function.
3502 (Sized_incremental_binary::inputs_reader): Add const.
3503 (Sized_incremental_binary::symtab_reader): Add const.
3504 (Sized_incremental_binary::relocs_reader): Add const.
3505 (Sized_incremental_binary::got_plt_reader): Add const.
3506 (Sized_incremental_binary::get_symtab_view): New function.
3507 (Sized_incremental_binary::Inputs_reader): New typedef.
3508 (Sized_incremental_binary::Input_entry_reader): New typedef.
3509 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3510 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3511 (Sized_incremental_binary::do_file_has_changed): New function.
3512 (Sized_incremental_binary::do_init_layout): New function.
3513 (Sized_incremental_binary::do_reserve_layout): New function.
3514 (Sized_input_reader::Inputs_reader): Remove.
3515 (Sized_input_reader::Input_entry_reader): Remove.
3516 (Sized_input_reader::do_arg_serial): New function.
3517 (Sized_input_reader::do_get_unused_symbol_count): New function.
3518 (Sized_input_reader::do_get_unused_symbol): New function.
3519 (Sized_incremental_binary::do_input_file_count): New function.
3520 (Sized_incremental_binary::do_get_input_reader): Change signature;
3521 use index instead of filename.
3522 (Sized_incremental_binary::section_map_): New data member.
3523 (Sized_incremental_binary::input_entry_readers_): New data member.
3524 (class Sized_incr_relobj): New class.
3525 (class Sized_incr_dynobj): New class.
3526 (make_sized_incremental_object): New function.
3527 (class Incremental_library): New class.
3528 * layout.cc (Free_list::num_lists): New static data member.
3529 (Free_list::num_nodes): New static data member.
3530 (Free_list::num_removes): New static data member.
3531 (Free_list::num_remove_visits): New static data member.
3532 (Free_list::num_allocates): New static data member.
3533 (Free_list::num_allocate_visits): New static data member.
3534 (Free_list::init): New function.
3535 (Free_list::remove): New function.
3536 (Free_list::allocate): New function.
3537 (Free_list::dump): New function.
3538 (Free_list::print_stats): New function.
3539 (Layout_task_runner::run): Resize output file for incremental updates.
3540 (Layout::Layout): Initialize new data members.
3541 (Layout::set_incremental_base): New function.
3542 (Layout::init_fixed_output_section): New function.
3543 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3544 incremental updates.
3545 (Layout::create_gold_note): Do not create gold note section for
3546 incremental updates.
3547 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3548 for incremental updates.
3549 (Layout::set_section_offsets): For incremental updates, allocate space
3550 from free list.
3551 (Layout::create_symtab_sections): Layout with offsets relative to
3552 start of section; for incremental updates, allocate space from free
3553 list.
3554 (Layout::create_shdrs): For incremental updates, allocate space from
3555 free list.
3556 (Layout::finish_dynamic_section): For incremental updates, do not
3557 check --as-needed (fixed in subsequent patch).
3558 * layout.h (class Free_list): New class.
3559 (Layout::set_incremental_base): New function.
3560 (Layout::incremental_base): New function.
3561 (Layout::init_fixed_output_section): New function.
3562 (Layout::allocate): New function.
3563 (Layout::incremental_base_): New data member.
3564 (Layout::free_list_): New data member.
3565 * main.cc (main): Print Free_list statistics.
3566 * object.cc (Relobj::finalize_incremental_relocs): Add
3567 clear_counts parameter; clear counts only when clear_counts is set.
3568 (Sized_relobj::Sized_relobj): Initialize new base class.
3569 (Sized_relobj::do_layout): Don't report special sections.
3570 (Sized_relobj::do_for_all_local_got_entries): New function.
3571 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3572 symtab_off to all symbol table offsets.
3573 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3574 * object.h (class Got_offset_list): Move to top of file.
3575 (Object::Object): Allow case where input_file == NULL.
3576 (Object::~Object): Likewise.
3577 (Object::input_file): Assert that input_file != NULL.
3578 (Object::lock): Allow case where input_file == NULL.
3579 (Object::unlock): Likewise.
3580 (Object::is_locked): Likewise.
3581 (Object::token): Likewise.
3582 (Object::release): Likewise.
3583 (Object::is_incremental): New function.
3584 (Object::get_mtime): New function.
3585 (Object::for_all_local_got_entries): New function.
3586 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3587 (Object::set_is_in_system_directory): New function.
3588 (Object::is_in_system_directory): New function.
3589 (Object::do_is_incremental): New function.
3590 (Object::do_get_mtime): New function.
3591 (Object::do_for_all_local_got_entries): New function.
3592 (Object::is_in_system_directory_): New data member.
3593 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3594 (class Sized_relobj_base): New class.
3595 (class Sized_relobj): Derive from Sized_relobj_base.
3596 (class Sized_relobj::Symbols): Redeclare from base class.
3597 (class Sized_relobj::local_got_offset_list): Remove.
3598 (class Sized_relobj::Output_sections): Redeclare from base class.
3599 (class Sized_relobj::do_for_all_local_got_entries): New function.
3600 (class Sized_relobj::write_local_symbols): Add offset parameter.
3601 (class Sized_relobj::local_symbol_offset_): Update comment.
3602 (class Sized_relobj::local_dynsym_offset_): Update comment.
3603 * options.cc (Input_arguments::add_file): Remove const.
3604 * options.h (Input_file_argument::Input_file_argument):
3605 Initialize arg_serial_ (all constructors).
3606 (Input_file_argument::set_arg_serial): New function.
3607 (Input_file_argument::arg_serial): New function.
3608 (Input_file_argument::arg_serial_): New data member.
3609 (Input_arguments::Input_arguments): Initialize file_count_.
3610 (Input_arguments::add_file): Remove const.
3611 (Input_arguments::number_of_input_files): New function.
3612 (Input_arguments::file_count_): New data member.
3613 (Command_line::number_of_input_files): Call
3614 Input_arguments::number_of_input_files.
3615 * output.cc (Output_segment_headers::Output_segment_headers):
3616 Set current size.
3617 (Output_section::Input_section::current_data_size): New function.
3618 (Output_section::Output_section): Initialize new data members.
3619 (Output_section::add_input_section): Don't do merge sections for
3620 an incremental link; allocate space from free list for an
3621 incremental update.
3622 (Output_section::add_output_section_data): Allocate space from
3623 free list for an incremental update.
3624 (Output_section::update_data_size): New function.
3625 (Output_section::set_fixed_layout): New function.
3626 (Output_section::reserve): New function.
3627 (Output_segment::set_section_addresses): Remove const.
3628 (Output_segment::set_section_list_addresses): Remove const; allocate
3629 space from free list for an incremental update.
3630 (Output_segment::set_offset): Adjust size of RELRO segment for an
3631 incremental update.
3632 * output.h (Output_data::current_data_size): Move here from
3633 child classes.
3634 (Output_data::pre_finalize_data_size): New function.
3635 (Output_data::update_data_size): New function.
3636 (Output_section_headers::update_data_size): new function.
3637 (Output_section_data_build::current_data_size): Move to Output_data.
3638 (Output_data_strtab::update_data_size): New function.
3639 (Output_section::current_data_size): Move to Output_data.
3640 (Output_section::set_fixed_layout): New function.
3641 (Output_section::has_fixed_layout): New function.
3642 (Output_section::reserve): New function.
3643 (Output_section::update_data_size): New function.
3644 (Output_section::has_fixed_layout_): New data member.
3645 (Output_section::free_list_): New data member.
3646 (Output_segment::set_section_addresses): Remove const.
3647 (Output_segment::set_section_list_addresses): Remove const.
3648 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3649 New function.
3650 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3651 New function.
3652 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3653 parameter when calling Add_symbols constructor; store argument
3654 serial number for members of a lib group.
3655 (Add_symbols::locks): Allow case where token == NULL.
3656 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3657 (Read_member::~Read_member): New function.
3658 (Read_member::is_runnable): New function.
3659 (Read_member::locks): New function.
3660 (Read_member::run): New function.
3661 (Check_script::~Check_script): New function.
3662 (Check_script::is_runnable): New function.
3663 (Check_script::locks): New function.
3664 (Check_script::run): New function.
3665 (Check_library::~Check_library): New function.
3666 (Check_library::is_runnable): New function.
3667 (Check_library::locks): New function.
3668 (Check_library::run): New function.
3669 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3670 (Add_symbols::library_): New data member.
3671 (class Read_member): New class.
3672 (class Check_script): New class.
3673 (class Check_library): New class.
3674 * reloc.cc (Read_relocs::is_runnable): Allow case where
3675 token == NULL.
3676 (Read_relocs::locks): Likewise.
3677 (Scan_relocs::locks): Likewise.
3678 (Relocate_task::locks): Likewise.
3679 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3680 to clear counters.
3681 (Sized_relobj::incremental_relocs_scan): Fix comment.
3682 (Sized_relobj::do_relocate): Pass output file offset to
3683 write_local_symbols.
3684 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3685 from class declaration.
3686 * script.cc (read_input_script): Allocate Script_info; pass
3687 argument serial number to report_script.
3688 * script.h (class Script_info): Move to incremental.h.
3689 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3690 * symtab.h (Symbol_table::add_from_incrobj): New function.
3691 (Symbol_table::set_file_offset): New function.
3692
b961d0d7
CC
36932011-04-05 Cary Coutant <ccoutant@google.com>
3694
3695 * incremental-dump.cc (dump_incremental_inputs): Change signature
3696 to take a Sized_incremental_binary; change caller. Use readers
3697 in Sized_incremental_binary.
3698 * incremental.cc
3699 (Sized_incremental_binary::find_incremental_inputs_sections):
3700 Rename do_find_incremental_inputs_sections to this.
3701 (Sized_incremental_binary::setup_readers): New function.
3702 (Sized_incremental_binary::do_check_inputs): Check
3703 has_incremental_info_ flag; move setup code to setup_readers;
3704 use input readers.
3705 (Sized_incremental_binary::do_file_is_unchanged): New function.
3706 (Sized_incremental_binary::do_get_input_reader): New function.
3707 * incremental.h (class Incremental_binary): Move to end of file.
3708 (Incremental_binary::file_is_unchanged): New function.
3709 (Incremental_binary::do_file_is_unchanged): New function.
3710 (Incremental_binary::Input_reader): New class.
3711 (Incremental_binary::get_input_reader): New function.
3712 (class Sized_incremental_binary): Move to end of file.
3713 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3714 input section reader classes.
3715 (Sized_incremental_binary::has_incremental_info): New function.
3716 (Sized_incremental_binary::inputs_reader): New function.
3717 (Sized_incremental_binary::symtab_reader): New function.
3718 (Sized_incremental_binary::relocs_reader): New function.
3719 (Sized_incremental_binary::got_plt_reader): New function.
3720 (Sized_incremental_binary::do_file_is_unchanged): New function.
3721 (Sized_incremental_binary::Sized_input_reader): New class.
3722 (Sized_incremental_binary::get_input_reader): New function.
3723 (Sized_incremental_binary::find_incremental_inputs_sections):
3724 Rename do_find_incremental_inputs_sections to this.
3725 (Sized_incremental_binary::setup_readers): New function.
3726 (Sized_incremental_binary::has_incremental_info_): New data member.
3727 (Sized_incremental_binary::inputs_reader_): New data member.
3728 (Sized_incremental_binary::symtab_reader_): New data member.
3729 (Sized_incremental_binary::relocs_reader_): New data member.
3730 (Sized_incremental_binary::got_plt_reader_): New data member.
3731 (Sized_incremental_binary::current_input_file_): New data member.
3732
a869183f
PP
37332011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3734
3735 PR gold/12640
3736 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3737 violation.
3738
37392011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3740
3741 * archive.cc (Archive::include_member): Adjust call to report_object.
3742 (Add_archive_symbols::run): Add script_info to call to
3743 report_archive_begin.
3744 (Lib_group::include_member): Adjust call to report_object.
3745 (Add_lib_group_symbols::run): Adjust call to report_object.
3746 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3747 blocks. Add object count for script input files.
3748 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3749 script_info parameter; change all callers.
3750 (Incremental_inputs::report_object): Add script_info parameter;
3751 change all callers.
3752 (Incremental_inputs::report_script): Store backpointer to
3753 incremental info entry.
3754 (Output_section_incremental_inputs::set_final_data_size): Record
3755 additional information for scripts.
3756 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3757 * incremental.h (Incremental_script_entry::add_object): New function.
3758 (Incremental_script_entry::get_object_count): New function.
3759 (Incremental_script_entry::get_object): New function.
3760 (Incremental_script_entry::objects_): New data member; adjust
3761 constructor.
3762 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3763 (Incremental_inputs::report_object): Add script_info parameter.
3764 (Incremental_inputs_reader::get_object_count): New function.
3765 (Incremental_inputs_reader::get_object_offset): New function.
3766 * options.cc (Input_arguments::add_file): Return reference to
3767 new input argument.
3768 * options.h (Input_argument::set_script_info): New function.
3769 (Input_argument::script_info): New function.
3770 (Input_argument::script_info_): New data member; adjust all
3771 constructors.
3772 (Input_file_group::add_file): Return reference to new input argument.
3773 (Input_file_lib::add_file): Likewise.
3774 (Input_arguments::add_file): Likewise.
3775 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3776 * script.cc (Parser_closure::Parser_closure): Add script_info
3777 parameter; adjust all callers.
3778 (Parser_closure::script_info): New function.
3779 (Parser_closure::script_info_): New data member.
3780 (read_input_script): Report scripts earlier to incremental info.
3781 (script_add_file): Set script_info in Input_argument.
3782 (script_add_library): Likewise.
3783 * script.h (Script_options::Script_info): Rewrite class.
3784
a869183f 37852011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3786
3787 * archive.cc (Library_base::should_include_member): Move
3788 method here from class Archive.
3789 (Archive::Archive): Initialize base class.
3790 (Archive::should_include_member): Move to base class.
3791 (Archive::do_for_all_unused_symbols): New function.
3792 (Add_archive_symbols::run): Remove redundant access to
3793 incremental_inputs.
3794 (Lib_group::Lib_group): Initialize base class.
3795 (Lib_group::do_filename): New function.
3796 (Lib_group::include_member): Pass pointer to Lib_group to
3797 report_object.
3798 (Lib_group::do_for_all_unused_symbols): New function.
3799 (Add_lib_group_symbols::run): Report archive information for
3800 incremental links.
3801 * archive.h (class Library_base): New base class.
3802 (class Archive): Derive from Library_base.
3803 (Archive::filename): Move to base class.
3804 (Archive::set_incremental_info): Likewise.
3805 (Archive::incremental_info): Likewise.
3806 (Archive::Should_include): Likewise.
3807 (Archive::should_include_member): Likewise.
3808 (Archive::Armap_entry): Remove.
3809 (Archive::Unused_symbol_iterator): Remove.
3810 (Archive::unused_symbols_begin): Remove.
3811 (Archive::unused_symbols_end): Remove.
3812 (Archive::do_filename): New function.
3813 (Archive::do_get_mtime): New function.
3814 (Archive::do_for_all_unused_symbols): New function.
3815 (Archive::task_): Move to base class.
3816 (Archive::incremental_info_): Likewise.
3817 (class Lib_group): Derive from Library_base.
3818 (Lib_group::do_filename): New function.
3819 (Lib_group::do_get_mtime): New function.
3820 (Lib_group::do_for_all_unused_symbols): New function.
3821 (Lib_group::task_): Move to base class.
3822 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3823 function.
3824 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3825 function.
3826 * incremental.cc (Incremental_inputs::report_archive_begin):
3827 Use Library_base; call library's get_mtime; add incremental inputs
3828 entry before members.
3829 (class Unused_symbol_visitor): New class.
3830 (Incremental_inputs::report_archive_end): Use Library_base; use
3831 visitor class to record unused symbols; don't add incremental inputs
3832 entry after members.
3833 (Incremental_inputs::report_object): Use Library_base.
3834 * incremental.h
3835 (Incremental_archive_entry::Incremental_archive_entry): Remove
3836 unused Archive parameter.
3837 (Incremental_inputs::report_archive_begin): Use Library_base.
3838 (Incremental_inputs::report_archive_end): Likewise.
3839 (Incremental_inputs::report_object): Likewise.
3840 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3841 function.
3842 * object.h (Object::for_all_global_symbols): New function.
3843 (Object::do_for_all_global_symbols): New function.
3844 (Sized_relobj::do_for_all_global_symbols): New function.
3845 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3846 function.
3847 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3848 function.
3849
61ab3e40
ILT
38502011-03-27 Ian Lance Taylor <iant@google.com>
3851
3852 * archive.cc (Archive::interpret_header): Return -1 if something
3853 goes wrong. Change callers accordingly.
3854
30e1f9e6
CC
38552011-03-25 Cary Coutant <ccoutant@google.com>
3856
3857 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3858 * testsuite/Makefile.in: Regenerate.
3859
9370ce59 38602011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3861
3862 * plugin.cc (get_view): New.
3863 (Plugin::load): Pass get_view to the plugin.
3864 (Plugin_manager::get_view): New.
3865
9312bb0a
ILT
38662011-03-21 Ian Lance Taylor <iant@google.com>
3867
3868 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3869 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3870
7e12ba9e
ST
38712011-03-21 Sriraman Tallam <tmsriram@google.com>
3872
3873 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3874 Change == to -eq.
3875 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3876 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3877 Change == to -eq.
3878 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3879 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3880
fd7a005d
ILT
38812011-03-14 Ian Lance Taylor <iant@google.com>
3882
3883 * script-sections.cc (Sort_output_sections::script_compare):
3884 Rename from is_before, change return type.
3885 (Sort_output_sections::operator()): Adjust accordingly.
3886
ed16fd1b
ILT
38872011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3888
3889 PR gold/12572
3890 * testsuite/odr_violation2.cc: Add comment to make all error line
3891 numbers double digits.
3892 * testsuite/debug_msg.sh: Adjust expected errors.
3893
71ff8986
ILT
38942011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3895
3896 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3897 but mark earlier ones as non-canonical
3898 (offset_to_iterator): Update search target and example
3899 (do_addr2line): Return extra lines in a vector*
3900 (format_file_lineno): Extract from do_addr2line
3901 (one_addr2line): Add vector* out-param
3902 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3903 when a lineno entry appeared last for its instruction
3904 (Dwarf_line_info): Add vector* out-param
3905 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3906 * symtab.cc (Odr_violation_compare): Include the lineno in the
3907 comparison again.
3908 (linenos_from_loc): New. Combine the canonical line for an
3909 address with its other lines.
3910 (True_if_intersect): New. Helper functor to make
3911 std::set_intersection a query.
3912 (detect_odr_violations): Compare sets of lines instead of just
3913 one line for each function. This became less deterministic, but
3914 has fewer false positives.
3915 * symtab.h: Declarations.
3916 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3917 mix an optimized and non-optimized object in the same binary
3918 (odr_violation2.so): Same.
3919 * testsuite/Makefile.in: Regenerate from Makefile.am.
3920 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3921 * testsuite/debug_msg.sh: Update line numbers and add
3922 assertions.
3923 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3924 non-optimized context.
3925 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3926 isn't inlined, and use OdrDerived in an optimized context.
3927 * testsuite/odr_header1.h: Defines OdrDerived, where
3928 optimization will change the
3929 first-instruction-in-the-destructor's file and line number.
3930 * testsuite/odr_header2.h: Defines OdrBase.
3931
a19fefdc
ILT
39322011-03-09 Ian Lance Taylor <iant@google.com>
3933
3934 * fileread.cc (File_read::clear_views): Don't delete the whole
3935 file view.
3936
ecb351e9
ILT
39372011-03-08 Ian Lance Taylor <iant@google.com>
3938
3939 PR gold/12525
3940 * fileread.cc: #include <climits>.
3941 (GOLD_IOV_MAX): Define.
3942 (File_read::read_multiple): Limit number of entries by iov_max.
3943 * fileread.h (class File_read): Always set max_readv_entries to
3944 128.
3945
b821d13c
ILT
39462011-03-07 Ian Lance Taylor <iant@google.com>
3947
3948 PR gold/12525
3949 * options.h (class General_options): Add -dy and -dn.
3950
89243142
CC
39512011-03-02 Cary Coutant <ccoutant@google.com>
3952
3953 * testsuite/script_test_9.t: Add TLS segment.
3954
d0773f31
ILT
39552011-03-02 Simon Baldwin <simonb@google.com>
3956
3957 * configure.ac: Add check for gnu_indirect_function support in
3958 the toolchain building binutils.
3959 * configure: Rebuild.
3960
9370ce59 39612011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3962
3963 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3964 plugin only symbols.
3965 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3966 in plugin files as not needed in the symbol table.
3967
4cf7a849
ST
39682011-02-11 Sriraman Tallam <tmsriram@google.com>
3969
3970 * output.cc (Output_section::add_input_section): Delay fill
3971 generation for section ordering.
3972
b578bd7d
ILT
39732011-02-09 Ian Lance Taylor <iant@google.com>
3974
3975 PR gold/12316
3976 * object.h (class Sized_relobj): Remove clear_local_symbols.
3977 * reloc.cc (Sized_relobj::do_relocate): Don't call
3978 clear_local_symbols.
3979
9370ce59 39802011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3981
3982 * plugin.cc (is_visible_from_outside): Return true for symbols
3983 in the -u option.
3984
55382fb7
ILT
39852011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3986
3987 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3988 filename.
3989
4e271fff
ST
39902011-02-02 Sriraman Tallam <tmsriram@google.com>
3991
3992 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3993 to std::string.
4e271fff 3994 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3995 section_name to be std::string.
4e271fff
ST
3996 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3997
d433c3ac
ILT
39982011-01-25 Ian Lance Taylor <iant@google.com>
3999
4000 * script.cc (script_add_extern): Rewrite to use
4001 add_symbol_reference.
4002
880473a6
DK
40032011-01-25 Doug Kwan <dougkwan@google.com>
4004
d433c3ac 4005 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4006
f30f86fa
ILT
40072011-01-24 Ian Lance Taylor <iant@google.com>
4008
4009 * options.h (class General_options): Accept
4010 --no-detect-odr-violations.
4011
8e51a0b9
ILT
40122011-01-24 Ian Lance Taylor <iant@google.com>
4013
4014 * version.cc (version_string): Bump to 1.11.
4015
0f3b89d8
ILT
40162011-01-24 Ian Lance Taylor <iant@google.com>
4017
4018 * plugin.cc (class Plugin_rescan): Define new class.
4019 (Plugin_manager::claim_file): Set any_claimed_.
4020 (Plugin_manager::save_archive): New function.
4021 (Plugin_manager::save_input_group): New function.
4022 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4023 necessary.
4024 (Plugin_manager::new_undefined_symbol): New function.
4025 (Plugin_manager::rescan): New function.
4026 (Plugin_manager::rescannable_defines): New function.
4027 (Plugin_manager::add_input_file): Set any_added_.
4028 * plugin.h (class Plugin_manager): define new fields rescannable_,
4029 undefined_symbols_, any_claimed_, and any_added_. Declare
4030 Plugin_rescan as friend. Declare new functions.
4031 (Plugin_manager::Rescannable): Define type.
4032 (Plugin_manager::Rescannable_list): Define type.
4033 (Plugin_manager::Undefined_symbol_list): Define type.
4034 (Plugin_manager::Plugin_manager): Initialize new fields.
4035 * archive.cc (Archive::defines_symbol): New function.
4036 (Add_archive_symbols::run): Pass archive to plugins if any.
4037 * archive.h (class Archive): Declare defines_symbol.
4038 * readsyms.cc (Input_group::~Input_group): New function.
4039 (Finish_group::run): Pass input_group to plugins if any.
4040 * readsyms.h (class Input_group): Declare destructor.
4041 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4042 any.
4043
3bb951e5
ILT
40442011-01-10 Ian Lance Taylor <iant@google.com>
4045
4046 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4047 section as relro.
4048 (Layout::set_segment_offsets): Reset increase_relro before calling
4049 set_section_addresses a second time.
4050
0aa45fac
CC
40512011-01-04 Cary Coutant <ccoutant@google.com>
4052
4053 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4054 sections before NOBITS sections.
4055
0db46eb4
L
40562011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4057
4058 * version.cc (print_version): Update copyright to 2011.
4059
829c9745
CC
40602010-12-23 Cary Coutant <ccoutant@google.com>
4061
4062 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4063 of OS to this->add. Add OD parameter to second form of the function.
4064
7500420b
ILT
40652010-12-20 Ian Lance Taylor <iant@google.com>
4066
4067 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4068 second of two consecutive entries with same offset.
4069
f8e9a930
RW
40702010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4071
4072 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4073 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4074 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4075 to avoid unneeded links against $(LDADD).
4076 * testsuite/Makefile.in: Regenerate.
4077
2fbb4320
ILT
40782010-12-15 Ian Lance Taylor <iant@google.com>
4079
4080 PR gold/12324
4081 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4082 for R_X86_64_32 and R_X86_64_PC32.
4083 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4084 ver_matching_def_pic.o.
4085 (ver_matching_def_pic.o): New target.
4086
fedb228d
RW
40872010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4088
4089 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4090 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4091 Move definition before File_read::View member definitions.
4092 (File_read::View::~View): Initialize and hold lock before
4093 updating current_mapped_bytes.
4094
9b547ce6
RW
40952010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4096
4097 * dwarf_reader.cc: Remove outdated comment.
4098 * gold-threads.cc: Fix typo in error message.
4099 * archive.cc: Fix typos in comments.
4100 * archive.h: Likewise.
4101 * arm-reloc-property.cc: Likewise.
4102 * arm-reloc-property.h: Likewise.
4103 * arm-reloc.def: Likewise.
4104 * arm.cc: Likewise.
4105 * attributes.h: Likewise.
4106 * cref.cc: Likewise.
4107 * ehframe.cc: Likewise.
4108 * fileread.h: Likewise.
4109 * gold.h: Likewise.
4110 * i386.cc: Likewise.
4111 * icf.cc: Likewise.
4112 * incremental.h: Likewise.
4113 * int_encoding.cc: Likewise.
4114 * layout.h: Likewise.
4115 * main.cc: Likewise.
4116 * merge.h: Likewise.
4117 * object.cc: Likewise.
4118 * object.h: Likewise.
4119 * options.cc: Likewise.
4120 * readsyms.cc: Likewise.
4121 * reduced_debug_output.cc: Likewise.
4122 * reloc.cc: Likewise.
4123 * script-sections.cc: Likewise.
4124 * sparc.cc: Likewise.
4125 * symtab.h: Likewise.
4126 * target-reloc.h: Likewise.
4127 * target.cc: Likewise.
4128 * target.h: Likewise.
4129 * timer.cc: Likewise.
4130 * timer.h: Likewise.
4131 * x86_64.cc: Likewise.
4132
83e17bd5
CC
41332010-12-09 Cary Coutant <ccoutant@google.com>
4134
4135 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4136 stack.
4137 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4138 parameter; change all callers.
4139 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4140 * options.h (warn_execstack): New option.
4141
017257f8
DK
41422010-12-07 Doug Kwan <dougkwan@google.com>
4143
4144 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4145 like function call relocations.
4146
c20cbc06
ILT
41472010-12-07 Ian Lance Taylor <iant@google.com>
4148
4149 * archive.cc (Archive::get_elf_object_for_member): Permit
4150 punconfigured to be NULL.
4151 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4152 (Archive::include_member): Pass NULL to get_elf_object_for_member
4153 if we searched for the archive and this is the first included
4154 object.
4155
4dbfafcc
ILT
41562010-12-01 Ian Lance Taylor <iant@google.com>
4157
4158 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4159 track_relocs_type_ field.
4160 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4161 Set track_relocs_type_.
4162 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4163 contents when using RELA relocs.
4164 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4165 reloc_map_.
4166 * reloc.cc (Track_relocs::next_addend): New function.
4167 * reloc.h (class Track_relocs): Declare next_addend.
4168
e5e19edd
ILT
41692010-12-01 Ian Lance Taylor <iant@google.com>
4170
4171 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4172 virtual destructor.
4173
9a5ce24c
ILT
41742010-12-01 Ian Lance Taylor <iant@google.com>
4175
4176 * README: Update compilers known to work and fail.
4177
c7791212
NC
41782010-11-23 Matthias Klose <doko@ubuntu.com>
4179
4180 * configure.in: For --enable-gold, handle value `default' instead of
4181 `both*'. Always install ld as ld.bfd, install as ld if gold is
4182 not the default.
4183 * configure: Regenerate.
4184
0ad220c9
DK
41852010-11-18 Doug Kwan <dougkwan@google.com>
4186
4187 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4188 and right_alignment to be zero. Store result alignment only if it is
4189 greater than existing alignment.
4190
ab8056e0
CC
41912010-11-16 Cary Coutant <ccoutant@google.com>
4192
4193 PR gold/12220
4194 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4195 Check for ".zdebug_line".
4196
fd064a5b
CC
41972010-11-16 Doug Kwan <dougkwan@google.com>
4198 Cary Coutant <ccoutant@google.com>
4199
4200 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4201 by reference; adjust all callers.
4202 * output.cc (Output_segment::set_section_addresses): Adjust references
4203 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4204 list is empty.
4205 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4206 end at page boundary.
4207
6fc6ea19
CC
42082010-11-16 Cary Coutant <ccoutant@google.com>
4209
4210 PR gold/12220
4211 * layout.cc (Layout::choose_output_section): Transform names of
4212 compressed sections even when using a script with a SECTIONS clause.
4213 (Layout::output_section_name): Remove code to transform
4214 compressed debug section names.
4215 * output.cc (Output_section::add_input_section): Use uncompressed
4216 section size when tracking input sections.
4217
95a2c8d6
RS
42182010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4219
4220 * symtab.h (Symbol::NON_PIC_REF): Remove.
4221 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4222 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4223 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4224 (Symbol::use_plt_offset): Take a flags argument and pass it
4225 directly to needs_dynamic_reloc. Restrict check for undefined
4226 weak symbols to function calls.
4227 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4228 (Target_arm::Scan::global): Use it.
4229 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4230 (Target_arm::Relocate::relocate): Likewise.
4231 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4232 parameter with an r_type parameter. Use get_reference_flags
4233 to get the flags.
4234 (Target_arm::Relocate::relocate): Update accordingly.
4235 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4236 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4237 (Target_i386::Scan::global): Likewise.
4238 (Target_i386::Relocate::relocate): Likewise.
4239 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4240 parameter with an r_type parameter. Use get_reference_flags
4241 to get the flags.
4242 (Target_i386::Relocate::relocate): Update accordingly.
4243 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4244 (Target_powerpc::Scan::global): Use it.
4245 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4246 (Target_powerpc::Relocate::relocate): Likewise.
4247 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4248 (Target_sparc::Scan::global): Use it.
4249 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4250 (Target_sparc::Relocate::relocate): Likewise.
4251 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4252 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4253 (Target_x86_64::Scan::global): Likewise.
4254 (Target_x86_64::Relocate::relocate): Likewise.
4255
f625ae50
DK
42562010-11-08 Doug Kwan <dougkwan@google.com>
4257 Cary Coutant <ccoutant@google.com>
4258
4259 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4260 (Arm_exidx_merge_section::section_contents_): New data member.
4261 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4262 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4263 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4264 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4265 in parameters instead of calling Object::section_contents without
4266 locking.
4267 (Arm_output_section::group_section): New parameter TASK. Pass it
4268 to callees that need locking objects.
4269 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4270 to lock EXIDX input sections. Fix a formatting issue. Call
4271 Arm_exidx_merged_section::build_contents to create merged section
4272 contents.
4273 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4274 to lock object of stub table owner.
4275 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4276 TEXT_SIZE to initialize data member TEXT_SIZE_.
4277 (Arm_exidx_input_section::addralign): Fix typo in comment.
4278 (Arm_exidx_input_section::text_size): New method.
4279 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4280 that require locking objects. Lock objects before scanning for stubs
4281 and updating local symbols.
4282 (Arm_input_section<big_endian>::init): Copy contents of original
4283 input section.
2e702c99 4284 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4285 original input section instead of calling Object::section_contents
4286 without locking.
4287 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4288 size without calling Object::section_size().
4289 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4290 for size. Allocate a buffer for merged EXIDX entries.
4291 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4292 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4293 building code to Arm_exidx_merged_section::build_contetns. Write
4294 out contetns in buffer instead of building it on the fly.
4295 (Arm_relobj::make_exidx_input_section): Also pass text section size
4296 to Arm_exidx_input_section constructor.
4297 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4298 (Arm_dynobj::do_read_symbols): Fix memory leak.
4299 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4300 * target.h: (class Task): Add forward declaration.
4301 (Target::relax): Add new parameter TASK and pass it to
4302 Target::do_relax().
4303 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4304
5f9bcf58
CC
43052010-11-05 Cary Coutant <ccoutant@google.com>
4306
4307 PR gold/10708
4308 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4309 object when reading from the file.
4310 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4311 second layout pass.
4312 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4313 when reading section contents.
4314 (get_section_contents): Likewise.
4315 (icf::find_identical_sections): Likewise.
4316 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4317 object when reading from the file.
4318 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4319 the object when doing deferred section layout.
4320
e597fa08
NC
43212010-11-03 Nick Clifton <nickc@redhat.com>
4322
4323 PR gold/12001
4324 * script.h (class Symbol_assignment: name): New member. Returns
4325 the name of the symbol.
4326 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4327 Returns true if the given symbol name is on the list of
4328 assignments wating to be processed.
4329 * archive.cc (should_incldue_member): If the symbol is undefined,
4330 check to see if it is on the list of symbols pending assignment.
4331
3f9a3278
ILT
43322010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4333
4334 * script-sections.cc (Script_sections::find_memory_region): Check
4335 for a NULL output section pointer.
4336
d06fb4d1
DK
43372010-10-29 Doug Kwan <dougkwan@google.com>
4338
4339 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4340 Output_section::add_relaxed_input_section.
4341 * output.cc (Output_section::add_relaxed_input_section): Add new
4342 arguments LAYOUT and NAME. Set section order index.
4343 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4344 Copy section order index.
4345 * output.h (Output_section::add_relaxed_input_section): Add new
4346 arguments LAYOUT and NAME.
4347
90e24de5
ILT
43482010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4349
4350 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4351 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4352 * testsuite/Makefile.in: Regenerate.
4353
c9484ea5
DK
43542010-10-20 Doug Kwan <dougkwan@google.com>
4355
4356 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4357 without SHF_LINK_ORDER flags.
4358 * layout.cc (Layout::choose_output_section): Do not filter
4359 SHF_LINK_ORDER flag in a relocatable link.
4360
5bc2f5be
CC
43612010-10-17 Cary Coutant <ccoutant@google.com>
4362
4363 * output.h (Output_segment::set_section_addresses): Change function
4364 signature. Update all callers.
4365 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4366 sections.
4367 (Output_segment::set_section_addresses): Align after last TLS
4368 section. Add padding before last relro section instead of after.
4369
0c91cf04
DK
43702010-10-17 Doug Kwan <dougkwan@google.com>
4371
4372 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4373 GOT output section to be writable.
4374
8c21d9d3
CC
43752010-10-14 Cary Coutant <ccoutant@google.com>
4376
4377 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4378 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4379 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4380 mode.
4381 * incremental.cc (report_command_line): Ignore all forms of
4382 --incremental.
4383 * layout.cc (Layout::Layout): Check parameters for incremental link
4384 mode.
4385 * options.cc (General_options::parse_incremental): New function.
4386 (General_options::parse_no_incremental): New function.
4387 (General_options::parse_incremental_full): New function.
4388 (General_options::parse_incremental_update): New function.
4389 (General_options::incremental_mode_): New data member.
4390 (General_options::finalize): Check incremental_mode_.
4391 * options.h (General_options): Update help text for --incremental.
4392 Add --no-incremental, --incremental-full, --incremental-update.
4393 (General_options::Incremental_mode): New enum type.
4394 (General_options::incremental_mode): New function.
4395 (General_options::incremental_mode_): New data member.
4396 * parameters.cc (Parameters::incremental_mode_): New data member.
4397 (Parameters::set_options): Set incremental_mode_.
4398 (Parameters::set_incremental_full): New function.
4399 (Parameters::incremental): New function.
4400 (Parameters::incremental_update): New function.
4401 (set_parameters_incremental_full): New function.
4402 * parameters.h (Parameters::set_incremental_full): New function.
4403 (Parameters::incremental): New function.
4404 (Parameters::incremental_update): New function.
4405 (Parameters::incremental_mode_): New data member.
4406 (set_parameters_incremental_full): New function.
4407 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4408 incremental link mode.
4409 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4410 (Sized_relobj::do_relocate_sections): Likewise.
4411 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4412 option.
4413 * testsuite/Makefile.in: Regenerate.
4414 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4415
bb32aa18 44162010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4417
4418 * script-sections.h (class Script_sections): Make
4419 Sections_elements typedef public.
4420 * script-sections.cc (class Sort_output_sections): Add elements_
4421 field. Add constructor which sets it; change all callers.
4422 (Sort_output_sections::is_before): New function.
4423 (Sort_output_sections::operator()): Call is_before.
4424 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4425 conditional.
4426 * testsuite/script_test_10.sh: New test. Test script section
4427 order.
4428 * testsuite/script_test_10.t: Likewise.
4429 * testsuite/script_test_10.s: Likewise.
4430 * testsuite/Makefile.am: Wrap the cross linker tests and the
4431 common tests into NATIVE_OR_CROSS_LINKER.
4432 (check_SCRIPTS): Add script_test_10.sh.
4433 (check_DATA): Add script_test_10.stdout.
4434 (script_test_10.o, script_test_10): New targets.
4435 (script_test_10.stdout): New target.
4436 * configure, testsuite/Makefile.in: Regenerate.
4437
3cef7179
ILT
44382010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4439
4440 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4441 error for the deprecated relocations.
4442 (Target_arm::Scan::global): Likewise.
4443 (Target_arm::Relocate::relocate): Likewise.
4444
7411e9a8
RS
44452010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4446
4447 * fileread.cc (Input_file::find_file): Initialize *found_name
4448 and *namep when using the fallback search for case 4.
4449
6a9da32a
CC
44502010-10-11 Cary Coutant <ccoutant@google.com>
4451
4452 * options.h (class General_options): Redefine -z lazy as an alias for
4453 the negation of -z now.
4454
ac897c20
ILT
44552010-10-11 Ian Lance Taylor <iant@google.com>
4456
4457 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4458 binding.
4459
ea5cae92
NC
44602010-10-06 Nick Clifton <nickc@redhat.com>
4461
4462 * script-sections.cc(class Memory_region): Remove
4463 current_lma_offset_ field. Rename current_vma_offset_ to
4464 current_offset_. Add last_section_ field.
4465 (Memory_region::get_current_vma_address): Rename to
4466 get_current_address.
4467 (Memory_region::get_current_lma_address): Delete.
4468 (Memory_region::increment_vma_offset): Rename to
4469 increment_offset.
4470 (Memory_region::increment_lma_offset): Delete.
4471 (Memory_region::attributes_compatible): New method. Returns
4472 true if the provided section is compatible with the region.
4473 (Memory_region::get_last_section): New method. Returns the last
4474 section to use the region.
4475 (Memory_region::set_last_section): New method. Stores the last
4476 section to use the region.
4477 (Script_sections::block_in_region): New method. Returns true if
4478 a block of memory is contained within a region.
4479 (Script_sections::find_memory_region): New method. Locates a
4480 memory region to be used to set a VMA or LMA address.
4481 (Output_section_definition::set_section_addresses): Add code to
4482 check for addresses set by memory regions.
4483 (Output_segment::set_section_addresses): Remove memory region
4484 walking code.
4485 (Script_sections::create_segment): Add a warning if a header
4486 segment is created outside of any region.
4487 * script-sections.h (class Script_sections): Add prototypes for
4488 find_memory_region and block_in_region methods.
4489 * testsuite/memory_test.s: Use .long instead of .word.
4490 * testsuite/memory_test.t: Add some more output sections.
4491 * testsuite/memory_test.sh: Update expected output.
4492
a9bfd952
DK
44932010-10-02 Doug Kwan <dougkwan@google.com>
4494
4495 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4496 defintion to symtab.h
4497 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4498 declaration to defintion.
4499
bacff3ab
NC
45002010-10-01 Nick Clifton <nickc@redhat.com>
4501
4502 * expression.cc (eval): Replace dummy argument with NULL.
4503 (eval_maybe_dot): Check for a NULL result section pointer.
4504 (Symbol_expression::value): Likewise.
4505 (Dot_expression::value): Likewise.
4506 (BINARY_EXPRESSION): Likewise.
4507 (Max_expression::value): Likewise.
4508 (Min_expression::value): Likewise.
4509 (Absolute_expression::value): Likewise.
4510 (Addr_expression::value_from_output_section): Likewise.
4511 (Loaddddr_expression::value_from_output_section): Likewise.
4512 (Segment_start_expression::value): Likewise.
4513 * script-sections.cc
4514 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4515 argument with NULL.
4516 (Sections_elememt_dot_assignment::set_section_addresses):
4517 Likewise.
4518 (Output_data_expression::do_write_to_buffer): Likewise.
4519 (Output_section_definition::finalize_symbols): Likewise.
4520 (Output_section_definition::set_section_addresses): Likewise.
4521
f81bc8b5
DK
45222010-09-30 Doug Kwan <dougkwan@google.com>
4523
4524 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4525
c95e9f27
ST
45262010-09-28 Sriraman Tallam <tmsriram@google.com>
4527
4528 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4529 function.
c95e9f27
ST
4530 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4531 virtual function.
4532 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4533 virtual function.
4534 * icf.cc (get_section_contents): Inline merge sections only when
4535 target allows it.
4536
3cac54d2
RW
45372010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4538
4539 * configure: Regenerate.
4540
2904037a
ILT
45412010-09-17 Ian Lance Taylor <iant@google.com>
4542
4543 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4544 * testsuite/Makefile.am (memory_test.o): New target.
4545 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4546 memory_test.t.
4547 * testsuite/Makefile.in: Rebuild.
2904037a 4548
bca7fb63
DK
45492010-09-17 Doug Kwan <dougkwan@google.com>
4550
4551 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4552 defintion if relocation uses GOT entries of the symbol.
4553 * testsuite/icf_safe_test.sh: Fix test.
4554 * testsuite/icf_safe_so_test.sh: Fix test.
4555
4ef28648
CC
45562010-09-16 Cary Coutant <ccoutant@google.com>
4557
4558 * script_sections.cc (class Memory_region): Remove "NULL" from
4559 vector initializations.
4560
793990de
CC
45612010-09-15 Cary Coutant <ccoutant@google.com>
4562
4563 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4564 Resolve forwarding symbols.
4565
81e015e2
DK
45662010-09-15 Doug Kwan <dougkwan@google.com>
4567
4568 * gold/testsuite/script_test_3.t: Add ARM special sections.
4569 * gold/testsuite/script_test_4.t: Same.
4570 * gold/testsuite/script_test_5.t: Same.
4571 * gold/testsuite/script_test_6.t: Same.
4572 * gold/testsuite/script_test_7.t: Same.
4573 * gold/testsuite/script_test_7.t: Same.
4574 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4575
36171d64
CC
45762010-09-14 Cary Coutant <ccoutant@google.com>
4577
4578 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4579 (Target_x86_64::Relocate::relocate_tls): Replace check for
4580 saw_tls_block_reloc_ with test for executable section.
4581
d89051bd
CC
45822010-09-12 Cary Coutant <ccoutant@google.com>
4583
4584 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4585 position-independent executables to shared libraries need dynamic
4586 relocations.
4587 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4588 position-independent executables.
4589 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4590 * testsuite/Makefile.in: Regenerate.
4591
fca41f0f
NC
45922010-09-10 Nick Clifton <nickc@redhat.com>
4593
4594 PR gold/11997
4595 * testsuite/memory_test.t: Discard any sections that are not
4596 needed.
4597
6695e4b3
L
45982010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4599
4600 PR gold/11996
4601 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4602 "This::" to work around a bug in gcc 4.2.
4603
4604 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4605
0f72bf6f
RÁE
46062010-09-09 Rafael Espindola <espindola@google.com>
4607
4608 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4609 sections with different PF_X flags in the same segment.
4610 (Layout::find_first_load_seg): Search all segments to find the first
4611 one.
4612 * options.h (rosegment): New.
4613
46142010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4615
05a79166 4616 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4617
aa98ff75
DK
46182010-09-08 Doug Kwan <dougkwan@google.com>
4619
4620 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4621 (Arm_relobj::do_relocate_sections): Add new parameter for output
4622 file to match the parent.
4623 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4624 of local symbols instead of input values. Update code to track
4625 changes in gold::relocate_section.
4626 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4627 (Sized_relobj::compute_final_local_value_internal): New methods.
4628 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4629 body into private version of Sized_relobj::compute_final_local_value.
4630 Call the inline method.
4631 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4632 merged symbol value if there is one.
4633 (Symbol_value::has_output_value): New method defintiion.
4634 (Sized_relobj::Compute_final_local_value_status): New enum type.
4635 (Sized_relobj::compute_final_local_value): New methods.
4636 (Sized_relobj::compute_final_local_value_internal): New methods.
4637 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4638 and arm_cortex_a8.sh.
4639 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4640 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4641 New tests.
4642 * Makefile.in: Regenerate.
4643 * testsuite/arm_bl_out_of_range.s: Update test.
4644 * testsuite/thumb_bl_out_of_range.s: Ditto.
4645 * testsuite/thumb_blx_out_of_range.s: Ditto.
4646 * testsuite/arm_branch_out_of_range.sh: New file.
4647 * testsuite/arm_cortex_a8.sh: Ditto.
4648 * testsuite/arm_cortex_a8_b.s: Ditto.
4649 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4650 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4651 * testsuite/arm_cortex_a8_bl.s: Ditto.
4652 * testsuite/arm_cortex_a8_blx.s: Ditto.
4653 * testsuite/arm_cortex_a8_local.s: Ditto.
4654 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4655 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4656
05a79166
L
46572010-09-08 Rafael Espindola <espindola@google.com>
4658
4659 * Makefile.am (memory_test.stdout): Run readelf with -W.
4660 * Makefile.in: Regenerate.
4661 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4662 64 bit output.
4663
33dbc701
RÁE
46642010-09-08 Rafael Espindola <espindola@google.com>
4665
4666 * script-sections.cc (Script_sections::add_memory_region): Convert
4667 field precision to int.
4668 * script.cc (script_set_section_region, script_set_section_region):
4669 Convert field precision to int.
4670
731ca54a
RÁE
46712010-09-08 Rafael Espindola <espindola@google.com>
4672
4673 * arm.cc (do_finalize_sections): Create the __exidx_start and
4674 __exdix_end symbols even when the section is missing.
4675
7f8cd844
NC
46762010-09-08 Nick Clifton <nickc@redhat.com>
4677
4678 * README: Remove claim that MEMORY is not supported.
4679 * expression.cc (script_exp_function_origin)
4680 (script_exp_function_length): Move from here to ...
4681 * script.cc: ... here.
4682 (script_set_section_region, script_add_memory)
4683 (script_parse_memory_attr, script_include_directive): New
4684 functions.
4685 * script-sections.cc
4686 (class Memory_region): New class.
4687 (class Output_section_definition): Add set_memory_region,
4688 set_section_vma, set_section_lma and get_section_name methods.
4689 (class Script_Sections): Add add_memory_region,
4690 find_memory_region, find_memory_region_origin,
4691 find_memory_region_length and set_memory_region methods.
4692 Have set_section_addresses method walk the list of set memory
4693 regions.
4694 Extend the print methos to display memory regions.
4695 * script-sections.h: Add prototypes for new methods.
4696 Add enum for MEMORY region attributes.
4697 * yyscript.y: Add support for parsing MEMORY regions.
4698 * script-c.h: Add prototypes for new functions.
4699 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4700 * testsuite/Makefile.in: Regenerate.
4701 * testsuite/memory_test.sh: New script.
4702 * testsuite/memory_test.s: New assembler source file.
4703 * testsuite/memory_test.t: New linker script.
4704
a4649286
DK
47052010-08-27 Doug Kwan <dougkwan@google.com>
4706
4707 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4708 reference override an existing dynamic weak reference.
4709 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4710 * testsuite/Makefile.in: Regenerate.
4711 * testsuite/dyn_weak_ref.sh: New file.
4712 * testsuite/dyn_weak_ref_1.c: Ditto.
4713 * testsuite/dyn_weak_ref_2.c: Ditto.
4714
b56648ad
ILT
47152010-08-27 Ian Lance Taylor <iant@google.com>
4716
4717 * incremental.h (class Incremental_input_entry): Add virtual
4718 destructor.
4719
809313cb
ILT
47202010-08-27 Ian Lance Taylor <iant@google.com>
4721
4722 * testsuite/start_lib_test_3.c: Mark t3 as used.
4723
11e32464
NC
47242010-08-27 Nick Clifton <nickc@redhat.com>
4725
4726 * options.cc (version_script): Fix small typo in previous
4727 whitespace tidyup.
4728
ca09d69a
NC
47292010-08-25 Nick Clifton <nickc@redhat.com>
4730
4731 * archive.cc: Formatting fixes: Remove whitespace between
4732 typename and following asterisk. Remove whitespace between
4733 function name and opening parenthesis.
4734 * archive.h: Likewise.
4735 * arm.cc: Likewise.
4736 * attributes.cc: Likewise.
4737 * attributes.h: Likewise.
4738 * common.cc: Likewise.
4739 * copy-relocs.cc: Likewise.
4740 * dirsearch.h: Likewise.
4741 * dynobj.cc: Likewise.
4742 * ehframe.cc: Likewise.
4743 * ehframe.h: Likewise.
4744 * expression.cc: Likewise.
4745 * fileread.cc: Likewise.
4746 * fileread.h: Likewise.
4747 * gc.h: Likewise.
4748 * gold-threads.cc: Likewise.
4749 * gold.cc: Likewise.
4750 * i386.cc: Likewise.
4751 * icf.h: Likewise.
4752 * incremental-dump.cc: Likewise.
4753 * incremental.cc: Likewise.
4754 * layout.cc: Likewise.
4755 * layout.h: Likewise.
4756 * main.cc: Likewise.
4757 * merge.cc: Likewise.
4758 * merge.h: Likewise.
4759 * object.cc: Likewise.
4760 * object.h: Likewise.
4761 * options.cc: Likewise.
4762 * options.h: Likewise.
4763 * output.cc: Likewise.
4764 * output.h: Likewise.
4765 * plugin.cc: Likewise.
4766 * plugin.h: Likewise.
4767 * powerpc.cc: Likewise.
4768 * reloc.cc: Likewise.
4769 * script-c.h: Likewise.
4770 * script-sections.cc: Likewise.
4771 * script.cc: Likewise.
4772 * stringpool.cc: Likewise.
4773 * symtab.cc: Likewise.
4774 * symtab.h: Likewise.
4775 * target.cc: Likewise.
4776 * timer.cc: Likewise.
4777 * timer.h: Likewise.
4778 * version.cc: Likewise.
4779 * x86_64.cc: Likewise.
4780
b8fa8750
NC
47812010-08-24 Nick Clifton <nickc@redhat.com>
4782
4783 PR 11899
4784 * layout.cc (segment_precedes): Sort segments by their physical
4785 addresses, if they have been set.
4786
9919d93b
CC
47872010-08-23 Cary Coutant <ccoutant@google.com>
4788
4789 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4790 symbols data.
4791 (Lib_group::include_member): Unlock object after deleting its
4792 symbols data.
4793 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4794 the bug fixed here.
4795
97b4be1c
CC
47962010-08-19 Neil Vachharajani <nvachhar@google.com>
4797 Cary Coutant <ccoutant@google.com>
4798
4799 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4800 constructor, and set_blocker.
4801 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4802 readsyms_blocker_.
4803 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4804 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4805 * testsuite/Makefile.am (start_lib_test): New test case.
4806 * testsuite/Makefile.in: Regenerate.
4807 * testsuite/start_lib_test_main.c: New file.
4808 * testsuite/start_lib_test_1.c: New file.
4809 * testsuite/start_lib_test_2.c: New file.
4810 * testsuite/start_lib_test_3.c: New file.
4811
dd0b1884
ILT
48122010-08-19 Ian Lance Taylor <iant@google.com>
4813
4814 * Makefile.in: Rebuild with automake 1.11.1.
4815 * aclocal.m4: Likewise.
4816 * testsuite/Makefile.in: Likewise.
4817
7223e9ca
ILT
48182010-08-19 Ian Lance Taylor <iant@google.com>
4819
4820 PR 10893
4821 * i386.cc (class Output_data_plt_i386): Update declarations.
4822 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4823 local_ifuncs_ fields.
4824 (Target_i386::do_plt_section_for_global): New function.
4825 (Target_i386::do_plt_section_for_local): New function.
4826 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4827 parameter; change all callers. Initialize global_ifuncs_ and
4828 local_ifuncs_. If doing a static link define __rel_iplt_start and
4829 __rel_iplt_end.
4830 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4831 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4832 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4833 symbols.
4834 (Target_i386::make_plt_section): New function, broken out of
4835 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4836 (Target_i386::make_plt_entry): Call make_plt_section.
4837 (Target_i386::make_local_ifunc_plt_entry): New function.
4838 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4839 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4840 R_386_IRELATIVE to switch.
4841 (Target_i386::Scan::global): Likewise.
4842 (Target_i386::Relocate::relocate): Likewise.
4843 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4844 switch.
4845 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4846 (Target_x86_64::do_plt_section_for_global): New function.
4847 (Target_x86_64::do_plt_section_for_local): New function.
4848 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4849 parameter; change all callers. If doing a static link define
4850 __rela_iplt_start and __rela_iplt_end.
4851 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4852 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4853 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4854 to point to .plt.
4855 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4856 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4857 switch.
4858 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4859 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4860 R_X86_64_IRELATIVE to switch.
4861 (Target_x86_64::Scan::global): Likewise.
4862 (Target_x86_64::Relocate::relocate): Likewise.
4863 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4864 switch.
4865 * target.h (class Target): Add plt_section_for_global and
4866 plt_section_for_local functions. Add do_plt_section_for_global
4867 and do_plt_section_for_local virtual functions.
4868 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4869 clarifying comments.
4870 (Symbol::use_plt_offset): Handle IFUNC symbol.
4871 * object.cc (Sized_relobj::Sized_relobj): Initialize
4872 local_plt_offsets_.
4873 (Sized_relobj::local_has_plt_offset): New function.
4874 (Sized_relobj::local_plt_offset): New function.
4875 (Sized_relobj::set_local_plt_offset): New function.
4876 (Sized_relobj::do_count): Handle IFUNC symbol.
4877 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4878 a bit away from input_shndx_ field. Add set_is_func_symbol and
4879 is_ifunc_symbol functions.
4880 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4881 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4882 local_plt_offsets_ field.
4883 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4884 * output.h (class Output_section_data): Add non-const
4885 output_section function.
4886 (class Output_data_got): Update declarations.
4887 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4888 Add use_plt_offset parameter to global and local constructors.
4889 Change all callers. Change local_sym_index_ field to 31 bits.
4890 Change GSYM_CODE and CONSTANT_CODE accordingly.
4891 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4892 doing a static link don't set sh_link field.
4893 (Output_data_got::Got_entry::write): Use PLT offset if
4894 appropriate.
4895 (Output_data_got::add_global_plt): New function.
4896 (Output_data_got::add_local_plt): New function.
4897 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4898 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4899 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4900 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4901 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4902 IFUNC conditional.
4903 * testsuite/ifunc-sel.h: New file.
4904 * testsuite/ifuncmain1.c: New file.
4905 * testsuite/ifuncmain1vis.c: New file.
4906 * testsuite/ifuncmod1.c: New file.
4907 * testsuite/ifuncdep2.c: New file.
4908 * testsuite/ifuncmain2.c: New file.
4909 * testsuite/ifuncmain3.c: New file.
4910 * testsuite/ifuncmod3.c: New file.
4911 * testsuite/ifuncmain4.c: New file.
4912 * testsuite/ifuncmain5.c: New file.
4913 * testsuite/ifuncmod5.c: New file.
4914 * testsuite/ifuncmain6pie.c: New file.
4915 * testsuite/ifuncmod6.c: New file.
4916 * testsuite/ifuncmain7.c: New file.
4917 * configure, testsuite/Makefile.in: Rebuild.
4918
56f75c03
ILT
49192010-08-18 Ian Lance Taylor <iant@google.com>
4920
4921 * incremental.cc
4922 (Output_section_incremental_inputs::write_input_files): Add cast
4923 to avoid signed/unsigned comparison warning.
4924 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4925
55455f89
CC
49262010-08-12 Cary Coutant <ccoutant@google.com>
4927
4928 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4929
e2054bcb
ILT
49302010-08-13 Ian Lance Taylor <iant@google.com>
4931
4932 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4933
74f67560
DK
49342010-08-12 Cary Coutant <ccoutant@google.com>
4935 Doug Kwan <dougkwan@google.com>
4936
4937 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4938 defintion overrides non-weak undef, remember that the original undef
4939 is not weak.
4940 * symtab.cc (Symbol_table::sized_write_global): For undef without
4941 an original weak binding, set binding to global in output.
4942 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4943 * testsuite/Makefile.in: Regenerate.
4944 * testsuite/strong_ref_weak_def.sh: New file.
4945 * testsuite/strong_ref_weak_def_1.c: Ditto.
4946 * testsuite/strong_ref_weak_def_2.c: Ditto.
4947
d1238d12
CC
49482010-08-12 Cary Coutant <ccoutant@google.com>
4949
4950 * testsuite/incremental_test.sh: Rewrite.
4951 * testsuite/incremental_test_1.c: Rewrite.
4952 * testsuite/incremental_test_2.c: Rewrite.
4953
0e70b911
CC
49542010-08-12 Cary Coutant <ccoutant@google.com>
4955
4956 * arm.cc (Target_arm::got_size): Add const.
4957 (Target_arm::got_entry_count): New function.
4958 (Target_arm::plt_entry_count): New function.
4959 (Target_arm::first_plt_entry_offset): New function.
4960 (Target_arm::plt_entry_size): New function.
4961 (Output_data_plt_arm::entry_count): New function.
4962 (Output_data_plt_arm::first_plt_entry_offset): New function.
4963 (Output_data_plt_arm::get_plt_entry_size): New function.
4964 * i386.cc (Target_i386::got_size): Add const.
4965 (Target_i386::got_entry_count): New function.
4966 (Target_i386::plt_entry_count): New function.
4967 (Target_i386::first_plt_entry_offset): New function.
4968 (Target_i386::plt_entry_size): New function.
4969 (Output_data_plt_i386::entry_count): New function.
4970 (Output_data_plt_i386::first_plt_entry_offset): New function.
4971 (Output_data_plt_i386::get_plt_entry_size): New function.
4972 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4973 find_incremental_inputs_sections. Dump incremental_got_plt section.
4974 * incremental.cc: Include target.h.
4975 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4976 parameter. Adjust all callers. Find incremental_got_plt section.
4977 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4978 section.
4979 (Output_section_incremental_inputs::set_final_data_size): Calculate
4980 size of incremental_got_plt section.
4981 (Output_section_incremental_inputs::do_write): Write the
4982 incremental_got_plt section.
4983 (Got_plt_view_info): New struct.
4984 (Local_got_offset_visitor): New class.
4985 (Global_got_offset_visitor): New class.
4986 (Global_symbol_visitor_got_plt): New class.
4987 (Output_section_incremental_inputs::write_got_plt): New function.
4988 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4989 Add parameter. Adjust all callers.
4990 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4991 (Incremental_inputs::got_plt_section): New function.
4992 (Incremental_inputs::got_plt_section_): New data member.
4993 (Incremental_got_plt_reader): New class.
4994 * layout.cc (Layout::create_incremental_info_sections): Add the
4995 incremental_got_plt section.
4996 * object.h (Got_offset_list::get_list): New function.
4997 (Got offset_list::for_all_got_offsets): New function.
4998 (Sized_relobj::local_got_offset_list): New function.
4999 * powerpc.cc (Target_powerpc::got_size): Add const.
5000 (Target_powerpc::got_entry_count): New function.
5001 (Target_powerpc::plt_entry_count): New function.
5002 (Target_powerpc::first_plt_entry_offset): New function.
5003 (Target_powerpc::plt_entry_size): New function.
5004 (Output_data_plt_powerpc::entry_count): New function.
5005 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5006 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5007 * sparc.cc (Target_sparc::got_size): Add const.
5008 (Target_sparc::got_entry_count): New function.
5009 (Target_sparc::plt_entry_count): New function.
5010 (Target_sparc::first_plt_entry_offset): New function.
5011 (Target_sparc::plt_entry_size): New function.
5012 (Output_data_plt_sparc::entry_count): New function.
5013 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5014 (Output_data_plt_sparc::get_plt_entry_size): New function.
5015 * symtab.h (Symbol::got_offset_list): New function.
5016 (Symbol_table::for_all_symbols): New function.
5017 * target.h (Sized_target::got_entry_count): New function.
5018 (Sized_target::plt_entry_count): New function.
5019 (Sized_target::plt_entry_size): New function.
5020 * x86_64.cc (Target_x86_64::got_size): Add const.
5021 (Target_x86_64::got_entry_count): New function.
5022 (Target_x86_64::plt_entry_count): New function.
5023 (Target_x86_64::first_plt_entry_offset): New function.
5024 (Target_x86_64::plt_entry_size): New function.
5025 (Output_data_plt_x86_64::entry_count): New function.
5026 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5027 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5028
09ec0418
CC
50292010-08-12 Cary Coutant <ccoutant@google.com>
5030
5031 * archive.cc: Include incremental.h.
5032 (Archive::Archive): Initialize incremental_info_.
5033 (Archive::include_member): Record archive members in incremental info.
5034 (Add_archive_symbols::run): Record begin and end of an archive in
5035 incremental info.
5036 (Lib_group::include_member): Record objects in incremental info.
5037 * archive.h (Incremental_archive_entry): Forward declaration.
5038 (Archive::set_incremental_info): New member function.
5039 (Archive::incremental_info): New member function.
5040 (Archive::Unused_symbol_iterator): New class.
5041 (Archive::unused_symbols_begin): New member function.
5042 (Archive::unused_symbols_end): New member function.
5043 (Archive::incremental_info_): New data member.
5044 * incremental-dump.cc (find_input_containing_global): New function.
5045 (dump_incremental_inputs): Dump new incremental info sections.
5046 * incremental.cc: Include symtab.h.
5047 (Output_section_incremental_inputs): New class.
5048 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5049 new incremental info sections.
5050 (Sized_incremental_binary::do_check_inputs): Likewise.
5051 (Incremental_inputs::report_archive): Remove.
5052 (Incremental_inputs::report_archive_begin): New function.
5053 (Incremental_inputs::report_archive_end): New function.
5054 (Incremental_inputs::report_object): New function.
5055 (Incremental_inputs::finalize_inputs): Remove.
5056 (Incremental_inputs::report_input_section): New function.
5057 (Incremental_inputs::report_script): Rewrite.
5058 (Incremental_inputs::finalize): Do nothing but finalize string table.
5059 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5060 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5061 (Incremental_inputs::create_data_sections): New function.
5062 (Incremental_inputs::relocs_entsize): New function.
5063 (Output_section_incremental_inputs::set_final_data_size): New function.
5064 (Output_section_incremental_inputs::do_write): New function.
5065 (Output_section_incremental_inputs::write_header): New function.
5066 (Output_section_incremental_inputs::write_input_files): New function.
5067 (Output_section_incremental_inputs::write_info_blocks): New function.
5068 (Output_section_incremental_inputs::write_symtab): New function.
5069 * incremental.h (Incremental_script_entry): Forward declaration.
5070 (Incremental_object_entry): Forward declaration.
5071 (Incremental_archive_entry): Forward declaration.
5072 (Incremental_inputs): Forward declaration.
5073 (Incremental_inputs_header_data): Remove.
5074 (Incremental_inputs_header): Remove.
5075 (Incremental_inputs_header_write): Remove.
5076 (Incremental_inputs_entry_data): Remove.
5077 (Incremental_inputs_entry): Remove.
5078 (Incremental_inputs_entry_write): Remove.
5079 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5080 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5081 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5082 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5083 Likewise.
5084 (Incremental_input_entry): New class.
5085 (Incremental_script_entry): New class.
5086 (Incremental_object_entry): New class.
5087 (Incremental_archive_entry): New class.
5088 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5089 (Incremental_inputs::report_inputs): Remove.
5090 (Incremental_inputs::report_archive): Remove.
5091 (Incremental_inputs::report_archive_begin): New function.
5092 (Incremental_inputs::report_archive_end): New function.
5093 (Incremental_inputs::report_object): Change prototype.
5094 (Incremental_inputs::report_input_section): New function.
5095 (Incremental_inputs::report_script): Change prototype.
5096 (Incremental_inputs::get_reloc_count): New function.
5097 (Incremental_inputs::set_reloc_count): New function.
5098 (Incremental_inputs::create_data_sections): New function.
5099 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5100 (Incremental_inputs::inputs_section): New function.
5101 (Incremental_inputs::symtab_section): New function.
5102 (Incremental_inputs::relocs_section): New function.
5103 (Incremental_inputs::get_stringpool): Add const.
5104 (Incremental_inputs::command_line): Add const.
5105 (Incremental_inputs::inputs): Remove.
5106 (Incremental_inputs::command_line_key): New function.
5107 (Incremental_inputs::input_file_count): New function.
5108 (Incremental_inputs::input_files): New function.
5109 (Incremental_inputs::relocs_entsize): New function.
5110 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5111 (Incremental_inputs::finalize_inputs): Remove.
5112 (Incremental_inputs::Input_info): Remove.
5113 (Incremental_inputs::lock_): Remove.
5114 (Incremental_inputs::inputs_): Change type.
5115 (Incremental_inputs::inputs_map_): Remove.
5116 (Incremental_inputs::current_object_entry_): New data member.
5117 (Incremental_inputs::inputs_section_): New data member.
5118 (Incremental_inputs::symtab_section_): New data member.
5119 (Incremental_inputs::relocs_section_): New data member.
5120 (Incremental_inputs::reloc_count_): New data member.
5121 (Incremental_inputs_reader): New class.
5122 (Incremental_symtab_reader): New class.
5123 (Incremental_relocs_reader): New class.
5124 * layout.cc (Layout::finalize): Move finalization of incremental info
5125 and creation of incremental info sections to follow finalization of
5126 symbol table. Set offsets for postprocessing sections.
5127 (Layout::create_incremental_info_sections): Call
5128 Incremental_inputs::create_data_sections. Add incremental symtab
5129 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5130 sections to layout after input sections.
5131 * layout.h (struct Timespec): Forward declaration.
5132 (Layout::incremental_inputs): Add const.
5133 (Layout::create_incremental_info_sections): Add parameter.
5134 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5135 * object.cc: Include incremental.h.
5136 (Relobj::finalize_incremental_relocs): New function.
5137 (Sized_relobj::do_layout): Record input sections in incremental info.
5138 * object.h (Object::output_section): New function.
5139 (Object::output_section_offset): Moved from Relobj.
5140 (Object::get_incremental_reloc_base): New function.
5141 (Object::get_incremental_reloc_count): New function.
5142 (Object::do_output_section): New function.
5143 (Object::do_output_section_offset): Moved from Relobj.
5144 (Object::do_get_incremental_reloc_base): New function.
5145 (Object::do_get_incremental_reloc_count): New function.
5146 (Object::Object): Initialize new data members.
5147 (Relobj::output_section): Renamed do_output_section and moved to
5148 protected.
5149 (Relobj::output_section_offset): Moved to Object.
5150 (Relobj::do_get_incremental_reloc_base): New function.
5151 (Relobj::do_get_incremental_reloc_count): New function.
5152 (Relobj::allocate_incremental_reloc_counts): New function.
5153 (Relobj::count_incremental_reloc): New function.
5154 (Relobj::finalize_incremental_relocs): New function.
5155 (Relobj::next_incremental_reloc_index): New function.
5156 (Relobj::reloc_counts_): New data member.
5157 (Relobj::reloc_bases_): New data member.
5158 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5159 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5160 (Sized_relobj::incremental_relocs_scan): New function.
5161 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5162 (Sized_relobj::incremental_relocs_write): New function.
5163 (Sized_relobj::incremental_relocs_write_reltype): New function.
5164 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5165 incremental link.
5166 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5167 archives and object files elsewhere.
5168 (Add_symbols::run): Report object files here.
5169 (Finish_group::run): Report end of archive at end of group.
5170 * reloc.cc: Include layout.h, incremental.h.
5171 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5172 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5173 (Sized_relobj::incremental_relocs_scan): New function.
5174 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5175 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5176 (Sized_relobj::incremental_relocs_write): New function.
5177 (Sized_relobj::incremental_relocs_write_reltype): New function.
5178 * script.cc (read_input_script): Rewrite test for incremental link.
5179 Change call to Incremental_inputs::report_script.
5180 * symtab.h (Symbol_table::first_global_index): New function.
5181 (Symbol_table::output_count): New function.
5182
ce0d1972
DK
51832010-08-12 Doug Kwan <dougkwan@google.com>
5184
5185 * arm.cc (Target_arm::merge_object_attributes): Check command line
5186 options --no-wchar-size-warning and --no-enum-size-warning.
5187 * options.h (General_options): Add ld-compatible options
5188 --no-enum-size-warning and --no-wchar-size-warning.
5189
6e5710ce
ILT
51902010-08-04 Ian Lance Taylor <iant@google.com>
5191
5192 * x86_64.cc (Target_x86_64::Scan::local): Use
5193 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5194 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5195 (Target_x86_64::Scan::global): Likewise.
5196 (Target_x86_64::Relocate::relocate): Likewise.
5197 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5198 Likewise.
5199
fef830db
CC
52002010-08-03 Cary Coutant <ccoutant@google.com>
5201
5202 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5203 to reserve space in merged_strings vector. Keep total input size
5204 for stats.
5205 (Output_merge_string::do_print_merge_stats): Print total input size.
5206 * merge.h (Output_merge_string): Add input_size_ field.
5207 * stringpool.cc (Stringpool_template::string_length): Move
5208 implementations out of Stringpool_template class and place in
5209 stringpool.h.
5210 * stringpool.h (string_length): Move out of Stringpool_template.
5211
1e3811b0
ILT
52122010-08-03 Ian Lance Taylor <iant@google.com>
5213
5214 PR 11712
5215 * layout.cc (relaxation_loop_body): If address of load segment is
5216 set, adjust address to include headers if possible.
5217
7af0c620
ILT
52182010-08-03 Ian Lance Taylor <iant@google.com>
5219
5220 * version.cc (version_string): Bump to 1.10.
5221
22f0da72
ILT
52222010-08-03 Ian Lance Taylor <iant@google.com>
5223
5224 PR 11805
5225 * layout.h (enum Output_section_order): Define.
5226 (class Layout): Update declarations.
5227 * layout.cc (Layout::get_output_section): Add order parameter.
5228 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5229 is_first_non_relro parameters. Change all callers.
5230 (Layout::choose_output_section): Likewise.
5231 (Layout::add_output_section_data): Likewise.
5232 (Layout::make_output_section): Likewise. Set order.
5233 (Layout::default_section_order): New function.
5234 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5235 * output.cc (Output_section::Output_section): Initialize order_.
5236 Don't initialize deleted fields.
5237 (Output_segment::Output_segment): Don't initialize deleted
5238 fields.
5239 (Output_segment::add_output_section_to_load): New function
5240 replacing add_output_section. Change all callers to call this or
5241 add_output_section_to_nonload.
5242 (Output_segment::add_output_section_to_nonload): New function.
5243 (Output_segment::remove_output_section): Rewrite.
5244 (Output_segment::add_initial_output_data): Likewise.
5245 (Output_segment::has_any_data_sections): Likewise.
5246 (Output_segment::is_first_section_relro): Likewise.
5247 (Output_segment::maximum_alignment): Likewise.
5248 (Output_segment::has_dynamic_reloc): New function replacing
5249 dynamic_reloc_count. Change all callers.
5250 (Output_segment::has_dynamic_reloc_list): New function replacing
5251 dynamic_reloc_count_list. Change all callers.
5252 (Output_segment::set_section_addresses): Rewrite.
5253 (Output_segment::set_offset): Rewrite.
5254 (Output_segment::find_first_and_last_list): Remove.
5255 (Output_segment::set_tls_offsets): Rewrite.
5256 (Output_segment::first_section_load_address): Likewise.
5257 (Output_segment::output_section_count): Likewise.
5258 (Output_segment::section_with_lowest_load_address): Likewise.
5259 (Output_segment::write_section_headers): Likewise.
5260 (Output_segment::print_sections_to_map): Likewise.
5261 * output.h (class Output_data): Remove dynamic_reloc_count_
5262 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5263 (Output_data::add_dynamic_reloc): Rewrite.
5264 (Output_data::has_dynamic_reloc): New function.
5265 (Output_data::dynamic_reloc_count): Remove.
5266 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5267 is_last_relro_, is_first_non_relro_, is_interp_,
5268 is_dynamic_linker_section_ fields. Add order and set_order
5269 functions. Remove is_relro_local, set_is_relro_local,
5270 is_last_relro, set_is_last_relro, is_first_non_relro,
5271 set_is_first_non_relro functions, is_interp, set_is_interp,
5272 is_dynamic_linker_section, and set_is_dynamic_linker_section
5273 functions.
5274 (class Output_segment): Change Output_data_list from std::list to
5275 std:;vector. Add output_lists_ field. Remove output_data_ and
5276 output_bss_ fields. Update declarations.
5277
3ff2ccb0
ILT
52782010-08-02 Ian Lance Taylor <iant@google.com>
5279
5280 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5281 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5282 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5283
88a4108b
ILT
52842010-08-02 Ian Lance Taylor <iant@google.com>
5285
5286 PR 11855
5287 * script.cc (Script_options::Script_options): Initialize
5288 symbol_definitions_ and symbol_references_.
5289 (Script_options::add_symbol_assignment): Update
5290 symbol_definitions_ and symbol_references_.
5291 (Script_options::add_symbol_reference): New function.
5292 (script_symbol): New function.
5293 * script.h (class Script_options): Add symbol_definitions_ and
5294 symbol_references_ fields.
5295 (Script_options::referenced_const_iterator): New type.
5296 (Script_options::referenced_begin): New function.
5297 (Script_options::referenced_end): New function.
5298 (Script_options::is_referenced): New function.
5299 (Script_options::any_unreferenced): New function.
5300 * script-c.h (script_symbol): Declare.
5301 * yyscript.y (exp): Call script_symbol.
5302 * symtab.cc: Include "script.h".
5303 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5304 Change all callers. Check symbols referenced by scripts.
5305 (Symbol_table::add_undefined_symbols_from_command_line): Add
5306 layout parameter. Change all callers.
5307 (Symbol_table::do_add_undefined_symbols_from_command_line):
5308 Likewise. Break out loop body. Check symbols referenced by
5309 scripts.
5310 (Symbol_table::add_undefined_symbol_from_command_line): New
5311 function broken out of
5312 do_add_undefined_symbols_from_command_line.
5313 * symtab.h (class Symbol_table): Update declarations.
5314 * archive.cc: Include "layout.h".
5315 (Archive::should_include_member): Add layout parameter. Change
5316 all callers. Check for symbol mentioned in expression.
5317 * archive.h (class Archive): Update declaration.
5318 * object.cc (Sized_relobj::do_should_include_member): Add layout
5319 parameter.
5320 * object.h (Object::should_include_member): Add layout parameter.
5321 Change all callers.
5322 (Object::do_should_include_member): Add layout parameter.
5323 (class Sized_relobj): Update declaration.
5324 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5325 parameter.
5326 * dynobj.h (class Sized_dynobj): Update declaration.
5327 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5328 layout parameter.
5329 * plugin.h (class Sized_pluginobj): Update declaration.
5330
5f1ab67a
ILT
53312010-08-02 Ian Lance Taylor <iant@google.com>
5332
5333 PR 11866
5334 * output.cc (Output_segment::set_offset): Search for the first and
5335 last sections rather than assuming that the list is in order.
5336 (Output_segment::find_first_and_last_list): New function.
5337 * output.h (class Output_segment): Update declarations.
5338 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5339 (relro_strip_test_SOURCES): New variable.
5340 (relro_strip_test_DEPENDENCIES): New variable.
5341 (relro_strip_test_LDFLAGS): New variable.
5342 (relro_strip_test_LDADD): New variable.
5343 (relro_strip_test.so): New target.
5344
a8df5856
ILT
53452010-08-02 Ian Lance Taylor <iant@google.com>
5346
5347 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5348 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5349 (Target_i386::got_tlsdesc_section): New function.
5350 (Target_i386::got_section): Create space for GOT entries for
5351 TLSDESC relocations.
5352 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5353 R_386_TLS_GOTDESC.
5354 (Target_i386::Scan::global): Likewise.
5355 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5356 using TLSDESC GOT.
5357 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5358 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5359 (Target_x86_64::got_tlsdesc_section): New function.
5360 (Target_x86_64::got_section): Create space for GOT entries for
5361 TLSDESC relocations.
5362 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5363 R_386_TLS_GOTDESC.
5364 (Target_x86_64::Scan::global): Likewise.
5365 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5366 using TLSDESC GOT.
5367
0c10a0a6
ILT
53682010-08-02 Ian Lance Taylor <iant@google.com>
5369
5370 * testsuite/final_layout.sh: Use dc to convert from hex to
5371 decimal.
5372
41cbeecc
ST
53732010-07-29 Sriraman Tallam <tmsriram@google.com>
5374
5375 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5376 paramter to the call to gold::gc_process_relocs.
5377 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5378 paramter to the call to gold::gc_process_relocs.
5379 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5380 parameter to the call to gold::gc_process_relocs.
5381 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5382 template parameter to the call to gold::gc_process_relocs.
5383 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5384 paramter to the call to gold::gc_process_relocs.
5385 * gc.h (get_embedded_addend_size): New function.
5386 (gc_process_relocs): Save the size of the reloc for use by ICF.
5387 * icf.cc (get_section_contents): Get the addend from the text section
5388 for SHT_REL relocation sections.
5389 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5390 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5391 * int_encoding.h (read_from_pointer): New overloaded function.
5392 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5393 * testsuite/icf_sht_rel_addend_test.sh: New file.
5394 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5395 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5396
6ea55b82
RW
53972010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5398
5399 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5400 * Makefile.in: Regenerate.
5401 * testsuite/Makefile.in: Regenerate.
5402
9691462b
ILT
54032010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5404
5405 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5406 * gold/testsuite/debug_msg.cc: Likewise.
5407 * gold/testsuite/odr_violation1.cc
5408 * gold/testsuite/odr_violation2.cc
5409
76897331
CC
54102010-07-21 Cary Coutant <ccoutant@google.com>
5411
5412 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5413 string, and length fields.
5414 (Output_merge_string::Merged_strings_list): New type.
5415 (Output_merge_string::Merged_strings_lists): New typedef.
5416 (Output_merge_string): Replace merged_strings_ with
5417 merged_strings_lists_.
5418 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5419 Merged_strings_list per input object and section. Don't store pointer
5420 to the string. Don't store length with each merged string entry.
5421 (Output_merge_string::finalize_merged_data): Loop over list of merged
5422 strings lists. Recompute length of each merged string.
5423
78384e8f
CC
54242010-07-15 Cary Coutant <ccoutant@google.com>
5425
5426 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5427 here.
5428
783659f9
ILT
54292010-07-14 Ian Lance Taylor <iant@google.com>
5430
5431 * descriptors.cc (Descriptors::open): Report correct name in error
5432 message.
5433
131687b4
DK
54342010-07-13 Doug Kwan <dougkwan@google.com>
5435
5436 * arm.cc (Arm_input_section::Arm_input_section): For a
5437 SHT_ARM_EXIDX section, always keeps the input sections.
5438 (Arm_input_section::set_exidx_section_link): New method.
5439 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5440 has_errors_ to false.
5441 (Arm_exidx_input_section::has_errors,
5442 Arm_exidx_input_section::set_has_errors): New methods.
5443 (Arm_exidx_input_section::has_errors_): New data member.
5444 (Arm_relobj::get_exidx_shndx_list): New method.
5445 (Arm_output_section::append_text_sections_to_list): Do not skip
5446 section without SHF_EXECINSTR.
5447 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5448 errors.
2e702c99 5449 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5450 section header. Make error messages more verbose. Check for
5451 a non-executable section linked to an EXIDX section.
5452 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5453 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5454 check that there is no deferred EXIDX section if we exit early.
5455 Instead of not making an EXIDX section in case of an error, make one
5456 and set the has_errors flag of it.
5457 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5458 in a relocatable link.
5459 (Target_arm::do_relax): Look for the EXIDX output section instead of
5460 assuming that it is called .ARM.exidx.
2e702c99 5461 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5462 section list. Do not check for SHF_EXECINSTR section flags but
5463 skip any input section with errors.
5464 * output.cc (Output_section::Output_section): Initialize
5465 always_keeps_input_sections_ to false.
5466 (Output_section::add_input_section): Check for
5467 always_keeps_input_sections_.
5468 * output.h (Output_section::always_keeps_input_sections,
5469 Output_section::set_always_keeps_input_sections): New methods.
5470 (Output_section::always_keeps_input_sections): New data member.
5471
69517287
RÁE
54722010-07-13 Rafael Espindola <espindola@google.com>
5473
5474 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5475 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5476
82742395
ILT
54772010-07-13 Philip Herron <herron.philip@googlemail.com>
5478 Ian Lance Taylor <iant@google.com>
5479
5480 * output.h (Output_section_lookup_maps::add_merge_section):
5481 Correct check of whether value was inserted.
5482 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5483 (Output_section_lookup_maps::add_relaxed_input_section):
5484 Likewise.
5485 * arm.cc (Target_arm::got_section): Remove used local os.
5486 * i386.cc (Target_i386::got_section): Likewise.
5487 * x86_64.cc (Target_x86_64::got_section): Likewise.
5488 * sparc.cc (Target_sparc::got_section): Likewise.
5489 (Target_sparc::relocate): Remove unused local have_got_offset.
5490 * powerpc.cc (Target_powerpc::relocate): Likewise.
5491
f2d707b5
ILT
54922010-07-13 Ian Lance Taylor <iant@google.com>
5493
241531d6
ILT
5494 * compressed_output.cc (zlib_decompress): Fix signature in
5495 !HAVE_ZLIB_H case.
5496
f2d707b5
ILT
5497 * archive.cc (Archive::include_member): Unlock an external member
5498 of a thin archive. Don't bother to delete an object we know is
5499 NULL.
5500
a2e47362
CC
55012010-07-12 Cary Coutant <ccoutant@google.com>
5502
5503 * compressed_output.cc (zlib_decompress): New function.
5504 (get_uncompressed_size): New function.
5505 (decompress_input_section): New function.
5506 * compressed_output.h (get_uncompressed_size): New function.
5507 (decompress_input_section): New function.
5508 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5509 Handle compressed debug sections.
5510 * layout.cc (is_compressed_debug_section): New function.
5511 (Layout::output_section_name): Map compressed section names to
5512 canonical names.
5513 * layout.h (is_compressed_debug_section): New function.
5514 (is_debug_info_section): Recognize compressed debug sections.
5515 * merge.cc: Include compressed_output.h.
5516 (Output_merge_data::do_add_input_section): Handle compressed
5517 debug sections.
5518 (Output_merge_string::do_add_input_section): Handle compressed
5519 debug sections.
5520 * object.cc: Include compressed_output.h.
5521 (Sized_relobj::Sized_relobj): Initialize new data members.
5522 (build_compressed_section_map): New function.
5523 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5524 * object.h (Object::section_is_compressed): New method.
5525 (Object::do_section_is_compressed): New method.
5526 (Sized_relobj::Compressed_section_map): New type.
5527 (Sized_relobj::do_section_is_compressed): New method.
5528 (Sized_relobj::compressed_sections_): New data member.
5529 * output.cc (Output_section::add_input_section): Handle compressed
5530 debug sections.
5531 * reloc.cc: Include compressed_output.h.
5532 (Sized_relobj::write_sections): Handle compressed debug sections.
5533
ce279a62
CC
55342010-07-08 Cary Coutant <ccoutant@google.com>
5535
5536 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5537 weak when resolving to a dynamic def.
5538 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5539 for weak undef/dynamic def cases. Adjust callers.
5540 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5541 undef_binding_weak_.
5542 (Symbol_table::sized_write_globals): Adjust symbol binding.
5543 (Symbol_table::sized_write_symbol): Add binding parameter.
5544 * symtab.h (Symbol::set_undef_binding): New method.
5545 (Symbol::is_undef_binding_weak): New method.
5546 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5547 (Symbol_table::should_override): Add new parameter.
5548 (Symbol_table::sized_write_symbol): Add new parameter.
5549
5550 * testsuite/weak_undef_file1.cc: Add new test case.
5551 * testsuite/weak_undef_file2.cc: Fix header comment.
5552 * testsuite/weak_undef_test.cc: Add new test case.
5553
b2286c10
DK
55542010-06-29 Doug Kwan <dougkwan@google.com>
5555
5556 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5557 Initialize USE_SYMBOL_.
5558 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5559 definition.
5560 (Arm_reloc_property::uses_symbol_): New data member declaration.
5561 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5562 uses symbol value and symbol is undefined but not weakly undefined.
5563
4802450a
RÁE
55642010-06-28 Rafael Espindola <espindola@google.com>
5565
5566 * plugin.cc (Plugin::load): Use dlerror.
5567
e5ca47ba
ILT
55682010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5569
5570 * symtab.cc (detect_odr_violations): When reporting an ODR
5571 violation, report an object where the symbol is defined.
5572
8a75a161
DK
55732010-06-25 Doug Kwan <dougkwan@google.com>
5574
5575 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5576 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5577 definition.
5578 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5579 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5580 target hook to detect function points.
5581 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5582 * icf.h (Icf::check_section_for_function_pointers): Change type of
5583 parameter SECTION_NAME to const reference to std::string. Use
5584 target hook to determine if section may have unsafe pointers.
5585 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5586 method definition.
5587
42218b9f
RÁE
55882010-06-21 Rafael Espindola <espindola@google.com>
5589
5590 * fileread.cc (Input_file::find_fie): New
5591 (Input_file::open): Use Input_file::find_fie.
5592 * fileread.h (Input_file::find_fie): New
5593 * plugin.cc (set_extra_library_path): New.
5594 (Plugin::load): Add set_extra_library_path to the transfer vector.
5595 (Plugin_manager::set_extra_library_path): New.
5596 (Plugin_manager::add_input_file): Use the extra search path if set.
5597 (set_extra_library_path(): New.
5598 * plugin.h (Plugin_manager): Add set_extra_library_path and
5599 extra_search_path_.
5600
a0506cca
CC
56012010-06-19 Cary Coutant <ccoutant@google.com>
5602
5603 * layout.cc (gdb_sections): Add .debug_types.
5604 (lines_only_debug_sections): Likewise.
5605
6508b958
RÁE
56062010-06-18 Rafael Espindola <espindola@google.com>
5607
5608 * plugin.cc (add_input_file,add_input_library)
5609 (Plugin_manager::add_input_file): Make filename arguments const.
5610 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5611 const.
5612
3e235302
DK
56132010-06-16 Doug Kwan <dougkwan@google.com>
5614
5615 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5616 .ARM.attributes section if we have not merged any input
5617 attributes sections.
5618
106e8a6c
DK
56192010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5620
5621 * arm.cc: Allow combining objects with no EABI version
5622 information.
5623
91ff43fe
RÁE
56242010-06-15 Rafael Espindola <espindola@google.com>
5625
5626 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5627
68ed838c
ILT
56282010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5629
5630 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5631 (struct iovec): Correct !HAVE_READV definition.
5632
f3a2388f
CC
56332010-06-10 Cary Coutant <ccoutant@google.com>
5634
5635 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5636 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5637 reloc sections.
5638 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5639
5640 PR 11683
5641 * symtab.h (Symbol::is_placeholder): New member function.
5642 * target-reloc.h (relocate_section): Check for placeholder symbols.
5643
5644 * testsuite/Makefile.am (plugin_test_8): New test.
5645 (plugin_test_9): New test.
5646 * testsuite/Makefile.in: Regenerate.
5647
e1df38aa
NC
56482010-06-09 Nick Clifton <nickc@redhat.com>
5649
5650 * yyscript.y (input_list_element): Allow strings prefixed with
5651 the '-' character. Treat these as libraries.
5652 * script.cc (script_add_library): New function. Adds a library
5653 specified by "-l<name>" found in an input script.
5654 * script-c.h: Add prototype for script_add_library.
5655
25bbe950
DK
56562010-06-07 Doug Kwan <dougkwan@google.com>
5657
5658 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5659 Restrict stub-group size to be within long conditional branch
5660 range when working around cortex-A8 erratum.
5661
0f32ea4c
ILT
56622010-06-07 Damien Diederen <dd@crosstwine.com>
5663
5664 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5665 #ifdef typo.
5666
8fe2a369
ST
56672010-06-03 Sriraman Tallam <tmsriram@google.com>
5668
5669 PR gold/11658
5670 * output.cc
5671 (Output_section::Input_section_sort_entry::compare_section_ordering):
5672 Change to return non-zero correctly.
5673 (Output_section::Input_section_sort_section_order_index_compare
5674 ::operator()): Change to fix ambiguity in comparisons.
5675
6e9ba2ca
ST
56762010-06-01 Sriraman Tallam <tmsriram@google.com>
5677
5678 * gold.h (is_wildcard_string): New function.
5679 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5680 (Layout::layout_eh_frame): Ditto.
5681 (Layout::find_section_order_index): New method.
5682 (Layout::read_layout_from_file): New method.
5683 * layout.h (Layout::find_section_order_index): New method.
5684 (Layout::read_layout_from_file): New method.
5685 (Layout::input_section_position_): New private member.
5686 (Layout::input_section_glob_): New private member.
5687 * main.cc (main): Call read_layout_from_file here.
5688 * options.h (--section-ordering-file): New option.
5689 * output.cc (Output_section::input_section_order_specified_): New
5690 member.
5691 (Output_section::Output_section): Initialize new member.
5692 (Output_section::add_input_section): Add new parameter.
5693 Keep input sections when --section-ordering-file is used.
5694 (Output_section::set_final_data_size): Sort input sections when
5695 section ordering file is specified.
5696 (Output_section::Input_section_sort_entry): Add new parameter.
5697 Check sorting type.
5698 (Output_section::Input_section_sort_entry::compare_section_ordering):
5699 New method.
5700 (Output_section::Input_section_sort_compare::operator()): Change to
5701 consider section_order_index.
5702 (Output_section::Input_section_sort_init_fini_compare::operator()):
5703 Change to consider section_order_index.
5704 (Output_section::Input_section_sort_section_order_index_compare
5705 ::operator()): New method.
5706 (Output_section::sort_attached_input_sections): Change to sort
5707 according to section order when specified.
e1df38aa
NC
5708 (Output_section::add_input_section<32, true>): Add new parameter.
5709 (Output_section::add_input_section<64, true>): Add new parameter.
5710 (Output_section::add_input_section<32, false>): Add new parameter.
5711 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5712 * output.h (Output_section::add_input_section): Add new parameter.
5713 (Output_section::input_section_order_specified): New
5714 method.
5715 (Output_section::set_input_section_order_specified): New method.
5716 (Input_section::Input_section): Initialize section_order_index_.
5717 (Input_section::section_order_index): New method.
5718 (Input_section::set_section_order_index): New method.
5719 (Input_section::section_order_index_): New member.
5720 (Input_section::Input_section_sort_section_order_index_compare): New
5721 struct.
5722 (Output_section::input_section_order_specified_): New member.
5723 * script-sections.cc (is_wildcard_string): Delete and move modified
5724 method to gold.h.
5725 (Output_section_element_input::Output_section_element_input): Modify
5726 call to is_wildcard_string.
5727 (Output_section_element_input::Input_section_pattern
5728 ::Input_section_pattern): Ditto.
5729 (Output_section_element_input::Output_section_element_input): Ditto.
5730 * testsuite/Makefile.am (final_layout): New test case.
5731 * testsuite/Makefile.in: Regenerate.
5732 * testsuite/final_layout.cc: New file.
5733 * testsuite/final_layout.sh: New file.
5734
3537c84b
RÁE
57352010-06-01 Rafael Espindola <espindola@google.com>
5736
5737 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5738
105b6afd
RÁE
57392010-06-01 Rafael Espindola <espindola@google.com>
5740
5741 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5742 visibility of symbols.
5743
29e11421
DK
57442010-05-27 Doug Kwan <dougkwan@google.com>
5745
5746 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5747 from start of output section instead of address for a local symbol
5748 in a merged or relaxed section when doing a relocatable link.
5749
5e0f337e
RÁE
57502010-05-26 Rafael Espindola <espindola@google.com>
5751
703d02da 5752 PR 11604
5e0f337e
RÁE
5753 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5754 adding sections the garbage collector removed.
5755 * gold/testsuite/Makefile.am: Add test.
5756 * gold/testsuite/Makefile.in: Regenerate.
5757 * gold/testsuite/plugin_test_7.sh: New.
5758 * gold/testsuite/plugin_test_7_1.c: New.
5759 * gold/testsuite/plugin_test_7_2.c: New.
5760
f4187277
RÁE
57612010-05-26 Rafael Espindola <espindola@google.com>
5762
5763 * script-sections.cc (Output_section_definition::set_section_addresses):
5764 Check for --section-start.
5765
5c388529
DK
57662010-05-26 Doug Kwan <dougkwan@google.com>
5767
5768 * arm.cc (Arm_scan_relocatable_relocs): New class.
5769 (Target_arm::relocate_special_relocatable): New method.
5770 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5771 (Arm_relocate_functions::thumb_branch_common): Same.
5772 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5773 instead of Default_scan_relocatable_relocs.
5774 * target-reloc.h (relocate_for_relocatable): Let target handle
5775 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5776 * target.h (Sized_target::relocate_special_relocatable): New method.
5777
bca1c3ae
ILT
57782010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5779
5780 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5781
0439c796
DK
57822010-05-23 Doug Kwan <dougkwan@google.com>
5783
5784 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5785 instead of a cast.
5786 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5787 with a direct branch, not a conditional branch, to a stub.
5788 * merge.cc (Output_merge_base::record_input_section): New method
5789 defintion.
5790 (Output_merge_data::do_add_input_section): Record input section if
5791 keeps-input-sections flag is set.
5792 (Output_merge_string::do_add_input_section): Ditto.
5793 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5794 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5795 INPUT_SECTIONS_.
5796 (Output_merge_base::keeps_input_sections,
5797 Output_merge_base::set_keeps_input_sections,
5798 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5799 method definitions.
5800 (Output_merge_base::Input_sections): New type declaration.
5801 (Output_merge_base::input_sections_begin,
5802 Output_merge_base::input_sections_end,
5803 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5804 (Output_merge_base::bool keeps_input_sections_,
5805 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5806 Output_merge_base::input_sections_): New data members.
5807 (Output_merge_data::do_set_keeps_input_sections): New method
5808 defintion.
5809 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5810 * output.cc (Output_section::Input_section::relobj): Move method
5811 defintion from class declaration to here and handle merge sections.
5812 (Output_section::Input_section::shndx): Ditto.
5813 (Output_section::Output_section): Remove initializations of removed
5814 data members and initialize new data member LOOKUP_MAPS_.
5815 (Output_section::add_input_section): Set keeps-input-sections flag
5816 for a newly created merge output section as appropriate. Adjust code
5817 to use Output_section_lookup_maps class.
5818 (Output_section::add_relaxed_input_section): Adjst code for lookup
5819 maps code refactoring.
2e702c99 5820 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5821 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5822 class. If adding input section to a newly created merge output
5823 section fails, remove the new merge section.
5824 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5825 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5826 (Output_section::find_merge_section): Ditto.
0439c796 5827 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5828 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5829 Output_section_lookup_maps class.
5830 (Output_section::get_input_sections): Export merge sections. Adjust
5831 code to use Output_section_lookup_maps class.
5832 (Output_section:::add_script_input_section): Adjust code to use
5833 Output_section_lookup_maps class. Update lookup maps for merge
5834 sections also.
5835 (Output_section::discard_states): Use Output_section_lookup_maps.
5836 (Output_section::restore_states): Same.
5837 * output.h (Merge_section_properties): Move class defintion out of
5838 Output_section.
5839 (Output_section_lookup_maps): New class.
5840 (Output_section::Input_section::is_merge_section): New method
5841 defintion.
5842 (Output_section::Input_section::relobj): Move defintion out of class
5843 defintion. Declare method only.
5844 (Output_section::Input_section::shndx): Ditto.
5845 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5846 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5847 (Output_section::Merge_section_by_properties_map,
5848 Output_section::Output_section_data_by_input_section_map,
5849 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5850 Remove types.
2e702c99 5851 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5852 KEEPS_INPUT_SECTIONS.
5853 (Output_section::build_lookup_maps): New method declaration.
5854 (Output_section::merge_section_map_,
5855 Output_section::merge_section_by_properties_map_,
5856 Output_section::relaxed_input_section_map_,
5857 Output_section::is_relaxed_input_section_map_valid_): Remove data
5858 members.
5859 (Output_section::lookup_maps_): New data member.
5860
76295588
L
58612010-05-21 Doug Kwan <dougkwan@google.com>
5862
5863 PR gold/11619
5864 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5865 avoid a compilation error.
5866
d103a984
RÁE
58672010-05-19 Rafael Espindola <espindola@google.com>
5868
5869 * script-sections.cc (Output_section_definition::allocate_to_segment):
5870 Update the phdrs_list even when the output section is NULL.
5871 * testsuite/Makefile.am: Add test.
5872 * testsuite/Makefile.in: Regenerate.
5873 * testsuite/script_test_9.cc: New.
5874 * testsuite/script_test_9.sh: New.
5875 * testsuite/script_test_9.t: New.
5876
6625d24e
DK
58772010-05-19 Doug Kwan <dougkwan@google.com>
5878
5879 * arm.cc (Arm_input_section::original_size): New method.
5880 (Arm_input_section::do_addralign): Add a cast.
5881 (Arm_input_section::do_output_offset): Remove static cast.
5882 (Arm_input_section::original_addralign,
5883 Arm_input_section::original_size_): Change type to uint32_t.
5884 (Arm_input_section::init): Add safe casts for section alignment
5885 and size.
5886 (Arm_input_section::set_final_data_size): Do not set address and
5887 offset of stub table.
5888 (Arm_output_section::fix_exidx_coverage): Change use of of
5889 Output_section::Simple_input_section to that of
5890 Output_section::Input_section.
5891 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5892 except for the first pass.
5893 * output.cc (Output_section::get_input_sections): Change type of
5894 input_sections to std::list<Input_section>.
5895 (Output_section::add_script_input_section): Rename from
5896 Output_section::add_simple_input_section. Change type of SIS
5897 parameter from Simple_input_section to Input_section.
5898 * output.h (Output_section::Simple_input_section): Remove class.
5899 (Output_section::Input_section): Change class visibility to public.
5900 (Output_section::Input_section::addralign): Use stored alignments
5901 for special input sections if set.
5902 (Output_section::Input_section::set_addralign): New method.
5903 (Output_section::get_input_sections): Change parameter type from
5904 list of Simple_input_section to list of Input_section.
5905 (Output_section::add_script_input_section): Rename from
5906 Output_section::add_simple_input_section. Change first parameter's
5907 type from Simple_input_section to Input_section and remove the
5908 second and third parameters.
5909 * script-sections.cc (Input_section::Input_section_list): Change
5910 type to list of Output_section::Input_section/
5911 (Input_section_info::Input_section_info): Change parameter type of
5912 INPUT_SECTION to Output_section::Input_section.
5913 (Input_section_info::input_section): Change return type.
5914 (Input_section_info::input_section_): Change type to
5915 Output_section::Input_section.
5916 (Output_section_element_input::set_section_addresses): Adjust code
5917 to use Output_section::Input_section instead of
5918 Output_section::Simple_input_section. Adjust code for renaming
5919 of Output_section::add_simple_input_section.
5920 (Orphan_output_section::set_section_addresses): Ditto.
5921
e1e82ea4
RW
59222010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5923
5924 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5925 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5926
91e75c8a
RÁE
59272010-05-18 Rafael Espindola <espindola@google.com>
5928
5929 * options.cc (General_options::finalize): Handle -nostdlib.
5930 * options.h (nostdlib): New option.
5931 * script.cc (script_add_search_dir): Handle -nostdlib.
5932
da59ad79
DK
59332010-05-12 Doug Kwan <dougkwan@google.com>
5934
5935 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5936 attributes section only if there no attributes section after merging.
5937 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5938 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5939 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5940 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5941 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5942 and arm_attr_merge_7.stdout.
5943 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5944 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5945 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5946 arm_attr_merge_7b.o): New rules.
5947 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5948 arm_attr_merge_7
5949 * testsuite/Makefile.in: Regenerate.
5950 * testsuite/arm_attr_merge.sh: New file.
5951 * testsuite/arm_attr_merge_[67][ab].s: Same.
5952
3e01a7fd
NC
59532010-05-05 Nick Clifton <nickc@redhat.com>
5954
5955 * po/es.po: Updated Spanish translation.
5956
7ad2014a
L
59572010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5958
5959 * Makefile.am (install-exec-local): Properly install gold as
5960 default cross linker.
5961 * Makefile.in: Regenerated.
5962
4fda8867
NC
59632010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5964 Nick Clifton <nickc@redhat.com>
5965
5966 * configure.ac (install_as_default): Define and set to false
5967 unless --enable-gold or --enable-gold=both/gold has been
5968 specified.
5969 * configure: Regenerate.
5970
5971 * Makefile.am (install-exec-local): Install the executable as
5972 'ld.gold'. If install_as_default is true then also install it as
5973 'ld'.
5974 * Makefile.in: Regenerated.
5975
bd288ea2
ILT
59762010-04-24 Ian Lance Taylor <iant@google.com>
5977
5978 * layout.cc (Layout::layout_reloc): In relocatable link don't
5979 combine reloc sections for grouped sections.
5980
ef38fd8a
ST
59812010-04-23 Sriraman Tallam <tmsriram@google.com>
5982
5983 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5984 sections that are not ordinary to icf.
5985 * icf.cc (get_section_contents): Handle relocation pointing to section
5986 with no object or shndx information.
5987 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5988 * testsuite/Makefile.in: Regenerate.
5989 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5990 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5991
f6973bdc
ILT
59922010-04-22 Ian Lance Taylor <iant@google.com>
5993
5994 * expression.cc (Expression::Expression_eval_info): Add
5995 result_alignment_pointer field.
5996 (Expression::eval_with_dot): Add result_alignment_pointer
5997 parameter. Change all callers.
5998 (Expression::eval_maybe_dot): Likewise.
5999 (class Binary_expression): Add alignment_pointer parameter to
6000 left_value and right_value. Change all callers.
6001 (BINARY_EXPRESSION): Set result alignment.
6002 (class Trinary_expression): Add alignment_pointer parameter to
6003 arg2_value and arg3_value. Change all callers.
6004 (Trinary_cond::value): Set result alignment.
6005 (Max_expression::value, Min_expression::value): Likewise.
6006 (Align_expression::value): Likewise.
6007 * script-sections.cc (class Sections_element): Add dot_alignment
6008 parameter to set_section_addresses virtual function. Update
6009 instantiations.
6010 (class Output_section_element): Likewise.
6011 (Script_sections::create_segments): Add dot_alignment parameter.
6012 Change all callers.
6013 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6014 (Script_sections::set_phdrs_clause_addresses): Likewise.
6015 * script-sections.h: Update declarations.
6016 * script.h: Update declarations.
6017 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6018 min_p_align.
6019 * testsuite/script_test_3.t: Set large alignment.
6020 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6021 segment has expected alignment.
6022
9c9c98a5
NC
60232010-04-22 Nick Clifton <nickc@redhat.com>
6024
6025 * po/gold.pot: Updated by the Translation project.
6026 * po/vi.po: Updated Vietnamese translation.
6027
2253bfba
L
60282010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6029
6030 * testsuite/Makefile.am (check_PROGRAMS): Add
6031 icf_virtual_function_folding_test.
6032 * testsuite/Makefile.in: Regenerated.
6033
85fdf906
AH
60342010-04-15 Andrew Haley <aph@redhat.com>
6035
6036 * options.h (merge_exidx_entries): New option.
6037 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6038 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6039 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6040 (Target_arm::merge_exidx_entries): New function.
6041 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6042 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6043 to Arm_exidx_fixup constructor.
6044 Add new arg, merge_exidx_entries.
6045 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6046 Arm_output_section::fix_exidx_coverage.
6047
ce97fa81
ST
60482010-04-18 Sriraman Tallam <tmsriram@google.com>
6049
6050 * icf.cc (get_section_contents): Check for preemptible functions.
6051 Ignore addend when appropriate.
6052 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6053 section folded.
6054 (add_from_relobj): Check for section folded.
6055 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6056 * symtab.h (should_add_dynsym_entry): Add new parameter.
6057 * target-reloc.h (scan_relocs): Check for section folded.
6058 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6059 Check reloc types for function pointers in shared objects.
6060 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6061 case.
6062 (icf_preemptible_functions_test): New test case.
6063 (icf_string_merge_test): New test case.
6064 * testsuite.Makefile.in: Regenerate.
6065 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6066 bar_glob. Refactor code.
6067 * testsuite/icf_preemptible_functions_test.cc: New file.
6068 * testsuite/icf_preemptible_functions_test.sh: New file.
6069 * testsuite/icf_string_merge_test.cc: New file.
6070 * testsuite/icf_string_merge_test.sh: New file.
6071 * testsuite/icf_virtual_function_folding_test.cc: New file.
6072 * testsuite/icf_virtual_function_folding_test.sh: New file.
6073
04ceb17c
DK
60742010-04-14 Doug Kwan <dougkwan@google.com>
6075
6076 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6077 for local symbol recounting if we remove a section due to ICF.
6078 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6079 there are no regular objects in input.
6080
153e7da4
DK
60812010-04-13 Doug Kwan <dougkwan@google.com>
6082
6083 * arm.cc (Arm_input_section::set_final_data_size): Compute
6084 accurate final data size instead of using current data size.
6085
4dbd9faf
DK
60862010-04-09 Doug Kwan <dougkwan@google.com>
6087
6088 * layout.cc (Layout::choose_output_section): Handle script section
6089 types.
6090 (Layout::make_output_section_for_script): Add section type parameter.
6091 Handle script section types.
6092 * layout.h (Layout::make_output_section_for_script): Add section
6093 type parameter.
6094 * output.cc (Output_section::Output_section): Initialize data member
6095 is_noload_.
6096 (Output_section::do_reset_address_and_file_offset): Do not set address
6097 to 0 if section is a NOLOAD section.
6098 * output.h (Output_section::is_noload): New method.
6099 (Output_section::set_is_noload): Ditto.
6100 (Output_section::is_noload_): New data member.
6101 * script-c.h (Script_section_type): New enum type.
6102 (struct Parser_output_section_header): Add new file section_type.
6103 * script-sections.cc (Sections_element::output_section_name): Add
6104 parameter for returning script section type.
6105 (Output_section_definition::output_section_name): Ditto.
6106 (Output_section_definition::section_type)P; New method.
6107 (Output_section_definiton::script_section_type_name): Ditto.
6108 (Output_section_definition::script_section_type_): New data member.
6109 (Output_section_definition::Output_section_definition): Initialize
6110 data member Output_section_definition::script_section_type_.
6111 (Output_section_definition::create_sections): Pass script section type
6112 to Layout::make_output_section_for_script.
6113 (Output_section_definition::output_section_name): Return script
6114 section type to caller.
6115 (Output_section_definition::set_section_address): Do not advance
6116 dot value and load address if section type is NOLOAD. Set address
6117 of NOLOAD sections regardless of section flags.
6118 (Output_section_definition::print): Print section type if it is
6119 not SCRIPT_SECTION_TYPE_NONE.
6120 (Output_section_definition::section_type): New method.
6121 (Output_section_definition::script_section_type_name): Ditto.
6122 (Script_sections::output_section_name): Add new parameter
6123 PSECTION_TYPE for returning script section type. Pass it to
6124 section elements. Handle discard sections.
6125 (Sort_output_sections::operator()): Handle NOLOAD sections.
6126 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6127 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6128 returning script section type.
6129 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6130 INFO and NOLOAD.
6131 * yyscript.y (union): Add new field SECTION_TYPE.
6132 (COPY, DSECT, INFO, NOLOAD): New tokens.
6133 (opt_address_and_section_type): Change type to output_section_header.
6134 (section_type): New non-terminal
6135 (section_header): Handle section type.
2253bfba 6136 (opt_address_and_section_type): Return section type value.
4dbd9faf 6137
721ea635
L
61382010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6139
6140 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6141 * testsuite/plugin_common_test_2.c (foo): Likewise.
6142
6bf924b0
DK
61432010-04-08 Doug Kwan <dougkwan@google.com>
6144
6145 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6146 Output_merge_data.
6147 * output.cc (Output_section::add_merge_input_section): Simplify
6148 code and return status of Output_merge_base::add_input_section.
e1df38aa 6149 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6150 returns true.
6151
24af6f92
DK
61522010-04-07 Doug Kwan <dougkwan@google.com>
6153
6154 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6155 if section is marked as containing instructions but has no mapping
6156 symbols.
6157 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6158 correct section index.
6159 (Arm_relobj::find_linked_text_section): Ditto.
6160
00698fc5
CC
61612010-04-07 Cary Coutant <ccoutant@google.com>
6162
6163 * archive.cc (include_member): Destroy Read_symbols_data object before
6164 releasing file.
6165 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6166 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6167 (Read_symbols_data::~Read_symbols_data) New destructor.
6168 (Section_relocs::Section_relocs) New constructor.
6169 (Section_relocs::~Section_relocs) New destructor.
6170 (Read_relocs_data::Read_relocs_data) New constructor.
6171 (Read_relocs_data::~Read_relocs_data) New destructor.
6172 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6173 pointers to NULL after deleting.
6174
7296d933
DK
61752010-04-07 Doug Kwan <dougkwan@google.com>
6176
6177 * arm.cc: Replace "endianity" with "endianness" in comments.
6178 (Arm_exidx_cantunwind): Ditto.
6179 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6180 (Arm_relobj::merge_flags_and_attributes): New method.
6181 (Arm_relobj::merge_flags_and_attributes_): New data member.
6182 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6183 (Arm_relobj::scan_sections_for_stubs): Ditto.
6184 (Arm_relobj::do_read_symbols): Check to see if we really want to
6185 merge processor-specific flags and attributes. Exit early if
6186 an object is empty except for section names and the undefined symbol.
6187 (Target_arm::do_finalize_sections): Move check for ELF format to
6188 Arm_relobj::do_read_symbols. Merge processor specific flags and
6189 attributes from a regular object only when we have determined that
6190 it is aapropriate. Do not create an .ARM.attributes section in
6191 output if there is no regular input object.
6192 (Target_arm::merge_processor_specific_flags): Check
6193 --warn-mismatch before printing any error.
6194 (Target_arm::merge_object_attributes): Ditto.
6195 * gold.cc (queue_middle_tasks): Handle the case in which there is
6196 no regular object in input.
6197 * options.cc (General_options::parse_EB): New method.
6198 (General_options::parse_EL): Same.
6199 (General_options::General_options): Initialize endianness_.
6200 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6201 New options.
6202 (General_options::Endianness): New enum.
6203 (General_options::endianness): New method.
6204 (General_options::endianness_): New data member.
6205 * parameters.cc (Parameters::set_options): Check target endianness.
6206 (Parameters::set_target_once): Ditto.
6207 (Parameters::check_target_endianness): New method.
6208 (parameters_force_valid_target): If either -EL or -EB is specified,
6209 use it to define endianness of default target.
6210 * parameters.h (Parameters::check_target_endianness): New method
6211 declaration.
6212 * target.h (class Target): Change "endianity" to "endianness"
6213 in comments.
6214
efc8d4f2
RW
62152010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6216
6217 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6218 * configure: Regenerate.
6219 * Makefile.in: Regenerate.
6220 * testsuite/Makefile.in: Regenerate.
6221
be234d88
CC
62222010-04-06 Cary Coutant <ccoutant@google.com>
6223
6224 gcc PR lto/42757
6225 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6226 prevailing definitions of common symbols.
6227 * testsuite/plugin_test_6.sh: New test case.
6228 * testsuite/plugin_common_test_1.c: New test case.
6229 * testsuite/plugin_common_test_2.c: New test case.
6230 * testsuite/Makefile.am (plugin_test_6): New test case.
6231 * testsuite/Makefile.in: Regenerate.
6232
bd32c6bd
NC
62332010-04-06 Nick Clifton <nickc@redhat.com>
6234
6235 * po/vi.po: New Vietnamese translation.
6236
323c532f
DK
62372010-03-30 Doug Kwan <dougkwan@google.com>
6238
6239 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6240
4fcd97eb
DK
62412010-03-25 Doug Kwan <dougkwan@google.com>
6242
6243 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6244 to avoid a conversion warning on a 32-bit host.
6245
4ebf39db
ILT
62462010-03-24 Ian Lance Taylor <iant@google.com>
6247
6248 * testsuite/script_test_3.t: Add a TLS segment.
6249 * testsuite/Makefile.am (check_PROGRAMS): Add
6250 tls_phdrs_script_test.
6251 (tls_phdrs_script_test_SOURCES): Define.
6252 (tls_phdrs_script_test_DEPENDENCIES): Define.
6253 (tls_phdrs_script_test_LDFLAGS): Define.
6254 (tls_phdrs_script_test_LDADD): Define.
6255 * testsuite/Makefile.in: Rebuild.
6256
4a599bdd
CC
62572010-03-23 Cary Coutant <ccoutant@google.com>
6258
6259 * fileread.cc (find_or_make_view): Fix comment.
6260
6c93b22c
ILT
62612010-03-23 Ian Lance Taylor <iant@google.com>
6262
6263 * script-sections.cc (class Orphan_section_placement): Define
6264 PLACE_TLS and PLACE_TLS_BSS.
6265 (Orphan_section_placement::Orphan_section_placement): Initialize
6266 new places.
6267 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6268 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6269 (tls_script_test_SOURCES): Define.
6270 (tls_script_test_DEPENDENCIES): Define.
6271 (tls_script_test_LDFLAGS): Define.
6272 (tls_script_test_LDADD): Define.
6273 * testsuite/Makefile.in: Rebuild.
6274
a2c7281b
DK
62752010-03-22 Doug Kwan <dougkwan@google.com>
6276
6277 * arm.cc (Arm_relocate_functions::abs8,
6278 Arm_relocate_functions::abs16): Use correct check for overflow
6279 specified in the ARM ELF specs.
6280 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6281 target of a BLX instruction specially.
6282 (Reloc_stub::stub_type_for_reloc): Ditto.
6283 (Relocate::relocate): Use symbolic names instead of numeric relocation
6284 codes to report error.
6285 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6286 workaround.
6287 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6288 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6289 thumb2_blx_out_of_range.stdout
6290 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6291 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6292 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6293 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6294 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6295 thumb2_blx_in_range, thumb2_blx_in_range.o,
6296 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6297 thumb2_blx_out_of_range.o): New rules.
2e702c99 6298 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6299 thumb2_blx_in_range and thumb2_blx_out_of_range.
6300 * testsuite/Makefile.in: Regenerate.
6301 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6302 * testsuite/thumb_blx_in_range.s: New file.
6303 * testsuite/thumb_blx_out_of_range.s: New file.
6304
b0193076
RÁE
63052010-03-22 Rafael Espindola <espindola@google.com>
6306
6307 * archive.cc (Should_include): Move to archive.h.
6308 (should_include_member): Make it a member of Archive.
6309 (Lib_group): New.
6310 (Add_lib_group_symbols): New.
6311 * archive.h: Include options.h.
6312 (Archive_member): Moved from Archive.
6313 (Should_include): Moved from archive.cc.
6314 (Lib_group): New.
6315 (Add_lib_group_symbols): New.
6316 * dynobj.cc (do_should_include_member): New.
6317 * dynobj.h (do_should_include_member): New.
6318 * gold.cc (queue_initial_tasks): Update call to queue.
6319 * main.cc (main): Print lib group stats.
6320 * object.cc (do_should_include_member): New.
6321 * object.h: Include archive.h.
6322 (Object::should_include_member): New.
6323 (Object::do_should_include_member): New.
6324 (Sized_relobj::do_should_include_member): New.
6325 * options.cc (General_options::parse_start_lib): New.
6326 (General_options::parse_end_lib): New.
6327 (Input_arguments::add_file): Handle lib groups.
6328 (Input_arguments::start_group): Check we are not in a lib.
6329 (Input_arguments::start_lib): New.
6330 (Input_arguments::end_lib): New.
6331 * options.h (General_options): Add start_lib and end_lib.
6332 (Input_argument::lib_): New.
6333 (Input_argument::lib): New.
6334 (Input_argument::is_lib): New.
6335 (Input_file_lib): New.
6336 (Input_arguments::in_lib_): New.
6337 (Input_arguments::in_lib): New.
6338 (Input_arguments::start_lib): New.
6339 (Input_arguments::end_lib_): New.
6340 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6341 in unused members as preempted.
6342 (Sized_pluginobj::do_should_include_member): New.
6343 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6344 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6345 return the blocker.
6346 (Read_symbols::do_whole_lib_group): New.
6347 (Read_symbols::do_lib_group): New.
6348 (Read_symbols::do_read_symbols): Handle lib groups.
6349 (Read_symbols::get_name): Handle lib groups.
6350 * readsyms.h (Read_symbols): Add an archive member pointer.
6351 (Read_symbols::do_whole_lib_group): New.
6352 (Read_symbols::do_lib_group): New.
6353 (Read_symbols::member_): New.
6354 * script.cc (read_input_script): Update call to queue_soon.
6355
d099120c
DK
63562010-03-19 Doug Kwan <dougkwan@google.com>
6357
6358 * arm.cc (Stub_table::Stub_table): Initialize new data members
6359 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6360 (Stub_table::add_reloc_stub): Assign stub offset and update
6361 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6362 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6363 New data members.
2e702c99 6364 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6365 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6366 instead of going over all reloc stubs.
2e702c99 6367 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6368 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6369 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6370 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6371 Stringpool_template::offset_.
6372 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6373 Stringpool_template::offset_ to zero.
6374
1aa37384
DK
63752010-03-15 Doug Kwan <dougkwan@google.com>
6376
6377 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6378 offset_.
6379 (Stringpool_template::new_key_offset): New method.
6380 (Stringpool_template::add_string): Assign offsets when adding new
6381 strings.
6382 (Stringpool_template::set_string_offsets): Do not set string offsets
6383 when not optimizing.
6384 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6385 member size_.
2e702c99
RM
6386 (Chunked_vector::clear): Clear size_.
6387 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6388 (Chunked_vector::size): Return size_.
6389 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6390 (Chunked_vector::size_): New data member.
1aa37384
DK
6391 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6392 (Stringpool_template::new_key_offset): New method declaration.
6393 (Stringpool_template::offset_): New data member.
6394
b672b057
RÁE
63952010-03-15 Rafael Espindola <espindola@google.com>
6396
6397 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6398 Add_symbols' constructor.
6399 * readsyms.h (Add_symbols): Remove the input_group member.
6400
b6848d3c
ILT
64012010-03-10 Ian Lance Taylor <iant@google.com>
6402
6403 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6404 target to ask whether a reference to a symbol requires a stack
6405 split.
6406 * target.h (Target::is_call_to_non_split): New function.
6407 (Target::do_is_call_to_non_split): Declare virtual function.
6408 * target.cc: Include "symtab.h".
6409 (Target::do_is_call_to_non_split): New function.
6410 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6411
a2a5469e
CC
64122010-03-10 Cary Coutant <ccoutant@google.com>
6413
6414 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6415 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6416 (File_read::open[2]): Add whole_file_view_ to list of views.
6417 (File_read::make_view): Remove test of whole_file_view_.
6418 (File_read::find_or_make_view): Create whole_file_view_ if
6419 necessary.
6420 (File_read::clear_views): Replace bool parameter with enum;
6421 adjust all callers. Don't delete views with permanent data;
6422 do delete cached views and views from archives if
6423 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6424 if clearing the corresponding view.
6425 * fileread.h (File_read::Clear_views_mode): New enum.
6426 (File_read::View::is_permanent_view): New method.
6427 (File_read::clear_views): Replace bool parameter
6428 with enum; adjust all callers.
6429 * options.h (General_options): Change keep_files_mapped option;
6430 add map_whole_files.
6431 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6432 releasing the file.
6433 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6434 the file.
6435
8861f32b
DM
64362010-03-10 David S. Miller <davem@davemloft.net>
6437
6438 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6439
d62d0f5f
ST
64402010-03-09 Sriraman Tallam <tmsriram@google.com>
6441
6442 * icf.cc (get_section_contents): Add '@' marker after processing the
6443 merge reloc.
6444
9177756d
DK
64452010-03-08 Doug Kwan <dougkwan@google.com>
6446
6447 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6448 due to a conversion warning.
6449 (Arm_relobj::update_output_local_symbol_count): Check for local
6450 symbol with unset output index.
6451
9e9e071b
ILT
64522010-03-05 Ian Lance Taylor <iant@google.com>
6453
6454 * options.h (class General_options): Add --spare-dynamic-tags.
6455 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6456 --spare-dynamic-tags.
6457
a81ee015
ILT
64582010-03-05 Ian Lance Taylor <iant@google.com>
6459
6460 * incremental.cc: Include "libiberty.h".
6461
44ec90b9
RO
64622010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6463
6464 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6465 function, is_info_ member.
6466 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6467 (Versions::Versions): Update caller.
6468 (Versions::define_base_version): Likewise.
6469 (Versions::add_def): Likewise.
6470
0897ed3b
ST
64712010-03-03 Sriraman Tallam <tmsriram@google.com>
6472
6473 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6474 (Scan::possible_function_pointer_reloc): New function.
6475 (Scan::local_reloc_may_be_function_pointer): Change to call
6476 possible_function_pointer_reloc.
6477 (Scan::global_reloc_may_be_function_pointer): Ditto.
6478 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6479 relocations in ".data.rel.ro._ZTV" section.
6480 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6481 * testsuite/icf_safe_so_test.cc: Ditto.
6482 * testsuite/icf_safe_test.cc: Ditto.
6483 * testsuite/icf_safe_test.sh: Ditto.
6484
d3bbad62
ILT
64852010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6486 Ian Lance Taylor <iant@google.com>
6487
6488 * target-reloc.h (relocate_section): Check the symbol table index
6489 for -1U before setting the local symbol index.
6490 (scan_relocatable_relocs): If copying the relocation, record that
6491 the local symbol is required.
6492 * object.h (Symbol_value::is_output_symtab_index_set): New
6493 function.
6494 (Symbol_value::may_be_discarded_from_output_symtab): New
6495 function.
6496 (Symbol_value::has_output_symtab_entry): New function.
6497 (Symbol_value::needs_output_symtab_entry): Remove.
6498 (Symbol_value::output_symtab_index): Make sure the symbol index is
6499 set.
6500 (Symbol_value::set_output_symtab_index): Make sure the symbol
6501 index is not set. Make sure the new index is valid.
6502 (Symbol_value::set_must_have_output_symtab_entry): New function.
6503 (Symbol_value::has_output_dynsym_entry): New function.
6504 (Symbol_value::set_output_dynsym_index): Make sure the new index
6505 is valid.
6506 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6507 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6508 local symbol if permitted.
6509 (Sized_relobj::do_finalize_local_symbols): Call
6510 is_output_symtab_index_set rather than needs_output_symtab_entry.
6511 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6512 rather than needs_output_symtab_entry. Call
6513 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6514 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6515 is_output_symtab_index_set rather than needs_output_symtab_entry.
6516 * testsuite/discard_locals_relocatable_test.c: New file.
6517 * testsuite/discard_locals_test.sh: Test -r.
6518 * testsuite/Makefile.am (check_DATA): Add
6519 discard_locals_relocatable_test1.syms,
6520 discard_local_relocatable_test2.syms.
6521 (MOSTLYCLEANFILES): Likewise. Also add
6522 discard_locals_relocatable_test1.lout and
6523 discard_locals_relocatable_test2.out.
6524 (discard_locals_relocatable_test1.syms): New target.
6525 (discard_locals_relocatable_test.o): New target.
6526 (discard_locals_relocatable_test1.out): New target.
6527 (discard_locals_relocatable_test2.syms): New target.
6528 (discard_locals_relocatable_test2.out): New target.
6529 (various): Add missing ../ld-new dependencies.
6530 * testsuite/Makefile.in: Rebuild.
6531
7e8ccf26
NC
65322010-03-03 Nick Clifton <nickc@redhat.com>
6533
6534 * po/fi.po: New Finnish translation.
6535
2a0ff005
DK
65362010-03-01 Doug Kwan <dougkwan@google.com>
6537
6538 * layout.cc (Layout::Layout): Force section types of .init_array*,
6539 .preinit_array* and .fini_array* sections.
6540 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6541 Fix check of return value of std::string::find.().
6542 (Output_section::Input_section_sort_compare::operator()): Remove
6543 comment about .init_array.
6544 (Output_section::Input_section_sort_init_fini_compare::operator()):
6545 New method.
6546 (Output_section::sort_attached_input_sections): Handle .init_array
6547 and .fini_array specially.
6548 * output.h (Output_section::Inut_section_sort_compare): Update
6549 comment.
6550 (Output_section::Input_section_sort_init_fini_compare): New struct.
6551
c3e4ae29
DK
65522010-02-26 Doug Kwan <dougkwan@google.com>
6553
6554 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6555 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6556 * testsuite/debug_msg.sh: Avoid matching source line number for
6557 use of global variable undef_int.
6558
2fd9ae7a
DK
65592010-02-26 Doug Kwan <dougkwan@google.com>
6560
6561 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6562 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6563 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6564 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6565 * options.cc (General_options::General_options): Initialize member
6566 fix_v4bx_.
6567 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6568 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6569 and rm_no_fix_v4bx.stdout
6570 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6571 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6572 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6573 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6574 and arm_no_fix_v4bx.
6575 * Makefile.in: Regenerate.
6576 * testsuite/arm_fix_v4bx.s: New file.
6577 * testsuite/arm_fix_v4bx.sh: Ditto.
6578
67ec7d0b
DK
65792010-02-24 Doug Kwan <dougkwan@google.com>
6580
6581 * arm.cc (Target_arm::got_section): Make the .got section the first
6582 non RELRO section in the data segment.
6583 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6584 suffixes of section names.
6585
10165461
DK
65862010-02-24 Doug Kwan <dougkwan@google.com>
6587
6588 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6589 flags and attributes merging if an input file is a binary file.
6590 * fileread.cc (Input_file::open): Record format of original file.
6591 * fileread.h (Input_file::Format): New enum type.
2e702c99 6592 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6593 (Input_file::format): New method definition.
6594 (Input_file::format_):: New data member.
6595
4a54abbb
DK
65962010-02-24 Doug Kwan <dougkwan@google.com>
6597
6598 * arm.cc (Arm_output_data_got): New class.
6599 (ARM_TCB_SIZE): New constant
6600 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6601 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6602 If user uses a script with a SECTIONS clause, issue only a warning
6603 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6604 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6605 garbage collection.
6606 (Target_arm::got_mode_index_entry): Handle static linking.
6607 (Target_arm::Scan::local): Ditto.
6608 (Target_arm::Scan::global): Ditto.
6609 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6610 all incorrectly implemented relocations.
e1df38aa 6611 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6612 Arm_output_section::fix_exidx_coverage.
6613 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6614 from ".ARM.exidx." and ".ARM.extab.".
6615
ca419a6f
ILT
66162010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6617
6618 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6619 section if it does not already exist.
6620 * attributes.cc (Attributes_section_data::Attributes_section_data):
6621 Don't crash if size is zero.
6622
135b9c78
ILT
66232010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6624 Ian Lance Taylor <iant@google.com>
6625
6626 * gold.cc (queue_middle_tasks): If no input files were opened,
6627 exit.
6628 * workqueue.h (Task_function::Task_function): Assert that there is
6629 a blocker.
6630
bb0bfe4f
DK
66312010-02-22 Doug Kwan <dougkwan@google.com>
6632
6633 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6634 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6635 types to avoid warnings due to different uint64_t implementations
6636 on different hosts.
6637
2a2b6d42
DK
66382010-02-21 Doug Kwan <dougkwan@google.com>
6639
6640 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6641 handling of the maximum backward branch offset.
2e702c99 6642 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6643 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6644 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6645 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6646 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6647 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6648 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6649 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6650 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6651 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6652 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6653 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6654 thumb2_bl_out_of_range.o): New rules.
6655 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6656 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6657 thumb2_bl_out_of_range
6658 * testsuite/Makefile.in: Regenerate.
6659 * testsuite/arm_bl_in_range.s: New file.
6660 * testsuite/arm_bl_out_of_range.s: Ditto.
6661 * testsuite/arm_branch_in_range.sh: Ditto.
6662 * testsuite/arm_branch_range.t: Ditto.
6663 * testsuite/thumb2_branch_range.t: Ditto.
6664 * testsuite/thumb_bl_in_range.s: Ditto.
6665 * testsuite/thumb_bl_out_of_range.s: Ditto.
6666 * testsuite/thumb_branch_range.t: Ditto.
6667
b487ad64
ST
66682010-02-20 Sriraman Tallam <tmsriram@google.com>
6669
6670 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6671 Add reloc offset information.
6672 * icf.cc (get_section_contents): Change iterators to point to the new
6673 vectors. Add reloc offset information to the contents.
6674 * icf.h (Icf::Sections_reachable_info): New typedef.
6675 (Icf::Sections_reachable_list): New typedef.
6676 (Icf::Offset_info): New typedef.
6677 (Icf::Reloc_info): New struct typedef.
6678 (Icf::Reloc_info_list): New typedef.
6679 (Icf::symbol_reloc_list): Delete method.
6680 (Icf::addend_reloc_list): Delete method.
6681 (Icf::section_reloc_list): Delete method.
6682 (Icf::reloc_info_list): New method.
6683 (Icf::reloc_info_list_): New member.
6684
f96accdf
DK
66852010-02-19 Doug Kwan <dougkwan@google.com>
6686
6687 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6688 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6689 * arm.cc (Arm_relocation_functions): New forward declaration.
6690 (Target_arm::Target_arm): Initialize new data members
6691 got_mod_index_offset_ and tls_base_symbol_defined_.
6692 (Target_arm::Relocate::relocate_tls): New method.
6693 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6694 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6695 New methods.
2e702c99 6696 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6697 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6698 (Target_arm::got_mod_index_offset_,
6699 Target_arm::tls_base_symbol_defined_): New data members.
6700 (Target_arm::Scan::local, Target::Scan::global,
6701 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6702 relocations.
6703
c8761b9a
DK
67042010-02-18 Doug Kwan <dougkwan@google.com>
6705
6706 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6707 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6708 text section as a parameter becuase some broken tools may not set
6709 the link in section header.
6710 (Target_arm::has_got_section): New method.
6711 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6712 without any mapping symbol as data only. Remove warning.
6713 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6714 link in its section header, try to discover the link by inspecting the
6715 REL31 relocation at the beginning of the section.
6716 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6717 in error message.
6718 (Target_arm::Scan::global): Treat any reference to the symbol
6719 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6720
21bb3914
ST
67212010-02-12 Sriraman Tallam <tmsriram@google.com>
6722
6723 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6724 (Scan::global_reloc_may_be_function_pointer): New function.
6725 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6726 (Scan::global_reloc_may_be_function_pointer): New function.
6727 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6728 (Scan::global_reloc_may_be_function_pointer): New function.
6729 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6730 (Scan::global_reloc_may_be_function_pointer): New function.
6731 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6732 (Scan::global_reloc_may_be_function_pointer): New function.
6733 (Scan::possible_function_pointer_reloc): New function.
6734 (Target_x86_64::can_check_for_function_pointers): New function.
6735 * gc.h (gc_process_relocs): Scan relocation types to determine if
6736 function pointers were taken for targets that support it.
6737 * icf.cc (Icf::find_identical_sections): Include functions for
6738 folding in safe ICF whose pointer is not taken.
6739 * icf.h (Secn_fptr_taken_set): New typedef.
6740 (fptr_section_id_): New member.
6741 (section_has_function_pointers): New function.
6742 (set_section_has_function_pointers): New function.
6743 (check_section_for_function_pointers): New function.
6744 * options.h: Fix comment for safe ICF option.
6745 * target.h (can_check_for_function_pointers): New function.
6746 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6747 Modify icf_safe_test for X86-64.
6748 * testsuite/Makefile.in: Regenerate.
6749 * testsuite/icf_safe_so_test.cc: New file.
6750 * testsuite/icf_safe_so_test.sh: New file.
6751 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6752 (main): Change to take pointer to function kept_func_3.
6753 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6754 folding is done correctly for X86-64.
6755
0da6fa6c
DM
67562010-02-12 David S. Miller <davem@davemloft.net>
6757
6758 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6759 is_symbolless parameter.
6760 (Output_reloc<SHT_REL>::is_symbolless): New.
6761 (Output_reloc<SHT_REL>::is_symbolless_): New.
6762 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6763 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6764 (Output_reloc<SHT_RELA>::is_symbolless): New.
6765 (Output_data_reloc::add_global): Handle is_symbolless.
6766 (Output_data_reloc::add_global_relative): Likewise.
6767 (Output_data_reloc::add_local): Likewise.
6768 (Output_data_reloc::add_local_relative): Likewise.
6769 (Output_data_reloc::add_symbolless_global_addend): New.
6770 (Output_data_reloc::add_symbolless_local_addend): New.
6771 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6772 is_symbolless.
6773 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6774 instead of ->is_relative_
6775 (Output_reloc::write): Likewise.
6776 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6777 (Output_reloc::write_rel): Simplify.
6778
6779 * sparc.cc (Target_sparc::Scan::local): Use
6780 ->add_symbolless_local_addend as needed.
6781 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6782 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6783 based upon relocation offset.
6784
e4782e83
DK
67852010-02-11 Doug Kwan <dougkwan@google.com>
6786
6787 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6788 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6789 beginning of function.
6790 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6791 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6792 parameter is_32bit in calls to should_apply_static_reloc.
6793 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6794 (check_DATA): Add arm_abs_global.stdout.
6795 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6796 arm_abs_global.stdout): New rules.
6797 (MOSTLLYCLEANFILES): Add arm_abs_global
6798 * Makefile.in: Regenerate.
6799 * testsuite/arm_abs_global.s: New file.
6800 * testsuite/arm_abs_global.sh: Ditto.
6801 * testsuite/arm_abs_lib.s: Ditto.
6802
93ceb764
ILT
68032010-02-11 Ian Lance Taylor <iant@google.com>
6804
6805 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6806 Read_relocs task.
6807 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6808 Allocate_commons_task first.
6809 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6810 task, rather than symtab_lock_.
6811 (Gc_process_relocs::~Gc_process_relocs): New function.
6812 (Gc_process_relocs::is_runnable): Check this_blocker_.
6813 (Gc_process_relocs::locks): Use next_blocker_ rather than
6814 blocker_.
6815 (Scan_relocs::~Scan_relocs): New function.
6816 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6817 symtab_lock_.
6818 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6819 next_blocker_.
6820 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6821 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6822 constructor accordingly.
6823 (class Gc_process_relocs): Likewise.
6824 (class Scan_relocs): Likewise.
6825 * common.h (class Allocate_commons_task): Remove symtab_lock_
6826 field, and corresponding constructor parameter.
6827 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6828 symtab_lock_.
6829 (Allocate_commons_task::locks): Likewise.
6830
114dfbe1
ILT
68312010-02-11 Ian Lance Taylor <iant@google.com>
6832
6833 * gold-threads.h (class Once): Define.
6834 (class Initialize_lock): Rewrite as child of Once.
6835 * gold-threads.cc (class Once_initialize): Define.
6836 (once_pointer_control): New static variable.
6837 (once_pointer, once_arg): New static variables.
6838 (c_run_once): New static function.
6839 (Once::Once, Once::run_once, Once::internal_run): New functions.
6840 (class Initialize_lock_once): Remove.
6841 (initialize_lock_control): Remove.
6842 (initialize_lock_pointer): Remove.
6843 (initialize_lock_once): Remove.
6844 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6845 (Initialize_lock::initialize): Rewrite.
6846 (Initialize_lock::do_run_once): New function.
6847 * archive.cc (Archive::interpret_header): Only clear name if it is
6848 not already empty.
6849 * fileread.cc: Include "gold-threads.h"
6850 (file_counts_lock): New static variable.
6851 (file_counts_initialize_lock): Likewise.
6852 (File_read::release): Only increment counts when using --stats.
6853 Use a lock around the increment.
6854 * parameters.cc (class Set_parameters_target_once): Define.
6855 (set_parameters_target_once): New static variable.
6856 (Parameters::Parameters): Move here from parameters.h.
6857 (Parameters::set_target): Rewrite.
6858 (Parameters::set_target_once): New function.
6859 (Parameters::clear_target): Move here and rewrite.
6860 * parameters.h (class Parameters): Update declarations. Add
6861 set_parameters_target_once_ field.
6862 (Parameters::Parameters): Move to parameters.cc.
6863 (Parameters::clear_target): Likewise.
6864 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6865 task.
6866 (Start_group::~Start_group): New function.
6867 (Start_group::is_runnable): New function.
6868 (Start_group::locks, Start_group::run): New functions.
6869 (Finish_group::run): Change saw_undefined to size_t.
6870 * readsyms.h (class Start_group): Define.
6871 (class Finish_group): Change saw_undefined_ field to size_t.
6872 (Finish_group::Finish_group): Remove saw_undefined and
6873 this_blocker parameters. Change all callers.
6874 (Finish_group::set_saw_undefined): New function.
6875 (Finish_group::set_blocker): New function.
6876 * symtab.h (class Symbol_table): Change saw_undefined to return
6877 size_t. Change saw_undefined_ field to size_t.
6878 * target-select.cc (Set_target_once::do_run_once): New function.
6879 (Target_selector::Target_selector): Initialize set_target_once_
6880 field. Don't initialize lock_ and initialize_lock_ fields.
6881 (Target_selector::instantiate_target): Rewrite.
6882 (Target_selector::set_target): New function.
6883 * target-select.h (class Set_target_once): Define.
6884 (class Target_selector): Update declarations. Make
6885 Set_target_once a friend. Remove lock_ and initialize_lock_
6886 fields. Add set_target_once_ field.
6887
fa17a3f4
ILT
68882010-02-10 Ian Lance Taylor <iant@google.com>
6889
6890 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6891 queueing any tasks.
6892 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6893 (queue_middle_tasks): Add all blockers before queueing any tasks.
6894 (queue_final_tasks): Likewise.
6895 * token.h (Task_token::add_blockers): New function.
6896 * object.h (Input_objects::number_of_relobjs): New function.
6897
c7177d31
ILT
68982010-02-10 Ian Lance Taylor <iant@google.com>
6899
5de0e392
ILT
6900 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6901 shared, not if not position independent.
6902 * x86_64.cc (Relocate::relocate_tls): Likewise.
6903 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6904 (tls_pie_pic_test): New target.
6905 * testsuite/Makefile.in: Rebuild.
6906
c7177d31
ILT
6907 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6908 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6909 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6910 * testsuite/Makefile.in: Rebuild.
6911
684b268a
DM
69122010-02-09 David S. Miller <davem@davemloft.net>
6913
6914 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6915 R_SPARC_RELATIVE using ->add_local_relative().
6916 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6917
612a8d3d
DM
6918 * output.h (Output_data_dynamic::add_section_size): New method
6919 that takes two Output_data objects.
6920 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6921 entry param. Handle it in initializers.
6922 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6923 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6924 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6925 arg.
6926 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6927 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6928 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6929 for dynrel_includes_plt.
6930 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6931 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6932 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6933 before .rela.plt
6934 (Target_sparc::do_finalize_sections): Update to pass true for
6935 dynrel_includes_plt.
6936 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6937 output before .rela.plt
6938 (Target_powerpc::do_finalize_sections): Update to pass true for
6939 dynrel_includes_plt when 32-bit.
6940
cb1be87e
DK
69412010-02-08 Doug Kwan <dougkwan@google.com>
6942
6943 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6944 method.
6945 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6946 Arm_relobj::scan_section_for_cortex_a8_stubs,
6947 Arm_relobj::do_relocation_section): Instead of calling
6948 Output_section::output_address, use faster
6949 Arm_relobj::simple_input_section_output_address.
6950
705b5121
DM
69512010-02-08 David S. Miller <davem@davemloft.net>
6952
6953 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6954 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6955 relocation helper function.
6956
024c4466
DM
6957 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6958 just like R_SPARC_GOT{10,13,22}.
6959 (Target_sparc::Scan::local): Likewise.
6960 (Target_sparc::Relocate:relocate): Likewise.
6961
9109c078
ILT
69622010-02-06 Ian Lance Taylor <iant@google.com>
6963
6964 * configure.ac: Rewrite targetobjs duplicate removal code to use
6965 only shell constructs.
6966 * configure: Rebuild.
6967
cf846138
DK
69682010-02-05 Doug Kwan <dougkwan@google.com>
6969
6970 PR 11247
6971 * arm.cc (Arm_relobj::section_is_scannable): New method.
6972 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6973 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6974
6cfaf60b
DK
69752010-02-04 Doug Kwan <dougkwan@google.com>
6976
6977 PR 11247
6978 * arm-reloc-property.cc (cstdio): Include.
6979 * configure.ac (targetobjs): Remove duplicates.
6980 * configure: Regenerate.
6981 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6982 big and little endian version for a given address size.
6983
5c57f1be
DK
69842010-02-03 Doug Kwan <dougkwan@google.com>
6985
6986 * arm-reloc-property.cc
6987 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6988 definition.
6989 * arm-reloc-property.h
6990 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6991 New method definition.
6992 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6993 declaration.
6994 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6995 overflow to N.
6996 (GOT_PREL): Change implemented to Y.
6997 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6998 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6999 (Arm_relocate_functions::movw_abs_nc): Remove method.
7000 (Arm_relocate_functions::movt_abs): Ditto.
7001 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7002 (Arm_relocate_functions::thm_movt_abs): Ditto.
7003 (Arm_relocate_functions::movw_rel_nc): Ditto.
7004 (Arm_relocate_functions::movw_rel): Ditto.
7005 (Arm_relocate_functions::movt_rel): Ditto.
7006 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7007 (Arm_relocate_functions:thm_movw_rel): Ditto.
7008 (Arm_relocate_functions:thm_movt_rel): Ditto.
7009 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7010 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7011 New method definitions.
7012 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7013 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7014 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7015 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7016 (Target_arm::Relocate::relocate): Check for non-static or
7017 unimplemented relocation code and exit early. Change calls to
7018 Target_arm::reloc_uses_thumb_bit and
7019 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7020 instead. Refactor code to handle similar relocations to increase
7021 code sharing. Remove check for unsupported relocation code in switch
7022 statement.
7023 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7024 relocation property table to find out size. Change error message to
7025 print out the name of a relocation code instead of the numeric value.
7026 (Target_arm::scan_reloc_for_stub): Use relocation property table
7027 instead of calling Target_arm::reloc_uses_thumb_bit().
7028
218c5831
DK
70292010-02-02 Doug Kwan <dougkwan@google.com>
7030
7031 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7032 types of relaxed input section.
7033
0d31c79d
DK
70342010-02-02 Doug Kwan <dougkwan@google.com>
7035
7036 * Makefile.am (HFILES): Add arm-reloc-property.h.
7037 (DEFFILES): New.
2e702c99
RM
7038 (TARGETSOURCES): Add arm-reloc-property.cc
7039 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7040 (libgold_a_SOURCES): $(DEFFILES)
7041 * Makefile.in: Regenerate.
7042 * arm-reloc-property.cc: New file.
7043 * arm-reloc-property.h: New file.
7044 * arm-reloc.def: New file.
7045 * arm.cc: Update comments.
7046 (arm-reloc-property.h): New included header.
7047 (arm_reloc_property_table): New global variable.
7048 (Target_arm::do_select_as_default_target): New method definition.
7049 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7050 arm-reloc-property to targ_extra_obj.
7051 * parameters.cc (set_parameters_target): Call
7052 Target::select_as_default_target().
7053 * target.h (Target::select_as_default_target): New method definition.
7054 (Target::do_select_as_default_target): Same.
7055
546c7457
DK
70562010-02-01 Doug Kwan <dougkwan@google.com>
7057
7058 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7059 first_output_text_section_.
7060 (Arm_exidx_fixup::first_output_text_section): New method definition.
7061 (Arm_exidx_fixup::first_output_text_section_): New data member.
7062 (Arm_exidx_fixup::process_exidx_section): Record the first text
7063 output section seen.
7064 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7065 and entsize in output section header.
7066
11b861d5
DK
70672010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7068
7069 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7070 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7071 (Arm_relocate_functions::thm_alu11): New Method.
7072 (Arm_relocate_functions::thm_pc8): New Method.
7073 (Arm_relocate_functions::thm_pc12): New Method.
7074 (Target_arm::Scan::local): Handle the relocations.
7075 (Target_arm::Scan::global): Likewise.
7076 (Target_arm::Relocate::relocate): Likewise.
7077 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7078
c9a2c125
DK
70792010-01-29 Doug Kwan <dougkwan@google.com>
7080
7081 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7082 of relocation types as ld.
7083
1521477a
DK
70842010-01-29 Doug Kwan <dougkwan@google.com>
7085
7086 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7087 to public.
7088 (Arm_relocate_functions::thumb_branch_common): Ditto.
7089 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7090 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7091 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7092 Arm_relocate_functions::jump24): Remove.
7093 (Target_arm::Relocate::relocate): Adjust code to call
7094 Arm_relocation_functions::arm_branch_common and
7095 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7096 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7097
e7eca48c
DK
70982010-01-29 Doug Kwan <dougkwan@google.com>
7099
7100 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7101 output_local_symbol_count_needs_update_.
7102 (Arm_relobj::output_local_symbol_count_needs_update,
7103 Arm_relobj::set_output_local_symbol_count_needs_update,
7104 Arm_relobj::update_output_local_symbol_count): New methods.
7105 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7106 member.
7107 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7108 of pointed function as in a R_ARM_PREL31 relocation.
7109 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7110 for output local symbol count updating.
7111 (Target_arm::do_relax): Update output local symbol counts in objects
7112 if necessary.
7113 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7114
02961d7e
ILT
71152010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7116
7117 * arm.cc: Added support for the ARM relocations:
7118 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7119 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7120 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7121 movw_prel_nc).
7122 (Arm_relocate_functions::movw_rel): New method.
7123 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7124 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7125 thm_movw_prel_nc).
7126 (Arm_relocate_functions::thm_movw_rel): New method.
7127 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7128 thm_movt_prel).
7129 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7130 relocations.
7131 (Target_arm::Scan::global): Likewise.
7132 (Target_arm::Relocate::relocate): Likewise.
7133 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7134 Likewise.
7135
b10d2873
ILT
71362010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7137
7138 * arm.cc: Added support for ARM group relocations.
7139 (Target_arm::reloc_needs_sym_origin): New method.
7140 (Arm_relocate_functions::calc_grp_kn): New method.
7141 (Arm_relocate_functions::calc_grp_residual): New method.
7142 (Arm_relocate_functions::calc_grp_gn): New method.
7143 (Arm_relocate_functions::arm_grp_alu): New Method.
7144 (Arm_relocate_functions::arm_grp_ldr): New Method.
7145 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7146 (Arm_relocate_functions::arm_grp_ldc): New Method.
7147 (Target_arm::Scan::local): Handle the ARM group relocations.
7148 (Target_arm::Scan::global): Likewise.
7149 (Target_arm::Relocate::relocate): Likewise.
7150 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7151 Likewise.
7152
2b328d4e
DK
71532010-01-26 Doug Kwan <dougkwan@google.com>
7154
7155 * arm.cc (set): Include.
7156 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7157 pointer type.
2e702c99 7158 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7159 (Arm_output_section::append_text_sections_to_list): New method.
7160 (Arm_output_section::fix_exidx_coverage): Ditto.
7161 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7162 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7163 Relobj::set_section_offset() instead of
7164 Sized_relobj::invalidate_section_offset().
2e702c99 7165 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7166 parameter for section headers. Ignore relocation sections for
7167 unallocated sections and EXIDX sections.
7168 (Target_arm::fix_exidx_coverage): New method.
7169 (Target_arm::output_section_address_less_than): New type.
7170 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7171 linked text section instead of the EXIDX section.
7172 (Arm_output_section::create_stub_group): Add an assertion to check
7173 that this is not an EXIDX output section.
7174 (Arm_output_section::append_text_sections_to_list): New method.
7175 (Arm_output_section::fix_exidx_coverage): Ditto.
7176 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7177 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7178 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7179 first pass.
7180 (Target_arm::fix_exidx_coverage): New method.
7181 * object.h (Relobj::set_output_section): New method.
7182 (Sized_relobj::invalidate_section_offset): Remove method.
7183 (Sized_relobj::do_invalidate_section_offset): Remove method.
7184 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7185
c7f3c371
DK
71862010-01-25 Doug Kwan <dougkwan@google.com>
7187
7188 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7189 Fix warning due to signed and unsigned comparison on a 32-bit host.
7190
8923b24c
DK
71912010-01-22 Doug Kwan <dougkwan@google.com>
7192
7193 * arm.cc (Target_arm::do_relax): Record an output section for section
7194 offset adjustment it contains any stub table that has changed.
7195 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7196 offsets in an output section if necessary.
7197 * output.cc (Output_section::Output_section): Initialize
7198 section_offsets_need_adjustments_.
7199 (Output_section::add_input_section_for_script): Renamed to
7200 Output_section::add_simple_input_section.
7201 (Output_section::save_states): Add a comment.
7202 (Output_section::discard_states): New method defintion.
7203 (Output_section::adjust_section_offsets): Same.
7204 * output.h (Output_section::add_input_section_for_script): Renamed to
7205 Output_section::add_simple_input_section.
7206 (Output_section::discard_states): New method declaration.
7207 (Output_section::adjust_section_offsets): Same.
7208 (Output_section::section_offsets_need_adjustment,
7209 Output_section::set_section_offsets_need_adjustment): New method
7210 definitions.
7211 (Output_section::section_offsets_need_adjustment_): New data member.
7212 * script-sections.cc
7213 (Output_section_element_input::set_section_address): Adjust code for
7214 renaming of Output_section::add_input_section_for_script.
7215 (Orphan_output_section::set_section_address): Same.
7216
9b2fd367
DK
72172010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7218
7219 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7220 Fix_v4bx enum values .
7221 * gold/options.h (General_options): New option definitions.
7222 (General_options::fix_v4bx): New method.
7223 (General_options::Fix_v4bx): New enum.
7224 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7225 (General_options::parse_fix_v4bx_interworking): New method.
7226
80d0d023
DK
72272010-01-22 Doug Kwan <dougkwan@google.com>
7228
7229 * arm.cc (Arm_exidx_fixup): New class.
7230
af2cdeae
DK
72312010-01-21 Doug Kwan <dougkwan@google.com>
7232
7233 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7234 classes.
7235 (Arm_exidx_section_offset_map): New type.
7236
993d07c1
DK
72372010-01-21 Doug Kwan <dougkwan@google.com>
7238
7239 * arm.cc (Arm_exidx_input_section): New class.
7240 (Arm_relobj::exidx_input_section_by_link,
7241 Arm_relobj::exidx_input_section_by_shndx,
7242 Arm_relobj::make_exidx_input_section): New methods.
7243 (read_arm_attributes_section): Remove.
7244 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7245 information about them.
7246 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7247 to here.
7248
5ac169d4
DK
72492010-01-20 Doug Kwan <dougkwan@google.com>
7250
7251 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7252 Input_section_specifier to Section_id.
7253 (Target_arm::new_arm_input_section: Adjust code for change of key
7254 type.
7255 (Target_arm::find_arm_input_section): Ditto.
7256 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7257 (Section_id): Remove.
7258 (Garbage_collection::Section_id_hash): Remove.
7259 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7260 (Section_id): Remove.
7261 (Icf::Section_id_hash): Remove.
7262 * object.h (Section_id, Const_section_id, Section_id_hash,
7263 Const_section_id_hash): New type definitions.
7264 * output.cc (Output_section::add_relaxed_input_section): Change to
7265 use Const_section_id instead of Input_section_specifier as key type.
7266 (Output_section::add_merge_input_section): Ditto.
7267 (Output_section::build_relaxation_map): Change to use Section_id
7268 instead of Input_section_specifier as key type.
2e702c99 7269 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7270 Ditto.
7271 (Output_section::convert_input_sections_to_relaxed_sections): Change
7272 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7273 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7274 (Output_section::find_relaxed_input_section): Ditto.
7275 * output.h (Input_section_specifier): Remove class.
7276 (Output_section::Output_section_data_by_input_section_map): Change
7277 key type to Const_section_id.
7278 (Output_section::Output_relaxed_input_section_by_input_section_map):
7279 Ditto.
7280 (Output_section::Relaxation_map): Change key type to Section_id.
7281
a2162063
ILT
72822010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7283
7284 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7285 (class Arm_v4bx_stub): New class.
7286 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7287 (Stub_factory::make_arm_v4bx_stub): New method.
7288 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7289 (Stub_table::empty): Handle v4bx stubs.
7290 (Stub_table::add_arm_v4bx_stub): New method.
7291 (Stub_table::find_arm_v4bx_stub): New method.
7292 (Arm_relocate_functions::v4bx): New method.
7293 (Target_arm::fix_v4bx): New method.
7294 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7295 (Stub_table::relocate_stubs): Likewise.
7296 (Stub_table::do_write): Likewise.
7297 (Stub_table::update_data_size_and_addralign): Likewise.
7298 (Stub_table::finalize_stubs): Likewise.
7299 (Target_arm::Scan::local): Likewise.
7300 (Target_arm::Scan::global): Likewise.
7301 (Target_arm::do_finalize_sections): Likewise.
7302 (Target_arm::Relocate::relocate): Likewise.
7303 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7304 Likewise.
7305 (Target_arm::scan_reloc_for_stub): Likewise.
7306 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7307
5696ab0b
ILT
73082010-01-19 Ian Lance Taylor <iant@google.com>
7309
7310 * output.cc (Output_section_headers::do_sized_write): Write large
7311 segment count to sh_info field.
7312 (Output_file_header::do_sized_write): For large segment count,
7313 write PN_XNUM to e_phnum field.
7314
800d0f56
ILT
73152010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7316
7317 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7318 (Arm_relocate_functions::thm_jump8): New function.
7319 (Arm_relocate_functions::thm_jump11): New function.
7320 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7321 R_ARM_THM_JUMP11.
7322 (Target_arm::Scan::global): Likewise.
7323 (Target_arm::Relocate::relocate): Likewise.
7324 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7325 Likewise.
7326
41263c05
DK
73272010-01-14 Doug Kwan <dougkwan@google.com>
7328
7329 * arm.cc (map, utility): Include headers.
7330 (Target_arm::apply_cortex_a8_workaround): New method.
7331 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7332 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7333 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7334 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7335 the --[no-]fix-cortex-a8 command line options.
7336 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7337 (Target_arm::relocate_stub): Use addend in instruction template.
7338 * options.h (DEFINE_bool): Set the user-set flag.
7339 (General_options): Add --[no-]-fix-cortex options.
7340 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7341 : Update fast look-up map after conversion.
41263c05 7342
459e9b03
ST
73432010-01-14 Sriraman Tallam <tmsriram@google.com>
7344
7345 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7346 in the first pass of do_layout.
7347
b521dfe4
DK
73482010-01-13 Doug Kwan <dougkwan@google.com>
7349
7350 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7351 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7352 apparent compiler problem of not folding static constant integral
7353 data members of elfcpp::Elf_sizes<32>.
7354
44272192
DK
73552010-01-13 Doug Kwan <dougkwan@google.com>
7356
7357 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7358 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7359 Arm_relobj::scan_section_for_cortex_a8_erratum,
7360 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7361 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7362 sections to scan for relocation stubs into a new method
7363 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7364 relocation and Cortex-A8 stub scanning.
7365 (Target_arm::do_relax): Force stubs to be after stubbed sections
7366 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7367 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7368 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7369
44b71ece
ILT
73702010-01-12 Ian Lance Taylor <iant@google.com>
7371
7372 * target-reloc.h (visibility_error): New inline function.
7373 (relocate_section): Call visibility_error.
7374 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7375 (MOSTLYCLEANFILES): Likewise.
7376 (protected_4_pic.o, protected_3.err): New targets.
7377 * testsuite/protected_4.cc: New file.
7378
a120bc7f
DK
73792010-01-12 Doug Kwan <dougkwan@google.com>
7380
7381 * arm.cc (Cortex_a8_reloc): New class.
7382 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7383 and cortex_a8_relocs_info_.
7384 (Target_arm::fix_cortex_a8): New method definition.
7385 (Target_arm::Cortex_a8_relocs_info): New type.
7386 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7387 New data member declarations.
7388 (Target_arm::scan_reloc_for_stub): Record information about
7389 relocations for THUMB branches that might be exempted from the
7390 Cortex-A8 workaround.
7391 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7392 at the beginning of a relaxation pass.
7393
20138696
DK
73942010-01-12 Doug Kwan <dougkwan@google.com>
7395
7396 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7397 (Arm_relobj::Mapping_symbol_position,
7398 Arm_reloj::Mapping_symbol_position_less,
7399 Arm_relobj::Mapping_symbols_info): New types.
7400 (Target_arm::is_mapping_symbol_name): New method definition.
7401 (Arm_relobj::do_count_local_symbols): Save information about mapping
7402 symbols.
7403
089d69dc
DK
74042010-01-11 Doug Kwan <dougkwan@google.com>
7405
7406 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7407 Arm_relocate_functions::thumb32_branch_upper,
7408 Arm_relocate_functions::thumb32_branch_lower,
7409 Arm_relocate_functions::thumb32_cond_branch_offset,
7410 Arm_relocate_functions::thumb32_cond_branch_upper,
7411 Arm_relocate_functions::thumb32_cond_branch_lower,
7412 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7413 branch offset encoding.
7414 (Arm_relocate_functions::thumb_branch_common): Use new branch
7415 offset encoding methods to avoid code duplication.
7416 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7417 (Stub_addend_reader::operator()): Use new branch encoding method
7418 to avoid code duplication.
7419
99e5bff2
DK
74202010-01-11 Doug Kwan <dougkwan@google.com>
7421
7422 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7423 (Target_arm::do_finalize_sections): Define special EXIDX section
7424 symbols only if referenced.
7425 * gc.h (Garbage_collection::add_reference): New method.
7426 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7427 code duplication.
7428
98e090bd
ILT
74292010-01-11 Ian Lance Taylor <iant@google.com>
7430
d0a91bd8
ILT
7431 * script.cc (Version_script_info::build_expression_list_lookup):
7432 Change complaing about duplicate wildcard match from error to
7433 warning.
7434
98e090bd
ILT
7435 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7436 of 2009-12-30.
7437 (Version_script_info::Version_script_info): Initialize globs_,
7438 default_version_, default_is_global_, and exact_. Don't
7439 initialize globals_ or locals_.
7440 (Version_script_info::build_lookup_tables): Build local symbols
7441 first.
7442 (Version_script_info::unquote): New function.
7443 (Version_script_info::add_exact_match): New function.
7444 (Version_script_info::build_expression_list_lookup): Remove lookup
7445 parameter. Add is_global parameter. Change all callers. Handle
7446 wildcard pattern specially. Unquote pattern. Call
7447 add_exact_match.
7448 (Version_script_info::get_name_to_match): New function.
7449 (Version_script_info::get_symbol_version): New function.
7450 (Version_script_info::get_symbol_version_helper): Remove.
7451 (Version_script_info::check_unmatched_names): Call unquote.
7452 * script.h (class Version_script_info): Change get_symbol_version
7453 to be non-inline and add is_global parameter; change all callers.
7454 Rewrite symbol_is_local. Update declarations. Define struct
7455 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7456 Remove globals_ and locals_ members. Add exact_, globs_,
7457 default_version_, is_global_.
7458 (Version_script_info::Glob): Remove pattern, add expression and
7459 is_global. Update constructor. Change all callers.
7460 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7461 default version.
7462 (Versions::symbol_section_contents): If a symbol is undefined, or
7463 defined in a dynamic object, set the version index to
7464 VER_NDX_LOCAL.
7465 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7466 symbol_is_local.
7467 (Symbol_table::add_from_pluginobj): Likewise.
7468 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7469
d56962d3
DK
74702010-01-11 Doug Kwan <dougkwan@google.com>
7471
7472 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7473 (incremental_dump_LDADD): Add linking option for libintl.
7474 * Makefile.in: Regenerate.
7475
94e6ee91
L
74762010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7477
7478 PR gold/11144
7479 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7480 instead of -Ds.
7481 * testsuite/Makefile.in: Regenerated.
7482
e96c574b
DK
74832010-01-10 Doug Kwan <dougkwan@google.com>
7484
7485 * options.h (DEFINE_var): Use parentheses around argument varname__
7486 in macro body to avoid any unintended subsequent substitutions.
7487
7198066b
ILT
74882010-01-10 Ian Lance Taylor <iant@google.com>
7489
ba4d53bf
ILT
7490 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7491 candidates before doing symbol resolution.
7492
7198066b
ILT
7493 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7494 ODR candidates if only one is weak.
7495
a2beed37
ILT
74962010-01-08 Ian Lance Taylor <iant@google.com>
7497
7498 * script.cc (Version_script_info::build_expression_list_lookup):
7499 Don't warn about ambiguous version, just record the ambiguity.
7500 (Version_script_info::get_symbol_version_helper): Give error if
7501 version is ambiguous.
7502
2fb7225c
DK
75032010-01-08 Doug Kwan <dougkwan@google.com>
7504
7505 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7506 prev_data_size_ and prev_addralign_. Remove initializer for
7507 deleted data member has_been_changed_.
7508 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7509 to determine if the table is empty.
7510 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7511 Remove.
7512 (Stub_table::add_reloc_stub): Define method in class definition
7513 instead of just declaring it there.
7514 (Stub_table::add_cortex_a8_stub): New method definition.
7515 (Stub_table::update_data_size_and_addralign): Ditto.
7516 (Stub_table::finalize_stubs): Ditto.
7517 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7518 (Stub_table::do_addralign_): Return address alignment in the
7519 (Stub_table::do_reset_address_and_file_offset): Define method in
7520 class definition instead of declaring it there. Set current data
7521 size to be the data size of the previous pass.
7522 (Stub_table::set_final_data_size): Use current data size as the
7523 final data size.
7524 (Stub_table::relocate_stub): Change parameter type of stub from
7525 Reloc_stub pointer to Stub pointer.
7526 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7527 (Stub_table::Cortex_a8_stub_list): New typedef.
7528 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7529 Stub_table::prev_addralign_): New data member.
7530 (Arm_relobj::Arm_relobj): Initialize data member
7531 section_has_cortex_a8_workaround_.
7532 (Arm_relobj::section_has_cortex_a8_workaround,
7533 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7534 definitions.
7535 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7536 declarations.
7537 (Target_arm::relocate_stub): Change parameter type of stub from
7538 Reloc_stub pointer to Stub pointer.
7539 (Insn_template::size, Insn_template::alignment): Handle
7540 THUMB16_SPECIAL_TYPE.
7541 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7542 Stub_table::update_data_size_and_addralign,
7543 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7544 definitions.
7545 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7546 (Stub_table::do_write): Ditto.
7547 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7548
880cd20d
ILT
75492010-01-08 Ian Lance Taylor <iant@google.com>
7550
7551 PR 11108
7552 * symtab.h (class Symbol): Remove fields is_target_special_ and
7553 has_plt_offset_. Add field is_defined_in_discarded_section_.
7554 (Symbol::is_defined_in_discarded_section): New function.
7555 (Symbol::set_is_defined_in_discarded_section): New function.
7556 (Symbol::has_plt_offset): Rewrite.
7557 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7558 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7559 Don't initialize is_target_special_ or has_plt_offset_.
7560 Initialize is_defined_in_discarded_section_.
7561 (Symbol_table::add_from_relobj): If appropriate, set
7562 is_defined_in_discarded_section.
7563 * resolve.cc (Symbol::override_base_with_special): Don't test
7564 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7565 * target-reloc.h (relocate_section): Do special handling for
7566 symbols defined in discarded sections for global symbols as well
7567 as local symbols.
7568
2703e3eb
ILT
75692010-01-08 Ian Lance Taylor <iant@google.com>
7570
7571 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7572 the SHT_SYMTAB case.
7573
339d40a3
ILT
75742010-01-08 Ian Lance Taylor <iant@google.com>
7575
7576 * object.cc (Sized_relobj::do_layout): Don't get confused if
7577 layout_eh_frame returns NULL.
7578
abecea76
ILT
75792010-01-08 Ian Lance Taylor <iant@google.com>
7580
7581 PR 11084
7582 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7583 dynamic symbol table, use the normal symbol table.
7584 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7585 symbol table.
7586
6b7dd3f3
ILT
75872010-01-08 Ian Lance Taylor <iant@google.com>
7588
7589 PR 11072
7590 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7591 sections.
7592
36c50e63
L
75932010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7594
7595 * version.cc (print_version): Change to "Copyright 2010".
7596
e291e7b9
ILT
75972010-01-08 Ian Lance Taylor <iant@google.com>
7598
7599 PR 10287
7600 PR 11063
7601 * i386.cc (class Target_i386): Change return type of plt_section
7602 to be non-const.
7603 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7604 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7605 tls_desc_rel_ field.
7606 (Output_data_plt_i386::rel_tls_desc): New function.
7607 (Target_i386::rel_tls_desc_section): New function.
7608 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7609 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7610 R_386_TLS_DESC reloc in rel_tls_desc_section.
7611 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7612 Define struct Tlsdesc_info.
7613 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7614 (Target_x86_64::do_reloc_symbol_index): New function.
7615 (Target_x86_64::add_tlsdesc_info): New function.
7616 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7617 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7618 tlsdesc_rel_ field.
7619 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7620 all callers.
7621 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7622 (Target_x86_64::rela_tlsdesc_section): New function.
7623 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7624 handling.
7625 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7626 (Target_x86_64::do_reloc_addend): New function.
7627 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7628 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7629 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7630 (Output_reloc::type): New function.
7631 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7632 (Output_reloc::is_target_specific): New function.
7633 (Output_reloc::target_arg): New function.
7634 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7635 absolute relocs and target specific relocs.
7636 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7637 add_target_specific.
7638 (class Output_data_reloc) [SHT_RELA]: Likewise.
7639 * output.cc (Output_reloc::Output_reloc): Add four new versions
7640 for absolute relocs and target specific relocs.
7641 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7642 (Output_reloc::get_symbol_index): Likewise.
7643 (Output_reloc::local_section_offset): Check that local_sym_index_
7644 is not TARGET_CODE or 0.
7645 (Output_reloc::symbol_value): Likewise.
7646 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7647 reloc.
7648 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7649 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7650 functions.
7651 * layout.cc (add_target_dynamic_tags): Use output section for
7652 DT_PLTRELSZ and DT_JMPREL.
7653
3a44184e
ILT
76542010-01-07 Ian Lance Taylor <iant@google.com>
7655
7656 PR 11061
7657 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7658 function.
7659 (class Output_data_reloc_generic): Define.
7660 (class Output_data_reloc_base): Change base class to
7661 Output_data_reloc_generic. Change add() method to call
7662 bump_relative_reloc_count for a relative reloc. Remove
7663 sort_relocs_ field.
7664 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7665 to sort_relocs().
7666 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7667 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7668 appropriate.
7669 * layout.h (class Layout): Update declaration.
7670
ea715a34
ILT
76712010-01-07 Ian Lance Taylor <iant@google.com>
7672
7673 * output.h (class Output_data): Add const version of
7674 output_section and do_output_section.
7675 (class Output_section_data): Add const version of
7676 do_output_section.
7677 (class Output_section): Likewise.
7678 * layout.cc (Layout::add_target_dynamic_tags): New function.
7679 * layout.h (class Layout): Update declarations.
7680 * arm.cc (Target_arm::do_finalize_sections): Use
7681 add_target_dynamic_tags.
7682 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7683 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7684 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7685 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7686
659948a4
ILT
76872010-01-07 Ian Lance Taylor <iant@google.com>
7688
7689 PR 11042
7690 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7691 object as needed.
7692
9d3b86f6
ILT
76932010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7694 Ian Lance Taylor <iant@google.com>
7695
7696 PR 11019
7697 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7698 Xindex::read_symtab_xindex.
7699
bb0d3eb0
DK
77002010-01-07 Doug Kwan <dougkwan@google.com>
7701
7702 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7703 (Insn_template::thumb16_bcond_insn): New method declaration.
7704 (Insn_template): Fix spelling.
7705 (Stub::thumb16_special): New method declaration.
7706 (Stub::do_write): Define virtual method which was previously pure
7707 virtual.
7708 (Stub::do_thumb16_special): New method declaration.
7709 (Stub::do_fixed_endian_write): New template member.
7710 (Reloc_stub::do_write): Remove.
7711 (Reloc_stub::do_fixed_endian_write): Remove.
7712 (Cortex_a8_stub): New class definition.
7713 (Stub_factory::make_cortex_a8_stub): New method definition.
7714 (Stub_factory::Stub_factory): Add missing static storage class
7715 qualifier for elf32_arm_stub_a8_veneer_blx.
7716
ffeef7df
ILT
77172010-01-07 Ian Lance Taylor <iant@google.com>
7718
dc3f80fe
ILT
7719 PR 10980
7720 * options.h (class General_options): Add --warn-unresolved-symbols
7721 and --error-unresolved-symbols.
7722 * errors.cc (Errors::undefined_symbol): Implement
7723 --warn-unresolved-symbols.
7724
ffeef7df
ILT
7725 * options.h (class General_options): Add -z text and -z textoff.
7726 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7727
f1ec9ded
ST
77282010-01-06 Sriraman Tallam <tmsriram@google.com>
7729
7730 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7731 (Garbage_collection::cident_sections): New function.
7732 (Garbage_collection::add_cident_section): New function.
7733 (Garbage_collection::cident_sections_): New member.
7734 (gc_process_relocs): Add references to sections whose names are C
7735 identifiers.
7736 * gold.h (cident_section_start_prefix): New constant.
7737 (cident_section_stop_prefix): New constant.
7738 (is_cident): New function.
7739 * layout.cc (Layout::define_section_symbols): Replace string constants
7740 with the newly defined constants.
7741 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7742 C identifiers.
7743 * testsuite/Makefile.am: Add gc_orphan_section_test.
7744 * testsuite/Makefile.in: Regenerate.
7745 * testsuite/gc_orphan_section_test.cc: New file.
7746 * testsuite/gc_orphan_section_test.sh: New file.
7747
6eda8c29
ILT
77482010-01-06 Ian Lance Taylor <iant@google.com>
7749
b9674e17
ILT
7750 PR 10980
7751 * options.h (class General_options): Add --warn-shared-textrel.
7752 * layout.cc (Layout::finish_dynamic_section): Implement
7753 --warn-shared-textrel.
7754
6eda8c29
ILT
7755 PR 10980
7756 * options.h (class General_options): Add --warn-multiple-gp.
7757
32dcd44e
ILT
77582010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7759
7760 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7761 $(THREADSLIB) and $(LIBDL).
7762 * Makefile.in: Rebuild.
7763
a192ba05
ILT
77642010-01-06 Ian Lance Taylor <iant@google.com>
7765
7766 PR 10980
7767 * options.cc (General_options::parse_section_start): New function.
7768 (General_options::section_start): New function.
7769 (General_options::General_options): Initialize all members.
7770 * options.h: Include <map>
7771 (class General_options): Add --section-start. Add section_starts_
7772 member.
7773 * layout.cc (Layout::attach_allocated_section_to_segment): If
7774 --section-start was used, set the address of the segment. Remove
7775 local sort_sections.
7776 (Layout::relaxation_loop_body): If the address of the load segment
7777 has been set by --section-start, don't use it.
7778 * output.h (Output_segment::update_flags_for_output_section): New
7779 function.
7780 * output.cc (Output_segment::add_output_section): Call
7781 update_flags_for_output_section.
7782
dde3f402
ILT
77832010-01-05 Ian Lance Taylor <iant@google.com>
7784
62dfdd4d
ILT
7785 PR 10980
7786 * options.h (class General_options): Add --undefined-version.
7787 * script.cc (struct Version_expression): Add was_matched_by_symbol
7788 field.
7789 (Version_script_info::matched_symbol): New function.
7790 (Version_script_info::get_symbol_version_helper): Call
7791 matched_symbol.
7792 (Version_script_info::check_unmatched_names): New function.
7793 * script.h (class Version_script_info): Update declarations.
7794 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7795
9c4ae156
ILT
7796 * options.h (class General_options): Use DEFINE_bool_alias for
7797 allow_multiple_definition.
7798 * resolve.cc (Symbol_table::should_override): Don't test
7799 allow_multiple_definition.
7800
dde3f402
ILT
7801 PR 10980
7802 * options.h (class General_options): Add --cref.
7803 * main.cc (main): Print cref table if --cref. Don't close mapfile
7804 until after printing cref table.
7805 * cref.cc: Include "symtab.h".
7806 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7807 (Cref_table_compare::operator()): New function.
7808 (Cref_inputs::gather_cref): New function.
7809 (filecol): New static const.
7810 (Cref_inputs::print_cref): New function.
7811 (Cref::print_cref): New function.
7812 * cref.h: Include <cstdio>.
7813 (class Cref): Update declarations.
7814 * mapfile.h (Mapfile::file): New function.
7815 * object.h (class Object): Define Symbols. Declare virtual
7816 do_get_global_symbols.
7817 (Object::get_global_symbols): New function.
7818 * object.cc (Input_objects::add_object): Pass object to cref_ if
7819 --cref.
7820 (Input_objects::archive_start): Likewise.
7821 (Input_objects::archive_stop): Likewise.
7822 (Input_objects::print_cref): New function.
7823 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7824 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7825 --cref.
7826 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7827 function.
7828 * plugin.h (class Sized_pluginobj): Update declarations.
7829
8781f709
ILT
78302010-01-05 Ian Lance Taylor <iant@google.com>
7831
7832 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7833 to is_default_version. Rename insdef to insdefault.
7834 (Symbol_table::add_from_relobj): Rename def to is_default_version
7835 and local to is_forced_local.
7836 (Symbol_table::add_from_pluginobj): Likewise.
7837 (Symbol_table::add_from_dynobj): Likewise.
7838 (Symbol_table::define_special_symbol): Rename insdef to
7839 insdefault.
7840
fe35d28d
ILT
78412010-01-04 Ian Lance Taylor <iant@google.com>
7842
30bc8c46
ILT
7843 PR 10980
7844 * options.h (class General_options): Add
7845 --allow-multiple-definition and -z muldefs.
7846 * resolve.cc (Symbol_table::should_override): Don't warn about a
7847 multiple symbol definition if --allow-multiple-definition or -z
7848 muldefs.
7849
7eaea549
ILT
7850 PR 10980
7851 * options.h (class General_options): Add --add-needed and
7852 --copy-dt-needed-entries. Tweak --as-needed help entry.
7853 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7854 error if --copy-dt-needed-entries aka --add-needed is used and
7855 would cause a change in behaviour.
7856
fe35d28d
ILT
7857 PR 10980
7858 * options.h (class General_options): Add -G as a short version of
7859 --shared. Add no-op options -assert, -g, and -i.
7860
55a2bb35
ST
78612010-01-04 Sriraman Tallam <tmsriram@google.com>
7862
7863 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7864 check for .text or .gnu.linkonce.t sections.
7865 * icf.cc (Icf::find_identical_sections): Ditto.
7866 Change the detection for mangled function name within the section
7867 name.
7868 * icf.h (is_section_foldable_candidate): New function.
7869
719328e1
ILT
78702009-12-30 Ian Lance Taylor <iant@google.com>
7871
7872 PR 10980
7873 * options.h (class General_options): Permit two dashes with
7874 --retain-symbols-file.
7875
d7bb5745
ILT
78762009-12-30 Ian Lance Taylor <iant@google.com>
7877
403a15dd
ILT
7878 PR 10979
7879 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7880 don't put the file header and segment headers in the text
7881 segment.
7882
eda294df
ILT
7883 PR 10979
7884 * common.cc (Sort_commons::operator()): Stabilize sort when both
7885 entries are NULL.
7886 (Symbol_table::do_allocate_commons_list): When allocating common
7887 symbols, skip a symbol which is no longer common.
7888 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7889 an object before checking its type.
7890 * testsuite/common_test_2.c: New file.
7891 * testsuite/common_test_3.c: New file.
7892 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7893 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7894 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7895 (common_test_2_pic.o, common_test_2.so): New targets.
7896 (common_test_3_pic.o, common_test_3.so): New targets.
7897 * testsuite/Makefile.in: Rebuild.
7898
d7bb5745
ILT
7899 PR 10979
7900 * script.cc (read_input_script): If we see a new SECTIONS clause,
7901 and we have added an input section, give an error.
7902 * layout.h (class Layout): Add have_added_input_section function.
7903 Add have_added_input_section_ field.
7904 * layout.cc (Layout::Layout): Initialize
7905 have_added_input_section_.
7906 (Layout::layout): Set have_added_input_section_.
7907 (Layout::layout_eh_frame): Likewise.
7908
fc59c572
ILT
79092009-12-30 Ian Lance Taylor <iant@google.com>
7910
7911 PR 10931
7912 * options.h (class General_options): Add --sort-common option.
7913 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7914 * common.cc (Sort_common): Add sort_order parameter to
7915 constructor. Add sort_order_ field.
7916 (Sort_commons::operator): Check sort_order_.
7917 (Symbol_table::allocate_commons): Determine the sort order.
7918 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7919 Change all callers.
7920 (Symbol_table::do_allocate_commons_list): Likewise.
7921
1c74fab0
ILT
79222009-12-30 Ian Lance Taylor <iant@google.com>
7923
7924 PR 10916
7925 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7926 symbols from this object, don't change the visibility of an
7927 undefined symbol.
7928 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7929
6affe781
ILT
79302009-12-30 Ian Lance Taylor <iant@google.com>
7931
7932 PR 10861
7933 * script.h (class Version_script_info): Define Language enum.
7934 Update declarations. Define Glob, Exact, and Lookup types. Add
7935 new fields globals_, locals_, and is_finalized_.
7936 * script.cc: Various formatting fixes.
7937 (class Parser_closure): Change language_stack_ from a vector of
7938 std::string to one of Version_script_info::Language. Adjust all
7939 uses accordingly.
7940 (class Lazy_demangler): Remove.
7941 (struct Version_expression): Change language from std::string to
7942 Version_script_info::Language.
7943 (Version_script_info::Version_script_info): New function.
7944 (Version_script_info::~Version_script_info): Don't call clear.
7945 (Version_script_info::finalize): New function.
7946 (Version_script_info::build_lookup_tables): New function.
7947 (Version_script_info::build_expression_list_lookup): New
7948 function.
7949 (Version_script_info::get_symbol_version_helper): Rewrite to use
7950 lookup tables.
7951 (Version_script_info::print_expression_list): Adjust to use
7952 Version_script_info::Language.
7953 (script_push_lex_into_version_mode): Check that the version script
7954 has not been finalized.
7955 (version_script_push_lang): Change language string to
7956 Version_script_info::Language.
7957 * options.cc (Command_line::version_script): New function.
7958 * options.h (class General_options): Add finalize_dynamic_list
7959 function. Change version_script from declaration to definition.
7960 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7961 * testsuite/version_script.map: Remove duplicate def of foo.
7962 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7963 version_script.map.
7964 * testsuite/Makefile.in: Rebuild.
7965
818bf354
ILT
79662009-12-30 Ian Lance Taylor <iant@google.com>
7967
7968 PR 10843
7969 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7970 if the input symbol index is 0, make the output symbol index 0.
7971
ebcc8304
ILT
79722009-12-30 Ian Lance Taylor <iant@google.com>
7973
7974 PR 10670
7975 * options.h (class General_options): Add -x/--discard-all.
7976 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7977 --discard-all. If the local symbol needs a dynamic entry, check
7978 that before handling --discard-locals.
7979
176fe33f
ILT
79802009-12-30 Ian Lance Taylor <iant@google.com>
7981
bb321bb1
ILT
7982 PR 10450
7983 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7984 flags to PF_R.
7985 (Output_segment::add_output_section): Don't change the flags if
7986 the type is PT_TLS.
7987
176fe33f
ILT
7988 PR 10450
7989 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7990 GNU hash table if they need a dynamic value. Otherwise, don't add
7991 them if they are defined in a dynamic object or are forced local.
7992
e8cd95c7
ILT
79932009-12-29 Ian Lance Taylor <iant@google.com>
7994
1b81fb71
ILT
7995 PR 10450
7996 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7997 .gnu.hash table for a 32-bit target.
7998
8d6d383d
ILT
7999 PR 10450
8000 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8001 regular and a dynamic object only needs a dynamic symbol table
8002 entry if it is externally visible.
8003
e785ec03
ILT
8004 PR 10450
8005 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8006 constructor. Add global_offset_table_ field.
8007 (Target_i386::got_section): Set global_offset_table_.
8008 (Target_i386::do_finalize_sections): Set global_offset_table_
8009 size.
8010 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8011 in constructor. Add global_offset_table_ field.
8012 (Target_x86_64::got_section): Set global_offset_table_.
8013 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8014 size.
8015
1a2dff53
ILT
8016 * layout.cc (Layout::Layout): Initialize increase_relro_.
8017 (Layout::get_output_section): Add is_relro, is_last_relro, and
8018 is_first_non_relro parameters. Change all callers.
8019 (Layout::choose_output_section): Likewise.
8020 (Layout::add_output_section_data): Likewise.
8021 (Layout::make_output_section): Likewise.
8022 (Layout::set_segment_offsets): Clear increase_relro when using a
8023 linker script.
8024 * layout.h (class Layout): Add increase_relro method. Add
8025 increase_relro_ field. Update declarations.
8026 * output.cc (Output_section::Output_section): Initialize
8027 is_last_relro_ and is_first_non_relro_.
8028 (Output_segment::add_output_section): Group relro sections is
8029 do_sort is true. Handle is_last_relro and is_first_non_relro.
8030 (Output_segment::maximum_alignment): Remove relro handling.
8031 (Output_segment::set_section_addresses): Add increase_relro
8032 parameter. Change all callers. Add initial alignment to align
8033 relro sections on separate page. Remove old relro handling.
8034 (Output_segment::set_section_list_addresses): Remove in_relro
8035 parameter. Change all callers.
8036 (Output_segment::set_offset): Add increase parameter. Change all
8037 callers. Remove old relro handling.
8038 * output.h (class Output_section): Add new methods: is_last_relro,
8039 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8040 Add is_last_relro_ and is_first_non_relro_ fields.
8041 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8042 Create separate .got.plt section. Call increase_relro.
8043 * x86_64.cc (Target_x86_64::got_section): Likewise.
8044 * testsuite/relro_script_test.t: Add .got.plt.
8045
f0ba79e2
ILT
8046 PR 10450
8047 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8048 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8049 (Layout::finalize): Call set_dynamic_symbol_size.
8050 (Layout::set_dynamic_symbol_size): New function.
8051 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8052 set_dynamic_symbol_size.
8053
e8cd95c7
ILT
8054 PR 10450
8055 * output.h (class Output_section): Add is_entsize_zero_ field.
8056 * output.cc (Output_section::Output_section): Initialize
8057 is_entsize_zero_.
8058 (Output_section::set_entsize): If two different entsizes are
8059 requested, force it to zero.
8060 (Output_section::add_input_section): Set flags for .debug_str
8061 before updating section flags. Set entsize.
8062 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8063 and SHF_STRING if all input sections have those flags.
8064
3e1b9a8a
RÁE
80652009-12-29 Rafael Espindola <espindola@google.com>
8066
8067 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8068 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8069 reporting.
3e1b9a8a 8070
3dcad376
ST
80712009-12-29 Sriraman Tallam <tmsriram@google.com>
8072
8073 * options.cc (General_options::parse_version): Allow -v to exit
8074 without an error if there is nothing to link.
8075
084e2665
ILT
80762009-12-29 Ian Lance Taylor <iant@google.com>
8077
8078 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8079 using a version of gcc before 4.1.
8080 * configure: Rebuild.
8081
250acde3
CD
80822009-12-28 Chris Demetriou <cgd@google.com>
8083
8084 * attributes.cc (Output_attributes_section_data::do_write): Use
8085 std::vector::front rather than std::vector::data.
8086
99fff23b
ILT
80872009-12-28 Ian Lance Taylor <iant@google.com>
8088
8089 * symtab.h (class Symbol_table): Add enum Defined.
8090 * resolve.cc (Symbol_table::should_override): Add defined
8091 parameter. Change all callers. Test whether object is NULL
8092 before calling a method on it.
8093 (Symbol_table::report_resolve_problem): Add defined parameter.
8094 Change all callers.
8095 (Symbol_table::should_override_with_special): Likewise.
8096 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8097 parameter. Change all callers.
8098 (Symbol_table::do_define_in_output_data): Likewise.
8099 (Symbol_table::define_in_output_segment): Likewise.
8100 (Symbol_table::do_define_in_output_segment): Likewise.
8101 (Symbol_table::define_as_constant): Likewise.
8102 (Symbol_table::do_define_as_constant): Likewise.
8103 * script.h (class Symbol_assignment): Add is_defsym parameter to
8104 constructor; change all callers.
8105 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8106 parameter. Change all callers. Add is_defsym_ field.
8107 (class Parser_closure): Add parsing_defsym parameter to
8108 constructor; change all callers. Add parsing_defsym accessor
8109 function. Add parsing_defsym_ field.
8110
556bd683
ILT
81112009-12-28 Ian Lance Taylor <iant@google.com>
8112
8113 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8114 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8115
1782c879
ILT
81162009-12-23 Ian Lance Taylor <iant@google.com>
8117
8118 * i386.cc (Target_i386::do_calls_non_split): Recognize
8119 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8120 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8121 -fsplit-stack prologue when using %r11.
1782c879 8122
329ca2b1
ST
81232009-12-21 Sriraman Tallam <tmsriram@google.com>
8124
8125 * options.cc (General_options::parse_version): Make -v continue and do
8126 the link like GNU ld does.
8127
d675ff46
RÁE
81282009-12-17 Rafael Avila de Espindola <espindola@google.com>
8129
8130 * Makefile.am (CCFILES): Add timer.cc.
8131 (HFILES): Add timer.h.
8132 * configure.ac: Check for sysconf and times.
8133 * main.cc: include timer.h.
8134 (main): Use Timer instead of get_run_time.
8135 * timer.cc: New.
8136 * timer.h: New.
8137 * workqueue.cc: include timer.h.
8138 (Workqueue::find_and_run_task):
8139 Report user, sys and wall time.
8140 * Makefile.in: Regenerate.
8141 * config.in: Regenerate.
8142 * configure: Regenerate.
8143
d6344fb5
DK
81442009-12-16 Doug Kwan <dougkwan@google.com>
8145
8146 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8147 sections.
8148 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8149 relaxed input sections.
8150 * output.cc (Output_section::find_relaxed_input_section): Change
8151 return type to Output_relaxed_input_section pointer. Adjust code
8152 for new type of relaxed_input_section_map_.
8153 * output.h (Output_section::find_relaxed_input_section): Change
8154 return type to Output_relaxed_input_section pointer.
8155 (Output_section::Output_relaxed_input_section_by_input_section_map):
8156 New type.
8157 (Output_section::relaxed_input_section_map_): Change type to
8158 Output_section::Output_relaxed_input_section_by_input_section_map.
8159 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8160 input section.
8161
0e0d5469
ILT
81622009-12-15 Ian Lance Taylor <iant@google.com>
8163
8164 * layout.cc (Layout::create_shstrtab): Only write out after input
8165 sections if we are compressing debug sections.
8166
0649a889
ILT
81672009-12-15 Ian Lance Taylor <iant@google.com>
8168
8169 * archive.cc (Archive::add_symbols): Only look up a symbol without
8170 a version if there is, in fact, a version.
8171
2ea97941
ILT
81722009-12-14 Ian Lance Taylor <iant@google.com>
8173
8174 Revert -Wshadow changes, all changes from:
8175 2009-12-11 Doug Kwan <dougkwan@google.com>
8176 2009-12-11 Nick Clifton <nickc@redhat.com>
8177 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8178
b0eec2cc
DK
81792009-12-11 Doug Kwan <dougkwan@google.com>
8180
8181 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8182 due to -Wshadow.
8183 * attributes.cc (Object_attribute::size): Ditto.
8184 (Attributes_section_data::size): Ditto.
8185 (Attributes_section_data::Attributes_section_data): Ditto.
8186 (Output_attributes_section_data::do_write): Ditto.
8187 * attributes.h (Object_attribute::set_type): Ditto.
8188 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8189
91d6fa6a
NC
81902009-12-11 Nick Clifton <nickc@redhat.com>
8191
8192 * archive.cc: Fix shadowed variable warnings.
8193 * arm.cc: Likewise.
8194 * compressed_output.cc: Likewise.
8195 * compressed_output.h: Likewise.
8196 * configure: Likewise.
8197 * dwarf_reader.cc: Likewise.
8198 * dynobj.cc: Likewise.
8199 * dynobj.h: Likewise.
8200 * ehframe.cc: Likewise.
8201 * ehframe.h: Likewise.
8202 * errors.cc: Likewise.
8203 * expression.cc: Likewise.
8204 * fileread.cc: Likewise.
8205 * fileread.h: Likewise.
8206 * freebsd.h: Likewise.
8207 * i386.cc: Likewise.
8208 * icf.cc: Likewise.
8209 * incremental.h: Likewise.
8210 * layout.cc: Likewise.
8211 * layout.h: Likewise.
8212 * mapfile.cc: Likewise.
8213 * merge.cc: Likewise.
8214 * merge.h: Likewise.
8215 * object.cc: Likewise.
8216 * object.h: Likewise.
8217 * options.h: Likewise.
8218 * output.cc: Likewise.
8219 * output.h: Likewise.
8220 * parameters.cc: Likewise.
8221 * plugin.cc: Likewise.
8222 * powerpc.cc: Likewise.
8223 * reduced_debug_output.cc: Likewise.
8224 * reduced_debug_output.h: Likewise.
8225 * reloc.cc: Likewise.
8226 * reloc.h: Likewise.
8227 * resolve.cc: Likewise.
8228 * script-sections.cc: Likewise.
8229 * script.cc: Likewise.
8230 * script.h: Likewise.
8231 * sparc.cc: Likewise.
8232 * symtab.cc: Likewise.
8233 * symtab.h: Likewise.
8234 * target-select.cc: Likewise.
8235 * target-select.h: Likewise.
8236 * token.h: Likewise.
8237 * workqueue.cc: Likewise.
8238 * workqueue.h: Likewise.
8239 * x86_64.cc: Likewise.
8240
a0351a69
DK
82412009-12-10 Doug Kwan <dougkwan@google.com>
8242
8243 * arm.cc (attributes.h): New include.
8244 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8245 (Arm_relobj::~Arm_relobj): Delete object pointed by
8246 attributes_section_data_.
8247 (Arm_relobj::attributes_section_data): New method definition.
8248 (Arm_relobj::attributes_section_data_): New data member declaration.
8249 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8250 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8251 attributes_section_data_.
8252 (Arm_dynobj::attributes_section_data): New method definition.
8253 (Arm_dynobj::attributes_section_data_): New data member declaration.
8254 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8255 initialization value of may_use_blx_ to false.
2e702c99 8256 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8257 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8258 object attributes to compute results instead of hard-coding.
8259 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8260 Target_arm::get_secondary_compatible_arch,
8261 Target_arm::set_secondary_compatible_arch
8262 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8263 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8264 New method declarations.
8265 (Target_arm::get_aeabi_object_attribute): New method definition.
8266 (Target_arm::attributes_section_data_): New data member declaration.
8267 (read_arm_attributes_section): New template definition.
8268 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8269 (Arm_dynobj::do_read_symbols): Ditto.
8270 (Target_arm::do_finalize_sections): Merge attributes sections from
8271 input. Check for BLX use after attributes section merging.
8272 Fix __exidx_start and __exidx_end visibility. Create an
8273 .ARM.attributes section if necessary.
8274 (Target_arm::get_secondary_compatible_arch,
8275 Target_arm::set_secondary_compatible_arch,
8276 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8277 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8278 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8279 New method definitions.
8280
b59befec
ILT
82812009-12-09 Ian Lance Taylor <iant@google.com>
8282
8283 * plugin.cc (Plugin::load): Don't cast from void* to a function
8284 pointer.
8285
1276bc89
ILT
82862009-12-09 Ian Lance Taylor <iant@google.com>
8287
8288 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8289 information fields.
8290
2f2de248
L
82912009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8292
8293 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8294 Replace two_file_shared_1.so with two_file_shared_2.so.
8295 * testsuite/Makefile.in: Regenerated.
8296
4f787271
DK
82972009-12-08 Doug Kwan <dougkwan@google.com>
8298
8299 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8300 (HFILES): Add attributes.h and int_encoding.h.
8301 * Makefile.in: Regenerate.
8302 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8303 function definitions to int_encoding.cc
8304 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8305 prototypes to int_encoding.h
8306 * reduced_debug_output.cc (int_encoding.h): New include.
8307 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8308 function definitions to int_encoding.cc
8309 (insert_into_vector, read_from_pointer): Move template definitions to
8310 int_encoding.h
8311 * attributes.cc: New file.
8312 * attributes.h: New file.
8313 * int_encoding.cc: New file.
8314 * int_encoding.h: New file.
8315
20b52f1a
RÁE
83162009-12-07 Rafael Avila de Espindola <espindola@google.com>
8317
8318 PR gold/11055
8319 * incremental-dump.cc (dump_incremental_inputs): New.
8320 (main): Use dump_incremental_inputs.
8321
53d7974c
L
83222009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8323
8324 PR gold/10893
8325 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8326 checking elfcpp::STT_FUNC.
8327 (Target_i386::Relocate::relocate): Likewise.
8328 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8329
8330 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8331 symbols from shared libraries into normal FUNC symbols.
8332
8333 * symtab.h (Symbol): Add is_func and use it.
8334
05a352e6
DK
83352009-12-05 Doug Kwan <dougkwan@google.com>
8336
8337 * arm.cc (Target_arm::arm_info): Initialize new fields
8338 attributes_section and attributes_vendor.
8339 * i386.cc (Target_i386::i386_info): Same.
8340 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8341 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8342 fields attributes_section and attributes_vendor.
53d7974c 8343 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8344 * target.h (Target::attributes_section, Target::attributes_vendor,
8345 Target::is_attributes_section, Target::attribute_arg_type,
8346 Target::attributes_order): New method definitions.
8347 (Target::Target_info::attributes_section,
8348 Target::Target_info::attributes_vendor): New fields.
8349 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8350 virtual method definitions.
8351 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8352 attributes_section and attributes_vendor.
8353 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8354
f4e5969c
DK
83552009-12-05 Doug Kwan <dougkwan@google.com>
8356
8357 * arm.cc: Update comments about interworking and stub generation.
8358 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8359 considered as non-PIC.
8360 (Arm_relocate_functions::base_abs): Fix formatting.
8361 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8362 of function to use GOT entry address instead of offset.
8363 (Target_arm::Scan::global): Issue an error if a symbol would need a
8364 PLT does not get one because it is untyped. Remove code to create
8365 dynamic symbols for relative branches.
8366 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8367 takes unsigned integer instead of boolean.
8368
1abce4a6
L
83692009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8370
8371 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8372 (two_file_test_LDADD): Likewise.
8373 (common_test_1_LDADD): Likewise.
8374 (exception_test_LDADD) Likewise.
8375 (weak_test_LDADD): Likewise.
8376 (many_sections_test_LDADD): Likewise.
8377 (initpri1_LDADD): Likewise.
8378 (script_test_1_LDADD): Likewise.
8379 (script_test_2_LDADD): Likewise.
8380 (justsyms_LDADD): Likewise.
8381 (binary_test_LDADD): Likewise.
8382 (large_LDADD): Likewise.
8383 * testsuite/Makefile.in: Regenerated.
8384
adcf2816 83852009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8386
adcf2816
L
8387 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8388 (Symbol_table::override_with_special): Likewise.
8389 (Symbol_table::add_from_object): Likewise.
8390
28e67f5d
RÁE
83912009-12-04 Rafael Avila de Espindola <espindola@google.com>
8392
8393 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8394 Don't set the data_offset twice.
8395
ae10a101
RÁE
83962009-12-04 Rafael Avila de Espindola <espindola@google.com>
8397
8398 * testsuite/Makefile.in: Regenerate.
8399
f59f41f3
DK
84002009-12-03 Doug Kwan <dougkwan@google.com>
8401
8402 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8403 (Target_arm::do_finalize_sections): Add parameter for symbol table
8404 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8405 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8406 parameter for symbol table pointer.
8407 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8408 an additional parameter for a pointer to symbol table.
8409 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8410 parameter for a symbol table pointer.
8411 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8412 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8413 Ditto.
8414 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8415 parameter for a symbol table pointer.
8416
ca55d848
RÁE
84172009-12-03 Rafael Avila de Espindola <espindola@google.com>
8418
8419 * incremental.cc (Incremental_inputs_header)
8420 (Incremental_inputs_header_write, Incremental_inputs_entry)
8421 (Incremental_inputs_entry_write): Move ...
8422 * incremental.h (Incremental_inputs_header)
8423 (Incremental_inputs_header_write, Incremental_inputs_entry)
8424 (Incremental_inputs_entry_write): here.
8425
3aec4f9c
RÁE
84262009-12-02 Rafael Avila de Espindola <espindola@google.com>
8427
8428 * incremental.cc (make_sized_incremental_binary): Set the target.
8429 Error if it is incompatible.
8430 * output.h (Output_file): Add filename method.
8431
9c0ae74d
RÁE
84322009-12-02 Rafael Avila de Espindola <espindola@google.com>
8433
8434 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8435 from the get_* methods.
8436
a45500ae
RÁE
84372009-12-02 Rafael Avila de Espindola <espindola@google.com>
8438
8439 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8440 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8441 Write 0 for the data_offset of scripts.
8442
325e6408
RÁE
84432009-12-02 Rafael Avila de Espindola <espindola@google.com>
8444
8445 * testsuite/Makefile.am: Add the incremental_test.sh test.
8446 * testsuite/incremental_test.sh: New.
8447 * testsuite/incremental_test_1.c: New.
8448 * testsuite/incremental_test_2.c: New.
8449
954c3e2e
RÁE
84502009-12-01 Rafael Avila de Espindola <espindola@google.com>
8451
703d02da 8452 * incremental-dump.cc (main): Fix typos.
954c3e2e 8453
f8086623
RÁE
84542009-11-27 Rafael Avila de Espindola <espindola@google.com>
8455
8456 PR gold/11025
8457 * incremental-dump.cc (main): Use llu to print 64 bit values.
8458
3b0dd6ac
L
84592009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8460 H.J. Lu <hongjiu.lu@intel.com>
8461
8462 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8463 $(LIBDL).
8464 (incremental_dump_LDADD): Likewise.
8465 * Makefile.in: Regenerated.
8466
a6d1ef57 84672009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8468
a6d1ef57
DK
8469 Revert:
8470
8471 2009-11-25 Doug Kwan <dougkwan@google.com>
8472
8473 * arm.cc (Target_arm::Target_arm): Move method definition
8474 outside of class definition. Add code to handle
8475 --target1-rel, --target1-abs and --target2= options.
8476 (Target_arm::get_reloc_reloc_type): Change method to be
8477 non-static and const.
8478 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8479 New data member declaration.
8480 (Target_arm::Scan::local, Target_arm::Scan::global,
8481 Target_arm::Relocate::relocate,
8482 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8483 Adjust call to Target_arm::get_real_reloc_type.
8484 (Target_arm::get_real_reloc_type): Use command line options
8485 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8486 * options.h (--target1-rel, --target1-abs, --target2): New
8487 ARM-only options.
8488
50aeb7d4
DK
84892009-11-25 Doug Kwan <dougkwan@google.com>
8490
8491 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8492 class definition. Add code to handle --target1-rel, --target1-abs
8493 and --target2= options.
8494 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8495 and const.
8496 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8497 member declaration.
8498 (Target_arm::Scan::local, Target_arm::Scan::global,
8499 Target_arm::Relocate::relocate,
8500 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8501 call to Target_arm::get_real_reloc_type.
8502 (Target_arm::get_real_reloc_type): Use command line options to
8503 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8504 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8505 options.
8506
51938283
DK
85072009-11-25 Doug Kwan <dougkwan@google.com>
8508
8509 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8510 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8511 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8512 formatting.
8513 (Arm_relocate_functions::thm_call): Replace body with a call to
8514 Arm_relocate_functions::thumb_branch_common.
8515 (Arm_relocate_functions::thm_jump24,
8516 Arm_relocate_functions::thm_xpc22): New method definitions.
8517 (Arm_relocate_functions::thumb_branch_common): New method definition.
8518 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8519 operator.
8520 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8521 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8522
e2b8f3c4
RÁE
85232009-11-24 Rafael Avila de Espindola <espindola@google.com>
8524
8525 * Makefile.am: Build incremental-dump
8526 * Makefile.in: Regenerate.
8527 * incremental-dump.cc: New.
8528 * incremental.cc (Incremental_inputs_header_data,
8529 Incremental_inputs_entry_data): Move to incremental.h
8530 * incremental.h: (Incremental_inputs_header_data,
8531 Incremental_inputs_entry_data): Move from incremental.cc
8532
bcba9aec
RÁE
85332009-11-24 Rafael Avila de Espindola <espindola@google.com>
8534
8535 * incremental.cc (Incremental_inputs_header,
8536 Incremental_inputs_header_write, Incremental_inputs_entry,
8537 Incremental_inputs_entry_write): Add a typedef with the data type.
8538
7c3afe08
RÁE
85392009-11-24 Rafael Avila de Espindola <espindola@google.com>
8540
8541 * incremental.cc (Incremental_inputs_header,
8542 Incremental_inputs_header_write, Incremental_inputs_entry,
8543 Incremental_inputs_entry_write): Update comment about which
8544 type has the filed descriptions.
8545
d204b6e9
DK
85462009-11-15 Doug Kwan <dougkwan@google.com>
8547
8548 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8549 (Arm_relocate_functions::arm_branch_common): Change method defintion
8550 in class definition to a method declaration and update list of formal
8551 parameters.
8552 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8553 Arm_relocation_functions::jump24): Adjust call to
8554 Arm_relocate_functions::arm_branch_common. Update list of formal
8555 parameters.
8556 (Arm_relocate_functions::xpc25): New method definition.
8557 (Arm_relocate_functions::arm_branch_common): Move method defintion
8558 out from class definition. Use stubs for mode-switching and extending
8559 branch ranges.
8560 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8561 specially. Change code to enable use of stubs in ARM branches.
8562
43d12afe
DK
85632009-11-10 Doug Kwan <dougkwan@google.com>
8564
8565 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8566 in method declaration.
8567 (Target_arm::relocate_stub): New method declaration.
8568 (Target_arm::default_target): Change to return a pointer instead of
8569 a const reference.
8570 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8571 Target_arm::default_target.
8572 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8573 method definition.
8574 (Target_arm::relocate_section): Adjust view.
8575 (Target_arm::relocate_stub): New method definition.
8576
ac33a407
DK
85772009-11-10 Doug Kwan <dougkwan@google.com>
8578
8579 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8580 a format warning.
8581 * incremental.cc (open_incremental_binary): Initialized local
8582 variables to avoid warnings.
8583 * object.cc (make_elf_object): Ditto.
8584 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8585 a format warning.
e1df38aa 8586
88ee28e9
L
8587009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8588
8589 PR gold/10930
8590 * testsuite/plugin_test.c: Include "config.h".
8591
2daedcd6
DK
85922009-11-09 Doug Kwan <dougkwan@google.com>
8593
8594 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8595 (arm_symbol_value): Remove.
8596 (Arm_relocate_functions::arm_branch_common,
8597 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8598 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8599 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8600 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8601 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8602 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8603 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8604 Arm_relocate_functions::thm_mobw_abs_nc,
8605 Arm_relocate_functions::thm_mov_abs,
8606 Arm_relocate_functions::movw_prel_nc,
8607 Arm_relocate_functions::thm_movt_abs,
8608 Arm_relocate_functions::movt_prel,
8609 Arm_relocate_functions::thm_movw_prel_nc,
8610 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8611 (Target_arm::Relocate::relocate): Only decompose address into two
8612 parts if relocation type uses the thumb-bit and pass the actual
8613 bit instead of a flag indicating that the thumb-bit is used. Adjust
8614 calls to methods in Arm_relocate_functions for this change.
8615
1276bc89 86162009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8617
8618 PR 10925
8619 * reloc.cc: Instantiate
8620 Sized_relobj::initialize_input_to_output_maps and
8621 Sized_relobj:free_input_to_output_maps.
8622
e53ad1b5
ILT
86232009-11-06 Ian Lance Taylor <iant@google.com>
8624
8625 PR 10876
8626 * defstd.cc (in_segment): Set only_if_ref true for "end".
8627
eb44217c
DK
86282009-11-06 Doug Kwan <dougkwan@google.com>
8629
8630 * arm.cc (class Reloc_stub): Correct a comment.
8631 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8632 (Target_arm::scan_section_for_stubs): New method declaration.
8633 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8634 Change methods from private to protected.
8635 (Target_arm::do_may_relax): New method definition.
8636 (Target_arm::do_relax, Target_arm::group_sections,
8637 Target_arm::scan_reloc_for_stub,
8638 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8639 (Target_arm::arm_input_section_map_): New data member declaration.
8640 (Target_arm::scan_reloc_for_stub,
8641 Target_arm::scan_reloc_section_for_stubs,
8642 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8643 Target_arm::do_relax): New method definitions.
8644
5d329b7d
ILT
86452009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8646
8647 * configure.ac: Check for (struct stat)::st_mtim
8648 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8649 * config.in: Regenerate.
8650 * configure: Regenerate.
8651
96a0d71b
ILT
86522009-11-05 Ian Lance Taylor <iant@google.com>
8653
8654 PR 10910
8655 * output.cc (Output_segment::add_output_section): Add missing
8656 return statement.
8657
594c8e5e
ILT
86582009-11-04 Ian Lance Taylor <iant@google.com>
8659
8660 PR 10880
8661 * object.h (class Object): Add is_needed and set_is_needed
8662 methods. Add is_needed_ field. Make bool fields into bitfields.
8663 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8664 defined in a dynamic object and referenced by a regular object,
8665 set is_needed for the dynamic object.
8666 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8667 if the file is marked with as_needed and it is not needed.
8668
22b127cc
ILT
86692009-11-04 Ian Lance Taylor <iant@google.com>
8670
8671 PR 10887
8672 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8673 tags if data is discarded by linker script.
8674 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8675 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8676 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8677 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8678
f5c870d2
ILT
86792009-11-04 Ian Lance Taylor <iant@google.com>
8680
8681 * layout.cc (Layout::get_output_section): Add is_interp and
8682 is_dynamic_linker_section parameters. Change all callers.
8683 (Layout::choose_output_section): Likewise.
8684 (Layout::make_output_section): Likewise.
8685 (Layout::add_output_section_data): Add is_dynamic_linker_section
8686 parameter. Change all callers.
8687 * layout.h (class Layout): Update declarations.
8688 * output.h (class Output_section): Add is_interp, set_is_interp,
8689 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8690 Add is_interp_, is_dynamic_linker_section_ fields. Change
8691 generate_code_fills_at_write_ to a bitfield.
8692 * output.cc (Output_section::Output_sections): Initialize new
8693 fields.
8694 (Output_segment::add_output_section): Add do_sort parameter.
8695 Change all callers.
8696
1ae4d23b
ILT
86972009-11-03 Ian Lance Taylor <iant@google.com>
8698
8699 PR 10860
8700 * options.h (class General_options): Add --warn-common.
8701 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8702 merging two common symbols.
8703 (Symbol_table::should_override): Handle --warn-common when merging
8704 a common symbol with a defined symbol. Use report_resolve_problem
8705 for multiple definitions.
8706 (Symbol_table::report_resolve_problem): New function.
8707 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8708
55da9579
DK
87092009-11-03 Doug Kwan <dougkwan@google.com>
8710
8711 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8712 stub_factory_.
8713 (Target_arm::stub_factory): New method definition.
8714 (Target_arm::new_arm_input_section,
8715 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8716 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8717 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8718 New type definitions.
8719 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8720 member declarations.
8721 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8722 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8723 New method definitions.
8724
37a9ac43
ILT
87252009-11-03 Ian Lance Taylor <iant@google.com>
8726
8727 * options.h (class General_options): Add --warn_constructors.
8728
b3d6a3d4
ILT
87292009-11-03 Ian Lance Taylor <iant@google.com>
8730
8731 PR 10893
8732 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8733 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8734
934b01dd
ILT
87352009-11-03 Ian Lance Taylor <iant@google.com>
8736
8737 PR 10895
8738 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8739 --msgid-bugs-address.
8740 (install-pdf): New target.
8741 (install-data_yes): Look up one directory to find mkinstalldirs.
8742
03c1939b
L
87432009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8744
8745 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8746 tree.
8747
ebd95253
DK
87482009-10-30 Doug Kwan <dougkwan@google.com>
8749
8750 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8751
e9bbb538
DK
87522009-10-30 Doug Kwan <dougkwan@google.com>
8753
8754 * arm.cc (Stub_addend_reader): New struct template definition
8755 and partial specializations.
8756 (Stub_addend_reader::operator()): New method definition for a
8757 partially specialized template.
8758
d5b40221
DK
87592009-10-30 Doug Kwan <dougkwan@google.com>
8760
8761 * arm.cc (Arm_relobj::processor_specific_flags): New method
8762 definition.
8763 (Arm_relobj::do_read_symbols): New method declaration.
8764 (Arm_relobj::processor_specific_flags_): New data member declaration.
8765 (Arm_dynobj): New class definition.
8766 (Target_arm::do_finalize_sections): Add input_objects parameter.
8767 (Target_arm::do_adjust_elf_header): New method declaration.
8768 (Target_arm::are_eabi_versions_compatible,
8769 (Target_arm::merge_processor_specific_flags): New method declaration.
8770 (Target_arm::do_make_elf_object): New overloaded method definitions
8771 and declaration.
8772 (Arm_relobj::do_read_symbols): New method definition.
8773 (Arm_dynobj::do_read_symbols): Ditto.
8774 (Target_arm::do_finalize_sections): Add input_objects parameters.
8775 Merge processor-specific flags from all input objects.
8776 (Target_arm::are_eabi_versions_compatible,
8777 Target_arm::merge_processor_specific_flags,
8778 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8779 New method definitions.
8780 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8781 Input_objects pointer type parameter.
8782 * layout.cc (Layout::finalize): Pass input objects to target's.
8783 finalize_sections function.
8784 * output.cc (Output_file_header::do_sized_write): Set ELF file
8785 header's processor-specific flags.
8786 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8787 Input_objects pointer type parameter.
8788 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8789 * target.h (Input_objects): New forward class declaration.
8790 (Target::processor_specific_flags,
8791 Target::are_processor_specific_flags_sect): New method definitions.
8792 (Target::finalize_sections): Add input_objects parameter.
8793 (Target::Target): Initialize processor_specific_flags_ and
8794 are_processor_specific_flags_set_.
8795 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8796 parameter.
8797 (Target::set_processor_specific_flags): New method definition.
8798 (Target::processor_specific_flags_,
8799 Target::are_processor_specific_flags_set_): New data member
8800 declarations.
8801 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8802 Input_objects pointer type parameter.
8803
ebabffbd
DK
88042009-10-30 Doug Kwan <dougkwan@google.com>
8805
8806 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8807
ad0f2072
ILT
88082009-10-28 Ian Lance Taylor <iant@google.com>
8809
8810 * object.h (class Relobj): Drop options parameter from
8811 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8812 do_scan_relocs, do_relocate. Change all callers.
8813 (class Sized_relobj): Drop options parameters from
8814 do_gc_process_relocs, do_scan_relocs, do_relocate,
8815 do_relocate_sections, relocate_sections, emit_relocs_scan,
8816 emit_relocs_scan_reltype. Change all callers.
8817 (struct Relocate_info): Remove options field and all references to
8818 it.
8819 * reloc.h (class Read_relocs): Remove options constructor
8820 parameter and options_ field. Change all callers.
8821 (class Gc_process_relocs, class Scan_relocs): Likewise.
8822 (class Relocate_task): Likewise.
8823 * target-reloc.h (scan_relocs): Remove options parameter. Change
8824 all callers.
8825 (scan_relocatable_relocs): Likewise.
8826 * target.h (class Sized_target): Remove options parameter from
8827 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8828 all callers.
8829 * gc.h (gc_process_relocs): Remove options parameter. Change all
8830 callers.
8831 * arm.cc: Update functions to remove options parameters.
8832 * i386.cc: Likewise.
8833 * powerpc.cc: Likewise.
8834 * sparc.cc: Likewise.
8835 * x86_64.cc: Likewise.
8836 * testsuite/testfile.cc: Likewise.
8837
8ffa3667
DK
88382009-10-28 Doug Kwan <dougkwan@google.com>
8839
8840 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8841 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8842 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8843 New method definitions.
8844
40f36857
CC
88452009-10-28 Cary Coutant <ccoutant@google.com>
8846
8847 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8848 (Plugin::cleanup_done_): New member.
8849 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8850 (Plugin_manager::cleanup_done_): Remove.
8851 (Plugin_manager::add_input_file): Edit error message.
8852 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8853 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8854
2c849493
ILT
88552009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8856
8857 * fileread.cc: (File_read::View::~View): Use the new
8858 data_ownership_ filed.
8859 (File_read::~File_read): Dispose the new whole_file_view_.
8860 (File_read::open): Mmap the whole file if needed.
8861 (File_read::open): Use whole_file_view_ instead of contents_.
8862 (File_read::find_view): Use whole_file_view_ if applicable.
8863 (File_read::do_read): Use whole_file_view_ instead of contents_.
8864 (File_read::make_view): Use whole_file_view_ instead of contents_,
8865 update File_read::View::View call.
8866 (File_read::find_or_make_view): Update File_read::View::View
8867 call.
8868 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8869 remove contents_
8870 (File_read::View::Data_ownership): New enum.
8871 (File_read::View::View): Replace bool mapped_ with Data_ownership
8872 argument.
8873 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8874 (File_read::View::data_ownership_): New field.
8875 (File_read::contents_): Remove (replaced by whole_file_view_).
8876 (File_read::whole_file_view_): New field.
8877 * options.h (class General_options): Add --keep-files-mapped.
8878
24998053
CC
88792009-10-27 Cary Coutant <ccoutant@google.com>
8880
8881 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8882 * testsuite/Makefile.am (plugin_test_5): New test case.
8883 * testsuite/Makefile.in: Regenerate.
8884
72adc4fa
DK
88852009-10-25 Doug Kwan <dougkwan@google.com>
8886
8887 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8888 from private to protected to allow access by child class.
8889 (Sized_relobj::do_relocate_sections): New method declaration.
8890 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8891 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8892 Sized_relobj::relocate_sections. Instantiate template explicitly
8893 for different target sizes and endianity.
8894
07f508a2
DK
88952009-10-24 Doug Kwan <dougkwan@google.com>
8896
8897 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8898 (Arm_input_section::as_arm_input_section): New method.
8899 (Arm_output_section): New class definition.
8900 (Arm_output_section::create_stub_group,
8901 Arm_output_section::group_sections): New method definitions.
8902
10ad9fe5
DK
89032009-10-22 Doug Kwan <dougkwan@google.com>
8904
8905 * arm.cc (Arm_input_section): New class definition.
8906 (Arm_input_section::init, Arm_input_section:do_write,
8907 Arm_input_section::set_final_data_size,
8908 Arm_input_section::do_reset_address_and_file_offset): New method
8909 definitions.
8910
56ee5e00
DK
89112009-10-21 Doug Kwan <dougkwan@google.com>
8912
8913 * arm.cc (Stub_table, Arm_input_section): New forward class
8914 declarations.
8915 (Stub_table): New class defintion.
8916 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8917 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8918 New method definition.
8919
b569affa
DK
89202009-10-21 Doug Kwan <dougkwan@google.com>
8921
8922 * arm.cc: Update copyright comments.
8923 (Target_arm): New forward class template declaration.
8924 (Arm_address): New type.
8925 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8926 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8927 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8928 constants.
8929 (Insn_template): Same.
8930 (DEF_STUBS): New macro.
8931 (Stub_type): New enum type.
8932 (Stub_template): New class definition.
8933 (Stub): Same.
8934 (Reloc_stub): Same.
8935 (Stub_factory): Same.
8936 (Target_arm::Target_arm): Initialize may_use_blx_ and
8937 should_force_pic_veneer_.
8938 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8939 Target_arm::should_force_pic_veneer,
8940 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8941 Target_arm::using_thumb_only, Target_arm:;default_target): New
8942 method defintions.
8943 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8944 New data member declarations.
8945 (Insn_template::size, Insn_template::alignment): New method defintions.
8946 (Stub_template::Stub_template): New method definition.
8947 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8948 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8949 (Stub_factory::Stub_factory): New method definition.
8950 * gold.h (string_hash): New template.
8951 * output.h (Input_section_specifier::hash_value): Use
8952 gold::string_hash.
8953 (Input_section_specifier::string_hash): Remove.
8954 * stringpool.cc (Stringpool_template::string_hash): Use
8955 gold::string_hash.
8956
6c172549
DK
89572009-10-20 Doug Kwan <dougkwan@google.com>
8958
8959 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8960 symbols of relaxed input sections.
8961 * output.h (Output_section::find_relaxed_input_section): Make
8962 method public.
8963
c5617f2f
DK
89642009-10-16 Doug Kwan <dougkwan@google.com>
8965
8966 * dynobj.cc (Versions::Versions): Initialize version_script_.
8967 Only insert base version symbol definition for a shared object
8968 if version script defines any version versions.
8969 (Versions::define_base_version): New method definition.
8970 (Versions::add_def): Check that base version is not needed.
8971 (Versions::add_need): Define base version lazily.
8972 * dynobj.h (Versions::define_base_version): New method declaration.
8973 (Versions::needs_base_version_): New data member declaration.
8974 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8975 (check_DATA): Add no_version_test.stdout.
8976 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8977 New make rules.
8978 * testsuite/Makefile.in: Regenerate.
8979 * testsuite/no_version_test.c: New file.
8980 * testsuite/no_version_test.sh: Ditto.
8981
3c12dcdb
DK
89822009-10-16 Doug Kwan <dougkwan@google.com>
8983
8984 * expression.cc (class Segment_start_expression): New class definition.
8985 (Segment_start_expression::value): New method definition.
8986 (script_exp_function_segment_start): Return a new
8987 Segment_start_expression.
8988 * gold/script-c.h (script_saw_segment_start_expression): New function
8989 prototype.
8990 * script-sections.cc (Script_sections::Script_sections): Initialize
8991 SAW_SEGMENT_START_EXPRESSION_ to false.
8992 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8993 and -Tbbs options to specify section addresses if given in
8994 command line and no SEGMENT_START expression is seen in a script.
8995 * script-sections.h (Script_sections::saw_segment_start_expression,
8996 Script_sections::set_saw_segment_start_expression): New method
8997 definition.
8998 (Script_sections::saw_segment_start_expression_): New data member
8999 declaration.
9000 * script.cc (script_saw_segment_start_expression): New function.
9001 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9002 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9003 script_test_7.sh and script_test_8.sh.
9004 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9005 script_test_8.stdout.
9006 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9007 (script_test_6, script_test_6.stdout, script_test_7,
9008 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9009 * Makefile.in: Regenerate.
9010 * testsuite/script_test_6.sh: New file.
9011 * testsuite/script_test_6.t: Same.
9012 * testsuite/script_test_7.sh: Same.
9013 * testsuite/script_test_7.t: Same.
9014 * testsuite/script_test_8.sh: Same.
9015
64b1ae37
DK
90162009-10-16 Doug Kwan <dougkwan@google.com>
9017
9018 * output.cc (Output_segment::set_section_list_address): Cast
9019 expressions to unsigned long long type to avoid format warnings.
9020
661be1e2
ILT
90212009-10-15 Ian Lance Taylor <iant@google.com>
9022
12edd763 9023 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9024 dot assignment to script_sections_.
12edd763
ILT
9025 * script-sections.cc (Script_sections::add_dot_assignment):
9026 Initialize if necessary.
9027
68b6574b
ILT
9028 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9029 program headers with no load segment if there is a linker script.
9030
661be1e2
ILT
9031 * layout.cc (Layout::set_segment_offsets): Align the file offset
9032 to the segment aligment for -N or -n with no load segment.
9033 * output.cc (Output_segment::add_output_section): Don't crash if
9034 the first section is a TLS section.
9035 (Output_segment::set_section_list_addresses): Print an error
9036 message if the address moves backward in a linker script.
9037 * script-sections.cc
9038 (Output_section_element_input::set_section_addresses): Don't
9039 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9040 (Orphan_output_section::set_section_addresses): Likewise.
9041
f15f61a7
DK
90422009-10-15 Doug Kwan <dougkwan@google.com>
9043
9044 * layout.cc (Layout::finish_dynamic_section): Generate tags
9045 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9046 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9047 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9048
82bb573a
ILT
90492009-10-14 Ian Lance Taylor <iant@google.com>
9050
9051 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9052 fields.
9053 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9054 data_shdr fields of relinfo.
9055 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9056 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9057 R_386_TLS_LDO_32, adjust based on section flags.
9058 (Target_i386::Relocate::fix_up_ldo): Remove.
9059
374ad285
ILT
90602009-10-13 Ian Lance Taylor <iant@google.com>
9061
9062 Add support for -pie.
9063 * options.h (class General_options): Add -pie and
9064 --pic-executable.
9065 (General_options::output_is_position_independent): Test -pie.
9066 (General_options::output_is_executable): Return true if not shared
9067 and not relocatable.
9068 (General_options::output_is_pie): Remove.
9069 * options.cc (General_options::finalize): Reject incompatible uses
9070 of -pie.
9071 * gold.cc (queue_middle_tasks): A -pie link is not static.
9072 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9073 * symtab.cc (Symbol::final_value_is_known): Return false if
9074 output_is_position_independent.
9075 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9076 output_is_position_independent.
9077 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9078 output_is_position_independent.
9079 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9080 output_is_position_independent.
9081 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9082 two_file_pie_test.
9083 (basic_pie_test.o, basic_pie_test): New targets.
9084 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9085 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9086 (two_file_pie_test): New target.
9087 * testsuite/Makefile.in: Rebuild.
9088 * README: Remove note saying that -pie is not supported.
9089
c6585162
ILT
90902009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9091
9092 * options.h (class General_options): Add -init and -fini.
9093 * layout.cc (Layout::finish_dynamic_section): Emit
9094 given init and fini functions.
9095
032ce4e9
ST
90962009-10-13 Sriraman Tallam <tmsriram@google.com>
9097
9098 * gc.h (gc_process_relocs): Check if icf is enabled using new
9099 function.
9100 * gold.cc (queue_initial_tasks): Likewise.
9101 (queue_middle_tasks): Likewise.
9102 * object.cc (do_layout): Likewise.
9103 * symtab.cc (is_section_folded): Likewise.
9104 * main.cc (main): Likewise.
9105 * reloc.cc (Read_relocs::run): Likewise.
9106 (Sized_relobj::do_scan_relocs): Likewise.
9107 * icf.cc (is_function_ctor_or_dtor): New function.
9108 (Icf::find_identical_sections): Check if function is ctor or dtor when
9109 safe icf is chosen.
9110 * options.h (General_options::icf): Change option to be an enum.
9111 (Icf_status): New enum.
9112 (icf_enabled): New method.
9113 (icf_safe_folding): New method.
9114 (set_icf_status): New method.
9115 (icf_status_): New variable.
9116 * (options.cc) (General_options::finalize): Set icf_status_.
9117 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9118 icf_test and icf_keep_unique_test to use the --icf enum flag.
9119 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9120 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9121
f345227a
ST
91222009-10-12 Sriraman Tallam <tmsriram@google.com>
9123
9124 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9125 includes to gc.h and icf.h.
9126 * arm.cc: Include gc.h.
9127 * gold.cc: Likewise.
9128 * i386.cc: Likewise.
9129 * powerpc.cc: Likewise.
9130 * sparc.cc: Likewise.
9131 * x86_64.cc: Likewise.
9132 * gc.h: Include icf.h.
9133
1c7814ed
ILT
91342009-10-11 Ian Lance Taylor <iant@google.com>
9135
9136 * plugin.cc: Include "gold.h" before other header files.
9137
ae3b5189
CD
91382009-10-10 Chris Demetriou <cgd@google.com>
9139
9140 * options.h (Input_file_argument::Input_file_type): New enum.
9141 (Input_file_argument::is_lib_): Replace with...
9142 (Input_file_argument::type_): New member.
9143 (Input_file_argument::Input_file_argument): Take Input_file_type
9144 'type' rather than boolean 'is_lib' as second argument.
9145 (Input_file_argument::is_lib): Use type_.
9146 (Input_file_argument::is_searched_file): New function.
9147 (Input_file_argument::may_need_search): Handle is_searched_file.
9148 * options.cc (General_options::parse_library): Support -l:filename.
9149 (General_options::parse_just_symbols): Update for Input_file_argument
9150 changes.
9151 (Command_line::process): Likewise.
9152 * archive.cc (Archive::get_file_and_offset): Likewise.
9153 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9154 * script.cc (read_script_file, script_add_file): Likewise.
9155 * fileread.cc (Input_file::Input_file): Likewise.
9156 (Input_file::will_search_for): Handle is_searched_file.
9157 (Input_file::open): Likewise.
9158 * readsyms.cc (Read_symbols::get_name): Likewise.
9159 * testsuite/Makefile.am (searched_file_test): New test.
9160 * testsuite/Makefile.in: Regenerate.
9161 * testsuite/searched_file_test.cc: New file.
9162 * testsuite/searched_file_test_lib.cc: New file.
9163
f3048a1d
ILT
91642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9165 Ian Lance Taylor <iant@google.com>
9166
9167 * descriptor.cc: Include <cstdio> and "binary-io.h".
9168 (Descriptors::open): Open the files in binary mode always.
9169 * script.cc (Lex::get_token): Treat \r as whitespace.
9170
d4780e57
ILT
91712009-10-09 Ian Lance Taylor <iant@google.com>
9172
9173 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9174
d9a893b8
ILT
91752009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9176 Ian Lance Taylor <iant@google.com>
9177
9178 * configure.ac: Check for readv function also.
9179 * fileread.cc (readv): Define if not HAVE_READV.
9180 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9181 does not exist.
9182 * config.in: Regenerate.
9183 * configure: Regenerate.
9184
c0a62865
DK
91852009-10-09 Doug Kwan <dougkwan@google.com>
9186
9187 * layout.cc (Layout::make_output_section): Call target hook to make
9188 ordinary output section.
9189 (Layout::finalize): Adjust parameter list of call the
9190 Target::may_relax().
9191 * layout.h (class Layout::section_list): New method.
9192 * merge.h (Output_merge_base::entsize): Change visibility to public.
9193 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9194 New methods.
9195 (Output_merge_string::do_is_string): New method.
9196 * object.cc (Sized_relobj::do_setup): renamed from
9197 Sized_relobj::set_up.
9198 * object.h (Sized_relobj::adjust_shndx,
9199 Sized_relobj::initializ_input_to_output_maps,
9200 Sized_relobj::free_input_to_output_maps): Change visibilities to
9201 protected.
9202 (Sized_relobj::setup): Virtualize.
9203 (Sized_relobj::do_setup): New method declaration.
9204 (Sized_relobj::invalidate_section_offset,
9205 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9206 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9207 * options.cc (parse_int): New function.
9208 * options.h (parse_int): New declaration.
9209 (DEFINE_int): New macro.
9210 (stub_group_size): New option.
9211 * output.cc (Output_section::Output_section): Initialize memebers
9212 merge_section_map_, merge_section_by_properties_map_,
9213 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9214 (Output_section::add_input_section): Handled deferred code-fill
9215 generation and remove an old comment.
9216 (Output_section::add_relaxed_input_section): New method definition.
9217 (Output_section::add_merge_input_section): Use merge section by
9218 properties map to speed to search. Update merge section maps
9219 as appropriate.
9220 (Output_section::build_relaxation_map): New method definition.
9221 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9222 Same.
9223 (Output_section::relax_input_section): Renamed to
9224 Output_section::convert_input_sections_to_relaxed_sections and change
9225 interface to take a vector of pointers to relaxed sections.
9226 (Output_section::find_merge_section,
9227 Output_section::find_relaxed_input_section): New method definitions.
9228 (Output_section::is_input_address_mapped,
9229 Output_section::output_offset, Output_section::output_address):
9230 Use output section data maps to speed up searching.
9231 (Output_section::find_starting_output_address): Add comments.
9232 (Output_section::do_write,
9233 Output_section::write_to_postprocessing_buffer): Do code-fill
9234 generation as appropriate.
9235 (Output_section::get_input_sections): Invalidate relaxed input section
9236 map.
9237 (Output_section::restore_states): Adjust type of checkpoint .
9238 Invalidate relaxed input section map.
9239 * output.h (Output_merge_base): New class declaration.
9240 (Input_section_specifier): New class defintion.
9241 (class Output_relaxed_input_section) Change base class to
9242 Output_section_data_build.
9243 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9244 base class initializer.
9245 (Output_section::add_relaxed_input_section): New method declaration.
9246 (Output_section::Input_section): Change visibility to protected.
2e702c99 9247 (Output_section::Input_section::relobj,
c0a62865
DK
9248 Output_section::Input_section::shndx): Handle relaxed input sections.
9249 Output_section::input_sections) Change visibility to protected. Also
9250 define overload to return a non-const pointer.
9251 (Output_section::Merge_section_properties): New class defintion.
9252 (Output_section::Merge_section_by_properties_map,
9253 Output_section::Output_section_data_by_input_section_map,
9254 Output_section::Relaxation_map): New types.
9255 (Output_section::relax_input_section): Rename method to
9256 Output_section::convert_input_sections_to_relaxed_sections and change
9257 interface to take a vector of relaxed section pointers.
9258 (Output_section::find_merge_section,
9259 Output_section::find_relaxed_input_section,
9260 Output_section::build_relaxation_map,
9261 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9262 New method declarations.
9263 (Output_section::merge_section_map_
9264 Output_section::merge_section_by_properties_map_,
9265 Output_section::relaxed_input_section_map_,
9266 Output_section::is_relaxed_input_section_map_valid_,
9267 Output_section::generate_code_fills_at_write_): New data members.
9268 * script-sections.cc
9269 (Output_section_element_input::set_section_addresses): Call
9270 current_data_size and addralign methods of relaxed input sections.
9271 (Orphan_output_section::set_section_addresses): Call current_data_size
9272 and addralign methods of relaxed input sections.
9273 * symtab.cc (Symbol_table::compute_final_value): Extract template
9274 from the body of Symbol_table::sized_finalize_symbol.
9275 (Symbol_table::sized_finalized_symbol): Call
9276 Symbol_table::compute_final_value.
9277 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9278 (Symbol_table::compute_final_value): New templated method declaration.
9279 * target.cc (Target::do_make_output_section): New method defintion.
9280 * target.h (Target::make_output_section): New method declaration.
9281 (Target::relax): Add more parameters for input objects, symbol table
9282 and layout. Adjust call to do_relax.
9283 (Target::do_make_output_section): New method declaration.
9284 (Target::do_relax): Add parameters for input objects, symbol table
9285 and layout.
9286
d446d6c4
ILT
92872009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9288
9289 * pread.c: Include stdio.h.
9290
bc06c745
ILT
92912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9292
9293 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9294 defined.
9295
75aea3d0
ILT
92962009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9297
9298 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9299 Change read_shndx type to unsigned int.
9300 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9301 int.
9302 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9303 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9304 Change read_shndx type to unsigned int.
9305 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9306 int.
9307 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9308 * layout.cc (Layout::create_symtab_sections): Cast the result of
9309 local_symcount * symsize to off_t in the gold_assert.
9310
be8fcb75
ILT
93112009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9312
9313 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9314 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9315 R_ARM_BASE_ABS.
9316 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9317 (Arm_relocate_functions::thm_abs5): New function.
9318 (Arm_relocate_functions::abs12): New function.
9319 (Arm_relocate_functions::abs16): New function.
9320 (Arm_relocate_functions::base_abs): New function.
9321 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9322 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9323 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9324 R_ARM_BASE_ABS.
9325 (Scan::global): Likewise.
9326 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9327 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9328 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9329 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9330 R_ARM_BASE_ABS.
9331
c2a122b6
ILT
93322009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9333
9334 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9335 (Arm_relocate_functions::movt_prel): New function.
9336 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9337 (Arm_relocate_functions::thm_movt_prel): New function.
9338 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9339 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9340 (Scan::global, Relocate::relocate): Likewise.
9341 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9342
c4aa1e2d
ILT
93432009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9344
9345 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9346 Incremental_checker.
9347 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9348 unsigned int.
9349 (class Incremental_inputs_header): New class.
9350 (Incremental_inputs_header_writer): Edit comment.
9351 (Incremental_inputs_entry): New class.
9352 (Incremental_inputs_entry_writer): Edit comment.
9353 (Sized_incremental_binary::do_find_incremental_inputs_section):
9354 Add *strtab_shndx parameter, fill it.
9355 (Sized_incremental_binary::do_check_inputs): New method.
9356 (Incremental_checker::can_incrementally_link_output_file): Use
9357 Sized_incremental_binary::check_inputs.
9358 (Incremental_inputs::report_command_line): Save command line in
9359 command_line_.
9360 * incremental.h:
9361 (Incremental_binary::find_incremental_inputs_section): New
9362 method.
9363 (Incremental_binary::do_find_incremental_inputs_section): Add
9364 strtab_shndx parameter.
9365 (Incremental_binary::do_check_inputs): New pure virtual method.
9366 (Sized_incremental_binary::do_check_inputs): Declare.
9367 (Incremental_checker::Incremental_checker): Add incremental_inputs
9368 parameter, use it to initialize incremental_inputs_.
9369 (Incremental_checker::incremental_inputs_): New field.
9370 (Incremental_checker::command_line): New method.
9371 (Incremental_checker::inputs): New method.
9372 (Incremental_checker::command_line_): New field.
9373
c549a694
ILT
93742009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9375
9376 * incremental.cc: Include <cstdarg> and "target-select.h".
9377 (vexplain_no_incremental): New function.
9378 (explain_no_incremental): New function.
9379 (Incremental_binary::error): New method.
9380 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9381 method.
9382 (make_sized_incremental_binary): New function.
9383 (open_incremental_binary): New function.
9384 (can_incrementally_link_file): Add checks if output is ELF and has
9385 inputs section.
9386 * incremental.h: Include "elfcpp_file.h" and "output.h".
9387 (Incremental_binary): New class.
9388 (Sized_incremental_binary): New class.
9389 (open_incremental_binary): Declare.
9390 * object.cc (is_elf_object): Use
9391 elfcpp::Elf_recognizer::is_elf_file.
9392 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9393 * output.h (Output_file::filesize): New method.
9394
fd3c5f0b
ILT
93952009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9396
9397 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9398 New function.
9399 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9400 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9401 function.
9402 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9403 function.
9404 (Arm_relocate_functions::movw_abs_nc): New function.
9405 (Arm_relocate_functions::movt_abs): New function.
9406 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9407 (Arm_relocate_functions::thm_movt_abs): New function.
9408 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9409 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9410 (Scan::global): Likewise.
9411 (Relocate::relocate): Likewise.
9412 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9413
7f5309a5
ILT
94142009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9415
9416 * arm.cc (Arm_relocate_functions::got_prel) New function.
9417 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9418 (Relocate::relocate): Likewise.
9419 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9420
364c7fa5
ILT
94212009-10-06 Ian Lance Taylor <iant@google.com>
9422
9423 * options.h (class General_options): Define
9424 split_stack_adjust_size parameter.
9425 * object.h (class Object): Add uses_split_stack_ and
9426 has_no_split_stack_ fields. Add uses_split_stack and
9427 has_no_split_stack accessor functions. Declare
9428 handle_split_stack_section.
9429 (class Reloc_symbol_changes): Define.
9430 (class Sized_relobj): Define Function_offsets. Declare
9431 split_stack_adjust, split_stack_adjust_reltype, and
9432 find_functions.
9433 * object.cc (Object::handle_split_stack_section): New function.
9434 (Sized_relobj::do_layout): Call handle_split_stack_section.
9435 * dynobj.cc (Sized_dynobj::do_layout): Call
9436 handle_split_stack_section.
9437 * reloc.cc (Sized_relobj::relocate_sections): Call
9438 split_stack_adjust for executable sections in split_stack
9439 objects. Pass reloc_map to relocate_section.
9440 (Sized_relobj::split_stack_adjust): New function.
9441 (Sized_relobj::split_stack_adjust_reltype): New function.
9442 (Sized_relobj::find_functions): New function.
9443 * target-reloc.h: Include "object.h".
9444 (relocate_section): Add reloc_symbol_changes parameter. Change
9445 all callers.
9446 * target.h (class Target): Add calls_non_split method. Declare
9447 do_calls_non_split virtual method. Declare match_view and
9448 set_view_to_nop.
9449 * target.cc: Include "elfcpp.h".
9450 (Target::do_calls_non_split): New function.
9451 (Target::match_view): New function.
9452 (Target::set_view_to_nop): New function.
9453 * gold.cc (queue_middle_tasks): Give an error if mixing
9454 split-stack and non-split-stack objects with -r.
9455 * i386.cc (Target_i386::relocate_section): Add
9456 reloc_symbol_changes parameter.
9457 (Target_i386::do_calls_non_split): New function.
9458 * x86_64.cc (Target_x86_64::relocate_section): Add
9459 reloc_symbol_changes parameter.
9460 (Target_x86_64::do_calls_non_split): New function.
9461 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9462 parameter.
9463 * powerpc.cc (Target_powerpc::relocate_section): Add
9464 reloc_symbol_changes parameter.
9465 * sparc.cc (Target_sparc::relocate_section): Add
9466 reloc_symbol_changes parameter.
9467 * configure.ac: Call AM_CONDITIONAL for the default target.
9468 * configure: Rebuild.
9469 * testsuite/Makefile.am (TEST_AS): New variable.
9470 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9471 (check_DATA): Add split_i386 and split_x86_64 files.
9472 (SPLIT_DEFSYMS): Define.
9473 (split_i386_[1234n].o): New targets.
9474 (split_i386_[124]): New targets.
9475 (split_i386_[1234r].stdout): New targets.
9476 (split_x86_64_[1234n].o): New targets.
9477 (split_x86_64_[124]): New targets.
9478 (split_x86_64_[1234r].stdout): New targets.
9479 (MOSTLYCLEANFILES): Add new executables.
9480 * testsuite/split_i386.sh: New file.
9481 * testsuite/split_x86_64.sh: New file.
9482 * testsuite/split_i386_1.s: New file.
9483 * testsuite/split_i386_2.s: New file.
9484 * testsuite/split_i386_3.s: New file.
9485 * testsuite/split_i386_4.s: New file.
9486 * testsuite/split_i386_n.s: New file.
9487 * testsuite/split_x86_64_1.s: New file.
9488 * testsuite/split_x86_64_2.s: New file.
9489 * testsuite/split_x86_64_3.s: New file.
9490 * testsuite/split_x86_64_4.s: New file.
9491 * testsuite/split_x86_64_n.s: New file.
9492 * testsuite/testfile.cc (Target_test): Update relocation_section
9493 function.
9494 * testsuite/Makefile.in: Rebuild.
9495
e8a9fcda
ILT
94962009-10-06 Ian Lance Taylor <iant@google.com>
9497
9498 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9499 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9500 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9501 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9502 the address on ldo_addrs_.
9503 (Target_i386::Relocate::fix_up_ldo): New function.
9504
e99daf92
ILT
95052009-10-06 Rafael Espindola <espindola@google.com>
9506
9507 * plugin.cc (add_input_library): New.
9508 (Plugin::load): Add add_input_library to tv.
9509 (Plugin_manager::add_input_file): Add the is_lib argument.
9510 (add_input_file): Update call to Plugin_manager::add_input_file.
9511 (add_input_library): New.
9512 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9513
966d4097
DK
95142009-09-30 Doug Kwan <dougkwan@google.com>
9515
9516 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9517 symbol and call Symbol::may_need_copy_reloc to determine if
9518 a copy reloc is needed.
9519 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9520 nocopyreloc is given in command line.
9521 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9522 given in command line.
9523 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9524 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9525 of the removed Target_i386::may_need_copy_reloc.
9526 * options.h (copyreloc): New option with default value false.
9527 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9528 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9529 instead of the removed Target_powerpc::may_need_copy_reloc.
9530 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9531 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9532 instead of the removed Target_sparc::may_need_copy_reloc.
9533 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9534 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9535 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9536 instead of the removed Target_x86_64::may_need_copy_reloc.
9537
029ba973
ILT
95382009-09-30 Ian Lance Taylor <iant@google.com>
9539
9540 * object.h (class Object): Remove target_ field, and target,
9541 sized_target, and set_target methods.
9542 (Object::sized_target): Remove.
9543 (class Sized_relobj): Update declarations. Remove sized_target.
9544 * object.cc (Sized_relobj::setup): Remove target parameter.
9545 Change all callers.
9546 (Input_objects::add_object): Don't do anything with the target.
9547 (make_elf_sized_object): Add punconfigured parameter. Change all
9548 callers. Set or test parameter target.
9549 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9550 Change all callers.
9551 * parameters.cc (Parameters::set_target): Change parameter type to
9552 be non-const.
9553 (Parameters::default_target): Remove.
9554 (set_parameters_target): Change parameter type to be non-const.
9555 (parameters_force_valid_target): New function.
9556 (parameters_clear_target): New function.
9557 * parameters.h (class Parameters): Update declarations. Remove
9558 default_target method. Add sized_target and clear_target
9559 methods. Change target_ to be non-const.
9560 (set_parameters_target): Update declaration.
9561 (parameters_force_valid_target): Declare.
9562 (parameters_clear_target): Declare.
9563 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9564 as NULL if we aren't searching.
9565 (Add_symbols::run): Don't check for compatible target.
9566 * fileread.cc (Input_file::open_binary): Call
9567 parameters_force_valid_target.
9568 * gold.cc (queue_middle_tasks): Likewise.
9569 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9570 set_target on object.
9571 * dynobj.h (class Sized_dynobj): Update declarations.
9572 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9573 make_elf_object returns NULL.
9574 (Archive::include_member): Don't check whether object target is
9575 compatible.
9576 * output.cc (Output_section::add_input_section): Get target from
9577 parameters.
9578 (Output_section::relax_input_section): Likewise.
9579 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9580 parameters.
9581 (Sized_relobj::do_scan_relocs): Likewise.
9582 (Sized_relobj::relocate_sections): Likewise.
9583 * resolve.cc (Symbol_table::resolve): Likewise.
9584 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9585 parameter. Change all callers.
9586 (Symbol_table::add_from_object): Get target from parameters.
9587 (Symbol_table::add_from_relobj): Don't check object target.
9588 (Symbol_table::add_from_dynobj): Likewise.
9589 (Symbol_table::define_special_symbol): Get target from
9590 parameters.
9591 * symtab.h (class Symbol_table): Update declaration.
9592 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9593 parameter. Change all callers. Clear parameter target.
9594 (Binary_test): Test target here.
9595 * testsuite/object_unittest.cc (gold_testsuite): Remove
9596 target_test_pointer parameter. Change all callers.
9597 (Object_test): Test target here.
9598
a6a22b83
ILT
95992009-09-26 Ian Lance Taylor <iant@google.com>
9600
9601 * testsuite/initpri1.c: Don't try to use constructor priorities if
9602 compiling with gcc before 4.3.
9603
6a8f49fe
ILT
96042009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9605
9606 * testsuite/retain_symbols_file_test.sh (check_present): Change
9607 output file name to retain_symbols_file_test.stdout.
9608 (check_absent): Likewise.
9609
8c604651
CS
96102009-09-18 Craig Silverstein <csilvers@google.com>
9611
9612 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9613 * options.cc: Include <cerrno> and <fstream>.
9614 (General_options::finalize): Parse -retain-symbols-file tag.
9615 * options.h: New flag.
9616 (General_options): New method should_retain_symbol, new
9617 variable symbols_to_retain.
9618 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9619 should_retain_symbol map.
9620 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9621 * testsuite/Makefile.in: Regenerate.
9622 * testsuite/retain_symbols_file_test.sh: New file.
9623
ca58b19f
NC
96242009-09-18 Nick Clifton <nickc@redhat.com>
9625
9626 * po/es.po: Updated Spanish translation.
9627
20e6d0d6
DK
96282009-09-17 Doug Kwan <dougkwan@google.com>
9629
9630 * debug.h (DEBUG_RELAXATION): New constant.
9631 (DEBUG_ALL): Add DEBUG_RELAXATION.
9632 (debug_string_to_enum): Add relaxation debug option.
9633 * layout.cc
9634 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9635 Layout::Relaxation_debug_check::read_sections,
9636 Layout::Relaxation_debug_check::read_sections): New method definitions.
9637 (Layout::Layout): Initialize data members
9638 record_output_section_data_from_scrips_,
9639 script_output_section_data_list_ and relaxation_debug_check_.
9640 (Layout::save_segments, Layout::restore_segments,
9641 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9642 Layout::relaxation_loop_body): New method definitions.
9643 (Layout::finalize): Support relaxation. Move section layout code to
9644 Layout::relaxation_loop_body.
9645 (Layout::set_asection_address_from_script): Move code for orphan
9646 section placement out.
9647 (Layout::place_orphan_sections_in_script): New method definition.
9648 * layout.h (Output_segment_headers, Output_file_header):
9649 New forward class declarations.
9650 (Layout::~Layout): Define.
9651 (Layout::new_output_section_data_from_script): New method definition.
9652 (Layout::place_orphan_sections_in_script): New method declaration.
9653 (Layout::Segment_states): New type declaration.
9654 (Layout::save_segments, Layout::restore_segments,
9655 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9656 Layout::relaxation_loop_body): New method declarations.
9657 (Layout::Output_section_data_list): New type declaration.
9658 (Layout::Relaxation_debug_check): New class definition.
9659 (Layout::record_output_section_data_from_script_,
9660 Layout::script_output_section_data_list_, Layout::segment_states_,
9661 Layout::relaxation_debug_check_): New data members.
9662 * output.cc: (Output_section_headers::do_size): New method definition.
9663 (Output_section_headers::Output_section_headers): Move size
9664 computation to Output_section_headers::do_size.
9665 (Output_segment_headers::do_size): New method definition.
e1df38aa 9666 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9667 Output_file_header::do_size and call it.
9668 (Output_file_header::do_size): New method definition.
9669 (Output_data_group::Output_data_group): Adjust call to
9670 Output_section_data.
9671 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9672 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9673 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9674 RELAXED_INPUT_SECTION_CODE.
9675 (Output_section::Output_section): Initialize data member checkpoint_.
9676 (Output_section::~Output_section): Delete checkpoint object pointed
9677 by checkpoint_.
9678 (Output_section::add_input_section): Always add an Input_section if
9679 relaxing.
9680 (Output_section::add_merge_input_section): Add assert.
9681 (Output_section::relax_input_section): New method definition.
9682 (Output_section::set_final_data_size): Set load address to zero for
9683 an unallocated section.
9684 (Output_section::do_address_and_file_offset_have_reset_values):
9685 New method definition.
9686 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9687 Handle relaxed input section.
9688 (Output_section::sort_attached_input_sections): Checkpoint input
9689 section list lazily.
9690 (Output_section::get_input_sections): Change type of input_sections to
9691 list of Simple_input_section pointers. Checkpoint input section list
9692 lazily. Also handle relaxed input sections.
9693 (Output_section::add_input_section_for_script): Take a reference to
9694 a Simple_input_section object instead of Relobj pointer and section
9695 index as parameter. Handle relaxed input sections.
9696 (Output_section::save_states, Output_section::restore_states): New
9697 method definitions.
9698 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9699 (Output_data::is_data_size_fixed): New method definition.
9700 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9701 if it is fixed.
9702 (Output_data::address_and_file_offset_have_reset_values): New method
9703 definition.
9704 (Output_data::do_address_and_file_offset_have_reset_values): New method
9705 definition.
9706 (Output_data::set_data_size): Check that data size is not fixed.
9707 (Output_data::fix_data_size): New method definition.
9708 (Output_data::is_data_size_fixed_): New data member.
9709 (Output_section_headers::set_final_data_size): New method definition.
9710 (Output_section_headers::do_size): New method declaration.
9711 (Output_segment_headers::set_final_data_size): New method definition.
9712 (Output_segment_headers::do_size): New method declaration.
9713 (Output_file_header::set_final_data_size)::New method definition.
9714 (Output_file_header::do_size)::New method declaration.
9715 (Output_section_data::Output_section_data): Add new parameter
9716 is_data_size_fixed and use it to fix data size.
9717 (Output_data_const::Output_data_const): Adjust call to base class
9718 constructor and fix data size.
9719 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9720 base class constructor and fix data size.
9721 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9722 base class constructor and fix data size.
9723 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9724 class constructor and fix data size.
9725 (Output_data_group::set_final_data_size): New method definition.
9726 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9727 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9728 class constructor and fix data size.
9729 (Output_relaxed_input_section): New class definition.
9730 (Output_section::Simple_input_section): New class definition.
9731 (Output_section::get_input_sections): Adjust parameter list.
9732 (Output_section::add_input_section_for_script): Same.
9733 (Output_section::save_states, Output_section::restore_states,
9734 Output_section::do_address_and_file_offset_have_reset_values,
9735 (Output_section::Input_section::Input_section): Handle
9736 RELAXED_INPUT_SECTION_CODE. Add new overload for
9737 Output_relaxed_input_section.
9738 (Output_section::Input_section::is_input_section,
9739 Output_section::Input_section::set_output_section): Handle relaxed
9740 input section.
9741 (Output_section::Input_section::is_relaxed_input_section,
9742 Output_section::Input_section::output_section_data,
9743 Output_section::Input_section::relaxed_input_section): New method
9744 definitions.
9745 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9746 value.
9747 (Output_section::Input_section::u1_): Update comments.
9748 (Output_section::Input_section::u2_): Add new union member poris.
9749 (Output_section::Checkpoint_output_section): New classs definition.
9750 (Output_section::relax_input_section): New method declaration.
9751 (Output_section::checkpoint_): New data member.
9752 (Output_segment): Update comments.
9753 (Output_segment::Output_segment): Un-privatize copy constructor.
9754 (Output_segment::operator=): Un-privatize.
9755 * script-sections.cc (Output_section_element::Input_section_list):
9756 Change element type to Output_section::Simple_input_section.
9757 (Output_section_element_dot_assignment::set_section_addresses):
9758 Register output section data for relaxation clean up.
9759 (Output_data_exression::Output_data_expression): Adjust call to base
9760 constructor to fix data size.
9761 (Output_section_element_data::set_section_addresses): Register
9762 Output_data_expression object for relaxation clean up.
9763 (struct Input_section_info): Replace Relobj pointer and section index
9764 pair with Output_section::Simple_input_section and Convert struct to a
9765 class.
9766 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9767 Input_section_info data member to use accessors.
20e6d0d6
DK
9768 (Output_section_element_input::set_section_addresses): Use layout
9769 parameter. Adjust code to use Output_section::Simple_input_section
9770 and Input_secction_info classes. Register filler for relaxation
9771 clean up.
9772 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9773 and section index pair with Output_section::Simple_input_section
9774 class. Adjust code accordingly.
9775 (Phdrs_element::release_segment): New method definition.
9776 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9777 segment list.
9778 (Script_sections::release_segments): New method definition.
9779 * gold/script-sections.h (Script_sections::release_segments): New
9780 method declaration.
9781 * gold/target.h (Target::may_relax, Target::relax,
9782 Target::do_may_relax, Target::do_relax): New method definitions.
9783
5e445df6
ILT
97842009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9785
9786 * arm.cc (has_signed_unsigned_overflow): New function.
9787 (Arm_relocate_functions::abs8): New function.
9788 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9789 (Target_arm::Scan::global): Likewise.
9790 (Target_arm::relocate::relocate): Likewise.
9791 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9792 Likewise.
9793
8c604651 97942009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9795
9796 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9797 * testsuite/Makefile.in: Regenerate.
9798
1e9cc1c2
NC
97992009-09-11 Nick Clifton <nickc@redhat.com>
9800
9801 * po/gold.pot: Updated by the Translation project.
9802
6a89f575
CC
98032009-09-08 Cary Coutant <ccoutant@google.com>
9804
9805 * output.cc (Output_file::open): Add execute permission to empty file.
9806 * testsuite/Makefile.am (permission_test): New test.
9807 * testsuite/Makefile.in: Regenerate.
9808
fdcac5af
ILT
98092009-09-02 Ian Lance Taylor <iant@google.com>
9810
9811 * output.cc (Output_file::resize): Call map_no_anonymous rather
9812 than map.
9813
44453f85
ILT
98142009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9815
9816 * gold.cc: Include "incremental.h".
9817 (queue_initial_tasks): Call Incremental_checker methods.
9818 * incremental.cc: Include "output.h".
9819 (Incremental_checker::can_incrementally_link_output_file): New
9820 method.
9821 * incremental.h (Incremental_checker): New class.
9822
9823 * output.cc (Output_file::open_for_modification): New method.
9824 (Output_file::map_anonymous): Changed return type to bool. Record
9825 map in base_ field.
9826 (Output_file::map_no_anonymous): New method, broken out of map.
9827 (Output_file::map): Use map_no_anonymous and map_anonymous.
9828 * output.h (class Output_file): Update declarations.
9829
293c1386
CC
98302009-08-24 Cary Coutant <ccoutant@google.com>
9831
9832 * options.h (Command_line::Pre_options): New class.
9833 (Command_line::pre_options): New member.
9834 * options.cc (gold::options::ready_to_register): New variable.
9835 (One_option::register_option): Do nothing if not registering options.
9836 Assert if same short option registered twice.
9837 (General_options::General_options): Turn off option registration when
9838 done constructing.
9839 (Command_line::Pre_options::Pre_options): New constructor.
9840
f773f3d2
CC
98412009-08-24 Cary Coutant <ccoutant@google.com>
9842
06a73cfe
CC
9843 * options.h (General_options::no_keep_memory): Remove incorrect
9844 short option.
f773f3d2 9845
a15af8e2
RW
98462009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9847
9848 * Makefile.am (am__skiplex, am__skipyacc): New.
9849 * Makefile.in: Regenerate.
9850
c462b41b
RW
98512009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9852
14ec8efd
RW
9853 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9854 (INCLUDES): ... this.
9855 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9856 (AM_CPPFLAGS): Renamed from ...
9857 (INCLUDE): ... this.
9858 * Makefile.in, testsuite/Makefile.in: Regenerate.
9859
81ecdfbb
RW
9860 * Makefile.in: Regenerate.
9861 * aclocal.m4: Likewise.
9862 * config.in: Likewise.
9863 * configure: Likewise.
9864 * testsuite/Makefile.in: Likewise.
9865
c462b41b
RW
9866 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9867 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9868 * Makefile.in: Regenerate.
9869 * testsuite/Makefile.in: Regenerate.
9870
2da73f13
CC
98712009-08-19 Cary Coutant <ccoutant@google.com>
9872
9873 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9874 symbols in shared libraries overridden by hidden or internal symbols
9875 in the main program.
9876
2db70501
CD
98772009-08-19 Chris Demetriou <cgd@google.com>
9878
9879 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9880 checking source file names in error messages.
9881
f733487b
DK
98822009-08-18 Doug Kwan <dougkwan@google.com>
9883
9884 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9885 an elcpp::Ehdr as parameter. Adjust call to set_target.
9886 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9887 an elfcpp::Ehdr as parameter.
9888 * object.cc (Object::set_target): Remove the version that looks up
9889 a target and sets it.
9890 (Sized_relobj::setup): Take a Target object instead of
9891 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9892 (make_elf_sized_object): Find target and ask target to
9893 make an ELF object.
9894 * object.h: (Object::set_target): Remove the version that looks up
9895 a target and sets it.
9896 (Sized_relobj::setup): Take a Target object instead of
9897 an elfcpp:Ehdr as parameter.
9898 * target.cc: Include dynobj.h.
9899 (Target::do_make_elf_object_implementation): New.
2e702c99 9900 (Target::do_make_elf_object): New.
f733487b
DK
9901 * target.h (Target::make_elf_object): New template declaration.
9902 (Target::do_make_elf_object): New method declarations.
9903 (Target::do_make_elf_object_implementation): New template declaration.
9904
cc70f101
ILT
99052009-08-14 Ian Lance Taylor <iant@google.com>
9906
9907 * gold.h (FUNCTION_NAME): Define.
9908 (gold_unreachable): Use FUNCTION_NAME.
9909
ef5e0cb1
ST
99102009-08-12 Sriraman Tallam <tmsriram@google.com>
9911
9912 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9913 symbol in the --keep-unique list is not found.
9914
48c187ce
ST
99152009-08-12 Sriraman Tallam <tmsriram@google.com>
9916
9917 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9918 been maked as --keep-unique.
9919 (Icf::unfold_section): New function.
9920 * icf.h (Icf::unfold_section): New function.
9921 * options.h (General_options::keep_unique): New option.
9922 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9923 * testsuite/Makefile.in: Regenerate.
9924 * testsuite/icf_keep_unique_test.sh: New file.
9925 * testsuite/icf_keep_unique_test.cc: New file.
9926
645afe0c
CC
99272009-08-12 Cary Coutant <ccoutant@google.com>
9928
9929 PR 10471
9930 * resolve.cc (Symbol_table::resolve): Check for references from
9931 dynamic objects to hidden and internal symbols.
9932 * testsuite/Makefile.am (hidden_test.sh): New test.
9933 * testsuite/Makefile.in: Regenerate.
9934 * testsuite/hidden_test.sh: New script.
9935 * testsuite/hidden_test_1.c: New test source.
9936 * testsuite/hidden_test_main.c: New test source.
9937
11af873f
DK
99382009-08-11 Doug Kwan <dougkwan@google.com>
9939
9940 * arm.cc: Update comments.
9941 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9942 segment to locate the .ARM.exidx section if present.
9943
b9f7d72d
DK
99442009-08-09 Doug Kwan <dougkwan@google.com>
9945
9946 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9947 patch.
9948
ddd3c53c
ST
99492009-08-07 Sriraman Tallam <tmsriram@google.com>
9950 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9951 compiler warnings.
9952
27721062
ST
99532009-08-06 Sriraman Tallam <tmsriram@google.com>
9954
9955 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9956 valid tls_segment only for non-debug-section relocations.
9957 * testsuite/Makefile.am: Add gc_tls_test.
9958 * testsuite/Makefile.in: Regenerate.
9959 * testsuite/gc_tls_test.cc: New file.
9960 * testsuite/gc_tls_test.sh: New file.
9961
ef15dade 99622009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9963
ef15dade
ST
9964 * icf.cc: New file.
9965 * icf.h: New file.
9966 * Makefile.am (CCFILES): Add icf.cc.
9967 (HFILES): Add icf.h
9968 * Makefile.in: Regenerate.
9969 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9970 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9971 section, symbol and addend information for the relocs.
9972 * gold.cc (queue_middle_tasks): Call identical code folding.
9973 * gold.h: Add defines for multimap.
9974 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9975 to the call of finalize_local_symbols.
9976 * main.cc (main): Create object of class Icf.
9977 * object.cc (Sized_relobj::do_layout): Allow this function to be
9978 called twice during icf.
9979 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9980 to sections marked as identical by icf.
9981 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9982 when available.
9983 (Sized_relobj::do_section_entsize): New function.
9984 * object.h (Object::section_entsize): New function.
9985 (Object::do_section_entsize): New pure virtual function.
9986 (Relobj::finalize_local_symbols): Add new parameter.
9987 (Relobj::do_section_entsize): New function.
9988 * options.h (General_options::icf): New option.
9989 (General_options::icf_iterations): New option.
9990 (General_options::print_icf_sections): New option.
9991 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9992 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9993 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9994 icf.
9995 * symtab.cc (Symbol_table::is_section_folded): New function.
9996 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9997 to sections marked as identical by icf.
9998 * symtab.h (Symbol_table::set_icf): New function.
9999 (Symbol_table::icf): New function.
10000 (Symbol_table::is_section_folded): New function.
10001 (Symbol_table::icf_): New data member.
10002 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10003 * testsuite/Makefile.am: Add commands to build icf_test.
10004 * testsuite/Makefile.in: Regenerate.
10005 * testsuite/icf_test.sh: New file.
10006 * testsuite/icf_test.cc: New file.
10007
c3b65ac4
CD
100082009-07-24 Chris Demetriou <cgd@google.com>
10009
10010 * layout.cc (is_compressible_debug_section): Fix incorrect
10011 comment about compressed section names.
10012
1caf2c51
ILT
100132009-07-20 Ian Lance Taylor <ian@airs.com>
10014
10015 PR 10419
10016 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10017
1ef4d87f
ILT
100182009-07-16 Ian Lance Taylor <iant@google.com>
10019
10020 PR 10400
10021 * layout.h: #include <map>.
10022 (class Kept_section): Change from struct to class. Add accessors
10023 and setters. Add section size to Comdat_group mapping. Change
10024 Comdat_group to std::map. Add is_comdat_ field. Add
10025 linkonce_size field in union.
10026 (class Layout): Update declaration of find_or_add_kept_section.
10027 Don't declare find_kept_object.
10028 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10029 parameter. Add object, shndx, is_comdat, and is_group_name
10030 parameters. Change all callers. Adjust for new Kept_section.
10031 (Layout::find_kept_object): Remove.
10032 * object.cc (Sized_relobj::include_section_group): Update use of
10033 Kept_section. Rename secnum to shndx. Only record
10034 Kept_comdat_section if sections are the same size.
10035 (Sized_relobj::include_linkonce_section): Update use of
10036 Kept_section. Only record Kept_comdat_section if sections are the
10037 same size. Set size of linkonce section.
10038 (Sized_relobj::map_to_kept_section): Update call to
10039 get_kept_comdat_section.
10040 * object.h (class Sized_relobj): Rename fields in
10041 Kept_comdat_section to drop trailing underscores; change object
10042 field to Relobj*. Change Kept_comdat_section_table to store
10043 struct rather than pointer.
10044 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10045 Add kept_object and kept_shndx parameters. Change all callers.
10046 (Sized_relobj::get_kept_comdat_section): Change return type to
10047 bool. Add kept_object and kept_shndx parameters. Change all
10048 callers.
10049 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10050 Layout::find_or_add_kept_section.
10051
37c3b7b0
ILT
100522009-07-09 Ian Lance Taylor <iant@google.com>
10053
10054 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10055 Reserve space in the hash table.
10056
98fa85cb
ILT
100572009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10058
10059 * fileread.cc (File_read::get_mtime): New method.
10060 * fileread.h (Timespec): New structure.
10061 (File_read::get_mtime): New method.
10062 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10063 Renamed from timestamp_nsec.
10064 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10065 Elf_Xword.
e1df38aa 10066 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10067 timestamp_nsec.
e1df38aa 10068 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10069 (Incremental_inputs::report_obejct): Save mtime; style fix.
10070 (Incremental_inputs::report_script): Save mtime; style fix.
10071 (Incremental_inputs::finalize_inputs): Style fix.
10072 (Incremental_inputs::finalize): Style fix.
10073 (Incremental_inputs::create_input_section_data): Store inputs
10074 mtime.
10075 * incremental.h (Incremental_inputs::report_script): Add mtime
10076 argument.
10077 (Incremental_inputs::Input_info::Input_info): Intialize only one
10078 union member.
10079 (Incremental_inputs::Input_info::archive): Move to nameless
10080 union.
10081 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10082 (Incremental_inputs::Input_info::script): Move to nameless union.
10083 (Incremental_inputs::mtime): New field.
10084 * script.cc (read_input_script): Pass file mtime to
10085 Incremental_input.
10086 * script.h (Script_info::inputs): Style fix.
10087
c9d70757
ILT
100882009-07-01 Ian Lance Taylor <ian@airs.com>
10089
10090 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10091 instead of 32.
10092
9c547ec3
ILT
100932009-06-24 Ian Lance Taylor <iant@google.com>
10094
10095 PR 10156
10096 * layout.cc (Layout::choose_output_section): If we find an
10097 existing section, update the flags.
10098 (Layout::create_notes): New function, broken out of
10099 Layout::finalize.
10100 (Layout::finalize): Don't create note sections.
10101 (Layout::create_note): Don't crash if linker script discards
10102 section.
10103 (Layout::create_gold_note): Likewise.
10104 (Layout::create_build_id): Likewise. Don't set
10105 after_input_sections on the section.
10106 (Layout::create_executable_stack_info): Remove target parameter.
10107 Change caller.
10108 * layout.h (class Layout): Declare create_notes. Update
10109 declaration of create_executable_stack_info.
10110 * gold.cc (queue_middle_tasks): Call create_notes.
10111 * output.cc (Output_section::update_flags_for_input_section): Move
10112 here from output.h. If SHF_ALLOC flag is newly set, mark address
10113 invalid.
10114 * output.h (Output_data::mark_address_invalid): New function.
10115 (class Output_section): Only declare, not define,
10116 update_flags_for_input_section. Remove set_flags.
10117
55458500
ILT
101182009-06-24 Ian Lance Taylor <iant@google.com>
10119
10120 * script-sections.cc (Output_section_definition::
10121 set_section_addresses): Rename shadowing local load_address to
10122 laddr.
10123
1307d6cd
ILT
101242009-06-24 Ian Lance Taylor <iant@google.com>
10125
10126 PR 10244
10127 * reloc.cc (relocate_sections): Skip empty relocation sections.
10128
ec3f783e
ILT
101292009-06-23 Ian Lance Taylor <iant@google.com>
10130
10131 PR 10156
10132 * layout.cc (Layout::create_note): Use choose_output_section
10133 rather than make_output_section.
10134
459c9f1c
ILT
101352009-06-23 Ian Lance Taylor <iant@google.com>
10136
10137 PR 10237
10138 * options.cc (General_options::parse_V): Set printed_version_.
10139 (General_options::General_options): Initialize printed_version_.
10140 * options.h (class General_options): Add printed_version_ field.
10141 * gold.cc (queue_initial_tasks): If there are no input files,
10142 don't give a fatal error if we printed the version information.
10143 (queue_middle_tasks): If using -r with a shared object, give a
10144 fatal error rather than an ordinary error.
10145
1518dc8f
ILT
101462009-06-23 Ian Lance Taylor <iant@google.com>
10147
10148 PR 10219
10149 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10150 (Layout::make_output_section): Set have_stabstr_section_ if we see
10151 a .stab*str section.
10152 (Layout::finalize): Call link_stabs_sections.
10153 (Layout::link_stabs_sections): New file.
10154 * layout.h (class Layout): Add have_stabstr_section_ field.
10155 Declare link_stabs_sections.
10156
3d857b98
DK
101572009-06-23 Doug Kwan <dougkwan@google.com>
10158
10159 * Makefile.am (libgold_a_LIBADD): New.
10160 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10161 * Makefile.in: Regenerate.
3d857b98
DK
10162 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10163 * configure: Regenerate.
10164 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10165 * fileread.cc: Include sys/state.h
10166 * gold.h: Declare memmem and strndup if found missing.
10167 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10168
0639a6f6
ILT
101692009-06-23 Ian Lance Taylor <iant@google.com>
10170
10171 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10172 * configure: Rebuild.
10173
8d63875c
ILT
101742009-06-23 Ian Lance Taylor <iant@google.com>
10175
10176 PR 10147
10177 * object.cc (Object::section_contents): Don't try to get a view if
10178 the section has length zero.
10179 (Object::handle_gnu_warning_section): If the section is empty, use
10180 the name of the section as the warning.
10181
f7c8a183
ILT
101822009-06-23 Ian Lance Taylor <iant@google.com>
10183
10184 PR 10133
10185 * stringpool.h (class Stringpool_template): Add optimize_ field.
10186 (Stringpool_template::set_optimize): New function.
10187 * stringpool.cc (Stringpool_template::Stringpool_template):
10188 Initialize optimize_ field.
10189 (Stringpool_template::set_string_offsets): Test local optimize
10190 fild rather than parameter.
10191 * layout.cc (Layout::Layout): Call set_optimize on the section
10192 name stringpool.
10193
e6a307ba
ILT
101942009-06-22 Ian Lance Taylor <iant@google.com>
10195
10196 PR 10030
10197 * yyscript.y: Parse TARGET.
10198 * script.cc (script_set_target): New function.
10199 * script-c.h (script_set_target): Declare.
10200 * options.cc (General_options::string_to_object_format): Rename
10201 from string_to_object_format in anonymous namespace. Change
10202 callers.
10203 * options.h (class General_options): Declare
10204 string_to_object_format.
10205
3ee173de
ILT
102062009-06-22 Ian Lance Taylor <iant@google.com>
10207
10208 * script-sections.cc (Script_sections::create_segments): Don't put
10209 program headers in a PT_LOAD segment if -n or -N.
10210
102112009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10212
10213 PR 10141
10214 * options.h (class General_options): Add -z lazy and -z now. Sort
10215 -z options into alphabetical order.
10216 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10217
cd6739a1 102182009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10219
10220 * layout.cc (Layout::make_output_section): Call
10221 Target::new_output_section.
10222 (Layout::attach_allocated_section_to_segment): Put large section
10223 sections in a separate load segment with the large segment flag
10224 set.
10225 (Layout::segment_precedes): Sort large data segments after other
10226 load segments.
10227 (align_file_offset): New static function.
10228 (Layout::set_segment_offsets): Use align_file_offset.
10229 * output.h (class Output_section): Add is_small_section_ and
10230 is_large_section_ fields.
10231 (Output_section::is_small_section): New function.
10232 (Output_section::set_is_small_section): New function.
10233 (Output_section::is_large_section): New function.
10234 (Output_section::set_is_large_section): New function.
10235 (Output_section::is_large_data_section): New function.
10236 (class Output_segment): Add is_large_data_segment_ field.
10237 (Output_segment::is_large_data_segment): New function.
10238 (Output_segment::set_is_large_data_segment): New function.
10239 * output.cc (Output_section::Output_section): Initialize new
10240 fields.
10241 (Output_segment::Output_segment): Likewise.
10242 (Output_segment::add_output_section): Add assertion that large
10243 data sections always go in large data segments. Force small data
10244 sections to the end of the list of data sections. Force small BSS
10245 sections to the start of the list of BSS sections. For large BSS
10246 sections to the end of the list of BSS sections.
10247 * symtab.h (class Symbol): Declare is_common_shndx.
10248 (Symbol::is_defined): Check Symbol::is_common_shndx.
10249 (Symbol::is_common): Likewise.
10250 (class Symbol_table): Define enum Commons_section_type. Update
10251 declarations. Add small_commons_ and large_commons_ fields.
10252 * symtab.cc (Symbol::is_common_shndx): New function.
10253 (Symbol_table::Symbol_table): Initialize new fields.
10254 (Symbol_table::add_from_object): Put small and large common
10255 symbols in the right list.
10256 (Symbol_table::sized_finalized_symbol): Check
10257 Symbol::is_common_shndx.
10258 (Symbol_table::sized_write_globals): Likewise.
10259 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10260 common symbol lists. Don't call do_allocate_commons_list if the
10261 list is empty.
10262 (Symbol_table::do_allocate_commons_list): Remove is_tls
10263 parameter. Add comons_section_type parameter. Change all
10264 callers. Handle small and large common symbols.
10265 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10266 Symbol::is_common_shndx.
10267 * resolve.cc (symbol_to_bits): Likewise.
10268 * target.h (Target::small_common_shndx): New function.
10269 (Target::small_common_section_flags): New function.
10270 (Target::large_common_shndx): New function.
10271 (Target::large_common_section_flags): New function.
10272 (Target::new_output_section): New function.
10273 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10274 small_common_section_flags, and large_common_section_flags
10275 fields.
10276 (Target::do_new_output_section): New virtual function.
10277 * arm.cc (Target_arm::arm_info): Initialize new fields.
10278 * i386.cc (Target_i386::i386_info): Likewise.
10279 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10280 Likewise.
10281 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10282 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10283 (Target_x86_64::do_new_output_section): New function.
10284 * configure.ac: Define conditional MCMODEL_MEDIUM.
10285 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10286 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10287 (large_LDFLAGS): Define.
10288 * testsuite/large.c: New file.
10289 * testsuite/testfile.cc (Target_test::test_target_info):
10290 Initialize new fields.
10291 * configure, testsuite/Makefile.in: Rebuild.
10292
bb04269c
DK
102932009-06-05 Doug Kwan <dougkwan@google.com>
10294
10295 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10296 * Makefile.in: Regenerate.
bb04269c
DK
10297 * i386.cc (class Target_i386): Define new virtual method to
10298 override do_is_local_label_name in parent.
10299 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10300 local symbols if --discard-locals or -X is given.
10301 * options.h (class General_options): Declare new options
10302 '--discard-locals' and '-X' for discarding locals.
10303 * target.h (class Target): Define new methods is_local_label_name.
10304 Declare new virtual method do_is_local_label_name.
10305 * target.cc: New file.
10306 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10307 (check_SCRIPTS): Add discard_locals_test.sh.
10308 (check_DATA): Add discard_local_tests.syms.
10309 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10310 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10311 * testsuite/Makefile.in: Regenerate.
10312 * testsuite/discard_locals_test.c: New file.
10313 * testsuite/discard_locals_test.sh: Same.
10314
805bb01c
DK
103152009-06-05 Doug Kwan <dougkwan@google.com>
10316
10317 * object.cc (Sized_relobj::Sized_relobj): Initialize
10318 discarded_eh_frame_shndx_ to -1U.
10319 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10320 section.
10321 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10322 a discarded .eh_frame section.
10323 (Sized_relobj::do_finalize_local_symbols): Ditto.
10324 * object.h (class Sized_relobj): Declare new member
10325 discarded_eh_frame_shndx_.
10326 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10327 (local_labels_test.o, local_labels_test): New rules.
10328 * testsuite/Makefile.in: Regenerate.
10329
1dcd334d
DK
103302009-06-04 Doug Kwan <dougkwan@google.com>
10331
10332 * layout.cc (Layout::section_name_mapping): Add mapping for
10333 special ARM sections.
10334
96d49306
DK
103352009-06-03 Doug Kwan <dougkwan@google.com>
10336
10337 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10338 (utils::has_overflow): Same.
10339
dff16297
ILT
103402009-06-03 Ian Lance Taylor <iant@google.com>
10341
10342 * layout.cc (Layout::section_name_mapping): New array, replacing
10343 Layout::linkonce_mapping.
10344 (Layout::section_name_mapping_count): New variable, replacing
10345 Layout::linkonce_mapping_count.
10346 (Layout::linkonce_output_name): Remove.
10347 (Layout::output_section_name): Rewrite.
10348 * layout.h (class Layout): Rename Linkonce_mapping to
10349 Section_name_mapping, linkonce_mapping to section_name_mapping,
10350 linkonce_mapping_count to section_name_mapping_count. Don't
10351 declare linkonce_output_name.
10352
c121c671
DK
103532009-06-03 Doug Kwan <dougkwan@google.com>
10354
10355 * gold/arm.cc (namespace utils): New.
10356 (Target_arm::reloc_is_non_pic): Define new method.
10357 (class Arm_relocate_functions): New.
10358 (Target_arm::Relocate::relocate): Handle relocation types used by
10359 Android.
10360
07800fab
ILT
103612009-06-03 Ian Lance Taylor <iant@google.com>
10362
10363 * arm.cc (Target_arm::scan::global): Use || instead of |.
10364
c121c671
DK
103652009-06-02 Doug Kwan <dougkwan@google.com>
10366
10367 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10368 issued_non_pic_error_.
10369 (class Target_arm::Scan): Declare new method check_non_pic.
10370 Define new method symbol_needs_plt_entry.
10371 Declare new data member issued_non_pic_error_.
10372 (class Target_arm::Relocate): Declare new method
10373 should_apply_static_reloc.
10374 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10375 (Target_arm::Scan::check_non_pic): Define new method.
10376 (Target_arm::Scan::local): Handle a small subset of reloc types used
10377 by Android.
10378 (Target_arm::Scan::local): Same.
10379 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10380
b19b0c6d
ILT
103812009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10382
10383 * incremental.cc (Incremental_inputs::report_command_line): Filter
10384 out --incremental-* options.
10385
94cdfcff
DK
103862009-05-29 Doug Kwan <dougkwan@google.com>
10387
10388 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10389 template class.
10390 (class Target_arm): Update comment.
10391 (Target_arm::Target_arm): Initialize new data members GOT_,
10392 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10393 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10394 and Target_arm::rel_dyn_section.
10395 Declare new_enum Target_arm::Got_type.
10396 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10397 and DYNBSS_.
10398 Update commments for member do_dynsym_value.
10399 (Target_arm::got_size, Target_arm::plt_section,
10400 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10401 new methods inside class defintion.
10402 (Target_arm::got_section): Define new method.
10403 (Target_arm::rel_dyn_section): Same.
10404 (Output_data_plt_arm): New template class.
10405 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10406 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10407 (Output_data_plt_arm::add_entry): Same.
10408 (Output_data_plt_arm::first_plt_entry): Define new
10409 static data member for PLT instruction template.
10410 (Output_data_plt_arm::plt_entry): Same.
10411 (Output_data_plt_arm::do_write): Define new method.
10412 (Target_arm::make_plt_entry): Same.
10413 (Target_arm::do_finalize_sections): Same.
10414 (Target_arm::do_dynsym_value): Same.
10415
4a657b0d
DK
104162009-05-28 Doug Kwan <dougkwan@google.com>
10417
10418 * Makefile.am (TARGETSOURCES): Add arm.cc.
10419 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10420 * Makefile.in: Regenerate.
10421 * arm.cc: New file.
10422 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10423
e7ae8c36
DK
104242009-05-26 Doug Kwan <dougkwan@google.com>
10425
10426 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10427 (General_options::check_excluded_libs): Strip off directories in
10428 archive name before matching like GNU ld does.
10429 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10430 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10431 (exclude_libs_test_LDFLAGS): Add linker option
10432 -Wl,--exclude-libs,libexclude_libs_test_3
10433 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10434 an explicit archive without using -l.
10435 (alt/libexclude_libs_test_3.a): New make rule.
10436 * testsuite/Makefile.in: Regenerate.
10437 * testsuite/exclude_libs_test.c : Declare lib3_default().
10438 (main): Call it.
10439 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10440 * exclude_libs_test_3.c: New file.
10441
f12e7348
NC
104422009-05-26 Nick Clifton <nickc@redhat.com>
10443
10444 * po/id.po: New Indonesian translation.
10445 * po/gold.pot: Updated template file.
10446
4daadc0d
ST
104472009-05-22 Sriraman Tallam <tmsriram@google.com>
10448
e1df38aa 10449 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10450 gc_comdat_test files. Add -Wl,--gc-sections to build
10451 gc_comdat_test.
10452 * testsuite/Makefile.in: Regenerate.
10453 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10454
531813ad
ST
104552009-05-21 Sriraman Tallam <tmsriram@google.com>
10456
10457 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10458 kept comdat section was garbage collected.
10459 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10460 * testsuite/Makefile.in: Regenerate.
10461 * testsuite/gc_comdat_test.sh: New file.
10462 * testsuite/gc_comdat_test_1.cc: New file.
10463 * testsuite/gc_comdat_test_2.cc: New file.
10464
65514900
CC
104652009-05-19 Doug Kwan <dougkwan@google.com>
10466
10467 * archive.cc (Archive::Archive): Move constructor from archive.h
10468 to here. Initialize no_export_.
10469 (Archive::get_elf_object_for_member): Set no_export flag of object.
10470 * archive.h (Archive::Archive): Move constructor body to
10471 archive.cc.
10472 (Archive::no_export): New method.
10473 (Archive::no_export_): New field.
10474 * object.h (Object::Object): Initialize no_export_ to false.
10475 (Object::no_export, Object::set_no_export): New methods.
10476 (Object::no_export_): New field.
10477 * options.cc (General_options::parse_exclude_libs): New method.
10478 (General_options::check_excluded_libs) Same.
10479 * options.h (exclude_libs): New option.
10480 (General_options::check_excluded_libs): New method declaration.
10481 (General_options::excluded_libs_): New field.
10482 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10483 default or protected visibility if an object has no-export flag set.
10484 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10485 (check_SCRIPTS): Add exclude_libs_test.sh.
10486 (check_DATA): Add exclude_libs_test.syms.
10487 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10488 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10489 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10490 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10491 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10492 libexclude_libs_test_2.a): New rules.
10493 * testsuite/Makefile.in: Regenerate.
10494 * testsuite/exclude_libs_test.c: New file.
10495 * testsuite/exclude_libs_test.sh: Ditto.
10496 * testsuite/exclude_libs_test_1.c: Ditto.
10497 * testsuite/exclude_libs_test_2.c: Ditto.
10498
1b77ea50
ILT
104992009-05-15 Ian Lance Taylor <iant@google.com>
10500
10501 * configure.ac: Check for declarations for cases where libiberty.h
10502 checks HAVE_DECL_xxx.
10503 * configure, config.in: Rebuild.
10504
072fe7ce
ILT
105052009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10506
10507 * gold.h (Incremental_argument_list): Remove (invalid) forward
10508 declaration.
10509 * incremental.cc (Incremental_inputs::report_achive): New method.
10510 (Incremental_inputs::report_object): New method.
10511 (Incremental_inputs::report_script): New method.
10512 (Incremental_inputs::finalize_inputs): New method.
10513 (Incremental_inputs::finalize): Call finalize_inputs().
10514 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10515 Create inputs entries.
10516 * incremental.h (Incremental_input_type): New enum.
10517 (Incremental_inputs::Incremental_input): Initialize new fields.
10518 (Incremental_inputs::report_inputs): New method.
10519 (Incremental_inputs::report_achive): New method.
10520 (Incremental_inputs::report_object): New method.
10521 (Incremental_inputs::report_script): New method.
10522 (Incremental_inputs::finalize_inputs): New method.
10523 (Incremental_inputs::Input_info): New struct.
10524 (Incremental_inputs::Input_info_map): New typedef.
10525 (Incremental_inputs::lock_): New field.
10526 (Incremental_inputs::Inputs_): New field.
10527 (Incremental_inputs::Inputs_map): New field.
10528 * main.cc (main): Call Incremental_input::report_inputs.
10529 * options.h (Input_argument_list): Typedef moved from
10530 Input_arguments.
10531 (Input_file_group::Files): Remove, use ::Input_argument_list.
10532 (Input_file_group::Input_argument_list): Remove, use
10533 ::Input_argument_list.
10534 * plugin.cc (Plugin_manager::add_input_file): Add error in
10535 incremental build.
10536 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10537 functions.
10538 * script.cc (read_input_script): Call
10539 Incremental_input::report_script.
10540 * script.h (Script_info): New class.
10541
b0481b0b
ILT
105422009-04-27 Ian Lance Taylor <iant@google.com>
10543
10544 * x86_64.cc (do_adjust_output_section): Set entsize to
10545 plt_entry_size.
10546
b22a5a41 105472009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10548
10549 * output.cc (Output_file::close): After short writes, continue
10550 writing from the correct offset in the buffer being written.
10551
40fde488
CD
105522009-04-23 Chris Demetriou <cgd@google.com>
10553
10554 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10555 * configure: Regenerate.
10556 * config.in: Regenerate.
10557 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10558 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10559
3ce2c28e
ILT
105602009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10561
10562 * incremental.cc (Incremental_inputs_header_data): Renamed from
10563 Incremental_input_header_data.
10564 (Incremental_inputs_header_data::data_size): New field.
10565 (Incremental_inputs_header_data::put_input_file_count): Renamed
10566 from input_file_count.
10567 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10568 from command_line_offset.
10569 (Incremental_inputs_header_data::put_reserved): Renamed from
10570 put_reserved.
10571 (Incremental_inputs_entry_data): Renamed from
10572 Incremental_input_entry_data.
10573 (Incremental_inputs_entry_data::data_size): New field.
10574 (Incremental_inputs::report_command_line): New method.
10575 (Incremental_inputs::finalize): New method.
10576 (Incremental_inputs::create_incremental_inputs_data): New method.
10577 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10578 * incremental.h: New file.
10579 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10580 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10581 incremental builds.
703d02da 10582 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10583 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10584 (Layout::create_incremental_info_sections): New method.
10585 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10586 * main.cc (main): Notify Incremental_input of the command line.
10587
e55bde5e
ILT
105882009-04-01 Ian Lance Taylor <iant@google.com>
10589 Mikolaj Zalewski <mikolajz@google.com>
10590
10591 * gold.h (reserve_unordered_map): Define, three versions, one for
10592 each version of Unordered_map.
10593 * layout.cc (Layout::Layout): Remove options parameter. Add
10594 number_of_input_files parameter. Don't initialize options_.
10595 Initialize number_of_input_files_ and resized_signatures_. Move
10596 sections_are_attached_.
10597 (Layout::layout_group): Reserve space for group_signatures_.
10598 (Layout::find_or_add_kept_section): Change name parameter to be a
10599 reference. Resize signatures_ map when it gets large enough.
10600 (Layout::layout_eh_frame): Use parameters->options() instead of
10601 this->options_.
10602 (Layout::make_output_section): Likewise.
10603 (Layout::attach_allocated_section_to_segment): Likewise.
10604 (Layout::finalize, Layout::create_executable_stack): Likewise.
10605 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10606 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10607 * layout.h (class Layout): Update declarations. Remove options_
10608 field. Add number_of_input_files_ and resized_signatures_
10609 fields. Move sections_are_attached_ field.
10610 * main.cc (main): Pass number of input files to Layout
10611 constructor. Don't pass options.
10612
154b857c
ILT
106132009-03-30 Ian Lance Taylor <iant@google.com>
10614
10615 * ffsll.c (ffsll): Correct implementation.
10616
2f35ab9b
ILT
106172009-03-27 Ian Lance Taylor <iant@google.com>
10618
fd03461a
ILT
10619 * ffsll.c: New file.
10620 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10621 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10622 * ftruncate.c (ftruncate): Declare before definition.
10623 * mremap.c (mremap): Likewise.
10624 * pread.c (pread): Likewise.
10625 * configure, Makefile.in, config.in: Rebuild.
10626
2f35ab9b
ILT
10627 * mremap.c: New file.
10628 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10629 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10630 (mremap): Declare if HAVE_MREMAP is not defined.
10631 * configure, Makefile.in, config.in: Rebuild.
10632
33aea2fd
CC
106332009-03-27 Cary Coutant <ccoutant@google.com>
10634
10635 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10636 position independent.
10637 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10638 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10639
6d479619
CC
106402009-03-24 Cary Coutant <ccoutant@google.com>
10641
10642 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10643 an executable.
10644 (needs_dynamic_reloc): Likewise.
10645
afc06bb8
ILT
106462009-03-24 Ian Lance Taylor <iant@google.com>
10647
10648 * yyscript.y (file_cmd): Recognize EXTERN.
10649 (extern_name_list, extern_name_list_body): New nonterminals.
10650 * script.cc (script_add_extern): Define.
10651 * script-c.h (script_add_extern): Declare.
10652
f6060a4d
ILT
106532009-03-24 Rafael Avila de Espindola <espindola@google.com>
10654
10655 * object.cc (is_elf_object): Define.
10656 * object.h (is_elf_object): Declare.
10657 * archive.cc (Archive::get_elf_object_for_member): Call
10658 is_elf_object.
33aea2fd 10659 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10660
26736d8e
ILT
106612009-03-24 Elliott Hughes <enh@google.com>
10662
10663 * output.cc (Output_file::map_anonymous): Define.
10664 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10665 try an anonymous one. Report the size if the mmap fails.
10666 * output.h (class Output_file): Declare map_anonymous.
10667
22fd9730
ILT
106682009-03-24 Ian Lance Taylor <iant@google.com>
10669
10670 * target-select.cc (instantiate_target): Don't acquire the lock if
10671 the instantiated_target_ field has already been set.
10672
cb010894
ILT
106732009-03-23 Ian Lance Taylor <iant@google.com>
10674
7f055c20
ILT
10675 * gold-threads.h (class Initialize_lock): Define.
10676 * gold-threads.cc (class Initialize_lock_once): Define.
10677 (initialize_lock_control): New static variable.
10678 (initialize_lock_pointer): New static variable.
10679 (initialize_lock_once): New static function.
10680 (Initialize_lock::Initialize_lock): Define.
10681 (Initialize_lock::initialize): Define.
10682 * target-select.h: Include "gold-threads.h".
10683 (class Target_selector): Add lock_ and initialize_lock_ fields.
10684 Don't define instantiate_target, just declare it.
10685 * target-select.cc (Target_selector::Target_selector): Initialize
10686 new fields.
10687 (Target_selector::instantiate_target): Define.
10688 * descriptors.h: Include "gold-threads.h".
10689 (class Descriptors): Add initialize_lock_ field.
10690 * descriptors.cc (Descriptors::Descriptors): Initialize new
10691 field.
10692 (Descriptors::open): Use initialize_lock_ field
10693 * errors.h (class Errors): Add initialize_lock_ field.
10694 * errors.cc (Errors::Errors): Initialize new field.
10695 (Errors::initialize_lock): Use initialize_lock_ field.
10696 * powerpc.cc (class Target_selector_powerpc): Remove
10697 instantiated_target_ field. In do_recognize call
10698 instantiate_target rather than do_instantiate_target. In
10699 do_instantiate_target just allocate a new target.
10700 * sparc.cc (class Target_selector_sparc): Likewise.
10701
36959681
ILT
10702 * freebsd.h: New file.
10703 * i386.cc: Include "freebsd.h".
10704 (Target_i386): Derive from Target_freebsd rather than
10705 Sized_target.
10706 (Target_selector_i386): Derive from Target_selector_freebsd rather
10707 than Target_selector.
10708 * x86_64.cc: Include "freebsd.h".
10709 (Target_x86_64): Derive from Target_freebsd rather than
10710 Sized_target.
10711 (Target_selector_x86_64): Derive from Target_selector_freebsd
10712 rather than Target_selector.
10713 * target.h (class Target): Add adjust_elf_header and
10714 do_adjust_elf_header.
10715 * output.cc (Output_file_header:: do_sized_write): Call target
10716 adjust_elf_header routine.
10717 * configure.tgt: Set targ_osabi.
10718 * configure.ac: Define GOLD_DEFAULT_OSABI.
10719 * parameters.cc (Parameters::default_target): Pass
10720 GOLD_DEFAULT_OSABI to select_target.
10721 * target-select.h (class Target_selector): Make instantiate_target
10722 protected rather than private.
10723 * Makefile.am (HFILES): Add freebsd.h.
10724 * configure, Makefile.in, config.in: Rebuild.
10725
cb010894
ILT
10726 * merge.cc (do_add_input_section): Correct pend value. Change
10727 message about last entry not being null terminated from error to
10728 warning.
10729
0e879927
ILT
107302009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10731
10732 * incremental.cc: New file.
10733 * Makefile.am (CCFILES): Add incremental.cc.
10734 * Makefile.in: Rebuild.
10735
41105937
PP
107362009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10737
10738 * layout.cc (Layout::output_section_name): Preserve names
10739 of '.note.' sections.
e1df38aa 10740
60439920
ILT
107412009-03-19 Ian Lance Taylor <iant@google.com>
10742
10743 * descriptors.cc (Descriptors::open): Check that the options are
10744 valid before using them.
10745
0d371ad3
ILT
107462009-03-18 Ian Lance Taylor <iant@google.com>
10747
10748 * script-sections.h: Include <list>.
10749 (class Script_sections): Change Sections_elements from std::vector
10750 to std::list. Typedef public Elements_iterator. Add
10751 orphan_section_placement_, data_segment_align_start_, and
10752 saw_data_segment_align_ fields. Remove data_segment_align_index_
10753 field.
10754 * script-sections.cc (class Orphan_section_placement): New class.
10755 (class Sections_element): Add virtual functions is_relro and
10756 orphan_section_init. Remove virtual function place_orphan_here.
10757 (class Output_section_definition): Add is_relro and
10758 orphan_section_init. Remove place_orphan_here.
10759 (class Orphan_output_section): Likewise.
10760 (Script_sections::Script_sections): Update for field changes.
10761 (Script_sections::data_segment_align): Set saw_data_segment_align_
10762 and data_segment_align_start_, not data_segment_align_index.
10763 (Script_sections::data_segment_relro_end): Check
10764 saw_data_segment_align_. Use data_segment_align_start_ rather
10765 than data_segment_align_index_.
10766 (Script_sections::place_orphan): Rewrite to use
10767 Orphan_section_placement.
10768
9201d894
ILT
107692009-03-17 Ian Lance Taylor <iant@google.com>
10770
9c5b8369
ILT
10771 * archive.cc (Archive::add_symbols): Check for a version attached
10772 to the symbol name in the archive map.
10773 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10774 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10775 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10776 (ver_test_11.a): New target.
10777 * testsuite/Makefile.in: Rebuild.
10778
9201d894
ILT
10779 * configure.ac: Check for chsize and posix_fallocate. Replace
10780 ftruncate.
10781 * ftruncate.c: New file, from gnulib.
10782 * output.cc (posix_fallocate): Define dummy version if not
10783 HAVE_POSIX_FALLOCATE.
10784 (Output_file::map): Call posix_fallocate rather than lseek and
10785 write.
10786 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10787 * configure, Makefile.in, config.in: Rebuild.
10788
ef4ab7a8 107892009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10790
ef4ab7a8
PP
10791 * layout.h (Layout::create_note): Add section_name parameter.
10792 * layout.cc (Layout::create_note): Likewise.
10793 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10794
8c500701
ILT
107952009-03-17 Ian Lance Taylor <iant@google.com>
10796
e85b18e1
ILT
10797 * descriptors.cc: Include "options.h".
10798 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10799 (Descriptors::open): Always use O_CLOEXEC when opening a new
10800 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10801 then set FD_CLOEXEC.
10802
9efe6174
ILT
10803 * sparc.cc (class Target_sparc): Add has_got_section.
10804 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10805 make sure we have a GOT section.
10806
10807 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10808 (Target_sparc::Scan::local): Likewise.
10809 (Target_sparc::Scan::global): Likewise.
10810 (Target_sparc::Relocate::relocate): Likewise.
10811 (Target_sparc::Relocate::relocate_tls): Likewise.
10812
8c500701
ILT
10813 * symtab.cc (Symbol_table::define_default_version): New function,
10814 broken out of add_from_object.
10815 (Symbol_table::add_from_object): Call define_default_version.
10816 (Symbol_table::define_special_symbol): Add resolve_oldsym
10817 parameter. Change all callers. If the version for a symbol comes
10818 from a version script, resolve it with the symbol with the same
10819 name with no version. Also add the symbol without a version if
10820 appropriate.
10821 (do_define_in_output_data): If resolving with oldsym, don't delete
10822 sym.
10823 (do_define_in_output_segment): Likewise.
10824 (do_define_as_constant): Likewise.
10825 * symtab.h (class Symbol_table): Update declarations.
10826
f1ed28fb
ILT
108272009-03-13 Ian Lance Taylor <iant@google.com>
10828
15f8229b
ILT
10829 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10830 (Read_symbols::requeue): New function.
10831 (Read_symbols::do_read_symbols): If make_elf_object fails because
10832 the target type is not configured, and the file was searched for,
10833 issue a warning and retry with the next directory.
10834 (Add_symbols::run): If the file has an incompatible format, and
10835 it was searched for, requeue the Read_symbols task. On error,
10836 release the object.
10837 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10838 dirindex parameter to constructor. Change all callers. Declare
10839 incompatible_warning and requeue.
10840 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10841 input_argument_ and input_group_ fields. Add them to
10842 constructor. Change all callers.
10843 (class Read_script): Add dirindex_ field. Add it to constructor.
10844 Change all callers.
10845 * archive.cc (Archive::setup): Remove input_objects parameter.
10846 Change all callers.
10847 (Archive::get_file_and_offset): Likewise.
10848 (Archive::read_all_symbols): Likewise.
10849 (Archive::read_symbols): Likewise.
10850 (Archive::get_elf_object_for_member): Remove input_objects
10851 parameter. Add punconfigured parameter. Change all callers.
10852 (Archive::add_symbols): Change return type to bool. Check return
10853 value of include_member.
10854 (Archive::include_all_members): Likewise.
10855 (Archive::include_member): Change return type to bool. Return
10856 false if first included object has incompatible target. Set
10857 included_member_ field.
10858 (Add_archive_symbols::run): If add_symbols returns false, requeue
10859 Read_symbols task.
10860 * archive.h (class Archive): Add included_member_ field.
10861 Initialize it in constructor. Add input_file and searched_for
10862 methods. Update declarations.
10863 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10864 input_argument_ fields. Add them to constructor. Change all
10865 callers.
10866 * script.cc: Include "target-select.h".
10867 (class Parser_closure): Add skip_on_incompatible_target_ and
10868 found_incompatible_target_ fields. Add
10869 skip_on_incompatible_target parameter to constructor. Change all
10870 callers. Add methods skip_on_incompatible_target,
10871 clear_skip_on_incompatible_target, found_incompatible_target, and
10872 set_found_incompatible_target.
10873 (read_input_script): Add dirindex parameter. Change all callers.
10874 If parser finds an incompatible target, requeue Read_symbols
10875 task.
10876 (script_set_symbol): Clear skip_on_incompatible_target in
10877 closure.
10878 (script_add_assertion, script_parse_option): Likewise.
10879 (script_start_sections, script_add_phdr): Likewise.
10880 (script_check_output_format): New function.
10881 * script.h (read_input_script): Update declaration.
10882 * script-c.h (script_check_output_format): Declare.
10883 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10884 (ignore_cmd): Remove OUTPUT_FORMAT.
10885 * fileread.cc (Input_file::Input_file): Add explicit this.
10886 (Input_file::will_search_for): New function.
10887 (Input_file::open): Add pindex parameter. Change all callers.
10888 * fileread.h (class Input_file): Add input_file_argument method.
10889 Declare will_search_for. Update declarations.
10890 * object.cc (make_elf_object): Add punconfigured parameter.
10891 Change all callers.
10892 * object.h (class Object): Make input_file public. Add
10893 searched_for method.
10894 (make_elf_object): Update declaration.
10895 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10896 restart search.
10897 * dirsearch.h (class Dirsearch): Update declaration.
10898 * options.h (class General_options): Add --warn-search-mismatch.
10899 * parameters.cc (Parameters::is_compatible_target): New function.
10900 * parameters.h (class Parameters): Declare is_compatible_target.
10901 * workqueue.cc (Workqueue::add_blocker): New function.
10902 * workqueue.h (class Workqueue): Declare add_blocker.
10903
f1ed28fb
ILT
10904 * fileread.cc (Input_file::open): Remove options parameter.
10905 Change all callers.
10906 (Input_file::open_binary): Likewise.
10907 * script.cc (read_input_script): Likewise.
10908 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10909 options parameter from constructor. Change all callers.
10910 (class Read_script): Likewise.
10911 * fileread.h (class Input_file): Update declarations.
10912 * script.h (read_input_script): Update declaration.
10913
34dd024a
NC
109142009-03-10 Nick Clifton <nickc@redhat.com>
10915
10916 * po/es.po: New Spanish translation.
10917
6d71b17c
CC
109182009-03-06 Cary Coutant <ccoutant@google.com>
10919
10920 * options.cc (parse_short_option): Keep dash_z from registering itself.
10921
031cdbed
ILT
109222009-03-03 Ian Lance Taylor <iant@google.com>
10923
10924 PR 9918
10925 * target-reloc.h (relocate_section): Pass output_section to
10926 relocate.
10927 * i386.cc (Target_i386::should_apply_static_reloc): Add
10928 output_section parameter. Change all callers.
10929 (Target_i386::Relocate::relocate): Add output_section parameter.
10930 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10931 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10932 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10933 * testsuite/two_file_shared.sh: New script.
10934 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10935 (check_DATA): Add two_file_shared.dbg.
10936 (two_file_shared.dbg): New target.
10937 * testsuite/Makefile.in: Rebuild.
10938
15d5fa16
ILT
109392009-03-01 Ian Lance Taylor <iant@google.com>
10940
10941 * configure.ac: Check for byteswap.h.
10942 * configure: Rebuild.
10943 * config.in: Rebuild.
10944
8a4c0b0d
ILT
109452009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10946
10947 * layout.cc (Layout::find_or_add_kept_section): New function.
10948 (Layout::add_comdat): Removed.
10949 * layout.h (struct Kept_section): Move out of class Layout.
10950 Remove trailing underscores from field names. Add group_sections
10951 field. Rename group_ field to is_group. Change all uses.
10952 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10953 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10954 comdat_groups_ field.
10955 (Sized_relobj::include_section_group): Use
10956 find_or_add_kept_section and Kept_section::group_sections.
10957 (Sized_relobj::include_linkonce_section): Likewise.
10958 * object.cc (class Sized_relobj): Don't define Comdat_group or
10959 Comdat_group_table. Remove find_comdat_group and
10960 add_comdat_group. Remove comdat_groups_ field.
10961 * plugin.cc (include_comdat_group): Use
10962 Layout::find_or_add_kept_section.
10963
b4ecf66b
ILT
109642009-02-28 Ian Lance Taylor <iant@google.com>
10965
14359ca0
ILT
10966 * README: --gc-sections and map files are now supported. Document
10967 some build requirements.
10968
b4ecf66b
ILT
10969 PR 6992
10970 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10971 relocatable link set the value of the section symbol to zero.
10972 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10973 relocatable link don't include the section address in the local
10974 symbol value.
10975
0602e05a
ILT
109762009-02-27 Ian Lance Taylor <iant@google.com>
10977
fd9d194f
ILT
10978 PR 6811
10979 * options.h (class Search_directory): Add is_system_directory.
10980 (class General_options): Declare is_in_system_directory.
10981 * options.cc (get_relative_sysroot): Make static.
10982 (get_default_sysroot): Make static.
10983 (General_optoins::is_in_system_directory): New function.
10984 * fileread.cc (Input_file::is_in_system_directory): New function.
10985 * fileread.h (class Input_file): Declare is_in_system_directory.
10986 * object.h (class Object): Add is_in_system_directory.
10987 (class Input_objects): Remove system_library_directory_ field.
10988 * object.cc (Input_objects::add_object): Don't set
10989 system_library_directory_.
10990 (input_objects::found_in_system_library_directory): Remove.
10991 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10992 parameter. Change all callers.
10993 (Symbol_table::sized_write_globals): Likewise.
10994 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10995 Call Object::is_in_system_directory.
10996 * symtab.h (class Symbol_table): Update declarations.
10997
61edd21f
ILT
10998 PR 5990
10999 * descriptors.h (Open_descriptor): Add is_on_stack field.
11000 * descriptors.cc (Descriptors::open): If the descriptor is on the
11001 top of the stack, remove it. Initialize is_on_stack field.
11002 (Descriptors::release): Only add pod to stack if it is not on the
11003 stack already.
11004 (Descriptors::close_some_descriptor): Clear stack_next and
11005 is_on_stack fields.
11006
e29e076a
ILT
11007 PR 7091
11008 * output.cc (Output_section::find_starting_output_address): Rename
11009 from starting_output_address; add PADDR parameter; change return
11010 type.
11011 * output.h (class Output_section): Declare
11012 find_starting_output_address instead of starting_output_address.
11013 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11014 section symbol for which we can't find a merge section.
11015
0602e05a
ILT
11016 PR 9836
11017 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11018 hidden or internal, force the symbol to be local.
11019 * resolve.cc (Symbol::override_visibility): Define.
11020 (Symbol::override_base): Use override_visibility.
11021 (Symbol_table::resolve): Likewise.
11022 (Symbol::override_base_with_special): Likewise.
11023 (Symbol_table::override_with_special): If the visibility is hidden
11024 or internal, force the symbol to be local.
11025 * symtab.h (class Symbol): Add set_visibility and
11026 override_visibility.
11027 * testsuite/ver_test_1.sh: New file.
11028 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11029 (check_DATA): Add ver_test_1.syms.
11030 (ver_test_1.syms): New target.
11031 * testsuite/Makefile.in: Rebuild.
11032
401a9a73
CC
110332009-02-25 Cary Coutant <ccoutant@google.com>
11034
11035 * layout.cc (Layout::choose_output_section): Don't rename sections
11036 when using a linker script that has a SECTIONS clause.
11037 * Makefile.in: Regenerate.
11038
11039 * testsuite/Makefile.am (script_test_5.sh): New test case.
11040 * testsuite/Makefile.in: Regenerate.
11041 * testsuite/script_test_5.cc: New file.
11042 * testsuite/script_test_5.sh: New file.
11043 * testsuite/script_test_5.t: New file.
11044
f488e4b0
CC
110452009-02-13 Rafael Avila de Espindola <espindola@google.com>
11046
11047 * archive.cc (Archive::include_member): Update calls to add_symbols.
11048 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11049 the Layout argument.
11050 * dynobj.h (do_add_symbols): Add the Layout argument.
11051 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11052 Layout argument.
11053 * object.h (Object::add_symbols): Add the Layout argument.
11054 (Object::do_add_symbols): Add the Layout argument.
11055 (Sized_relobj::do_add_symbols): Add the Layout argument.
11056 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11057 Unify the two versions.
11058 (Add_plugin_symbols): Remove.
11059 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11060 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11061 (Add_plugin_symbols): Remove.
11062 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11063 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11064 (Add_symbols::run): Make it work with Pulginobj.
11065
89dd1680
ILT
110662009-02-06 Ian Lance Taylor <iant@google.com>
11067
11068 * object.cc (Sized_relobj::do_layout): Make info message start
11069 with lower case letter.
11070
266d0a74
ILT
110712009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11072
602b464e
ILT
11073 * binary.cc: Fix file comment.
11074
266d0a74
ILT
11075 * options.h (enum Incremental_disposition): Define.
11076 (class General_options): Add new options: --incremental,
11077 --incremental_changed, --incremental_unchanged,
11078 --incremental_unknown. Add incremental_disposition_ and
11079 implicit_incremental_ fields.
11080 (General_options::incremental_disposition): New function.
11081 (class Position_dependent_options): Add incremental_disposition
11082 option.
11083 (Position_dependent_options::copy_from_options): Set incremental
11084 dispositions.
11085 * options.cc (General_options::parse_incremental_changed): New
11086 function.
2e702c99
RM
11087 (General_options::parse_incremental_unchanged): New function.
11088 (General_options::parse_incremental_unknown): New function.
11089 (General_options::General_options): Initialize new fields
266d0a74 11090 incremental_disposition_ and implicit_incremental_.
2e702c99 11091 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11092 without --incremental.
11093
f073bbf7
CD
110942009-02-06 Chris Demetriou <cgd@google.com>
11095
11096 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11097 pointer and to report location as the file name associated with
11098 the symbol.
11099 (gold_undefined_symbol_at_location): New function to replace the
11100 old gold_undefined_symbol functionality.
11101 * target-reloc.h (relocate_section): Update to use
11102 gold_undefined_symbol_at_location.
11103 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11104 Call gold_undefined_symbol function rather than gold_error.
11105 * errors.h (Errors::undefined_symbol): Take location as a
11106 string, rather than calculating it from a relocation.
11107 * errors.cc (Errors::fatal): Print "fatal error:" before the
11108 formatted message.
11109 (Errors::error, Errors::error_at_location): Print "error: "
11110 before the formatted message.
11111 (Errors::undefined_symbol): Take location as a string, rather
11112 than calculating it from a relocation.
11113 (gold_undefined_symbol_at_location): New function akin to
11114 old gold_undefined_symbol, calculates location from relocation.
11115 (gold_undefined_symbol): Change to take only a Symbol pointer
11116 and to report location as the file name associated with the symbol.
11117 * testsuite/debug_msg.sh: Update for changed error messages.
11118 * testsuite/undef_symbol.sh: Likewise.
11119
8e94a90c
ILT
111202009-02-04 Duncan Sands <baldrick@free.fr>
11121
11122 PR 9812
11123 * reduced_debug_output.h
11124 (Output_reduced_debug_abbrev_section::failed): Use format for
11125 gold_warning.
11126 (Output_reduced_debug_info_section::faild): Likewise.
11127
88a0e15b
ILT
111282009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11129
11130 * script.cc (Lazy_demangler): New class.
2e702c99 11131 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11132 symbol only once.
11133
5efc7cd2
CC
111342009-01-29 Cary Coutant <ccoutant@google.com>
11135
11136 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11137 to __tls_get_addr.
11138 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11139
e0ebcf42
ILT
111402009-01-28 Ian Lance Taylor <iant@google.com>
11141
5efc7cd2 11142 * version.cc (version_string): Bump to 1.9.
75fe7426 11143
e0ebcf42
ILT
11144 * gold.h: Include <cstring> and <stdint.h>.
11145 * version.cc: Include <cstdio>.
11146 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11147 warning.
11148 * reduced_debug_output.cc (insert_into_vector): Rename from
11149 Insert_into_vector; change all callers. Use Swap_unaligned to
11150 avoid aliasing issue; remove union since it is unnecessary.
11151
8e2813be 111522009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11153
11154 * Makefile.am (CCFILES): Add gc.cc.
11155 (HFILES): Add gc.h.
11156 * Makefile.in: Regenerate.
11157 * gold.cc (Gc_runner): New class.
11158 (queue_initial_tasks): Call garbage collection related tasks
11159 when corresponding options are invoked.
11160 (queue_middle_gc_tasks): New function.
11161 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11162 processed early before laying out sections during garbage collection.
11163 * gold.h (queue_middle_gc_tasks): New function.
11164 (is_prefix_of): Move from "layout.cc".
11165 * i386.cc (Target_i386::gc_process_relocs): New function.
11166 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11167 * main.cc (main): Create object of class "Garbage_collection".
11168 * object.cc (Relobj::copy_symbols_data): New function.
11169 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11170 (Sized_relobj::do_layout): Allow this function to be called twice
11171 during garbage collection and defer layout of section during the
6d03d481
ST
11172 first call.
11173 * object.h (Relobj::get_symbols_data): New function.
11174 (Relobj::is_section_name_included): New function.
11175 (Relobj::copy_symbols_data): New function.
11176 (Relobj::set_symbols_data): New function.
11177 (Relobj::get_relocs_data): New function.
11178 (Relobj::set_relocs_data): New function.
11179 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11180 (Relobj::gc_process_relocs): New function.
11181 (Relobj::do_gc_process_relocs): New pure virtual function.
11182 (Relobj::sd_): New data member.
11183 (Sized_relobj::is_output_section_offset_invalid): New function.
11184 (Sized_relobj::do_gc_process_relocs): New function.
11185 * options.h (General_options::gc_sections): Modify to not be a no-op.
11186 (General_options::print_gc_sections): New option.
11187 * plugin.cc (Plugin_finish::run): Remove function call to
11188 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11189 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11190 * reloc.cc (Read_relocs::run): Add task to process relocs and
11191 determine unreferenced sections when doing garbage collection.
11192 (Gc_process_relocs): New class.
11193 (Sized_relobj::do_gc_process_relocs): New function.
11194 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11195 sections that are garbage collected.
11196 * reloc.h (Gc_process_relocs): New class.
11197 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11198 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11199 symbols whose corresponding sections are garbage collected.
11200 (Symbol_table::Symbol_table): Add new parameter for the garbage
11201 collection object.
11202 (Symbol_table::gc_mark_undef_symbols): New function.
11203 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11204 (Symbol_table::gc_mark_dyn_syms): New function.
11205 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11206 as garbage.
11207 (Symbol_table::add_from_object): Likewise.
11208 (Symbol_table::add_from_relobj): When building shared objects, do not
11209 treat externally visible symbols as garbage.
11210 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11211 table information for static and relocatable links.
11212 * symtab.h (Symbol_table::set_gc): New function.
11213 (Symbol_table::gc): New function.
11214 (Symbol_table::gc_mark_undef_symbols): New function.
11215 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11216 (Symbol_table::gc_mark_dyn_syms): New function.
11217 (Symbol_table::gc_): New data member.
e1df38aa 11218 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11219 function.
11220 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11221 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11222
3b293544
CF
112232009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11224
11225 * options.h (General_options::gc_sections): Define as a no-op for now.
11226 (General_options::no_keep_memory): Ditto.
11227 (General_options::Bshareable): Define.
11228 * options.cc (General_options::finalize): Honor -Bshareable.
11229
83d22aa8
AS
112302009-01-20 Andreas Schwab <schwab@suse.de>
11231
11232 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11233 read the value in the contents, since we don't use it. Use the
11234 template endianness when writing.
11235 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11236
cd536b21
AS
112372009-01-19 Andreas Schwab <schwab@suse.de>
11238
11239 * configure.tgt (powerpc64-*): Fix targ_obj.
11240
99e9a495
ILT
112412009-01-15 Ian Lance Taylor <iant@google.com>
11242
11243 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11244 local symbols when stripping all symbols.
11245
bbbfea06
CC
112462009-01-14 Cary Coutant <ccoutant@google.com>
11247
99e9a495 11248 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11249
0f7c0701
CC
112502009-01-14 Cary Coutant <ccoutant@google.com>
11251
11252 * archive.cc (Archive::get_elf_object_for_member): Remove call
11253 to File_read::claim_for_plugin.
11254 * descriptors.cc (Descriptors::open): Remove reference to
11255 is_claimed.
11256 (Descriptors::claim_for_plugin): Remove.
11257 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11258 (Descriptors::is_claimed): Remove.
11259 (claim_descriptor_for_plugin): Remove.
11260 * fileread.cc (File_read::claim_for_plugin): Remove.
11261 * fileread.h (File_read::claim_for_plugin): Remove.
11262 (File_read::descriptor): Reopen descriptor if necessary.
11263 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11264 (Plugin_manager::all_symbols_read): Add task parameter. Change
11265 all callers.
11266 (Plugin_manager::get_input_file): New function.
11267 (Plugin_manager::release_input_file): New function.
11268 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11269 corresponding data member.
11270 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11271 and pass to base constructor. Change all callers.
11272 (get_input_file, release_input_file): New functions.
11273 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11274 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11275 (Plugin_manager::all_symbols_read): Add task parameter.
11276 (Plugin_manager::get_input_file): New function.
11277 (Plugin_manager::release_input_file): New function.
11278 (Plugin_manager::task_): New data member.
11279 (Pluginobj::Pluginobj): Add filesize parameter.
11280 (Pluginobj::filename): New function.
11281 (Pluginobj::descriptor): New function.
11282 (Pluginobj::filesize): New function.
11283 (Pluginobj::filesize_): New data member.
11284 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11285 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11286 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11287
11288 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11289 with archive libraries.
11290 * testsuite/Makefile.in: Regenerate.
11291 * testsuite/plugin_test.c (struct sym_info): New type.
11292 (get_input_file, release_input_file): New static variables.
11293 (onload): Capture new transfer vector entries.
11294 (claim_file_hook): Stop reading at end of file according to filesize.
11295 Factor out parsing of readelf output into separate function.
11296 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11297 APIs and get the source file name from the symbol table. Convert
11298 source file name to corresponding object file name. Print info
11299 message when adding new input files.
11300 (parse_readelf_line): New function.
11301 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11302 * testsuite/plugin_test_2.sh: Likewise.
11303 * testsuite/plugin_test_3.sh: Likewise.
11304 * testsuite/plugin_test_4.sh: New test case.
11305
62a6d109
ILT
113062009-01-07 Ian Lance Taylor <iant@google.com>
11307
11308 * version.cc (version_string): Bump to 1.8.
11309
483620e8
CC
113102008-12-23 Cary Coutant <ccoutant@google.com>
11311
11312 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11313 * plugin.cc (Plugin_manager::finish): Rename as
11314 layout_deferred_objects. Move cleanup to separate function.
11315 (Plugin_manager::cleanup): New function.
11316 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11317 separately.
11318 * plugin.h (Plugin_manager::finish): Rename as
11319 layout_deferred_objects.
11320 (Plugin_manager::cleanup): New function.
11321 (Plugin_manager::cleanup_done): New field.
11322
d66a9eb3
CC
113232008-12-23 Cary Coutant <ccoutant@google.com>
11324
11325 * plugin.cc (is_visible_from_outside): New function.
11326 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11327 so we don't return "IR only" status for exported symbols or -r links.
11328
11329 * testsuite/Makefile.am (plugin_test_3): New test case.
11330 * testsuite/Makefile.in: Regenerate.
11331 * testsuite/plugin_test_3.sh: New file.
11332
5995b570
CC
113332008-12-22 Cary Coutant <ccoutant@google.com>
11334
11335 * object.cc (Sized_relobj::layout_section): New function.
11336 (Sized_relobj::do_layout): Defer layout of input sections until after
11337 plugin has provided replacement files.
11338 (Sized_relobj::do_layout_deferred_sections): New function.
11339 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11340 (Relobj::layout_deferred_sections): New function.
11341 (Relobj::do_layout_deferred_sections): New function.
11342 (Sized_relobj::do_layout_deferred_sections): New function.
11343 (Sized_relobj::layout_section): New function.
11344 (Sized_relobj::Deferred_layout): New structure.
11345 (Sized_relobj::deferred_layout_): New field.
11346 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11347 Change all callers. Layout deferred sections.
11348 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11349 references.
11350 (Plugin_hook::run): Move code from do_plugin_hook inline.
11351 (Plugin_hook::do_plugin_hook): Remove.
11352 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11353 (Plugin_manager::finish): Renamed, was cleanup.
11354 (Plugin_manager::should_defer_layout): New function.
11355 (Plugin_manager::add_deferred_layout_object): New function.
11356 (Plugin_manager::Deferred_layout_list): New type.
11357 (Plugin_manager::deferred_layout_objects_): New field.
11358 (Plugin_hook::do_plugin_hook): Remove.
11359
ee769c88
ILT
113602008-12-17 Ian Lance Taylor <iant@google.com>
11361
11362 * options.h (class General_options): Add --no case for
11363 --export-dynamic.
11364
abc8dcba
CC
113652008-12-16 Cary Coutant <ccoutant@google.com>
11366
11367 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11368 vector.
11369 (Plugin_manager::claim_file): Create plugin object even if
11370 plugin did not call the add_symbols callback.
11371 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11372 asking for more symbols than were added.
11373 * testsuite/Makefile.am (plugin_test_1): Add test case with
11374 no global symbols.
11375 (empty.syms): New target.
11376 * testsuite/Makefile.in: Regenerate.
11377 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11378 message. Don't call add_symbols if no globals.
11379 (all_symbols_read_hook): Don't provide replacement for empty
11380 claimed file.
11381
b0074644
ILT
113822008-12-12 Ian Lance Taylor <iant@google.com>
11383
68943102
ILT
11384 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11385 r_type == 0 for a local symbol with r_sym == 0.
11386 (scan_relocatable_relocs): Pass r_sym to
11387 local_non_section_strategy.
11388 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11389 r_sym parameter.
11390
b0074644
ILT
11391 * configure.ac: Update test for TLS descriptors: they are
11392 supported as of glibc 2.9.
11393 * configure: Rebuild.
11394
c2508178
ILT
113952008-12-11 Ian Lance Taylor <iant@google.com>
11396
11397 PR 7091
11398 * target-reloc.h (Default_scan_relocatable_relocs): For each
11399 function, map r_type == 0 to RELOC_DISCARD.
11400
2756a258
CC
114012008-12-10 Cary Coutant <ccoutant@google.com>
11402
11403 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11404 object to override a kept COMDAT group from a plugin object.
11405
bb6f53d3
ILT
114062008-12-09 Ian Lance Taylor <iant@google.com>
11407
fbc558e1
ILT
11408 PR 7088
11409 * yyscript.y (file_cmd): Handle INPUT.
11410
bb6f53d3
ILT
11411 * testsuite/initpri1.c: Change all declarations to be full
11412 prototypes by adding void, to avoid compiler warnings.
11413
4674ecfc
CC
114142008-12-05 Rafael Avila de Espindola <espindola@google.com>
11415
11416 * options.cc (General_options::parse_plugin_opt): New.
11417 (General_options::add_plugin): The argument now is just the filename.
11418 (General_options::add_plugin_option): New.
11419 * options.h (plugin_opt): New.
11420 (add_plugin): Change argument name.
11421 (add_plugin_option): New.
11422 * plugin.cc (Plugin::load): Don't parse the plugin option.
11423 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11424 (Plugin::add_option): New.
11425 (Plugin::args_): Change type.
11426 (Plugin::filename_): New.
11427 (Plugin_manager::add_plugin_option): New.
11428 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11429 * testsuite/Makefile.in: Regenerate.
11430
fd06b4aa
CC
114312008-12-05 Cary Coutant <ccoutant@google.com>
11432
11433 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11434 Handle --strip-lto-sections option.
11435 * options.h (strip_lto_sections): New option.
11436
6c52134c
CC
114372008-12-01 Cary Coutant <ccoutant@google.com>
11438
11439 * plugin.cc (ld_plugin_message): Change format parameter to const.
11440 Fix mismatch between new[] and delete.
11441
a45248e0
CC
114422008-11-14 Cary Coutant <ccoutant@google.com>
11443
11444 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11445 instead of -1U.
11446
c82fbeee
CS
114472008-11-05 Craig Silverstein <csilvers@google.com>
11448
11449 * options.cc (General_options::parse_dynamic_list): New function.
11450 * options.h (General_options): New flags dynamic_list,
11451 dynamic_list_data, dynamic_list_cpp_new, and
11452 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11453 (General_options::in_dynamic_list): New function.
11454 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11455 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11456 (Lex::can_continue_name): Likewise.
11457 (yylex): Likewise.
11458 (read_script_file): New parameter script_options.
11459 (read_dynamic_list): New function.
11460 (Script_options::define_dynamic_list): New function.
11461 (dynamic_list_keyword_parsecodes): New variable.
11462 (dynamic_list_keywords): New variable.
11463 * script.h (Script_options::define_dynamic_list): New function
11464 prototype.
11465 (read_dynamic_list): New function prototype.
11466 * symtab.cc (strprefix): New macro.
11467 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11468 dynamic_list_data, dynamic_list_cpp_new, and
11469 dynamic_list_cpp_typeinfo.
11470 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11471 (dynamic_list_expr): New rule.
11472 (dynamic_list_nodes): Likewise.
11473 (dynamic_list_node): Likewise.
11474 * testsuite/Makefile.am (dynamic_list): New test.
11475 * testsuite/Makefile.in: Regenerated.
11476 * testsuite/dynamic_list.t: New file.
11477 * testsuite/dynamic_list.sh: New file.
11478
e0bb29a5
CS
114792008-11-05 Craig Silverstein <csilvers@google.com>
11480
11481 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11482 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11483 (t11_last): Likewise.
11484 * testsuite/ver_test_6.c (main): Likewise.
11485
4e1e25e0
CC
114862008-10-07 Cary Coutant <ccoutant@google.com>
11487
11488 * options.c (General_options::finalize): Add check for -static and
11489 -shared.
11490 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11491 is not empty.
11492
92f03fcb
CC
114932008-10-02 Cary Coutant <ccoutant@google.com>
11494
11495 * plugin.cc (make_sized_plugin_object): Fix conditional
11496 compilation to work when not all targets are enabled.
11497
fbd8a257
CC
114982008-09-29 Cary Coutant <ccoutant@google.com>
11499
11500 * archive.cc (Archive::get_file_and_offset): Use filename instead
11501 of name to get library path.
11502 (Archive::include_member): Unlock external member of a thin archive.
11503
11504 * testsuite/Makefile.am (TEST_AR): New variable.
11505 (thin_archive_test_1): New test.
11506 (thin_archive_test_2): New test.
81636b3f
CC
11507 * testsuite/Makefile.in: Regenerate.
11508 * testsuite/thin_archive_main.cc: New file.
11509 * testsuite/thin_archive_test_1.cc: New file.
11510 * testsuite/thin_archive_test_2.cc: New file.
11511 * testsuite/thin_archive_test_3.cc: New file.
11512 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11513
eff45813
CC
115142008-09-29 Cary Coutant <ccoutant@google.com>
11515
11516 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11517 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11518 instead of -1U.
11519 (Sized_relobj::do_finalize_local_symbols): Likewise.
11520 (Sized_relobj::map_to_kept_section): Likewise.
11521 * object.h (Sized_relobj::invalid_address): New constant.
11522 (Sized_relobj::do_output_section_offset): Check for invalid_address
11523 and return -1ULL.
11524 * output.cc (Output_reloc::local_section_offset): Use constant
11525 invalid_address instead of -1U.
11526 (Output_reloc::get_address): Likewise.
11527 (Output_section::output_address): Change -1U to -1ULL.
11528 * output.h (Output_reloc::invalid_address): New constant.
11529 * reloc.cc (Sized_relobj::write_sections): Use constant
11530 invalid_address instead of -1U.
11531 (Sized_relobj::relocate_sections): Likewise.
11532 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11533 values for merge sections.
11534 * target-reloc.h (relocate_for_relocatable): Use constant
11535 invalid_address instead of -1U.
11536
89fc3421
CC
115372008-09-19 Cary Coutant <ccoutant@google.com>
11538
11539 Add plugin functionality for link-time optimization (LTO).
11540 * configure.ac (plugins): Add --enable-plugins option.
11541 * configure: Regenerate.
11542 * config.in: Regenerate.
11543 * Makefile.am (LIBDL): New variable.
11544 (CCFILES): Add plugin.cc.
11545 (HFILES): Add plugin.h.
11546 (ldadd_var): Add LIBDL.
11547 * Makefile.in: Regenerate.
11548
11549 * archive.cc: Include "plugin.h".
11550 (Archive::setup): Don't preread archive symbols when using a plugin.
11551 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11552 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11553 files.
11554 (Archive::include_member): Add symbols from plugin objects.
11555 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11556 * descriptors.cc (Descriptors::open): Check for file descriptors
11557 abandoned by plugins.
11558 (Descriptors::claim_for_plugin): New function.
11559 * descriptors.h (Descriptors::claim_for_plugin): New function.
11560 (Open_descriptor::is_claimed): New field.
11561 (claim_descriptor_for_plugin): New function.
11562 * fileread.cc (File_read::claim_for_plugin): New function.
11563 * fileread.h (File_read::claim_for_plugin): New function.
11564 (File_read::descriptor): New function.
11565 * gold.cc: Include "plugin.h".
11566 (queue_initial_tasks): Add task to call plugin hooks for generating
11567 new object files.
11568 * main.cc: Include "plugin.h".
11569 (main): Load plugin libraries.
11570 * object.h (Pluginobj): Declare.
11571 (Object::pluginobj): New function.
11572 (Object::do_pluginobj): New function.
11573 (Object::set_target): New function.
11574 * options.cc: Include "plugin.h".
11575 (General_options::parse_plugin): New function.
11576 (General_options::General_options): Initialize plugins_ field.
11577 (General_options::add_plugin): New function.
11578 * options.h (Plugin_manager): Declare.
11579 (General_options): Add --plugin option.
11580 (General_options::has_plugins): New function.
11581 (General_options::plugins): New function.
11582 (General_options::add_plugin): New function.
11583 (General_options::plugins_): New field.
11584 * plugin.cc: New file.
11585 * plugin.h: New file.
11586 * readsyms.cc: Include "plugin.h".
11587 (Read_symbols::do_read_symbols): Check for archive before checking
11588 for ELF file. Call plugin hooks to claim files.
11589 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11590 from a real object file; force override when processing replacement
11591 files.
11592 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11593 (Symbol::init_base_object): Likewise.
11594 (Symbol::init_base_output_data): Likewise.
11595 (Symbol::init_base_output_segment): Likewise.
11596 (Symbol::init_base_constant): Likewise.
11597 (Symbol::init_base_undefined): Likewise.
11598 (Symbol::output_section): Assert that object is not a plugin.
11599 (Symbol_table::add_from_pluginobj): New function.
11600 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11601 undefined.
11602 (Symbol_table::sized_write_globals): Likewise.
11603 (Symbol_table::add_from_pluginobj): Instantiate template.
11604 * symtab.h (Sized_pluginobj): Declare.
11605 (Symbol::in_real_elf): New function.
11606 (Symbol::set_in_real_elf): New function.
11607 (Symbol::in_real_elf_): New field.
11608 (Symbol_table::add_from_pluginobj): New function.
11609
11610 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11611 (LIBDL): New variable.
11612 (LDADD): Add LIBDL.
11613 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11614 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11615 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11616 (MOSTLYCLEANFILES): Likewise.
11617 * testsuite/Makefile.in: Regenerate.
11618 * testsuite/plugin_test.c: New file.
11619 * testsuite/plugin_test_1.sh: New file.
11620 * testsuite/plugin_test_2.sh: New file.
11621
de31bda5
ILT
116222008-09-16 Ian Lance Taylor <iant@google.com>
11623
9c2d0ef9
ILT
11624 * target-reloc.h (relocate_section): Check whether a symbol is
11625 defined by the ABI before reporting an undefined symbol error.
11626 * target.h (Target::is_defined_by_abi): Make parameter const.
11627 (Target::do_is_defined_by_abi): Likewise.
11628 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11629 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11630 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11631 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11632 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11633 * testsuite/Makefile.in: Rebuild.
11634
de31bda5
ILT
11635 * fileread.cc (make_view): Add casts to avoid warning.
11636
9fa33bee
AO
116372008-09-16 Alexandre Oliva <aoliva@redhat.com>
11638
11639 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11640 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11641
183fd0e3
AO
116422008-09-16 Alexandre Oliva <aoliva@redhat.com>
11643
11644 * options.h (General_options::output_is_executable): New.
11645 (General_options::output_is_pie): New.
11646 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11647 for shared libraries.
11648 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11649
7be8330a
CD
116502008-09-11 Chris Demetriou <cgd@google.com>
11651
11652 * options.h (origin): New -z option.
11653 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11654 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11655 in DT_FLAGS_1.
11656
a9caad02
CC
116572008-09-05 Cary Coutant <ccoutant@google.com>
11658
11659 * fileread.cc (File_read::make_view): Add check for attempt to map
11660 beyond end of file.
11661
ae6dce4d
CC
116622008-09-05 Cary Coutant <ccoutant@google.com>
11663
11664 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11665 explicit instantiations.
11666
d7ab2a47
KVH
116672008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11668
11669 PR gold/6858
11670 * options.cc (General_options::finalize): Allow undefined symbols
11671 in shlibs if linking -shared.
11672
11673 PR gold/6859
11674 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11675 symbols as not needing a dynsym entry.
11676
1e52a9c1
CS
116772008-08-20 Craig Silverstein <csilvers@google.com>
11678
11679 * fileread.cc (File_read::open): Do not lock the file unless it
11680 was successfully opened.
11681
d85c80a3
CC
116822008-08-14 Cary Coutant <ccoutant@google.com>
11683
11684 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11685 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11686 * testsuite/tls_test.cc (struct int128): 128-bit struct
11687 for testing TLS relocs with non-zero addend.
11688 (v12): New TLS variable.
11689 (t12): New test.
11690 (t_last): Add check for v12.
11691 * testsuite/tls_test.h (t12): New function.
11692 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11693
2d924fd9
ILT
116942008-08-13 Ian Lance Taylor <iant@google.com>
11695
11696 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11697 set tls_segment_ or relro_segment_.
11698 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11699 when appropriate.
11700 * output.h (Output_section::clear_is_relro): New function.
11701 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11702 sections specially even when output_data_ is empty.
11703 (Output_segment::maximum_alignment): When first section is relro,
11704 only force alignment for PT_LOAD segments.
11705 * script.cc (script_data_segment_align): New function.
11706 (script_data_segment_relro_end): New function.
11707 * script-c.h (script_data_segment_align): Declare.
11708 (script_data_segment_relro_end): Declare.
11709 * script-sections.h (class Script_sections): Declare
11710 data_segment_align and data_segment_relro_end. Add fields
11711 segment_align_index_ and saw_relro_end_.
11712 * script-sections.cc (class Sections_element): Add set_is_relro
11713 virtual function. Add new bool* parameter to place_orphan_here.
11714 Add get_output_section virtual function.
11715 (class Output_section_definition): Add set_is_relro. Add new
11716 bool* parameter to place_orphan_here. Add get_output_section.
11717 Add is_relro_ field.
11718 (Output_section_definition::Output_section_definition): Initialize
11719 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11720 and is_relro_ fields.
11721 (Output_section_definition::place_orphan_here): Add is_relro
11722 parameter.
11723 (Output_section_definition::set_section_addresses): Set relro for
11724 output section.
11725 (Output_section_definition::alternate_constraint): Likewise.
11726 (class Orphan_output_section): Add new bool* parameter to
11727 place_orphan_here. Add get_output_section.
11728 (Orphan_output_section::place_orphan_here): Add is_relro
11729 parameter.
11730 (Script_sections::Script_sections): Initialize
11731 data_segment_align_index_ and saw_relro_end_.
11732 (Script_sections::data_segment_align): New function.
11733 (Script_sections::data_segment_relro_end): New function.
11734 (Script_sections::place_orphan): Set or clear is_relro.
11735 (Script_sections::set_section_addresses): Force alignment of first
11736 TLS section.
11737 * yyscript.y (exp): Call script_data_segment_align and
11738 script_data_segment_relro_end.
11739 * testsuite/relro_script_test.t: New file.
11740 * testsuite/relro_test.cc (using_script): Declare.
11741 (t1, t2): Test using_script.
11742 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11743 (relro_script_test_SOURCES): Define.
11744 (relro_script_test_DEPENDENCIES): Define.
11745 (relro_script_test_LDFLAGS): Define.
11746 (relro_script_test_LDADD): Define.
11747 (relro_script_test.so): New target.
11748 * testsuite/Makefile.in: Rebuild.
11749
f827c9a9
CC
117502008-08-06 Cary Coutant <ccoutant@google.com>
11751
11752 * archive.cc (Archive::total_archives, Archive::total_members)
11753 (Archive::total_members_loaded): New variables.
11754 (Archive::setup): Add parameter. Add option to preread
11755 archive symbols.
11756 (Archive::read_armap): Add counter.
11757 (Archive::get_file_and_offset): New function.
11758 (Archive::get_elf_object_for_member): New function.
11759 (Archive::read_all_symbols): New function.
11760 (Archive::read_symbols): New function.
11761 (Archive::add_symbols): Add counters.
11762 (Archive::include_all_members): Use armap to find members if it's
11763 already built.
11764 (Archive::include_member): Skip reading symbols if already read.
11765 Factored code into Archive::get_file_and_offset and
11766 Archive::get_elf_object_for_member. Changed call to
11767 Mapfile::report_include_archive_member.
11768 (Archive::print_stats): New function.
11769 * archive.h: Declare Object and Read_symbols_data classes.
11770 (Archive::Archive): Add initializers for new members.
11771 (Archive::setup): Add parameter.
11772 (Archive::print_stats): New function.
11773 (Archive::total_archives, Archive::total_members)
11774 (Archive::total_members_loaded): New variables.
11775 (Archive::get_file_and_offset): New function.
11776 (Archive::get_elf_object_for_member): New function.
11777 (Archive::read_all_symbols): New function.
11778 (Archive::read_symbols): New function.
11779 (Archive::Archive_member): New class.
11780 (Archive::members_): New member.
11781 (Archive::num_members_): New member.
11782 * main.cc: Include archive.h.
11783 (main): Call Archive::print_stats.
11784 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11785 archive parameter; member_name is now the fully-decorated name.
11786 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11787 * options.h: (General_options): Add --preread-archive-symbols option.
11788 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11789 Archive::setup.
11790
de4c45bd
ILT
117912008-08-04 Ian Lance Taylor <iant@google.com>
11792
11793 * symtab.h (Symbol::use_plt_offset): New function.
11794 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11795 * powerpc.cc (Relocate::relocate): Likewise.
11796 * sparc.cc (Relocate::relocate): Likewise.
11797 * x86_64.cc (Relocate::relocate): Likewise.
11798 * testsuite/weak_plt.sh: New test.
11799 * testsuite/weak_plt_main.cc: New test.
11800 * testsuite/weak_plt_shared.cc: New test.
11801 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11802 (check_PROGRAMS): Add weak_plt.
11803 (check_DATA): Add weak_plt_shared.so.
11804 (weak_plt_main_pic.o, weak_plt): New targets.
11805 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11806 * testsuite/Makefile.in: Rebuild.
11807
11808 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11809 gcctestdir/ld.
11810 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11811 * testsuite/Makefile.in: Rebuild.
11812
323ee3f4
AM
118132008-08-04 Alan Modra <amodra@bigpond.net.au>
11814
11815 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11816 * Makefile.in: Regenerate.
11817 * po/POTFILES.in: Regenerate.
11818
7c07ecec
ILT
118192008-07-29 Ian Lance Taylor <iant@google.com>
11820
11821 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11822 symbols before other symbols.
11823 * testsuite/script_test_2.cc (test_addr): Declare.
11824 (test_addr_alias): Declare.
11825 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11826 values.
7c07ecec
ILT
11827 * testsuite/script_test_2.t: Define test_addr_alias and
11828 test_addr.
11829
5778530e
ILT
118302008-07-24 Ian Lance Taylor <iant@google.com>
11831
2a00e4fb
ILT
11832 PR 5990
11833 * descriptors.cc: New file.
11834 * descriptors.h: New file.
11835 * gold-threads.h (class Hold_optional_lock): New class.
11836 * fileread.cc: Include "descriptors.h".
11837 (File_read::~File_read): Release descriptor rather than closing
11838 it.
11839 (File_read::open) [file]: Call open_descriptor rather than open.
11840 Set is_descriptor_opened_.
11841 (File_read::open) [memory]: Assert that descriptor is not open.
11842 (File_read::reopen_descriptor): New function.
11843 (File_read::release): Release descriptor.
11844 (File_read::do_read): Make non-const. Reopen descriptor.
11845 (File_read::read): Make non-const.
11846 (File_read::make_view): Reopen descriptor.
11847 (File_read::do_readv): Likewise.
11848 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11849 Update declarations.
11850 * layout.cc: Include "descriptors.h".
11851 (Layout::create_build_id): Use open_descriptor rather than open.
11852 * output.cc: Include "descriptors.h".
11853 (Output_file::open): Use open_descriptor rather than open.
11854 * archive.cc (Archive::const_iterator): Change Archive to be
11855 non-const.
11856 (Archive::begin, Archive::end): Make non-const.
11857 (Archive::count_members): Likewise.
11858 * archive.h (class Archive): Update declarations.
11859 * object.h (Object::read): Make non-const.
11860 * Makefile.am (CCFILES): Add descriptors.cc.
11861 (HFILES): Add descriptors.h.
11862 * Makefile.in: Rebuild.
11863
801647d1
ILT
11864 PR 6716
11865 * gold.h: Always include <clocale>. Add Solaris workarounds
11866 following code in binutils/sysdep.h.
11867
5edd166e
ILT
11868 PR 6048
11869 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11870 this->eh_frame_hdr_ is NULL before using it.
11871
c89ad728
ILT
11872 * dynobj.cc (Versions::Versions): Update comment.
11873
aa86f06b
ILT
11874 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11875 the base version name.
11876
5778530e
ILT
11877 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11878 array size plus one.
11879 (Stringpool_template::set_string_offsets): Subtract one from key
11880 before using it as an array index.
11881 (Stringpool_template::get_offset_with_length): Likewise.
11882 (Stringpool_template::write_to_buffer): Likewise.
11883 * stringpool.h (Stringpool_template::get_offset_from_key):
11884 Likewise.
11885
057ead22
ILT
118862008-07-23 Ian Lance Taylor <iant@google.com>
11887
7f649c59
ILT
11888 PR 6658
11889 * object.h (Merged_symbol_value::value): Do our best to handle a
11890 negative addend.
11891
057ead22
ILT
11892 PR 6647
11893 * script.cc (Version_script_info::get_versions): Don't add empty
11894 version tag to return value.
11895 (Version_script_info::get_symbol_version_helper): Change return
11896 type to bool. Add pversion parameter. Change all callers.
11897 (script_register_vers_node): Don't require a non-NULL tag.
11898 * script.h (class Version_script_info): Update declarations.
11899 (Version_script_info::get_symbol_version): Change return type to
11900 bool. Add version parameter. Change all callers.
11901 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11902 handling. Handle an empty version from a version script.
11903 (Symbol_table::define_special_symbol): Likewise.
11904 * testsuite/ver_test_10.script: New file.
11905 * testsuite/ver_test_10.sh: New file.
11906 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11907 (check_DATA): Add ver_test_10.syms.
11908 (ver_test_10.syms, ver_test_10.so): New target.
11909 * testsuite/Makefile.in: Rebuild.
11910
58e54ac2
CD
119112008-07-23 Simon Baldwin <simonb@google.com>
11912
11913 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11914 to zero for undefined symbols from dynamic libraries.
11915
95d14cd3
ILT
119162008-07-23 Ian Lance Taylor <iant@google.com>
11917
11918 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11919 Change all callers.
11920 * symtab.h (class Symbol_table): Update declaration.
11921 * testsuite/ver_test_9.cc: New file.
11922 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11923 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11924 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11925 (ver_test_9.so, ver_test_9.o): New targets.
11926 * testsuite/Makefile.in: Rebuild.
11927
92de84a6
ILT
119282008-07-22 Ian Lance Taylor <iant@google.com>
11929
34810851
ILT
11930 * options.h (class General_options): Define --check-sections.
11931 * layout.cc (Layout::set_segment_offsets): Handle
11932 --check-sections.
11933
af6156ef
ILT
11934 * options.h (class General_options): Define -n/--nmagic and
11935 -N/--omagic.
11936 * options.cc (General_options::finalize): For -n/--nmagic or
11937 -N/--omagic, set -static.
11938 * layout.cc (Layout::attach_allocated_section_to_segment): If
11939 -N/--omagic, don't put read-only and read-write sections in
11940 different segments.
11941 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11942 finding a read-only segment.
11943 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11944 don't set the minimum segment alignment to the common page size,
11945 and don't set the file offset to the address modulo the page size.
11946 * script-sections.cc (Script_sections::create_segments): If
11947 -n/--omagic, don't put read-only and read-write sections in
11948 different segments.
11949
92de84a6
ILT
11950 * cref.cc: New file.
11951 * cref.h: New file.
11952 * options.h (class General_options): Add --print-symbol-counts.
11953 * main.cc (main): Issue defined symbol report if requested.
11954 * archive.cc (Archive::interpret_header): Make into a const member
11955 function.
11956 (Archive::add_symbols): Call Input_objects::archive_start and
11957 archive_stop.
11958 (Archive::const_iterator): Define new class.
11959 (Archive::begin, Archive::end): New functions.
11960 (Archive::include_all_members): Rewrite to use iterator.
11961 (Archive::count_members): New function.
11962 * archive.h (class Archive): Update declarations.
11963 (Archive::filename): New function.
11964 * object.cc: Include "cref.h".
11965 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11966 (Sized_relobj::do_get_global_symbol_counts): New function.
11967 (Input_objects::add_object): Add object to cross-referencer.
11968 (Input_objects::archive_start): New function.
11969 (Input_objects::archive_stop): New function.
11970 (Input_objects::print_symbol_counts): New function.
11971 * object.h: Declare Cref and Archive.
11972 (Object::get_global_symbol_counts): New function.
11973 (Object::do_get_global_symbol_counts): New pure virtual function.
11974 (class Sized_relobj): Add defined_count_ field. Update
11975 declarations.
11976 (class Input_objects): Add cref_ field. Update constructor.
11977 Update declarations.
11978 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11979 defined_count_.
11980 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11981 symbol counts.
11982 (Sized_dynobj::do_get_global_symbol_counts): New function.
11983 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11984 defined_count_. Update declarations. Define Symbols typedef.
11985 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11986 parameter. Change all callers.
11987 (Symbol_table::add_from_dynobj): Add sympointers and defined
11988 parameters. Change all callers.
11989 * symtab.h (class Symbol_table): Update declarations.
11990 * Makefile.am (CCFILES): Add cref.cc.
11991 (HFILES): Add cref.h.
11992 * Makefile.in: Rebuild.
11993
3f7c5e1d
CD
119942008-07-22 Simon Baldwin <simonb@google.com>
11995
11996 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11997 to zero when writing undefined symbols.
11998
e0b64032
ILT
119992008-07-22 Ian Lance Taylor <iant@google.com>
12000
12001 * output.cc (Output_section::add_input_section): Don't try to
12002 merge empty merge sections.
12003
096b02cf
CS
120042008-07-21 Craig Silverstein <csilvers@google.com>
12005
12006 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12007 Include symbol version in error message.
cd536b21 12008
1d1f116d
CD
120092008-07-20 Chris Demetriou <cgd@google.com>
12010
cd536b21 12011 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12012 (RANDOM_SEED_CFLAGS): New substituted variable.
12013 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12014 * configure: Rebuild.
12015 * Makefile.in: Likewise.
12016 * testsuite/Makefile.in: Likewise.
12017
a18f591e
ILT
120182008-07-18 Ian Lance Taylor <iant@google.com>
12019
12020 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12021 where we see NAME/NULL and NAME/VERSION as separate symbols.
12022 * testsuite/ver_test_main.cc (main): Call t4.
12023 (t4, t4_2a): Define.
12024 * testsuite/ver_test_2.cc (t4_2): Define.
12025 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12026 * testsuite/ver_test_4.cc (t4_2a): Define.
12027 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12028 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12029
c6e3f6ed
ILT
120302008-07-17 Ian Lance Taylor <iant@google.com>
12031
12032 * dynobj.cc (Versions::add_def): If we give an error about a
12033 missing version, go ahead and create the version anyhow.
12034
ef9beddf
ILT
120352008-07-10 Ian Lance Taylor <iant@google.com>
12036
12037 Handle output sections with more than 0x7fffffff bytes.
12038 * object.h (class Relobj): Change map_to_output_ to
12039 output_sections_, and just keep a section pointer. Change all
12040 uses. Move comdat group support to Sized_relobj.
12041 (Relobj::is_section_specially_mapped): Remove.
12042 (Relobj::output_section): Remove poff parameter. Change all
12043 callers.
12044 (Relobj::output_section_offset): New function.
12045 (Relobj::set_section_offset): Rewrite.
12046 (Relobj::map_to_output): Remove.
12047 (Relobj::output_sections): New function.
12048 (Relobj::do_output_section_offset): New pure virtual function.
12049 (Relobj::do_set_section_offset): Likewise.
12050 (class Sized_relobj): Add section_offsets_ field. Add comdat
12051 group support from Relobj. Update declarations.
12052 (Sized_relobj::get_output_section_offset): New function.
12053 (Sized_relobj::do_output_section_offset): New function.
12054 (Sized_relobj::do_set_section_offset): New function.
12055 * object.cc (Relobj::output_section_address): Remove.
12056 (Sized_relobj::Sized_relobj): Initialize new fields.
12057 (Sized_relobj::include_section_group): Cast find_kept_object to
12058 Sized_relobj.
12059 (Sized_relobj::include_linkonce_section): Likewise.
12060 (Sized_relobj::do_layout): Use separate arrays for output section
12061 and output offset.
12062 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12063 output_sections.
12064 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12065 output_sections and section_offsets.
12066 (Sized_relobj::write_local_symbols): Likewise.
12067 (map_to_kept_section): Compute output address directly.
12068 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12069 output_sections and section_offsets.
12070 (Sized_relobj::write_sections): Likewise.
12071 (Sized_relobj::relocate_sections): Likewise.
12072 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12073 * output.h (class Output_reloc): Update declarations. Change
12074 u2_.relobj to Sized_relobj*.
12075 (class Output_data_reloc): Change add functions to use
12076 Sized_relobj*.
12077 * output.cc (Output_reloc::Output_reloc): Change relobj to
12078 Sized_relobj*.
12079 (Output_reloc::local_section_offset): Change return type to
12080 Elf_Addr. Use get_output_section_offset.
12081 (Output_reloc::get_address): Likewise.
12082 (Output_section::is_input_address_mapped): Don't call
12083 is_section_specially_mapped.
12084 (Output_section::output_offset): Likewise.
12085 (Output_section::output_address): Likewise.
12086 (Output_section::starting_output_address): Likewise.
12087 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12088 parameter to Sized_relobj*.
12089 (Copy_relocs::need_copy_reloc): Likewise.
12090 (Copy_relocs::save): Likewise.
12091 * copy-relocs.h (class Copy_relocs): Update declarations.
12092 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12093 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12094 * target-reloc.h (relocate_for_relocatable): Change
12095 offset_in_output_section type to Elf_Addr. Change code that uses
12096 it as well.
12097 * layout.cc (Layout::layout): Always set *off.
12098 * mapfile.cc (Mapfile::print_input_section): Use
12099 output_section_offset.
12100 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12101 Sized_relobj*.
12102 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12103 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12104 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12105
5cb66f97
ILT
121062008-07-03 Ian Lance Taylor <iant@google.com>
12107
12108 * layout.cc (Layout::include_section): Do not discard unrecognized
12109 SHT_STRTAB sections.
12110
afe47622
CS
121112008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12112
12113 * script.cc (Lex::can_continue_name): Make '?' allowable in
12114 version-script names.
12115 * testsuite/version_script.map: Change glob pattern to use '?'
12116
5adf9721
ILT
121172008-06-30 Manish Singh <yosh@gimp.org>
12118
12119 PR 6585
12120 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12121 Correct typo.
12122
e6fde208
ILT
121232008-06-30 Ian Lance Taylor <iant@google.com>
12124
12125 PR 6660
12126 PR 6682
12127 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12128 versions]: Don't try to read the value in the contents, since we
12129 don't use it. Use the template endianness when writing.
12130
3f2e6a2d
CC
121312008-06-25 Cary Coutant <ccoutant@google.com>
12132
12133 * fileread.cc (File_read::make_view): Assert on zero-length view.
12134 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12135 symbol table when there are no symbols to read.
12136
c43d3a48
CS
121372008-06-23 Craig Silverstein <csilvers@google.com>
12138
12139 * version.cc (version_string): Bump to 1.7
12140
5f494ea0
CS
121412008-06-18 Craig Silverstein <csilvers@google.com>
12142
12143 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12144 constant 0xFFFF to type Valtype.
12145 (Powerpc_relocate_functions::rel16_ha): Likewise.
12146
c42e122e
ILT
121472008-06-17 Ian Lance Taylor <iant@google.com>
12148
f34787f8
ILT
12149 * output.h (Output_section::Input_section): Initialize p2align_ to
12150 zero for Output_section_data constructors.
12151 (Output_section::Input_section::addralign): If not an input
12152 section, return the alignment of the Output_section_data.
12153 * testsuite/copy_test.cc: New file.
12154 * testsuite/copy_test_1.cc: New file.
12155 * testsuite/copy_test_2.cc: New file.
12156 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12157 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12158 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12159 (copy_test_1_pic.o, copy_test_1.so): New targets.
12160 (copy_test_2_pic.o, copy_test_2.so): New targets.
12161 * testsuite/Makefile.in: Rebuild.
12162
c42e122e
ILT
12163 * script-sections.cc (Script_sections::place_orphan): Initialize
12164 local variable exact.
12165
ce3ac18a
DE
121662008-06-13 David Edelsohn <edelsohn@gnu.org>
12167
12168 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12169
42cacb20
DE
121702008-06-12 David Edelsohn <edelsohn@gnu.org>
12171 David S. Miller <davem@davemloft.net>
12172
12173 * powerpc.cc: New file.
12174 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12175 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12176 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12177 * Makefile.in: Rebuild.
12178
7b308235
ILT
121792008-06-09 Ian Lance Taylor <iant@google.com>
12180
12181 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12182 <exception>.
12183 (throwing, orig_terminate): New static variables.
12184 (terminate_handler): New static function.
12185 (t2): Set terminate handler.
12186
f0b886e3
ILT
121872008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12188
12189 PR 6584
cd536b21 12190 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12191 alignment.
12192
3e90f135
CC
121932008-05-30 Cary Coutant <ccoutant@google.com>
12194
12195 * archive.cc (Archive::include_all_members) Correct to step
12196 over symbol table and extended name table in thin archives.
12197
e09ad04a
ILT
121982008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12199
12200 PR 6407
12201 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12202 calculation.
12203
62b01cb5
ILT
122042008-05-28 Caleb Howe <cshowe@google.com>
12205
12206 * reduced_debug_output.cc: New file.
12207 * reduced_debug_output.h: New file.
92de84a6 12208 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12209 * options.cc (General_options::finalize): Add strip_debug_non_line
12210 to the strip heirarchy.
12211 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12212 fields.
12213 * layout.cc: Include "reduced_debug_output.h".
12214 (Layout::Layout): Initialize new fields.
12215 (line_only_debug_sections): New static array.
12216 (is_lines_only_debug_sections): New static inline function.
12217 (Layout::include_section): Handle --strip-debug-non-line.
12218 (Layout::make_output_section): If --strip-debug-non-line, build
12219 new output sections for .debug_abbrev and .debug_info.
12220 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12221 gold. Warn about possible overflow.
12222 (read_signed_LEB_128): Likewise.
12223 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12224 (read_signed_LEB_128): Declare.
12225 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12226 (HFILES): Add reduced_debug_output.h.
12227 * Makefile.in: Rebuild.
12228
7d9e3d98
ILT
122292008-05-21 Ian Lance Taylor <iant@google.com>
12230
12231 * mapfile.cc: New file.
12232 * mapfile.h: New file.
12233 * options.h (class General_options): Add -M/--print-map and -Map.
12234 * options.cc (General_options::finalize): Make -M equivalent to
12235 -Map -.
12236 * main.cc: Include <cstdio> and "mapfile.h".
12237 (main): Open mapfile if requested.
12238 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12239 constructor. Change caller.
12240 (queue_initial_tasks): Add mapfile parameter. Change caller.
12241 (queue_middle_tasks): Likewise.
12242 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12243 declarations.
12244 * archive.cc: Include "mapfile.h".
12245 (Archive::add_symbols): Add mapfile parameter. Change all
12246 callers. Pass mapfile, symbol, and reason to include_member.
12247 (Archive::include_all_members): Add mapfile parameter. Change all
12248 callers.
12249 (Archive::include_member): Add mapfile, sym, and why parameters.
12250 Change all callers. Report inclusion to map file.
12251 * archive.h: Include "fileread.h".
12252 (class Archive): Update declarations.
12253 (Archive::file): New const method.
12254 (class Add_archive_symbols): Add mapfile_ field. Update
12255 constructor. Change all callers.
12256 * readsyms.h (class Read_symbols): Likewise.
12257 (class Finish_group): Likewise.
12258 (class Read_script): Likewise.
12259 * common.cc: Include "mapfile.h".
12260 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12261 all callers.
12262 (Symbol_table::do_allocate_commons): Likewise.
12263 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12264 symbol allocation to mapfile.
12265 * common.h (class Allocate_commons_task): Add mapfile_ field.
12266 Update constructor. Change all callers.
12267 * symtab.h (class Symbol_table): Update declarations.
12268 * layout.cc: Include "mapfile.h".
12269 (Layout_task_runner::run): Print information to mapfile.
12270 (Layout::create_gold_note): Change Output_data_fixed_space to
12271 Output_data_zero_fill.
12272 (Layout::create_build_id): Likewise.
12273 (Layout::print_to_mapfile): New function.
12274 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12275 constructor. Change caller.
12276 (class Layout): Declare print_to_mapfile.
12277 * output.cc (Output_section::Input_section::print_to_mapfile): New
12278 function.
12279 (Output_section::add_input_section): If producing a map, always
12280 add to input_sections_ list.
12281 (Output_section::do_print_to_mapfile): New function.
12282 (Output_segment::print_sections_to_mapfile): New function.
12283 (Output_segment::print_section_list_to_mapfile): New function.
12284 * output.h: Include "mapfile.h".
12285 (Output_data::print_to_mapfile): New function.
12286 (Output_data::do_print_to_mapfile): New virtual function.
12287 (Output_segment_headers::do_print_to_mapfile): New function.
12288 (Output_file_header::do_print_to_mapfile): New function.
12289 (Output_data_const::do_print_to_mapfile): New function.
12290 (class Output_data_const_buffer): Add map_name_ field. Update
12291 constructor. Change all callers. Add do_print_to_mapfile
12292 function.
12293 (class Output_data_fixed_space): Likewise.
12294 (class Output_data_space): Likewise.
12295 (class Output_data_zero_fill): New class.
12296 (Output_data_strtab::do_print_to_mapfile): New function.
12297 (Output_data_reloc_base::do_print_to_mapfile): New function.
12298 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12299 (Output_data_group::do_print_to_mapfile): New function.
12300 (Output_data_got::do_print_to_mapfile): New function.
12301 (Output_data_dynamic::do_print_to_mapfile): New function.
12302 (Output_symtab_xindex::do_print_to_mapfile): New function.
12303 (class Output_section): Declare do_print_to_mapflie. Declare
12304 print_to_mapfile in Input_section.
12305 (class Output_segment): Declare new functions.
12306 * object.h (Sized_relobj::symbol_count): New function.
12307 * script-sections.cc
12308 (Output_section_element_dot_assignment::set_section_addresses):
12309 Change Output_data_fixed_space to Output_data_zero_fill.
12310 (Output_data_expression::do_print_to_mapfile): New function.
12311 * script.cc (read_input_script): Add mapfile parameter. Change
12312 all callers.
12313 * script.h (read_input_script): Update declaration.
12314 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12315 (Eh_frame::do_print_to_mapfile): New function.
12316 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12317 (Output_merge_string::do_print_to_mapfile): New function.
12318 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12319 function.
12320 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12321 function.
12322 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12323 function.
12324 * Makefile.am (CCFILES): Add mapfile.cc.
12325 (HFILES): Add mapfile.h.
12326 * Makefile.in: Rebuild.
12327
9f1d377b
ILT
123282008-05-19 Ian Lance Taylor <iant@google.com>
12329
12330 * options.h (class General_options): Add -z relro.
12331 * layout.cc (Layout::Layout): Initialize relro_segment_.
12332 (Layout::add_output_section_data): Return the output section.
12333 (Layout::make_output_section): Rcognize relro sections and mark
12334 them appropriately.
12335 (Layout::attach_allocated_section_to_segment): Put relro sections
12336 in a PT_GNU_RELRO segment.
12337 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12338 section as relro.
12339 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12340 PT_TLS segments.
12341 (Layout::linkonce_mapping): Map d.rel.ro.local to
12342 .data.rel.ro.local.
12343 (Layout::output_section_name): Us .data.rel.ro.local for any
12344 section which begins with that.
12345 * layout.h (class Layout): Update add_output_section_data
12346 declaration. Add relro_segment_ field.
12347 * output.cc (Output_section::Output_section): Initialize is_relro_
12348 and is_relro_local_ fields.
12349 (Output_segment::add_output_section): Group relro sections.
12350 (Output_segment::is_first_section_relro): New function.
12351 (Output_segment::maximum_alignment): If there is a relro section,
12352 align the segment to the common page size.
12353 (Output_segment::set_section_addresses): Track whether we are
12354 looking at relro sections. If the last section is a relro
12355 section, align to the common page size.
12356 (Output_segment::set_section_list_addresses): Add in_relro
12357 parameter. Change all callers. Align to the page size when
12358 moving from relro to non-relro section.
12359 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12360 segment.
12361 * output.h (class Output_section): Add is_relro_ and
12362 is_relro_local_ fields.
12363 (Output_section::is_relro): New function.
12364 (Output_section::set_is_relro): New function.
12365 (Output_section::is_relro_local): New function.
12366 (Output_section::set_is_relro_local): New function.
12367 (class Output_segment): Update declarations.
12368 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12369 * sparc.cc (Target_sparc::got_section): Likewise.
12370 * x86_64.cc (Target_x86_64::got_section): Likewise.
12371 * testsuite/relro_test_main.cc: New file.
12372 * testsuite/relro_test.cc: New file.
12373 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12374 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12375 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12376 (relro_test.so, relro_test_pic.o): New targets.
12377 * testsuite/Makefile.in: Rebuild.
12378
a984ee1d
ILT
123792008-05-16 Ian Lance Taylor <iant@google.com>
12380
01676dcd
ILT
12381 * output.cc (Output_segment::add_output_section): Remove front
12382 parameter.
12383 * output.h (class Output_segment): Remove
12384 add_initial_output_section and overloaded add_output_section.
12385 Update declaration of remaining add_output_section.
12386 * layout.cc (Layout::create_interp): Call add_output_section
12387 rather than add_initial_output_section.
12388 (Layout::finish_dynamic_section): Likewise.
12389
497897f9
ILT
12390 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12391 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12392 know the dynamic type.
12393 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12394 field. Initialize it in constructor.
12395 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12396 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12397 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12398 reloc.
12399
a984ee1d
ILT
12400 * output.cc (Output_reloc::get_address): Change return type to
12401 Elf_Addr.
12402 * output.h (class Output_reloc): Update get_address declaration.
12403 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12404 for section addresses.
12405
55ba0940
ILT
124062008-05-09 Ian Lance Taylor <iant@google.com>
12407
12408 PR 6493
12409 * gold.cc (gold_nomem): Use return value of write.
12410
75517b77
ILT
124112008-05-08 Ian Lance Taylor <iant@google.com>
12412
12413 * symtab.c (Symbol::init_base_output_data): Add version
12414 parameter. Change all callers.
12415 (Symbol::init_base_output_segment): Likewise.
12416 (Symbol::init_base_constant): Likewise.
12417 (Symbol::init_base_undefined): Likewise.
12418 (Sized_symbol::init_output_data): Likewise.
12419 (Sized_symbol::init_output_segment): Likewise.
12420 (Sized_symbol::init_constant): Likewise.
12421 (Sized_symbol::init_undefined): Likewise.
12422 (Symbol_table::do_define_in_output_data): If the new symbol has a
12423 version, mark it as the default.
12424 (Symbol_table::do_define_in_output_segment): Likewise.
12425 (Symbol_table::do_define_as_constant): Likewise.
12426 * symtab.h (class Symbol): Update declarations.
12427 (class Sized_symbol): Likewise.
12428 * resolve.cc (Symbol::override_version): New function.
c42e122e 12429 (Symbol::override_base): Call override_version.
75517b77
ILT
12430 (Symbol::override_base_with_special): Likewise.
12431 * testsuite/ver_script_8.script: New file.
12432 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12433 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12434 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12435 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12436
f1f70eae
ILT
124372008-05-06 Ian Lance Taylor <iant@google.com>
12438
f3e9c5c5
ILT
12439 PR 6049
12440 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12441 functions.
12442 (class General_options): Remove existing --undefined, and add
12443 --no-undefined instead. Add new --undefined as synonym for -u.
12444 * archive.cc (Archive::add_symbols): Check whether symbol was
12445 named with -u.
12446 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12447 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12448 all uses. Add IS_UNDEFINED. Update declarations to split
12449 different versions of init_base. Declare init_base_undefined.
12450 (Symbol::is_defined): Handle IS_UNDEFINED.
12451 (Symbol::is_undefined): Likewise.
12452 (Symbol::is_weak_undefined): Call is_undefined.
12453 (Symbol::is_absolute): Handle IS_CONSTANT.
12454 (class Sized_symbol): Update declarations to split different
12455 versions of init. Declare init_undefined.
12456 (class Symbol_table): Declare new functions.
12457 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12458 Change all callers.
12459 (Symbol::init_base_output_data): Likewise.
12460 (Symbol::init_base_output_segment): Likewise.
12461 (Symbol::init_base_constant): Likewise.
12462 (Symbol::init_base_undefined): New function.
12463 (Sized_symbol::init_object): Rename from init. Change all
12464 callers.
12465 (Sized_symbol::init_output_data): Likewise.
12466 (Sized_symbol::init_output_segment): Likewise.
12467 (Sized_symbol::init_constant): Likewise.
12468 (Sized_symbol::init_undefined): New function.
12469 (Symbol_table::add_undefined_symbols_from_command_line): New
12470 function.
12471 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12472 function.
12473 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12474 (Symbol::output_section): Likewise.
12475 (Symbol::set_output_section): Likewise.
12476 (Symbol_table::sized_finalize_symbol): Likewise.
12477 (Symbol_table::sized_write_globals): Likewise.
12478 * resolve.cc (Symbol_table::should_override): Likewise.
12479 (Symbol::override_base_with_special): Likewise.
12480
8bdcdf2c
ILT
12481 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12482 symbol, change it to have default visibility.
12483 * testsuite/protected_1.cc: New file.
12484 * testsuite/protected_2.cc: New file.
12485 * testsuite/protected_3.cc: New file.
12486 * testsuite/protected_main_1.cc: New file.
12487 * testsuite/protected_main_2.cc: New file.
12488 * testsuite/protected_main_3.cc: New file.
12489 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12490 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12491 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12492 (protected_1.so): New target.
12493 (protected_1_pic.o, protected_2_pic.o): New targets.
12494 (protected_3_pic.o): New target.
12495 (check_PROGRAMS): Add protected_2.
12496 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12497 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12498 * testsuite/Makefile.in: Rebuild.
12499
2b706932
ILT
12500 * options.h (DEFINE_var): Add set_user_set_##varname__.
12501 (DEFINE_bool_alias): New macro.
12502 (class General_options): Define -Bstatic using DEFINE_bool_alias
12503 rather than DEFINE_special. Add --undefined as an alias for -z
12504 defs.
12505 * options.cc (General_options::parse_Bstatic): Remove.
12506
d82a5bcc
ILT
12507 * options.h (class General_options): Add --fatal-warnings.
12508 * main.cc (main): Implement --fatal-warnings.
12509 * errors.h (Errors::warning_count): New function.
12510
f1f70eae
ILT
12511 * options.h (class General_options): Add -Bsymbolic-functions.
12512 * symtab.h (Symbol::is_preemptible): Check for
12513 -Bsymbolic-functions.
12514
8825ac63
ILT
125152008-05-05 Ian Lance Taylor <iant@google.com>
12516
d98bc257
ILT
12517 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12518 as noVARNAME rather than no-VARNAME.
12519 (class General_options): Add option -z combreloc.
12520 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12521 get_address.
12522 (Output_reloc::sort_before) [SHT_REL]: New function.
12523 (Output_reloc::sort_before) [SHT_RELA]: New function.
12524 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12525 Sort_relocs_comparison.
12526 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12527 parameter. Change all callers.
12528 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12529 sort_relocs parameter. Change all callers.
12530 * output.cc (Output_reloc::get_address): New function, broken out
12531 of write_rel.
12532 (Output_reloc::write_rel): Call it.
12533 (Output_reloc::compare): New function.
12534 (Output_data_reloc_base::do_write): Optionally sort relocs.
12535
60b2b4e7
ILT
12536 * configure.ac: If targ_extra_obj is set, link it in.
12537 * configure.tgt: Initialize all variables.
12538 (x86_64*): Set targ_extra_obj and targ_extra_size.
12539 * configure: Rebuild.
12540
8825ac63
ILT
12541 * object.cc (Sized_relobj::include_section_group): Adjust section
12542 indexes read from group data. Build vector to pass to
12543 layout_group.
12544 * layout.cc (Layout::layout_group): Add flags and shndxes
12545 parameters. Remove contents parameter. Change caller. Update
12546 explicit instantiations.
12547 * layout.h (class Layout): Update layout_group declaration.
12548 * output.cc (Output_data_group::Output_data_group): Add flags and
12549 input_shndxes parameters. Remove contents parameter. Change
12550 caller.
12551 (Output_data_group::do_write): Change input_sections_ to
12552 input_shndxes_.
12553 * output.h (class Output_data_group): Update constructor
12554 declaration. Rename input_sections_ to input_shndxes_.
12555 * testsuite/many_sections_test.cc: Add template.
12556
e94cf127
CC
125572008-04-30 Cary Coutant <ccoutant@google.com>
12558
4418b2d5
CC
12559 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12560
e94cf127
CC
12561 * layout.cc (Layout::include_section): Refactored check for debug
12562 info section.
12563 (Layout::add_comdat): Add new parameters. Change type
12564 of signature parameter. Add object and shndx to signatures table.
12565 (Layout::find_kept_object): New function.
12566 * layout.h: Include <cstring>.
12567 (Layout::is_debug_info_section): New function.
12568 (Layout::add_comdat): Add new parameters.
12569 (Layout::find_kept_object): New function.
12570 (Layout::Kept_section): New struct.
12571 (Layout::Signatures): Change type of map range.
12572 * object.cc (Relobj::output_section_address): New function.
12573 (Sized_relobj::include_section_group): Add new parameters. Change
12574 calls to Layout::add_comdat. Change to build table of kept comdat
12575 groups and table mapping discarded sections to kept sections.
12576 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12577 (Sized_relobj::do_layout): Change calls to include_section_group and
12578 include_linkonce_section.
12579 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12580 value to zero when section is discarded.
12581 (Sized_relobj::map_to_kept_section): New function.
12582 * object.h (Relobj::output_section_address): New function.
12583 (Relobj::Comdat_group): New type.
12584 (Relobj::find_comdat_group): New function.
12585 (Relobj::Comdat_group_table): New type.
12586 (Relobj::Kept_comdat_section): New type.
12587 (Relobj::Kept_comdat_section_table): New type.
12588 (Relobj::add_comdat_group): New function.
12589 (Relobj::set_kept_comdat_section): New function.
12590 (Relobj::get_kept_comdat_section): New function.
12591 (Relobj::comdat_groups_): New field.
12592 (Relobj::kept_comdat_sections_): New field.
12593 (Symbol_value::input_value): Update comment.
12594 (Sized_relobj::map_to_kept_section) New function.
12595 (Sized_relobj::include_linkonce_section): Add new parameter.
12596 * target-reloc.h (Comdat_behavior): New type.
12597 (get_comdat_behavior): New function.
12598 (relocate_section): Add code to map a discarded section to the
12599 corresponding kept section when applying a relocation.
12600
e4e5049b
CS
126012008-04-30 Craig Silverstein <csilvers@google.com>
12602
12603 * dwarf_reader.cc (next_generation_count): New static var.
12604 (Addr2line_cache_entry): New struct.
12605 (addr2line_cache): New static var.
12606 (Dwarf_line_info::one_addr2line): Added caching.
12607 (Dwarf_line_info::clear_addr2line_cache): New function.
12608 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12609 cache-size parameter.
12610 (Dwarf_line_info::one_addr2line_cache): New function.
12611 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12612 new cache-size argument to one_addr2line(), and clear cache.
12613
d09e9154
CC
126142008-04-28 Cary Coutant <ccoutant@google.com>
12615
12616 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12617 R_386_PC8 relocations.
12618
7ef73768
ILT
126192008-04-23 Ian Lance Taylor <iant@google.com>
12620
55438702
ILT
12621 * object.cc (Sized_relobj::include_section_group): Check for
12622 invalid section group.
12623
c165fb93
ILT
12624 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12625 header size.
12626
7ef73768
ILT
12627 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12628 than read for file header.
12629 * archive.cc (Archive::include_member): Likewise.
12630
6194aaab
L
126312008-04-23 Paolo Bonzini <bonzini@gnu.org>
12632
12633 * aclocal.m4: Regenerate.
12634 * configure: Regenerate.
12635
d491d34e
ILT
126362008-04-19 Ian Lance Taylor <iant@google.com>
12637
5ea2bac6
ILT
12638 * version.cc (version_string): Bump to 1.6.
12639
7bc3e21a
ILT
12640 * testsuite/Makefile.am (many_sections_r_test): New target.
12641 (many_sections_r_test_SOURCES): Remove.
12642 (many_sections_r_test_DEPENDENCIES): Remove.
12643 (many_sections_r_test_LDFLAGS): Remove.
12644 (many_sections_r_test_LDADD): Remove.
12645
7fcd3aa9
ILT
12646 * object.cc (Sized_relobj::do_add_symbols): Always pass
12647 local_symbol_count_ to add_from_relobj.
12648
4c94d6ae
ILT
12649 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12650 every thousand variables.
12651 * testsuite/Makefile.in: Rebuild.
12652
d491d34e
ILT
12653 * object.cc (Xindex::initialize_symtab_xindex): New function.
12654 (Xindex::read_symtab_xindex): New function.
12655 (Xindex::sym_xindex_to_shndx): New function.
12656 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12657 available.
12658 (Sized_relobj::do_initialize_xindex): New function.
12659 (Sized_relobj::do_read_symbols): Adjust section links.
12660 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12661 parameter. Change all callers.
12662 (Sized_relobj::include_section_group): Adjust section links and
12663 symbol section indexes.
12664 (Sized_relobj::do_layout): Adjust section links.
12665 (Sized_relobj::do_count_local_symbols): Adjust section links and
12666 symbol section indexes.
12667 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12668 ordinary and special symbols.
12669 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12670 dynsym_xindex parameters. Change all callers. Adjust section
12671 links. Use SHN_XINDEX when needed.
12672 (Sized_relobj::get_symbol_location_info): Adjust section links.
12673 Don't get fooled by special symbols.
12674 * object.h (class Xindex): Define.
12675 (class Object): Add xindex_ parameter. Declare virtual functoin
12676 do_initialize_xindex.
12677 (Object::adjust_sym_shndx): New function.
12678 (Object::set_xindex): New protected function.
12679 (class Symbol_value): Add is_ordinary_shndx_ field.
12680 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12681 (Symbol_value::value): Assert ordinary section.
12682 (Symbol_value::initialize_input_to_output_map): Likewise.
12683 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12684 Change all callers.
12685 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12686 all callers.
12687 (class Sized_relobj): Update declarations.
12688 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12689 parameter. Change all callers.
12690 (Sized_relobj::adjust_shndx): New function.
12691 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12692 field.
12693 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12694 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12695 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12696 (Sized_dynobj::read_dynsym_section): Adjust section links.
12697 (Sized_dynobj::read_dynamic): Likewise.
12698 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12699 section links.
12700 (Sized_dynobj::do_initialize_xindex): New function.
12701 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12702 do_initialize_xindex.
12703 (Sized_dynobj::adjust_shndx): New function.
12704 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12705 dynsym_xindex_ fields.
12706 (Layout::finalize): Add a call to set_section_indexes before
12707 creating the symtab sections.
12708 (Layout::set_section_indexes): Don't do anything if the section
12709 already has a section index.
12710 (Layout::create_symtab_sections): Add shnum parameter. Change
12711 caller. Create .symtab_shndx section if needed.
12712 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12713 caller.
12714 (Layout::allocated_output_section_count): New function.
12715 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12716 needed.
12717 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12718 fields. Update declarations.
12719 (Layout::symtab_xindex): New function.
12720 (Layout::dynsym_xindex): New function.
12721 (class Write_symbols_task): Add layout_ field.
12722 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12723 Change caller.
12724 * output.cc (Output_section_headers::Output_section_headers): Add
12725 shstrtab_section parameter. Change all callers.
12726 (Output_section_headers::do_sized_write): Store overflow values
12727 for section count and section string table section index in
12728 section header zero.
12729 (Output_file_header::do_sized_write): Check for overflow of
12730 section count and section string table section index.
12731 (Output_symtab_xindex::do_write): New function.
12732 (Output_symtab_xindex::endian_do_write): New function.
12733 * output.h (class Output_section_headers): Add shstrtab_section_.
12734 Update declarations.
12735 (class Output_symtab_xindex): Define.
12736 (Output_section::has_out_shndx): New function.
12737 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12738 field.
12739 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12740 Change all callers.
12741 (Sized_symbol::init): Likewise.
12742 (Symbol::output_section): Check for ordinary symbol.
12743 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12744 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12745 callers.
12746 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12747 Change all callers. Simplify handling of symbols from sections
12748 not included in the link.
12749 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12750 distinction.
12751 (Weak_alias_sorter::operator()): Assert that symbols are
12752 ordinary.
12753 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12754 distinction.
12755 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12756 parameters. Change all callers.
12757 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12758 symbol distinction. Use SHN_XINDEX when needed.
12759 (Symbol_table::write_section_symbol): Add symtab_xindex
12760 parameter. Change all callers.
12761 (Symbol_table::sized_write_section_symbol): Likewise. Use
12762 SHN_XINDEX when needed.
12763 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12764 declarations.
12765 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12766 (Symbol::is_defined): Check is_ordinary.
12767 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12768 (Symbol::is_absolute, Symbol::is_common): Likewise.
12769 (class Sized_symbol): Update declarations.
12770 (class Symbol_table): Update declarations.
12771 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12772 parameters. Change all callers.
12773 (Sized_symbol::override): Likewise.
12774 (Symbol_table::override): Likewise.
12775 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12776 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12777 is_ordinary, and orig_st_shndx parameters. Change all callers.
12778 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12779 to be in an ordinary section.
12780 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12781 object and is_ordinary parameters. Change all callers.
12782 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12783 Change all callers. Don't add undefined or non-ordinary symbols
12784 to reloc_map_.
12785 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12786 Change all callers.
12787 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12788 declarations.
12789 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12790 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12791 (Sized_relobj::relocate_sections): Likewise.
12792 * target-reloc.h (scan_relocs): Adjust section symbol index.
12793 (scan_relocatable_relocs): Likewise.
12794 * i386.cc (Scan::local): Check for ordinary symbols.
12795 * sparc.cc (Scan::local): Likewise.
12796 * x86_64.cc (Scan::local): Likewise.
12797 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12798 to symbol_section_and_value.
12799 * testsuite/many_sections_test.cc: New file.
12800 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12801 (check_PROGRAMS): Add many_sections_test.
12802 (many_sections_test_SOURCES): Define.
12803 (many_sections_test_DEPENDENCIES): Define.
12804 (many_sections_test_LDFLAGS): Define.
12805 (BUILT_SOURCES): Add many_sections_define.h.
12806 (many_sections_define.h): New target.
12807 (BUILT_SOURCES): Add many_sections_check.h.
12808 (many_sections_check.h): New target.
12809 (check_PROGRAMS): Add many_sections_r_test.
12810 (many_sections_r_test_SOURCES): Define.
12811 (many_sections_r_test_DEPENDENCIES): Define.
12812 (many_sections_r_test_LDFLAGS): Define.
12813 (many_sections_r_test_LDADD): Define.
12814 (many_sections_r_test.o): New target.
12815 * testsuite/Makefile.in: Rebuild.
12816
c5818ff1
CC
128172008-04-17 Cary Coutant <ccoutant@google.com>
12818
12819 * errors.cc (Errors::info): New function.
12820 (gold_info): New function.
12821 * errors.h (Errors::info): New function.
12822 * gold.h (gold_info): New function.
12823 * object.cc (Input_objects::add_object): Print trace output.
12824 * options.cc (options::parse_set): New function.
12825 (General_options::parse_wrap): Deleted.
12826 (General_options::General_options): Deleted initializer.
12827 * options.h (options::String_set): New typedef.
12828 (options::parse_set): New function.
12829 (DEFINE_set): New macro.
12830 (General_options::wrap): Changed to use DEFINE_set. Changed
12831 callers of any_wrap_symbols and is_wrap_symbol.
12832 (General_options::trace, General_options::trace_symbol):
12833 New options.
12834 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12835 (General_options::wrap_symbols_): Deleted.
12836 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12837
b5be4a7c
DM
128382008-04-17 David S. Miller <davem@davemloft.net>
12839
12840 * options.cc (General_options::parse_V): New function.
12841 * options.h: Add entries for -V and -Qy.
12842
155a0dd7
ILT
128432008-04-17 Ian Lance Taylor <iant@google.com>
12844
12845 * common.cc (Symbol_table::allocate_commons): Remove options
12846 parameter. Change caller.
12847 (Symbol_table::do_allocate_commons): Remove options parameter.
12848 Change caller. Just call do_allocate_commons_list twice.
12849 (Symbol_table::do_allocate_commons_list): New function, broken out
12850 of do_allocate_commons.
12851 * common.h (class Allocate_commons_task): Remove options_ field.
12852 Update constructor.
12853 * symtab.cc (Symbol_table::Symbol_table): Initialize
12854 tls_commons_.
12855 (Symbol_table::add_from_object): Put TLS common symbols on
12856 tls_commons_ list.
12857 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12858 which are IN_OUTPUT_DATA.
12859 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12860 allocate_commons and do_allocate_commons declarations. Declare
12861 do_allocate_commons_list.
12862 * gold.cc (queue_middle_tasks): Update creation of
12863 Allocate_commons_task to not pass options.
12864 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12865 (TLS_TEST_C_FLAGS): New variable.
12866 (tls_test_c_pic.o): New target.
12867 (tls_test_shared.so): Link in tls_test_c_pic.o.
12868 (tls_test_c_pic_ie.o): New target.
12869 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12870 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12871 (tls_test_c.o): New target.
12872 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12873 (tls_pic_test_LDADD): Likewise.
12874 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12875 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12876 (tls_test_c_gnu2.o): New target.
12877 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12878 tls_test_c_gnu2.o.
12879 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12880 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12881 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12882 * testsuite/tls_test.cc: Include "config.h".
12883 (t_last): Call t11_last.
12884 * testsuite/tls_test.h (t11, t11_last): Declare.
12885 * testsuite/tls_test_c.c: New file.
12886 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12887 * configure.ac: Check for OpenMP support.
12888 * configure, config.in, Makefile.in: Rebuild.
12889 * testsuite/Makefile.in: Rebuild.
12890
edfbb029
CC
128912008-04-16 Cary Coutant <ccoutant@google.com>
12892
12893 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12894 (Target_i386::tls_base_symbol_defined_): New field.
12895 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12896 (Target_i386::Scan::global): Likewise.
12897 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12898 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12899 (Target_x86_64::tls_base_symbol_defined_): New field.
12900 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12901 (Target_x86_64::Scan::global): Likewise.
12902
f3c69fca
CC
129032008-04-16 Cary Coutant <ccoutant@google.com>
12904
12905 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12906 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12907 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12908 building shared libraries.
12909 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12910 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12911 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12912 * testsuite/Makefile.in: Rebuild.
12913 * testsuite/weak_undef.h: New file.
12914 * testsuite/weak_undef_file1.cc: Add extra test cases.
12915 * testsuite/weak_undef_file2.cc: Likewise.
12916 * testsuite/weak_undef_test.cc: Likewise.
12917
7c414435
DM
129182008-04-16 David S. Miller <davem@davemloft.net>
12919
32b769e1
DM
12920 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12921 Add issued_non_pic_error_ field. Declare check_non_pic.
12922 (Target_sparc::Scan::check_non_pic): New function.
12923 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12924 (Target_sparc::Scan::global): Likewise.
12925
11936fb1
DM
12926 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12927 * configure: Rebuild.
12928
7c414435
DM
12929 * options.h (DEFINE_enable): New macro.
12930 (new_dtags): New enable option.
12931 (initfirst, interpose, loadfltr, nodefaultlib,
12932 nodelete, nodlopen, nodump): New -z options.
12933 * layout.cc (Layout:finish_dynamic_section): If new
12934 dtags enabled, emit DT_RUNPATH. Also, emit a
12935 DT_FLAGS_1 containing any specified -z flags.
12936
85c7bf8b
ILT
129372008-04-16 Ian Lance Taylor <iant@google.com>
12938
12c0daef
ILT
12939 * copy-relocs.cc: New file.
12940 * copy-relocs.h: New file.
12941 * reloc.cc: Remove Copy_relocs code.
12942 * reloc.h: Likewise.
12943 * reloc-types.h (struct Reloc_types) [both versions]: Add
12944 get_reloc_addend_noerror.
12945 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12946 variants of add_global which take an addend which must be zero.
12947 * i386.cc: Include "copy-relocs.h".
12948 (class Target_i386): Change type of copy_relocs_ to variable,
12949 update initializer.
12950 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12951 Change all callers.
12952 (Target_i386::do_finalize_sections): Change handling of
12953 copy_relocs_.
12954 * sparc.cc: Include "copy-relocs.h".
12955 (class Target_sparc): Change type of copy_relocs_ to variable,
12956 update initializer.
12957 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12958 Change all callers.
12959 (Target_sparc::do_finalize_sections): Change handling of
12960 copy_relocs_.
12961 * x86_64.cc: Include "copy-relocs.h".
12962 (class Target_x86_64): Change type of copy_relocs_ to variable,
12963 update initializer.
12964 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12965 class. Change all callers.
12966 (Target_x86_64::do_finalize_sections): Change handling of
12967 copy_relocs_.
12968 * Makefile.am (CCFILES): Add copy-relocs.cc.
12969 (HFILES): Add copy-relocs.h.
12970
4f4995b6
ILT
12971 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12972
85c7bf8b
ILT
12973 * testsuite/script_test_4.sh: Permit leading zeroes.
12974
4f2a9edd
ILT
129752008-04-15 Ian Lance Taylor <iant@google.com>
12976
e6188289
ILT
12977 * script-sections.cc (Script_sections::create_segments): Use
12978 header_size_adjustment even when there is enough room for the
12979 headers.
12980 * testsuite/script_test_4.sh: New file.
12981 * testsuite/script_test_4.t: New file.
12982 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12983 (check_DATA): Add script_test_4.stdout.
12984 (MOSTLYCLEANFILES): Likewise.
12985 (script_test_4): New target.
12986 (script_test_4.stdout): New target.
12987 * testsuite/Makefile.in: Rebuild.
12988
4f2a9edd
ILT
12989 * sparc.cc: Add definitions for Output_data_plt_sparc class
12990 constants.
12991
f5314dd5
DM
129922008-04-14 David S. Miller <davem@davemloft.net>
12993
12994 * sparc.cc: New file.
12995 * Makefile.am (TARGETSOURCES): Add sparc.cc
12996 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12997 * configure.tgt: Document targ_extra_size and
12998 targ_extra_big_endian. Add entries for sparc-* and
12999 sparc64-*.
13000 * configure.ac: Handle targ_extra_size and
13001 targ_extra_big_endian.
13002 * Makefile.in: Rebuild.
13003 * configure: Likewise.
13004 * po/POTFILES.in: Likewise.
13005 * po/gold.pot: Likewise.
13006
154e0e9a
ILT
130072008-04-14 Ian Lance Taylor <iant@google.com>
13008
13009 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13010 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13011 in the name/type/flags to section mapping. Don't call
13012 allocate_output_section.
13013 (Layout::choose_output_section): Change parameter from adjust_name
13014 to is_input_section. Don't permit input sections after sections
13015 are attached to segments. Don't call allocate_output_section.
13016 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13017 not write_enable_output_section.
13018 (Layout::make_output_section): Don't push to
13019 unattached_section_list_ nor call attach_to_segment. Call
13020 attach_section_to_segment if sections are attached.
13021 (Layout::attach_sections_to_segments): New function.
13022 (Layout::attach_section_to_segment): New function.
13023 (Layout::attach_allocated_section_to_segment): Rename from
13024 attach_to_segment. Remove flags parameter.
13025 (Layout::allocate_output_section): Remove function.
13026 (Layout::write_enable_output_section): Remove function.
13027 * layout.h (class Layout): Update for above changes. Add new
13028 field sections_are_attached_.
13029 * output.h (Output_section::update_flags_for_input_section): New
13030 function.
13031 * output.cc (Output_section::add_input_section): Call
13032 update_flags_for_input_section.
13033 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13034
009a67a2
CC
130352008-04-11 Cary Coutant <ccoutant@google.com>
13036
13037 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13038 thought unnecessary.
13039 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13040
759b1a24
ILT
130412008-04-11 Ian Lance Taylor <iant@google.com>
13042
13043 * output.h (class Output_section_data): Remove inline definition
13044 of set_addralign.
13045 * output.cc (Output_section_data::set_addralign): New function.
13046
c2b45e22
CC
130472008-04-11 Cary Coutant <ccoutant@google.com>
13048
13049 Add support for TLS descriptors for i386 and x86_64.
13050 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13051 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13052 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13053 GOT_TYPE_TLS_DESC.
13054 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13055 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13056 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13057 relocations.
13058 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13059 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13060 Fix problem with initial-exec relocations.
13061 (Target_i386::Relocate::relocate_tls): Likewise.
13062 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13063 relaxation.
13064 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13065 support for section-plus-offset dynamic table entries.
13066 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13067 (Output_data_dynamic::Dynamic_entry): Add support for
13068 section-plus-offset dynamic table entries.
13069 (Output_data_dynamic::Classification): Likewise.
13070 (Output_data_dynamic::classification_): Renamed offset_.
13071 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13072 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13073 (Target_x86_64::make_plt_section): New function.
13074 (Target_x86_64::reserve_tlsdesc_entries): New function.
13075 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13076 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13077 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13078 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13079 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13080 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13081 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13082 add extra PLT entry for TLS descriptors.
13083 (Output_data_plt_x86_64::got_): New field.
13084 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13085 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13086 fields.
13087 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13088 descriptors.
13089 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13090 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13091 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13092 R_386_TLS_DESC_CALL relocations.
13093 (Target_x86_64::Scan::global): Likewise.
13094 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13095 for TLS descriptors.
13096 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13097 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13098 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13099 GD-to-IE relaxation.
13100 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13101 and TLS_DESCRIPTORS.
13102 * Makefile.in: Rebuild.
13103 * configure: Rebuild.
13104 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13105 (tls_test_shared2.so): New target.
13106 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13107 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13108 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13109 (tls_shared_gd_to_ie_test_LDADD): New variable.
13110 (tls_shared_gnu2_gd_to_ie_test): New target.
13111 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13112 New targets.
13113 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13114 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13115 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13116 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13117 (tls_shared_gnu2_test): New target.
13118 (tls_test_gnu2_shared.so): New target.
13119 (tls_shared_gnu2_test_SOURCES): New variable.
13120 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13121 (tls_shared_gnu2_test_LDFLAGS): New variable.
13122 (tls_shared_gnu2_test_LDADD): New variable.
13123 * testsuite/Makefile.in: Rebuild.
13124 * testsuite/Makefile.
13125
83bfb6b7
ILT
131262008-04-11 Ian Lance Taylor <iant@google.com>
13127
13128 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13129 justsyms.t.
13130 * testsuite/Makefile.in: Rebuild.
13131
13132 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13133 long.
13134 * testsuite/script_test_2.cc (main): Adjust test.
13135
706e1f5e
ILT
131362008-04-11 David S. Miller <davem@davemloft.net>
13137 Ian Lance Taylor <iant@google.com>
13138
13139 * options.h (General_options): Add entries for '-Y' and
13140 '-relax'.
13141 * options.cc (General_options:finalize): If -Y was used, add those
13142 entries to the library path instead of the default "/lib" and
13143 "/usr/lib".
13144
7c98e6bb
DM
131452008-04-11 David S. Miller <davem@davemloft.net>
13146
13147 * testsuite/justsyms.t: Start at 0x100.
13148 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13149 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13150 long.
13151 * testsuite/script_test_2.cc: Adjust string and section length
13152 checks.
7c98e6bb 13153
99a37bfd
ILT
131542008-04-09 Ian Lance Taylor <iant@google.com>
13155
2cefc357
ILT
13156 PR gold/5996
13157 * script-sections.cc (Sections_element::allocate_to_segment): Add
13158 orphan parameter.
13159 (Output_section_definition::allocate_to_segment): Likewise.
13160 (Orphan_output_section::allocate_to_segment): Likewise.
13161 (Script_sections::attach_sections_using_phdrs_clause): Don't
13162 propagate non-PT_LOAD segments to orphan sections.
13163 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13164 readelf rather than objdump.
13165 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13166 .interp section and PT_INTERP segment are the same size.
13167 * testsuite/Makefile.in: Rebuild.
13168
99a37bfd
ILT
13169 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13170 aliases for symbols defined in the same object.
13171 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13172 (weak_alias_test_SOURCES): New variable.
13173 (weak_alias_test_DEPENDENCIES): New variable.
13174 (weak_alias_test_LDFLAGS): New variable.
13175 (weak_alias_test_LDADD): New variable.
13176 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13177 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13178 (weak_alias_test_3.o): New target.
13179 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13180 * testsuite/weak_alias_test_main.cc: New file.
13181 * testsuite/weak_alias_test_1.cc: New file.
13182 * testsuite/weak_alias_test_2.cc: New file.
13183 * testsuite/weak_alias_test_3.cc: New file.
13184
780e49c5
ILT
131852008-04-08 Ian Lance Taylor <iant@google.com>
13186
cdb0b8f5
ILT
13187 * options.h (class General_options): Add --noinhibit-exec option.
13188 * main.cc (main): Check --noinhibit-exec.
13189
0864d551
ILT
13190 * options.h (class General_options): Define --wrap as a special
13191 option. Add wrap_symbols_ field.
13192 (General_options::any_wrap_symbols): New function.
13193 (General_options::is_wrap_symbol): New function.
13194 * options.cc (General_options::parse_wrap): New function.
13195 (General_options::General_options): Initialize wrap_symbols_.
13196 * symtab.cc (Symbol_table::wrap_symbol): New function.
13197 (Symbol_table::add_from_object): Handle --wrap.
13198 * symtab.h (class Symbol_table): Declare wrap_symbol.
13199 * target.h (Target::wrap_char): New function.
13200 (Target::Target_info): Add wrap_char field.
13201 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13202 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13203 * testsuite/testfile.cc (Target_test::test_target_info):
13204 Likewise.
13205
789aa6de
ILT
13206 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13207 there is one.
13208
2c38906f
ILT
13209 * layout.h (class Layout): Add added_eh_frame_data_ field.
13210 * layout.cc (Layout::Layout): Initialize new field.
13211 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13212 output section until we find a section we merged successfully.
13213 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13214 that the size be non-zero.
13215
780e49c5
ILT
13216 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13217 qualifier.
13218
7fcd0256
ILT
132192008-04-08 Craig Silverstein <csilvers@google.com>
13220
13221 * configure.ac: Export new conditional variable HAVE_ZLIB.
13222 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13223 on HAVE_ZLIB.
13224 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13225 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13226
6835af53
ILT
132272008-04-07 Ian Lance Taylor <iant@google.com>
13228
e24f324c
ILT
13229 * version.cc (version_string): Set to "1.5".
13230
a036edd8
ILT
13231 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13232 Add issued_non_pic_error_ field. Declare check_non_pic.
13233 (Target_x86_64::Scan::check_non_pic): New function.
13234 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13235 (Target_x86_64::Scan::global): Likewise.
13236
624f8810
ILT
13237 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13238 addend parameter. Change caller. Handle merge sections.
13239 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13240 Address to Addend. Don't add in the result of
13241 local_section_offset, pass down the addend and use the returned
13242 value.
13243 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13244 Update declarations of local_section_offset and symbol_value.
13245 * testsuite/two_file_test_1.cc (t18): New function.
13246 * testsuite/two_file_test_2.cc (f18): New function.
13247 * testsuite/two_file_test_main.cc (main): Call t18.
13248 * testsuite/two_file_test.h (t18, f18): Declare.
13249
6835af53
ILT
13250 * configure.ac: Don't test for objdump, c++filt, or readelf.
13251 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13252 conditionals.
13253 (TEST_READELF): New variable.
13254 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13255 (check_PROGRAMS): Add two_file_strip_test.
13256 (two_file_strip_test): New target.
13257 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13258 (two_file_same_shared_strip_test_SOURCES): New variable.
13259 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13260 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13261 (two_file_same_shared_strip_test_LDADD): New variable.
13262 (two_file_shared_strip.so): New target.
13263 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13264 (ver_test_5.syms, ver_test_7.syms): Likewise.
13265 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13266 (strip_test_3.stdout): Use TEST_OBJDUMP.
13267 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13268
86925eef
CC
132692008-04-04 Cary Coutant <ccoutant@google.com>
13270
13271 * symtab.h (Symbol::is_weak_undefined): New function.
13272 (Symbol::is_strong_undefined): New function.
13273 (Symbol::is_absolute): New function.
13274 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13275 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13276 absolute symbols.
13277 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13278 (weak_undef_test): New target.
13279 * testsuite/Makefile.in: Rebuild.
13280 * testsuite/weak_undef_file1.cc: New file.
13281 * testsuite/weak_undef_file2.cc: New file.
13282 * testsuite/weak_undef_test.cc: New file.
13283
126f3ece
ILT
132842008-04-03 Craig Silverstein <csilvers@google.com>
13285
13286 * compressed_output.h (class Output_compressed_section): Use
13287 unsigned buffer.
13288 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13289 add zlib header.
13290 (zlib_compressed_suffix): Removed.
13291 (Output_compressed_section::set_final_data_size): Use unsigned
13292 buffers.
13293 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13294 Fix linker invocation.
13295 (flagstest_o_specialfile_and_compress_debug_sections):
13296 Likewise.
13297 * testsuite/Makefile.in: Regenerated.
13298
deae2a14
DM
132992008-04-02 David S. Miller <davem@davemloft.net>
13300
13301 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13302 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13303
70752818
ILT
133042008-04-02 Craig Silverstein <csilvers@google.com>
13305
13306 * TODO: New file.
13307
39d0cb0e
ILT
133082008-04-02 Ian Lance Taylor <iant@google.com>
13309
13310 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13311 parameters. Update for new key type to views_. Change all
13312 callers.
13313 (File_read::read): Adjust for byteshift in returned view.
13314 (File_read::add_view): New function, broken out of
13315 find_and_make_view.
13316 (File_read::make_view): New function, broken out of
13317 find_and_make_view.
13318 (File_read::find_or_make_view): Add offset and aligned
13319 parameters. Rewrite accordingly. Change all callers.
13320 (File_read::get_view): Add offset and aligned parameters. Adjust
13321 for byteshift in return value.
13322 (File_read::get_lasting_view): Likewise.
13323 * fileread.h (class File_read): Update declarations.
13324 (class File_read::View): Add byteshift_ field. Add byteshift to
13325 constructor. Add byteshift method.
13326 * archive.h (Archive::clear_uncached_views): New function.
13327 (Archive::get_view): Add aligned parameter. Change all callers.
13328 * object.h (Object::get_view): Add aligned parameter. Change all
13329 callers.
13330 (Object::get_lasting_view): Likewise.
13331
13332 * fileread.cc (File_read::release): Don't call clear_views if
13333 there are multiple objects.
13334 * fileread.h (File_read::clear_uncached_views): New function.
13335 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13336 on the archive.
13337
a1207466
CC
133382008-03-31 Cary Coutant <ccoutant@google.com>
13339
13340 Add thin archive support.
13341 * archive.cc (Archive::armagt): New const.
13342 (Archive::setup): Remove task parameter and calls to unlock.
13343 (Archive::unlock_nested_archives): New function.
13344 (Archive::read_header): Add nested_off parameter. Change
13345 all callers.
13346 (Archive::interpret_header): Likewise.
13347 (Archive::include_all_members): Change to handle thin
13348 archives.
13349 (Archive::include_member): Likewise.
13350 * archive.h (Archive::Archive): Add new parameters and
13351 initializers.
13352 (Archive::armagt): New const.
13353 (Archive::setup): Remove task parameter.
13354 (Archive::unlock_nested_archives): New function.
13355 (Archive::read_header): Add nested_off parameter.
13356 (Archive::interpret_header): Likewise.
13357 (Archive::Nested_archive_table): New typedef.
13358 (Archive::is_thin_archive_): New field.
13359 (Archive::nested_archives_): New field.
13360 (Archive::options_): New field.
13361 (Archive::dirpath_): New field.
13362 (Archive::task_): New field.
13363 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13364 for thin archives. Pass additional parameters to
13365 Archive::Archive. Unlock the archive file after calling
13366 Archive::setup.
cd536b21 13367
479f6503
ILT
133682008-03-29 Ian Lance Taylor <iant@google.com>
13369
686c8caf
ILT
13370 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13371 version symbol to be local.
13372 * testsuite/ver_test_4.sh: New file.
13373 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13374 (check_DATA): Add ver_test_4.syms.
13375 (ver_test_4.syms): New target.
13376 * testsuite/Makefile.in: Rebuild.
13377
ab794b6b
ILT
13378 * output.cc
13379 (Output_section::Input_section_sort_entry::has_priority): New
13380 function.
13381 (Output_section::Input_section_sort_entry::match_file_name): New
13382 function.
13383 (Output_section::Input_section_sort_entry::match_section_name):
13384 Remove.
13385 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13386 Remove.
13387 (Output_section::Input_section_sort_entry::match_section_file):
13388 Remove.
13389 (Output_section::Input_section_sort_compare::operator()): Rewrite
13390 using new Input_section_sort_entry functions. Sort crtbegin and
13391 crtend first. Sort sections with no priority before sections with
13392 a priority.
13393 * testsuite/initpri1.c (d3): Check j != 4.
13394 (cd5): New constructor/destructor function.
13395 (main): Check j != 2.
13396
479f6503
ILT
13397 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13398 new symbol when resolving, don't call set_is_default.
13399 * testsuite/ver_test_7.cc: New file.
13400 * testsuite/ver_test_7.sh: New file.
13401 * testsuite/Makefile.am (ver_test_7.so): New target.
13402 (ver_test_7.o): New target.
13403 (check_SCRIPTS): Add ver_test_7.sh.
13404 (check_DATA): Add ver_test_7.syms.
13405 (ver_test_7.syms): New target.
13406
2fd32231
ILT
134072008-03-28 Ian Lance Taylor <iant@google.com>
13408
13409 * layout.cc (Layout::layout): If we see an input section with a
13410 name that needs sorting, set the must_sort flag for the output
13411 section.
13412 (Layout::make_output_section): If the name of the output section
13413 indicates that it might require sorting, set the may_sort flag.
13414 * output.h (Output_section::may_sort_attached_input_sections): New
13415 function.
13416 (Output_section::set_may_sort_attached_input_sections): New
13417 function.
13418 (Output_section::must_sort_attached_input_sections): New
13419 function.
13420 (Output_section::set_must_sort_attached_input_sections): New
13421 function.
13422 (class Output_section): Declare Input_section_sort_entry. Define
13423 Input_section_sort_compare. Declare
13424 sort_attached_input_sections. Add new fields:
13425 may_sort_attached_input_sections_,
13426 must_sort_attached_input_sections_,
13427 attached_input_sections_are_sorted_.
13428 * output.cc (Output_section::Output_section): Initialize new
13429 fields.
13430 (Output_section::add_input_section): Add an entry to
13431 input_sections_ if may_sort or must_sort are true.
13432 (Output_section::set_final_data_size): Call
13433 sort_attached_input_sections if necessary.
13434 (Output_section::Input_section_sort_entry): Define new class.
13435 (Output_section::Input_section_sort_compare::operator()): New
13436 function.
13437 (Output_section::sort_attached_input_sections): New function.
13438 * configure.ac: Check whether the compiler supports constructor
13439 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13440 * testsuite/initpri1.c: New file.
13441 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13442 CONSTRUCTOR_PRIORITY.
13443 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13444 (initpri1_LDFLAGS): New variable.
13445 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13446
18e6b24e
ILT
134472008-03-27 Ian Lance Taylor <iant@google.com>
13448
49bdd526
ILT
13449 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13450 * testsuite/common_test_1.c: New file.
13451 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13452 (common_test_1_SOURCES): New variable.
13453 (common_test_1_DEPENDENCIES): New variable.
13454 (common_test_1_LDFLAGS): New variable.
13455
18e6b24e
ILT
13456 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13457 and commons_ correctly when NAME/VERSION does not override
13458 NAME/NULL.
13459 * testsuite/ver_test_6.c: New file.
13460 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13461 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13462 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13463
04bf7072
ILT
134642008-03-26 Ian Lance Taylor <iant@google.com>
13465
5871526f
ILT
13466 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13467 of an undefined symbol from a version script.
13468 * testsuite/Makefile.am (ver_test_5.so): New target.
13469 (ver_test_5.o): New target.
13470 (check_SCRIPTS): Add ver_test_5.sh.
13471 (check_DATA): Add ver_test_5.syms.
13472 (ver_test_5.syms): New target.
13473 * testsuite/ver_test_5.cc: New file.
13474 * testsuite/ver_test_5.script: New file.
13475 * testsuite/ver_test_5.sh: New file.
13476 * Makefile.in, testsuite/Makefile.in: Rebuild.
13477
04bf7072
ILT
13478 PR gold/5986
13479 Fix problems building gold with gcc 4.3.0.
13480 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13481 (gold_error_at_location, gold_warning_at_location): Use it.
13482 * configure.ac: Check whether we can compile and use a template
13483 function with a printf attribute.
13484 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13485 when jumping over bytes.
13486 * object.cc: Instantiate Object::read_section_data.
13487 * debug.h: Include <cstring>
13488 * dwarf_reader.cc: Include <algorithm>
13489 * main.cc: Include <cstring>.
13490 * options.cc: Include <cstring>.
13491 * output.cc: Include <cstring>.
13492 * script.cc: Include <cstring>.
13493 * script.h: Include <string>.
13494 * symtab.cc: Include <cstring> and <algorithm>.
13495 * target-select.cc: Include <cstring>.
13496 * version.cc: Include <string>.
13497 * testsuite/testmain.cc: Include <cstdlib>.
13498 * configure, config.in: Rebuild.
13499
874c5b28
ILT
135002008-03-25 Ian Lance Taylor <iant@google.com>
13501
819d6c3a
ILT
13502 * options.cc: Include "../bfd/bfdver.h".
13503 (options::help): Print bug reporting address.
13504
f4b2c6f5
ILT
13505 * version.cc (print_version): Adjust output for current value of
13506 BFD_VERSION_STRING.
13507
13508 * NEWS: New file.
13509
e96caa79
ILT
13510 * options.cc (options::help): Print list of supported targets.
13511 * target-select.h: Include <vector>.
13512 (class Target_selector): Make machine_, size_, and is_big_endian_
13513 fields const. Add bfd_name_ and instantiated_target_ fields.
13514 (Target_selector::Target_selector): Add bfd_name parameter.
13515 (Target_selector::recognize): Make non-virtual, call
13516 do_recognize.
13517 (Target_selector::recognize_by_name): Make non-virtual, call
13518 do_recognize_by_name.
13519 (Target_selector::supported_names): New function.
13520 (Target_selector::bfd_name): New function.
13521 (Target_selector::do_instantiate_target): New pure virtual
13522 function.
13523 (Target_selector::do_recognize): New virtual function.
13524 (Target_selector::do_recognize_by_name): New virtual function.
13525 (Target_selector::instantiate_target): New private function.
13526 (supported_target_names): Declare.
13527 * target-select.cc (Target_selector::Target_selector): Update for
13528 new parameter and fields.
13529 (select_target_by_name): Check that the name matches before
13530 calling recognize_by_name.
13531 (supported_target_names): New function.
13532 * i386.cc (class Target_selector_i386): Update Target_selector
13533 constructor call. Remove recognize and recognize_by_name. Add
13534 do_instantiate_target.
13535 * x86_64.cc (class Target_selector_x86_64): Likewise.
13536 * testsuite/testfile.cc (class Target_selector_test): Update for
13537 changes to Target_selector.
13538
874c5b28
ILT
13539 * README: Rewrite, with some notes on unsupported features.
13540
0a65a3a7
CC
135412008-03-24 Cary Coutant <ccoutant@google.com>
13542
13543 * i386.cc (Target_i386::Got_type): New enum declaration.
13544 (Target_i386::Scan::local): Updated callers of Output_data_got
13545 member functions.
13546 (Target_i386::Scan::global): Likewise.
13547 (Target_i386::Relocate::relocate): Likewise.
13548 (Target_i386::Relocate::relocate_tls): Likewise.
13549 * object.h (Got_offset_list): New class.
13550 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13551 (Sized_relobj::local_got_offset): Likewise.
13552 (Sized_relobj::set_local_got_offset): Likewise.
13553 (Sized_relobj::local_has_tls_got_offset): Removed.
13554 (Sized_relobj::local_tls_got_offset): Removed.
13555 (Sized_relobj::set_local_tls_got_offset): Removed.
13556 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13557 * output.cc (Output_data_got::add_global): Added got_type parameter.
13558 (Output_data_got::add_global_with_rel): Likewise.
13559 (Output_data_got::add_global_with_rela): Likewise.
13560 (Output_data_got::add_global_pair_with_rel): New function.
13561 (Output_data_got::add_global_pair_with_rela): New function.
13562 (Output_data_got::add_local): Added got_type parameter.
13563 (Output_data_got::add_local_with_rel): Likewise.
13564 (Output_data_got::add_local_with_rela): Likewise.
13565 (Output_data_got::add_local_pair_with_rel): New function.
13566 (Output_data_got::add_local_pair_with_rela): New function.
13567 (Output_data_got::add_global_tls): Removed.
13568 (Output_data_got::add_global_tls_with_rel): Removed.
13569 (Output_data_got::add_global_tls_with_rela): Removed.
13570 (Output_data_got::add_local_tls): Removed.
13571 (Output_data_got::add_local_tls_with_rel): Removed.
13572 (Output_data_got::add_local_tls_with_rela): Removed.
13573 * output.h (Output_data_got::add_global): Added got_type parameter.
13574 (Output_data_got::add_global_with_rel): Likewise.
13575 (Output_data_got::add_global_with_rela): Likewise.
13576 (Output_data_got::add_global_pair_with_rel): New function.
13577 (Output_data_got::add_global_pair_with_rela): New function.
13578 (Output_data_got::add_local): Added got_type parameter.
13579 (Output_data_got::add_local_with_rel): Likewise.
13580 (Output_data_got::add_local_with_rela): Likewise.
13581 (Output_data_got::add_local_pair_with_rel): New function.
13582 (Output_data_got::add_local_pair_with_rela): New function.
13583 (Output_data_got::add_global_tls): Removed.
13584 (Output_data_got::add_global_tls_with_rel): Removed.
13585 (Output_data_got::add_global_tls_with_rela): Removed.
13586 (Output_data_got::add_local_tls): Removed.
13587 (Output_data_got::add_local_tls_with_rel): Removed.
13588 (Output_data_got::add_local_tls_with_rela): Removed.
13589 * resolve.cc (Symbol::override_base_with_special): Removed
13590 reference to has_got_offset_ field.
13591 * symtab.cc (Symbol::init_fields): Replaced initialization
13592 of got_offset_ with got_offsets_. Removed initialization
13593 of has_got_offset_
53fcba31 13594 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13595 (Symbol::got_offset): Likewise.
13596 (Symbol::set_got_offset): Likewise.
13597 (Symbol::has_tls_got_offset): Removed.
13598 (Symbol::tls_got_offset): Removed.
13599 (Symbol::set_tls_got_offset): Removed.
13600 (Symbol::got_offset_): Removed.
13601 (Symbol::tls_mod_got_offset_): Removed.
13602 (Symbol::tls_pair_got_offset_): Removed.
13603 (Symbol::got_offsets_): New field.
13604 (Symbol::has_got_offset): Removed.
13605 (Symbol::has_tls_mod_got_offset): Removed.
13606 (Symbol::has_tls_pair_got_offset): Removed.
13607 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13608 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13609 member functions.
13610 (Target_x86_64::Scan::global): Likewise.
13611 (Target_x86_64::Relocate::relocate): Likewise.
13612 (Target_x86_64::Relocate::relocate_tls): Likewise.
13613
bd52eafb
BE
136142008-03-25 Ben Elliston <bje@au.ibm.com>
13615
13616 * yyscript.y: Fix spelling error in comment.
13617
8b105e34
ILT
136182008-03-24 Ian Lance Taylor <iant@google.com>
13619
8ed814a9
ILT
13620 * options.h (class General_options): Define build_id option.
13621 * layout.h (class Layout): Declare write_build_id, create_note,
13622 create_build_id. Add build_id_note_ member.
13623 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13624 "libiberty.h", "md5.h", "sha1.h".
13625 (Layout::Layout): Initialize eh_frame_data_,
13626 eh_frame_hdr_section_, and build_id_note_.
13627 (Layout::finalize): Call create_build_id.
13628 (Layout::create_note): New function, broken out of
13629 Layout::create_gold_note.
13630 (Layout::create_gold_note): Call create_note.
13631 (Layout::create_build_id): New function.
13632 (Layout::write_build_id): New function.
13633 (Close_task_runner::run): Call write_build_id.
13634
8b105e34
ILT
13635 * x86_64.cc: Correct license to GPLv3.
13636
086a1841
ILT
136372008-03-23 Ian Lance Taylor <iant@google.com>
13638
13639 * options.cc: Include "demangle.h".
13640 (parse_optional_string): New function.
13641 (parse_long_option): Handle takes_optional_argument.
13642 (parse_short_option): Update dash_z initializer. Handle
13643 takes_optional_argument.
13644 (General_options::General_options): Initialize do_demangle_.
13645 (General_options::finalize): Set do_demangle_. Handle demangling
13646 style.
13647 * options.h (parse_optional_string): Declare.
13648 (struct One_option): Add optional_arg field. Update constructor.
13649 Update call constructor calls. Add takes_optional_argument
13650 function.
13651 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13652 (DEFINE_optional_string): Define.
13653 (General_options::demangle): Change from DEFINE_bool to
13654 DEFINE_optional_string.
13655 (General_options::no_demangle): New function.
13656 (General_options::do_demangle): New function.
13657 (General_options::set_do_demangle): New function.
13658 (General_options::execstack_status_): Move definition to end of
13659 class definition.
13660 (General_options::static_): Likewise.
13661 (General_options::do_demangle_): New field.
13662 * object.cc (big_endian>::get_symbol_location_info): Call
13663 Options::do_demangle, not Options::demangle.
13664 * symtab.cc (demangle): Likewise.
13665
cbb93e63
ILT
136662008-03-22 Ian Lance Taylor <iant@google.com>
13667
13668 * gold.h: Include <cstddef> and <sys/types.h>
13669 * options.h: Include <cstring>.
13670
ec531623
ILT
136712008-03-21 Ian Lance Taylor <iant@google.com>
13672
13673 * Added source code to GNU binutils.
This page took 0.81924 seconds and 4 git commands to generate.