merge from gcc
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c6905c28
CC
12013-07-31 Cary Coutant <ccoutant@google.com>
2
3 * object.cc (Sized_relobj::do_output_section_address): New function.
4 (Sized_relobj): Instantiate explicitly.
5 * object.h (Object::output_section_address): New function.
6 (Object::do_output_section_address): New function.
7 (Sized_relobj::do_output_section_address): New function.
8 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
9
102013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 11 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
12
13 * parameters.cc (Parameters::entry): Return target-specific entry
14 symbol name.
15 * target.h (Target::entry_symbol_name): New function.
16 (Target_info::entry_symbol_name): New data member.
17
18 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
19 * i386.cc (Target_i386::i386_info): Likewise.
20 (Target_i386_nacl::i386_nacl_info): Likewise.
21 * sparc.cc (Target_sparc::sparc_info): Likewise.
22 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
23 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
24 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
25 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
26
234d4ab8
SA
272013-07-22 Sterling Augustine <saugustine@google.com>
28
29 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
30 Convert parameter shndx to local variable. Add parameters symtab
31 and symtab_size. Scan over section names. Find relocation
32 section corresponding to current section. Create and initialize
33 reloc_mapper_ and reloc_type_.
34 (Dwarf_pubnames_table::read_header): Add assertion. Change
35 unit_length to off_t. Initialize member unit_length_. Fill in field
36 cu_offset_.
37 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
38 Initialize new fields unit_length_ and cu_offset_.
39 (Dwarf_pubnames_table::read_section): Update prototype.
40 (Dwarf_pubnames_table::cu_offset): New member function.
41 (Dwarf_pubnames_table::subsection_size): Likewise.
42 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
43 New fields.
44 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
45 member functions public.
46 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
47 Update comment. Rework logic. Move repeated parts to...
48 (Gdb_index_info_reader::read_pubtable): ...here. New function.
49 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
50 pubtypes_table_, and stmt_list_offset.
51 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
52 Gdb_index::find_pubtype_offset,
53 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
54 (Gdb_index::pubnames_read): Update prototype and rework logic.
55 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
56 Forward declare.
57 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
58 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
59 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
60 Gdb_index::map_pubtable_to_dies):
61 Declare functions.
62 (Gdb_index::pubnames_read): Update declaration.
63 (Gdb_index::Pubname_offset_map): New type.
64 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
65 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
66 Gdb_index::stmt_list_offset): Declare.
67 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
68 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
69 Gdb_index::pubtypes_offset_): Remove.
70
a3ed37d8
RM
712013-07-19 Roland McGrath <mcgrathr@google.com>
72
73 * options.h (General_options): Add -Trodata-segment option.
74 * parameters.cc (Parameters::check_rodata_segment): New function.
75 (Parameters::set_target_once): Call it.
76 * parameters.h (Parameters): Declare it (private member function).
77 * layout.cc (load_seg_unusable_for_headers): New function, broken
78 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
79 then validate rodata segment rather than text segment.
80 (relaxation_loop_body): Call that.
81 (is_text_segment): New function. Don't admit a non-executable
82 segment if TARGET->isolate_execinstr().
83 (set_segment_offsets): Call it. Honor -Trodata-segment option.
84
eb5b4ded
CC
852013-07-15 Shawn Landden <shawnlandden@gmail.com>
86
87 PR gold/15070
88 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
89 * nacl.h (Sniff_file::View::View): Request aligned view.
90
4d5effb9
CC
912013-07-11 Cary Coutant <ccoutant@google.com>
92
93 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
94 correct BRLT entry size.
95
ba8ca3e7
AM
962013-07-03 Alan Modra <amodra@gmail.com>
97
98 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
99 comment.
100
267257d2
CC
1012013-07-01 Cary Coutant <ccoutant@google.com>
102
103 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
104 reloc_type_.
105 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
106 (Dwarf_ranges_table::lookup_reloc): New function.
107 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
108 reloc_type_.
109 (Dwarf_ranges_table::lookup_reloc): New function.
110 (Dwarf_ranges_table::reloc_type_): New data member.
111
06f30c9d
CC
1122013-06-27 Jing Yu <jingyu@google.com>
113
114 PR gold/15662
115 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
116 function.
117 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
118 (Target_powerpc::do_relax): Call the above.
119
a2d7bf59
AM
1202013-06-27 Cary Coutant <ccoutant@google.com>
121
122 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
123 on garbage collected .opd section.
124
1252013-06-27 Alan Modra <amodra@gmail.com>
126
127 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
128 is non-zero.
129 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
130 (Target_powerpc::do_function_location): Likewise for loc->shndx.
131
32364e50
CC
1322013-06-14 Cary Coutant <ccoutant@google.com>
133
134 * resolve.cc (Symbol::override_base): Don't override st_type
135 from plugin placeholder symbols.
136 (Symbol_table::resolve): Likewise.
137 (Symbol_table::should_override): Don't complain about TLS mismatch
138 if the TO symbol is a plugin placeholder.
139 * testsuite/Makefile.am (plugin_test_tls): New test.
140 * testsuite/Makefile.in: Regenerate.
141 * testsuite/plugin_test_tls.sh: New test script.
142 * testsuite/two_file_test_2_tls.cc: New test source.
143 * testsuite/two_file_test_tls.cc: New test source.
144
7fb47cc9
CC
1452013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
146
147 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
148 the maximum segment alignment is larger than the page size.
149 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
150 correctly aligns the symbols with large alignemnt.
151 * testsuite/Makefile.in: Regenerate.
152 * testsuite/large_symbol_alignment.cc: New file.
153
6934001a
CC
1542013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
155 Sriraman Tallam <tmsriram@google.com>
156
157 * options.h (sort_section): New option.
158 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
159 Rename from Input_section_sort_section_name_special_ordering_compare.
160 (Input_section_sort_section_name_compare): New struct.
161 * output.cc (Output_section::Input_section_sort_section_name_compare::
162 operator()): New function.
163 (Output_section::sort_attached_input_sections): Use new sort function
164 for .text if --sort-section=name is specified.
165 * layout.cc (Layout::make_output_section):
166 Add sorting by name when --sort-section=name is specified.
167 * testsuite/Makefile.am (text_section_grouping): Test option
168 --sort-section=name.
169 * testsuite/Makefile.in: Regenerate.
170 * testsuite/section_sorting_name.cc: New file.
171 * testsuite/section_sorting_name.sh: New file.
172
93acabad
CC
1732013-05-21 Cary Coutant <ccoutant@google.com>
174
175 * symtab.h (Symbol::is_cxx_vtable): New function.
176 * target-reloc.h (relocate_section): Check for vtable symbol.
177 * testsuite/Makefile.am (missing_key_func.sh): New test case.
178 * testsuite/Makefile.in: Regenerate.
179 * testsuite/missing_key_func.cc: New test source.
180 * testsuite/missing_key_func.sh: New test script.
181
60e8b3fc
CC
1822013-05-21 Cary Coutant <ccoutant@google.com>
183
184 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
185 type of enclosing symbol.
186 (Relocate_info::location): Check symbol type when describing symbol.
187 * object.h (Symbol_location_info): Remove unused line_number;
188 add enclosing_symbol_type.
189 * testsuite/debug_msg.sh: Adjust expected output.
190
9df9de2c
CC
1912013-05-13 Cary Coutant <ccoutant@google.com>
192
193 * configure.ac: Export DEFAULT_TARGET.
194 * configure: Regenerate.
195 * Makefile.in: Regenerate.
196 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
197 * testsuite/Makefile.in: Regenerate.
198 * testsuite/debug_msg.sh: Delete duplicate tests.
199 Don't check undef_int error message match for powerpc where the
200 source file and line number aren't available.
201
bbc5ae17
RM
2022013-05-10 Roland McGrath <mcgrathr@google.com>
203
204 * options.h (General_options): Add --rosegment-gap option.
205 * options.cc (finalize): --rosegment-gap implies --rosegment.
206 * layout.cc (set_segment_offsets): Let user option override
207 target->rosegment_gap().
208
0c6e6c39
RM
2092013-05-10 Roland McGrath <mcgrathr@google.com>
210
211 * options.h (General_options): Remove leading space from help
212 messages for -nostdlib and --rosegment.
213
cde7cb01
MR
2142013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
215
216 PR ld/15365
217 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
218
f31ae5b8
AM
2192013-05-03 Alan Modra <amodra@gmail.com>
220
221 * merge.cc (Output_merge_string::do_add_input_section): Correct
222 scan for number of strings. Rename vars to avoid shadowing.
223 Include missing terminator in input_size_.
224
d3a7cd45
L
2252013-05-01 H.J. Lu <hongjiu.lu@intel.com>
226
227 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
228 Restore empty string handling.
229
6ad3daba
CC
2302013-05-01 Cary Coutant <ccoutant@google.com>
231
232 * stringpool.cc (Stringpool_template::new_key_offset): Fix
233 uninitialized warning.
234
e31908b6
CC
2352013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
236
237 * output.cc (Output_section::add_merge_input_section): Allow
238 to merge sections if the alignment is more than character size.
239 * merge.h (Output_merge_string::Output_merge_string): Remove
240 assert.
241 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
242 only not-null strings. Check the alignment of strings.
243 * stringpool.h
244 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
245 alignment as the argument.
246 (Stringpool_template<Stringpool_char>::addralign_): New class member.
247 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
248 Align non-zero length strings according to the addralign_.
249 (Stringpool_template<Stringpool_char>::set_string_offsets):
250 Updating offsets according to the given alignment.
251 * testsuite/Makefile.am (text_section_grouping): Test if string
252 literals are getting merged.
253 * testsuite/Makefile.in: Regenerate.
254 * testsuite/merge_string_literals_1.c: New file.
255 * testsuite/merge_string_literals_2.c: Ditto.
256 * testsuite/merge_string_literals.sh: Ditto.
257
0e804863
ILT
2582013-04-26 Ian Lance Taylor <iant@google.com>
259
260 * target-reloc.h (relocate_section): If the reloc offset is out of
261 range, pass VIEW as NULL to relocate.relocate.
262 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
263 * i386.cc (Target_i386::Relocate::relocate): Likewise.
264 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
265 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
266 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
267 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
268
e7c5ea40
CC
2692013-04-26 Geoff Pike <gpike@chromium.org>
270
271 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
272 * layout.cc (Hash_task): New class.
273 (Layout::queue_build_id_tasks): New function.
274 (Layout::write_build_id): Handle single-thread portion of build ID
275 computation. (In some cases, all of it is single-threaded.) Replace
276 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
277 functionality in fewer lines of code.
278 * layout.h (Layout::queue_build_id_tasks): New function declaration.
279 * options.h (General_options): make "--build-id" default to tree
280 rather than sha1. Add two new options related to --build-id=tree:
281 --build-id-chunk-size-for-treehash and
282 --build-id-min-file-size-for-treehash.
283 * Makefile.am: add testing of --build-id=tree and related new options
284 (these tests will be invoked by "make check").
285 * Makefile.in: Regenerate.
286
49926cd0
AM
2872013-04-25 Alan Modra <amodra@gmail.com>
288
289 * configure.tgt: Add powerpcle and powerpc64le.
290
a4034750
AM
2912013-04-22 Alan Modra <amodra@gmail.com>
292
293 PR gold/15355
294 * layout.cc (Layout::segment_precedes): Allow more than one
295 segment with the same type and flags.
296
e79c84aa
CC
2972013-04-15 Cary Coutant <ccoutant@google.com>
298
299 * layout.cc (Layout::set_relocatable_section_offsets): Don't
300 allocate space in file for BSS sections.
301
2199fbe7
CC
3022013-04-15 Cary Coutant <ccoutant@google.com>
303
304 * script-sections.cc (Orphan_output_section): Reset address
305 to zero after each orphaned section for relocatable links.
306
502e8a84
CC
3072013-04-15 Cary Coutant <ccoutant@google.com>
308
a4034750
AM
309 * symtab.cc (Symbol_table::sized_write_globals): Subtract
310 section starting address for relocatable link.
311 * testsuite/Makefile.am (script_test_11): New test.
312 * testsuite/Makefile.in: Regenerate.
313 * testsuite/script_test_11.c: New source file.
314 * testsuite/script_test_11.t: New linker script.
502e8a84 315
0cfdc767
AM
3162013-04-13 Alan Modra <amodra@gmail.com>
317
318 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
319 owner when sections are not adjacent and exceed group size.
320 (Target_powerpc::group_sections): Handle corner case.
321 (Target_powerpc::Branch_info::make_stub): Handle case where
322 stub table doesn't exist due to branches in non-exec sections.
323 (Target_powerpc::Relocate::relocate): Likewise.
324
6830ee24
AM
3252013-04-11 Alan Modra <amodra@gmail.com>
326
327 PR gold/15354
328 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
329 .branch_lt to match bfd ld. Adjust comments throughout file.
330
54a3d865
ILT
3312013-04-04 Ian Lance Taylor <iant@google.com>
332
333 GCC PR c++/56840
334 * object.cc (do_layout_deferred_sections): Handle .eh_frame
335 sections before checking whether they are included in the link.
336
9993ba11
ST
3372013-03-29 Sriraman Tallam <tmsriram@google.com>
338
339 * archive.cc (Archive::get_elf_object_for_member): Create the elf
340 object before calling the plugin claim_file handler. Pass the elf
341 object of the archive to the plugin. Delete the elf object if the
342 plugin claims the file.
343
ebacd51e
AM
3442013-03-21 Alan Modra <amodra@gmail.com>
345
346 * layout.cc (Layout::set_segment_offsets): Accept writable .text
347 segment when omagic.
348
117be58f
AM
3492013-03-21 Alan Modra <amodra@gmail.com>
350
351 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
352 comparison warning.
353 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
354 uninitialized" warning.
355
32e2b61d
AM
3562013-03-20 Alan Modra <amodra@gmail.com>
357
358 * symtab.h (Symbol::clear_version): New function.
359 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
360 is_needed by weak references. Clear version for symbols defined
361 in as-needed objects that are not needed.
362
b3ccdeb5
AM
3632013-03-15 Alan Modra <amodra@gmail.com>
364
365 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
366 static and public. Add report_err param. Return false for data refs.
367 (Target_powerpc::rela_dyn_section): New overloaded function.
368 (Target_powerpc::plt_, iplt_): Elucidate.
369 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
370 (Output_data_plt_powerpc::do_write): Don't write .iplt.
371 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
372 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
373 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
374 push_branch and make_plt_entry for ifunc syms when
375 reloc_needs_plt_for_ifunc.
376 (Target_powerpc::Relocate::relocate): Don't use plt entry value
377 for ifunc unless reloc_needs_plt_for_ifunc.
378
ad3d8a2f
AM
3792013-03-15 Alan Modra <amodra@gmail.com>
380
381 * gc.h (gc_process_relocs): Don't look through function descriptors.
382 * icf.cc (get_section_contents): Do so here instead.
383
4d9aa155
AM
3842013-03-13 Alan Modra <amodra@gmail.com>
385
386 * powerpc.cc (is_branch_reloc): Forward declare.
387 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
388 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
389 false for 64-bit, true for 32-bit non-branch relocs.
390 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
391 * testsuite/Makefile.am (icf_test): Use linker map file instead of
392 nm output.
393 (icf_safe_test): Generate linker map file as well as nm output.
394 (icf_safe_so_test): Likewise.
395 * testsuite/Makefile.in: Regenerate.
396 * testsuite/icf_test.sh: Parse linker map file to determine
397 section folding.
398 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
399 * testsuite/icf_safe_so_test.sh: Likewise.
400 (X86_32_or_ARM_specific_safe_fold): Merge into..
401 (arch_specific_safe_fold): ..this.
402 (X86_64_specific_safe_fold): Delete unused function.
403
57420c20
AM
4042013-03-12 Alan Modra <amodra@gmail.com>
405
406 * gc.h (gc_process_relocs): Look through function descriptors
407 to determine shndx, symvalue and addend used by ICF. Tidy
408 variable duplication.
409
dc3714f3
AM
4102013-03-11 Alan Modra <amodra@gmail.com>
411
412 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
413 * layout.cc (Layout_task_runner::run): ..to here.
414 * symtab.h (struct Symbol_location): Extract from..
415 (class Symbol_table): ..here.
416 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
417 * target.h (class Target): Add function_location and
418 do_function_location functions.
419 (class Sized_target): Add do_function_location.
420 * object.h (class Sized_relobj_file): Move find_shdr..
421 (class Object): ..to here.
422 * object.cc: Likewise. Update to suit. Instantiate.
423 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
424 * powerpc.cc (class Powerpc_dynobj): New.
425 (Target_powerpc::do_function_location): New function.
426 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
427 (Powerpc_dynobj::do_read_symbols): New function.
428 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
429
956b03bb
ILT
4302013-03-08 Ian Lance Taylor <iant@google.com>
431
432 * options.cc (General_options::string_to_object_format): Accept
433 "default".
434
4bead2d5
AM
4352013-03-08 Alan Modra <amodra@gmail.com>
436
437 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
438 pointer to Post_fde.
439 (struct Post_fde): Move definition to here..
440 * ehframe.cc (struct Post_fde): ..from here.
441 (Cie::write): Don't alloc Post_fde.
442 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
443
02e60bf7
AM
4442013-03-07 Alan Modra <amodra@gmail.com>
445
446 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
447 relocation referencing .LC0.
448 * testsuite/discard_locals_test.sh: Remove FIXMEs.
449
8343f03a
AM
4502013-03-07 Alan Modra <amodra@gmail.com>
451
452 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
453 always_inline. Add assembly for powerpc to avoid GOT.
454
3366d57c
AM
4552013-03-07 Alan Modra <amodra@gmail.com>
456
457 * testsuite/script_test_10.sh: Don't test .bss section
458 header number.
459
6c77229c
AM
4602013-03-06 Alan Modra <amodra@gmail.com>
461
462 * powerpc.cc (class Powerpc_relobj): Move some member functions.
463 (Target_powerpc::symval_for_branch): Add symtab param. Update
464 all callers. Handle folded sections.
465 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
466 to Powerpc_relobj.
467 (Global_symbol_visitor_opd::operator()): Likewise.
468
a39e4af6
AM
4692013-03-04 Alan Modra <amodra@gmail.com>
470
471 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
472 * testsuite/Makefile.in: Regenerate.
473
d5834edb
CC
4742013-03-01 Cary Coutant <ccoutant@google.com>
475
476 Add dwp support for v2 DWARF package file format.
477 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
478 tu_length parameter. Adjust all callers.
479 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
480 * dwp.cc: Include dwarf.h.
481 (Section_bounds): New struct type.
482 (Unit_set): New struct type.
483 (Dwo_file::Dwo_file): Initialize new data member.
484 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
485 Combine and rename to...
486 (Dwo_file::read_unit_index): ...this.
487 (Dwo_file::sized_read_compunit_index)
488 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
489 (Dwo_file::sized_read_unit_index): ...this.
490 (Dwo_file::copy_section): Remove section_name, is_str_offsets
491 parameters; add section_id parameter.
492 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
493 (Dwo_file::add_unit_set): ...this.
494 (Dwo_file::shndx_map_): Remove.
495 (Dwo_file::sect_offsets_): New data member.
496 (Dwp_output_file::Dwp_output_file): Initialize new data members.
497 (Dwp_output_file::add_section): Rename to...
498 (Dwp_output_file::add_contribution): ...this.
499 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
500 (Dwp_output_file::add_tu_set): Likewise.
501 (Dwp_output_file::Contribution): New type.
502 (Dwp_output_file::Section::contributions): New data member.
503 (Dwp_output_file::Cu_or_tu_set): Remove.
504 (Dwp_output_file::Section::Section): New ctor.
505 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
506 (Dwp_output_file::Dwp_index::Section_table): New type.
507 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
508 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
509 parameter.
510 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
511 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
512 (Dwp_output_file::Dwp_index::section_table): New member function.
513 (Dwp_output_file::Dwp_index::section_table_end): New member function.
514 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
515 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
516 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
517 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
518 (Dwp_output_file::Dwp_index::section_table_): New data member.
519 (Dwp_output_file::Dwp_index::section_mask_): New data member.
520 (Dwp_output_file::add_output_section): New member function.
521 (Dwp_output_file::write_new_section): New member function.
522 (Dwp_output_file::write_contributions): New member function.
523 (Dwp_output_file::section_id_map_): New data member.
524 (class Dwo_id_info_reader): Remove.
525 (class Unit_reader): New class.
526 (get_dwarf_section_name): New function.
527 (Dwo_file::read_executable): Adjust initializations of class data.
528 (Dwo_file::read): Add support for v2 package file format.
529 (Dwo_file::read_unit_index): Likewise.
530 (Dwo_file::sized_read_unit_index): Likewise.
531 (Dwo_file::copy_section): Likewise.
532 (Dwo_file::add_unit_set): Likewise.
533 (Dwp_output_file::add_output_section): Likewise.
534 (Dwp_output_file::add_contribution): Likewise.
535 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
536 for empty slot.
537 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
538 file format.
539 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
540 slot.
541 (Dwp_output_file::initialize): Remove unused function.
542 (Dwp_output_file::finalize): Add support for v2 package file format.
543 (Dwp_output_file::write_index): Likewise.
544 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
545 function prototype.
546
a68a081d
CC
5472013-03-01 Cary Coutant <ccoutant@google.com>
548
549 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
550 function into class definition in header file.
551 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
552 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
553 New function.
554 (Dwarf_info_reader::check_buffer): Move here from .cc file.
555
9d5781f8
AM
5562013-02-28 Alan Modra <amodra@gmail.com>
557
558 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
559 * target.cc (Target::do_plt_fde_location): New function.
560 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
561 accessor function, and constructor param.
562 (struct Post_fde, Post_fdes): Declare.
563 (Cie::write): Add post_fdes param.
564 * ehframe.cc (Fde::write): Use plt_fde_location.
565 (struct Post_fde): Define.
566 (Cie::write): Stash FDEs added post merge mapping.
567 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
568 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
569 (Eh_frame::do_sized_write): Arrange to write post map FDES after
570 other FDEs.
571 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
572 (Target_powerpc::has_glink): New function.
573 (Target_powerpc::do_relax): Add eh_frame info for stubs.
574 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
575 glink_eh_frame_fde_32, default_fde): New data.
576 (Stub_table::eh_frame_added_): New var.
577 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
578 Make const.
579 (Stub_table::add_eh_frame): New function.
580 (Output_data_glink::add_eh_frame): New function.
581 (Target_powerpc::make_glink_section): Call add_eh_frame.
582
214383dd
ILT
5832013-02-15 Ian Lance Taylor <iant@google.com>
584
585 * options.h (DEFINE_uint64_alias): Define.
586 (class General_options): Add -Ttext-segment as an alias for
587 -Ttext.
588
91c2b899
AM
5892013-02-15 Alan Modra <amodra@gmail.com>
590
591 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
592 (Stub_table::do_write): ..here, two places.
593 (Stub_table::plt_call_size): Use it here too.
594
20e2a8aa
ILT
5952013-02-11 Ian Lance Taylor <iant@google.com>
596
597 * descriptors.cc (Descriptors::close_all): New function.
598 * descriptors.h (class Descriptors): Declare close_all.
599 (close_all_descriptors): New inline function.
600 * plugin.cc: Include "descriptors.h".
601 (Plugin_manager::cleanup): Call close_all_descriptors.
602
8952bc69
AM
6032013-02-06 Alan Modra <amodra@gmail.com>
604
605 * README: Update coding style link.
606
29bd8b6b
CC
6072013-01-28 Cary Coutant <ccoutant@google.com>
608
a4034750
AM
609 * dwp.cc (File_list): New typedef.
610 (Dwo_name_info_reader): New class.
611 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
612 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
613 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
614 (Dwo_file::read_executable): New function.
615 (Dwo_file::read): Move common setup code to ...
616 (Dwo_file::make_object): ... here.
617 (dwp_options): Add --exec/-e.
618 (usage): Likewise.
619 (main): Likewise.
29bd8b6b 620
c6ac678d
ST
6212013-01-24 Sriraman Tallam <tmsriram@google.com>
622
623 * layout.cc (Layout::layout): Check for option text_reorder.
624 (Layout::make_output_section): Ditto.
625 * options.h (text_reorder): New option.
626 * output.cc (Input_section_sort_compare): Remove special ordering
627 of section names.
628 (Output_section::
629 Input_section_sort_section_name_special_ordering_compare::
630 operator()): New function.
631 (Output_section::sort_attached_input_sections): Use new sort function
632 for .text.
633 * output.h (Input_section_sort_section_name_special_ordering_compare):
634 New struct.
635 * testsuite/Makefile.am (text_section_grouping): Test option
636 --no-text-reorder
637 * testsuite/Makefile.in: Regenerate.
638 * testsuite/text_section_grouping.sh: Check order of functions without
639 default text reordering.
640
50701cc1
MF
6412013-01-18 Mike Frysinger <vapier@gentoo.org>
642
643 * options.h (General_options): Change default to true for new_dtags.
644
b1b00fcc
MF
6452013-01-18 Mike Frysinger <vapier@gentoo.org>
646
647 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
648 when enable_new_dtags is false. Only add DT_RUNPATH when
649 enable_new_dtags is true.
650
ec5b8187
AM
6512013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
652
653 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
654 used in declaration and definition consistent.
655 (Target_powerpc::symval_for_branch): Ditto.
656
a880d4c4
ST
6572013-01-16 Sriraman Tallam <tmsriram@google.com>
658
659 * testsuite/plugin_final_layout.cc: Fix comment.
660
7c381248
ST
6612013-01-16 Sriraman Tallam <tmsriram@google.com>
662
663 * layout.cc (Layout::layout): Do not do default sorting for
664 text sections when section ordering is specified.
665 (make_output_section): Ditto.
666 * testsuite/plugin_final_layout.cc: Name the function sections
667 to catch reordering issues.
668
e2458743
AM
6692013-01-15 Alan Modra <amodra@gmail.com>
670
671 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
672 plt-thread-safe.
673
431ed302
AM
6742013-01-15 Alan Modra <amodra@gmail.com>
675
676 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
677 * testsuite/Makefile.in: Regenerate.
678
0ec6429b
AM
6792013-01-14 Alan Modra <amodra@gmail.com>
680
681 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
682 * testsuite/Makefile.in: Regenerate.
683
0bf402d5
ILT
6842013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
685
36af3926 686 PR bfd/14430
0bf402d5
ILT
687 Fix mingw gold build with plugins enabled
688 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
689 * configure.ac: Export DLOPEN_LIBS and add headers check.
690 * plugin.cc: Handle non-dlfcn case.
691 * Makefile.in: Regenerate.
692 * config.in: Regenerate.
693 * configure: Regenerate.
694 * testsuite/Makefile.in: Regenerate.
695
9e9143bc
ST
6962013-01-09 Sriraman Tallam <tmsriram@google.com>
697
698 * output.h (sort_attached_input_sections): Change to be public.
699 * script-sections.cc
700 (Output_section_definition::set_section_addresses): Sort
701 attached input sections according to section order before linker
702 script assigns section addresses.
703 (Orphan_output_section::set_section_addresses): Sort
704 attached input sections according to section order before linker
705 script assigns section addresses.
706 * Makefile.am (final_layout.sh): Use a simple linker script to
707 check if section ordering still works.
708 * Makefile.in: Regenerate.
709
679af368
ILT
7102013-01-09 Ben Cheng <bccheng@google.com>
711
712 * arm.cc (Target_arm::attributes_accept_div): New function.
713 (Target_arm::attributes_forbid_div): New function.
714 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
715 attribute using the same new functions as what bfd/elf32_arm.c
716 does.
717
3136a00e
CC
7182013-01-07 Cary Coutant <ccoutant@google.com>
719
720 PR gold/14993
721 * output.cc (Output_section::add_input_section): For incremental
722 updates, don't track input sections that are allocated from patch
723 space.
724
f2a6224b
L
7252013-01-07 H.J. Lu <hongjiu.lu@intel.com>
726 Ian Lance Taylor <iant@google.com>
727
728 PR gold/14897
729 * configure.ac (--enable-ld): Removed.
730 (install_as_default): Set to yes only for --enable-gold=default
731 or --disable-ld.
732 * configure: Regenerated.
733
4f46f626
L
7342013-01-07 H.J. Lu <hongjiu.lu@intel.com>
735
736 * options.h (General_options): Add -fuse-ld= for GCC linker
737 option compatibility.
738
26e4ef59
CC
7392013-01-04 Cary Coutant <ccoutant@google.com>
740
741 * configure.ac: Fix typo restoring CXXFLAGS.
742 * configure: Regenerate.
743
3d587466
CC
7442013-01-04 Cary Coutant <ccoutant@google.com>
745
4f46f626
L
746 * testsuite/Makefile.am (CXXLINK_S): New macro.
747 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
748 * testsuite/Makefile.in: Regenerate.
3d587466 749
44db6695
L
7502013-01-02 H.J. Lu <hongjiu.lu@intel.com>
751
752 * version.cc (print_version): Update copyright year to 2013.
753
edcac0c1
ILT
7542012-12-20 Ian Lance Taylor <iant@google.com>
755
756 * layout.cc (Layout::special_ordering_of_input_section): New
757 function.
758 (Layout::layout): If input section requires special ordering, must
759 sort input sections.
760 (Layout::make_output_section): May sort .text input sections.
761 (Layout::is_section_name_prefix_grouped): Remove.
762 * layout.h (class Layout): Declare
763 special_ordering_of_input_section. Don't declare
764 is_section_name_prefix_grouped.
765 * output.cc (Output_section::add_input_section): Revert last
766 change.
767 (Output_section::Input_section_sort::match_file_name): Don't crash
768 if called on output section data.
769 (Output_section::Input_section_sort_compare): Sort based on
770 special ordering.
771 (Output_section::Input_section_sort_section_order_index_compare):
772 Revert last patch.
773 (Output_section::sort_attached_input_sections): Likewise.
774
28f2a4ac
ST
7752012-12-18 Sriraman Tallam <tmsriram@google.com>
776
edcac0c1 777 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
778 * layout.h (Layout::is_section_name_prefix_grouped): New function.
779 * output.cc (Output_section::add_input_section): Check if section
780 name contains special prefix. Keep input sections to sort such
781 sections.
782 (Output_section::Input_section_sort_section_order_index_compare
783 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
784 (Output_section::sort_attached_input_sections): Add condition to
785 Input_section_entry constructor call.
28f2a4ac
ST
786 * testsuite/Makefile.am (text_section_grouping): New test.
787 * testsuite/Makefile.in: Regenerate.
788 * testsuite/text_section_grouping.cc: New file.
789 * testsuite/text_section_grouping.sh: New file.
790
5bf135a7
NC
7912012-12-17 Nick Clifton <nickc@redhat.com>
792
793 * Makefile.am: Add copyright notice.
794 * NEWS: Likewise.
795 * README: Likewise.
796 * configure.ac: Likewise.
797 * ftruncate.c: Likewise.
798 * Makefile.in: Regenerate.
799
59965708
CC
8002012-12-14 Cary Coutant <ccoutant@google.com>
801
a4034750
AM
802 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
803 --no-as-needed flag.
804 (exception_separate_shared_12_test): Likewise.
805 (incremental_copy_test): Likewise.
806 * testsuite/Makefile.in: Regenerate.
59965708 807
2a77e2ab
CC
8082012-12-14 Cary Coutant <ccoutant@google.com>
809
810 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
811 (Dwp_output_file::Dwp_index::enter_set): Add assert.
812
e3deeb9c
AM
8132012-12-12 Alan Modra <amodra@gmail.com>
814
815 * powerpc.cc (class Track_tls): New.
816 (class Relocate, class Scan): Inherit Track_tls.
817 (Target_powerpc::Scan::local, global): Track tls optimization
818 and avoid creating plt entry for __tls_get_addr if all uses
819 are optimized away.
820 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
821
d8f5a274
AM
8222012-12-12 Alan Modra <amodra@gmail.com>
823
824 * options.h (General_options): Add --toc-sort/--no-toc-sort.
825 Replace no_toc_optimize with toc_optimize.
826 * output.h (Output_section::input_sections): Provide non-const variant.
827 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
828 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
829 accessors.
830 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
831 (class Sort_toc_sections): New.
832 (Target_powerpc::do_finalize_sections): Sort toc sections.
833 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
834
4c8a1de1
RM
8352012-12-10 Roland McGrath <mcgrathr@google.com>
836
837 * testsuite/binary_unittest.cc (read_all): New function.
838 (Sized_binary_test): Use it instead of ::read.
839 * fileread.cc (do_read): Don't assume pread always reads the whole
840 amount in a single call.
841
edc27beb
AM
8422012-12-10 Alan Modra <amodra@gmail.com>
843
844 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
845 Set EM_PPC64 or EM_PPC here.
846 (Target_selector_powerpc::do_recognize): Delete.
847
906b9150
AM
8482012-12-10 Alan Modra <amodra@gmail.com>
849
850 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
851 stub_table_.
852 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
853
418c15ae
RM
8542012-12-07 Roland McGrath <mcgrathr@google.com>
855
856 * testsuite/binary_unittest.cc (Sized_binary_test):
857 Use open_descriptor rather than ::open.
858
decdd3bc
AM
8592012-12-07 Alan Modra <amodra@gmail.com>
860
861 * powerpc.cc (Stub_table::do_write): Delete redundant Address
862 typedef and invalid_address constant.
863 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
864 instantiate constants.
865
db399005
ILT
8662012-12-06 Roland McGrath <mcgrathr@google.com>
867
868 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
869 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
870 * aclocal.m4: Regenerate.
871 * configure: Regenerate.
872 * Makefile.in: Regenerate.
873 * testsuite/Makefile.in: Regenerate.
874
aba6bc71
AM
8752012-12-07 Alan Modra <amodra@gmail.com>
876
877 * options.h (General_options): Add no_toc_optimize.
878 * powerpc.cc (ok_lo_toc_insn): New function.
879 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
880
9e69ed50
AM
8812012-12-06 Alan Modra <amodra@gmail.com>
882
883 * options.h (General_options): Add plt_align, plt_static_chain,
884 plt_thread_safe. Update stub_group_size help text.
885 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
886 for new plt_thread_safe_ var.
887 (use_plt_offset): Correct comments.
888 (Target_powerpc::do_relax): Look for thread creation symbols to
889 determine default plt_thread_safe value. Clear plt call stubs
890 as well as branch stubs each iteration.
891 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
892 insn constants.
893 (l, hi, ha, write_insn): Move earlier.
894 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
895 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
896 plt stubs too.
897 (Stub_table::update_size): Adjust.
898 (Stub_table::prev_size, set_prev_size): Delete.
899 (Stub_table::stub_align): Let --plt-align affect result.
900 (Stub_table::plt_call_size): Calculate sizes for various stubs.
901 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
902 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
903 (Stub_table::do_write): Support more stub variants.
904
f43ba157
AM
9052012-12-04 Alan Modra <amodra@gmail.com>
906
907 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
908 (Target_powerpc::do_define_standard_symbols): New function.
909
34171bc5
AM
9102012-12-03 Alan Modra <amodra@gmail.com>
911
912 * output.h: Formatting, whitespace.
913
dc9589e9 9142012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
915
916 * layout.h (Layout::get_executable_sections): Declare.
917 * layout.cc (Layout::get_executable_sections): New function.
918 * arm.cc (Target_arm::group_sections): Use it.
919 (Arm_output_section::group_sections): Delete now redundant test.
920 * output.cc (Output_reloc::Output_reloc): Add is_relative.
921 param to handle relative relocs.
922 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
923 (Output_data_reloc::add_absolute): Adjust.
924 (Output_data_reloc::add_relative): New function.
925 (Output_data::reset_data_size): New function.
926 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
927 (Output_section::set_addralign): New function.
928 (Output_section::checkpoint_set_addralign): New function.
929 (Output_section::clear_section_offsets_need_adjustment): New function.
930 (Output_section::input_sections): Make public.
931 * powerpc.cc (class Output_data_brlt_powerpc): New.
932 (class Stub_table, class Stub_control): New.
933 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
934 stub_table_, set_stub_table, stub_table): New vectors and accessor
935 functions.
936 (Target_powerpc::do_may_relax, do_relax, push_branch,
937 new_stub_table, stub_tables, brlt_section, group_sections,
938 add_branch_lookup_table, find_branch_lookup_table,
939 write_branch_lookup_table, make_brlt_section): New functions.
940 (Target_powerpc::struct Sort_sections, class Branch_info): New.
941 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
942 branch_info_): New vars.
943 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
944 make call stubs here.
945 (Output_data_glink): Remove all call stub handling from this class.
946 (Target_powerpc::Scan::local, global): Save interesting branch
947 relocs and relocs for ifunc. Adjust calls to plt entry functions.
948 (Target_powerpc::do_finalize_sections): Only make reg save/restore
949 functions on final link.
950 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
951 Handle long branch destinations too.
952 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
953 do_plt_address_for_local): Adjust lookup of plt call stubs.
954
627b30b7
AM
9552012-11-30 Alan Modra <amodra@gmail.com>
956
957 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
958 relocs against protected symbols when building 32-bit shared libs.
959
40b469d7
AM
9602012-11-30 Alan Modra <amodra@gmail.com>
961
962 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
963 param. Call got_section() to make .got. Update all callers
964 and their callers and so on.
965
bb66a627
AM
9662012-11-30 Alan Modra <amodra@gmail.com>
967
968 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
969 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
970 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
971 value if it already exists.
972
d2cf1c6c
L
9732012-11-19 H.J. Lu <hongjiu.lu@intel.com>
974
975 PR gold/14858
976 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
977
edccdf7c
RM
9782012-11-14 Roland McGrath <mcgrathr@google.com>
979
980 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
981 than bfc instruction for data sandboxing.
982
6febeb74
AM
9832012-11-08 Alan Modra <amodra@gmail.com>
984
985 * po/POTFILES.in: Regenerate.
986
0a6f1bf2
AM
9872012-11-05 Alan Modra <amodra@gmail.com>
988
989 * configure.ac: Apply 2012-09-10 change to config.in here.
990 * configure: Regenerate.
991
26a4e9cb
AM
9922012-11-05 Alan Modra <amodra@gmail.com>
993
994 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
995 (struct Opd_ent): Use "Address" rather than "Offset".
996 (Output_data_got_powerpc::got_base_offset): Return Valtype.
997 (Target_powerpc::got_section): Make public.
998 (Target_powerpc::scan_relocs): Move code setting symbols..
999 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1000 Create _SDA_BASE_ only when referenced.
1001
cc928013
RM
10022012-11-02 Roland McGrath <mcgrathr@google.com>
1003
1004 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1005 from last change.
1006
50ed5eb1
RM
10072012-11-01 Roland McGrath <mcgrathr@google.com>
1008
62fe925a
RM
1009 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1010 for offset_in_output_section parameter.
1011 (Sized_target::relocate_special_relocatable): Likewise.
1012 * arm.cc (Target_arm::relocate_relocs): Likewise.
1013 (Target_arm::relocate_special_relocatable): Likewise.
1014 * i386.cc (Target_i386::relocate_relocs): Likewise.
1015 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1016 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1017 * target-reloc.h (relocate_relocs): Likewise.
1018 * testsuite/testfile.cc (Target_test): Likewise.
1019 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1020 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1021
1022 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1023 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1024
1025 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1026 parameter, which is unused in the [!F_SETFD] case.
1027
50ed5eb1
RM
1028 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1029 SYMNDX to off_t before comparing it to this->data_size().
1030 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1031 * incremental.cc (Output_section_incremental_inputs::do_write):
1032 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1033
2cadc0bf
RM
1034 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1035
3bfcb652
NC
10362012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1037
1038 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1039 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1040 in EABI_VER5.
1041
c1a8d56e
CC
10422012-10-29 Cary Coutant <ccoutant@google.com>
1043
1044 * dwp.cc (usage): Add file and exit status parameters;
1045 add --help and --version options.
1046 (print_version): New function.
1047 (main): Add --help and --version options.
1048
b2490a7b
L
10492012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1050
1051 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1052 final_layout_sequence.txt.
1053 * testsuite/Makefile.in: Regenerated.
1054
aa543512
L
10552012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1056
1057 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1058 COMPILE generated by automake.
1059 (LINK1): Likewise.
1060 (CXXCOMPILE1): Likewise.
1061 (CXXLINK1): Likewise.
1062 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1063 (LINK): Likewise.
1064 (CXXCOMPILE): Likewise.
1065 (CXXLINK): Likewise.
1066 * testsuite/Makefile.in: Regenerated.
1067
d361fafb
L
10682012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1069
1070 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1071 on bad fwrite return.
1072
598c7410
L
10732012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1074
1075 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1076 on val.
1077
35c813e2
CC
10782012-10-23 Cary Coutant <ccoutant@google.com>
1079
1080 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1081 * testsuite/Makefile.in: Regenerate.
1082 * testsuite/dwp_test.h: New source file.
1083 * testsuite/dwp_test_1.cc: New source file.
1084 * testsuite/dwp_test_1.s: New source file.
1085 * testsuite/dwp_test_1.sh: New source file.
1086 * testsuite/dwp_test_1b.cc: New source file.
1087 * testsuite/dwp_test_1b.s: New source file.
1088 * testsuite/dwp_test_2.cc: New source file.
1089 * testsuite/dwp_test_2.s: New source file.
1090 * testsuite/dwp_test_2.sh: New source file.
1091 * testsuite/dwp_test_main.cc: New source file.
1092 * testsuite/dwp_test_main.s: New source file.
1093
77429909
CC
10942012-10-23 Cary Coutant <ccoutant@google.com>
1095
1096 * dwp.h: New header file.
1097 * dwp.cc: New source file.
1098 * gold.h: Move shared declarations to system.h.
1099 * system.h: New header file.
1100 * Makefile.am: Add dwp.
1101 * Makefile.in: Regenerate.
1102
ed5d6712
CC
11032012-10-23 Cary Coutant <ccoutant@google.com>
1104
1105 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1106 Dwarf_info_reader::read_from_pointer.
1107 (Dwarf_pubnames_table::read_header): Likewise.
1108 (Dwarf_pubnames_table::next_name): Likewise.
1109 (Dwarf_die::read_attributes): Likewise.
1110 (Dwarf_die::skip_attributes): Likewise.
1111 (Dwarf_info_reader::read_from_pointer): New function template.
1112 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1113 (Dwarf_pubnames_table): Likewise.
1114 (Dwarf_info_reader::read_from_pointer): New function template.
1115 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1116 Dwarf_pubnames_table ctor.
1117
8787852d
CC
11182012-10-23 Cary Coutant <ccoutant@google.com>
1119
1120 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1121 abbrev_shndx.
1122 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1123 abbrev_shndx_.
1124 (Dwarf_info_reader::set_abbrev_shndx): New method.
1125 (Dwarf_info_reader::abbrev_shndx_): New data member.
1126
9fc236f3
CC
11272012-10-23 Cary Coutant <ccoutant@google.com>
1128
1129 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1130 from object, not parameters.
1131 (Dwarf_info_reader::parse): Likewise.
1132 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1133 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1134 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1135 methods.
1136
effe8365
CC
11372012-10-23 Cary Coutant <ccoutant@google.com>
1138
1139 * fileread.cc (Input_file::Input_file): New constructor.
1140 * fileread.h (class Input_file): Add new constructor.
1141
1698990d
AM
11422012-10-18 Alan Modra <amodra@gmail.com>
1143
1144 PR gold/14727
1145 * object.cc (Relobj::is_section_name_included): Also match
1146 .sdata personality section.
1147
168a4726
AM
11482012-10-18 Alan Modra <amodra@gmail.com>
1149
1150 * target-reloc.h (class Default_comdat_behavior): New, package up..
1151 (get_comdat_behaviour): ..this.
1152 (relocate_section): Add Relocate_comdat_behavior template arg,
1153 adjust code to suit.
1154 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1155 (Target_arm::scan_reloc_section): Likewise.
1156 * i386.cc (Target_i386::relocate_section): Likewise.
1157 * sparc.cc (Target_sparc::relocate_section): Likewise.
1158 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1159 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1160 * powerpc.cc (class Relocate_comdat_behavior): New.
1161 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1162 gold::relocate_section with new template arg.
1163
acc276d8
AM
11642012-10-18 Alan Modra <amodra@gmail.com>
1165
1166 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1167 dynamic relocs for GOT_TPREL got entries, without symbol if
1168 resolving locally.
1169 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1170 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1171 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1172
e10f9870
AM
11732012-10-17 Alan Modra <amodra@gmail.com>
1174
1175 PR gold/14726
1176 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1177
ae034989
ST
11782012-10-16 Sriraman Tallam <tmsriram@google.com>
1179
1180 * layout.cc (Layout::include_section): Keep sections marked
1181 SHF_EXCLUDE when doing relocatable links.
1182
f3a0ed29
AM
11832012-10-16 Alan Modra <amodra@gmail.com>
1184
1185 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1186 (Target_powerpc::do_finalize_sections): Call it.
1187 (Output_data_save_res): New class and supporting functions.
1188 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1189 normal symbols defined in object files.
1190
c6de8ed4
AM
11912012-10-12 Alan Modra <amodra@gmail.com>
1192
1193 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1194 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1195 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1196 section if scan_opd_relocs not yet called.
1197 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1198
03e25981
AM
11992012-10-12 Alan Modra <amodra@gmail.com>
1200
1201 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1202 add_local_ifunc_entry): Revert last change.
1203 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1204
c9824451
AM
12052012-10-05 Alan Modra <amodra@gmail.com>
1206
1207 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1208 do_plt_address_for_global): New functions.
1209 (Output_data_got_powerpc::do_write): Don't segfault when linking
1210 statically.
1211 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1212 add_local_ifunc_entry): Return true on adding entry..
1213 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1214 glink->add_entry call. Remove unused symtab param. Adjust calls.
1215 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1216 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1217 set up symbols here.
1218 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1219 syms here. Do so even when no .iplt. Don't segfault when linking
1220 statically.
1221 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1222 new variants without reloc param.
1223 (Glink_sym_ent::Glink_sym_ent): Likewise.
1224 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1225 reloc when refs will resolve to plt call stub.
1226 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1227 R_PPC_PLTREL24 to resolve locally.
1228 (Target_powerpc::Scan::global): Correct ifunc handling.
1229 (Target_powerpc::Relocate::relocate): Correct local sym glink
1230 lookup. Don't destroy "value" when we have a plt call stub,
1231 and when checking plt call validity.
1232 (Target_powerpc::do_dynsym_value): Simplify.
1233
19fec8c1
AM
12342012-10-05 Alan Modra <amodra@gmail.com>
1235
1236 * i386.cc (Output_data_plt_i386::address_for_global,
1237 address_for_local): Add plt offset to returned value. Adjust uses.
1238 * sparc.cc (Output_data_plt_sparc::address_for_global,
1239 address_for_local): Likewise.
1240 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1241 address_for_local): Likewise.
1242 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1243 address_for_local): Likewise.
1244 * target.h (Target::plt_address_for_global, plt_address_for_local):
1245 Update comment.
1246 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1247 (Output_data_got::Got_entry::write): Nor here.
1248 * output.h: Comment fix.
1249
e867b647
WL
12502012-10-02 Jiong Wang <jiwang@tilera.com>
1251
1252 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1253 global_offset_table_ value for larget got.
1254 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1255
e5d5f5ed
AM
12562012-09-29 Alan Modra <amodra@gmail.com>
1257
1258 * powerpc.cc (Target_powerpc::iplt_): New output section.
1259 (Target_powerpc::iplt_section, make_iplt_section,
1260 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1261 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1262 Target_powerpc::plt_entry_count): Count iplt entries too.
1263 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1264 reloc section in constructor. New params.
1265 (Target_powerpc::make_plt_section): Create reloc section here instead.
1266 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1267 functions.
1268 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1269 (Output_data_glink::add_entry, find_entry): New functions to
1270 deal with local syms.
1271 (Glink_sym_ent): Add support for local syms.
1272 (Output_data_glink::do_write): Handle ifunc plt entries.
1273 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1274 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1275 (Target_powerpc::Relocate::relocate): Likewise.
1276 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1277
ec4dbad3
AM
12782012-09-25 Alan Modra <amodra@gmail.com>
1279
1280 * object.h (Sized_relobj_file::adjust_local_symbol,
1281 do_adjust_local_symbol): New functions.
1282 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1283 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1284 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1285 and irregular opd entry spacing.
1286 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1287 (Global_symbol_visitor_opd): New functor.
1288 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1289 on deleted opd entries.
1290
5c0b3823
WL
12912012-09-15 Jiong Wang <jiwang@tilera.com>
1292
1293 * tilegx.cc: New file.
1294 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1295 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1296 * configure.tgt: Add entries for tilegx*.
1297 * configure.ac: Likewise.
1298 * Makefile.in: Rebuild.
1299 * configure: Likewise.
1300 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1301 tilegx.
1302
bfdfa4cd
AM
13032012-09-13 Alan Modra <amodra@gmail.com>
1304
1305 * target-reloc.h (scan_relocs): Call scan.local for relocs
1306 against symbols in discarded sections. Pass is_discarded
1307 param.
1308 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1309 Add is_discarded param.
1310 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1311 is_discarded to flag opd entry as discarded. Don't emit dyn
1312 relocs on such entries.
1313 (Target_powerpc::Scan::global): Similarly detect and handle
1314 such opd entries.
1315 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1316 opd_ent_. Update all uses.
1317 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1318 (Target_powerpc::relocate_section): Zero out discarded opd
1319 entry relocs.
1320
d77a0555
ILT
13212012-09-12 Ian Lance Taylor <iant@google.com>
1322
1323 PR gold/14570
1324 * output.cc: Rename Output_data_got template parameter from size
1325 to got_size for all functions. Compile all variants of
1326 Output_data_got.
1327 (Output_data_got::Got_entry::write): Correct use of size for
1328 symbol value. Use local_is_tls rather than casting to
1329 Sized_relobj_file.
1330 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1331 (class Sized_relobj_file): Add do_local_is_tls.
1332 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1333
815a1205
AM
13342012-09-11 Alan Modra <amodra@gmail.com>
1335
1336 PR gold/14566
1337 * layout.cc (Layout::set_segment_offsets): When using
1338 common-page-size alignment, ensure we are on a new max-page-size
1339 page.
1340 * output.cc (Output_segment::set_section_addresses): Use
1341 abi_pagesize, not common_pagesize for relro boundary.
1342 (Output_segment::set_offset): Likewise.
1343
bd73a62d
AM
13442012-09-11 Alan Modra <amodra@gmail.com>
1345
1346 * output.h (Output_data_got::add_global_tls, add_local_tls,
1347 add_local_tls_pair): New functions.
1348 (Output_data_got::add_local_pair_with_rel): Remove second
1349 reloc param. Expand comment.
1350 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1351 use_plt_or_tls_offset_, similarly for constructor param.
1352 (Output_data_got::Got_entry::write): Add got_index param.
1353 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1354 add_local_tls_pair): New functions.
1355 (Output_data_got::Got_entry::write): Handle tls symbols
1356 with use_plt_or_tls_offset_ set specially.
1357 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1358 (Output_data_got::do_write): Replace iterator with index, pass
1359 index to entry write function.
1360 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1361 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1362 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1363 call.
1364 * i386.cc (Target_i386::Scan::local): Likewise.
1365 * sparc.cc (Target_sparc::Scan::local): Likewise.
1366 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1367 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1368 do_tls_offset_for_global): New functions.
1369 (Target_powerpc::Scan::local): Correct TLS relocations and got
1370 entry values.
1371 (Target_powerpc::Scan::global): Don't emit unnecessary
1372 dynamic relocations on TLS GOT entries.
1373
00716ab1
AM
13742012-09-10 Matthias Klose <doko@ubuntu.com>
1375
1376 * config.in: Disable sanity check for kfreebsd.
1377
c891b3f9
SA
13782012-09-10 Sterling Augustine <saugustine@google.com>
1379
1380 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1381 (Gdb_index::pubtypes_read): New parameter.
1382 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1383 to calls.
1384 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1385 pubtypes_object_.
1386
e81fea4d
AM
13872012-09-09 Alan Modra <amodra@gmail.com>
1388
1389 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1390 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1391 * gc.h (gc_process_relocs): Call target gc_add_reference.
1392 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1393 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1394 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1395 unnecessary cast.
1396 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1397 to cater for when we don't need code offset. Update use.
1398 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1399 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1400 set_opd_valid): New functions.
1401 (Target_powerpc::do_gc_add_reference): New function.
1402 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1403 stashed refs.
1404 (Target_powerpc::do_gc_mark_symbol): New function.
1405
d2d60eef
CC
14062012-09-06 Cary Coutant <ccoutant@google.com>
1407
1408 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1409 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1410 (Dwarf_die::skip_attributes): Likewise.
1411 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1412 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1413 (main): Call it.
1414 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1415
32ed4573
L
14162012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1417
1418 * testsuite/script_test_3.t: Add .got.plt output section
1419 statement.
1420 * testsuite/script_test_4.t: Likewise.
1421
f4baf0d4
AM
14222012-09-05 Alan Modra <amodra@gmail.com>
1423
1424 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1425 update all uses and lose "enum" when using type.
1426
864a1b56
AM
14272012-09-05 Alan Modra <amodra@gmail.com>
1428
1429 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1430 * configure: Regenerate.
1431 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1432 (plugin_final_layout.stdout): Likewise.
1433 (memory_test): Set page sizes to 0x1000.
1434 * testsuite/Makefile.in: Regenerate.
1435 * testsuite/discard_locals_test.sh: Add FIXME comment.
1436 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1437 * testsuite/pr14265.t: Add .got output section statement.
1438 * testsuite/script_test_2.t: Likewise.
1439 * testsuite/script_test_3.t: Likewise.
1440 * testsuite/script_test_4.t: Likewise.
1441 * testsuite/script_test_5.t: Likewise.
1442 * testsuite/script_test_6.t: Likewise.
1443 * testsuite/script_test_7.t: Likewise.
1444 * testsuite/script_test_9.t: Likewise.
1445
3ea0a085
AM
14462012-09-05 Alan Modra <amodra@gmail.com>
1447
1448 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1449 (Powerpc_relocate_functions::Status): New typedef.
1450 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1451 (Target_powerpc::Scan::local): Handle REL64.
1452 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1453 for REL32 and REL64.
1454 (Target_powerpc::symval_for_branch): New function, extracted from..
1455 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1456 checks. Report overflow errors.
1457
7404fe1b
AM
14582012-09-05 Alan Modra <amodra@gmail.com>
1459
1460 * object.h (Sized_relobj_file::emit_relocs): Delete.
1461 (Sized_relobj_file::emit_relocs_reltype): Delete.
1462 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1463 relocate_relocs for --emit-relocs.
1464 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1465 * output.h: Update comment.
1466 (Output_segment::first_section): New function.
1467 (Output_segment::first_section_load_address): Use first_section.
1468 * output.cc (Output_segment::first_section): New function extracted..
1469 (Output_segment::first_section_load_address): ..from here. Delete.
1470 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1471 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1472 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1473 adjust call to target.h function.
1474 * i386.cc (Target_i386): Likewise.
1475 * sparc.cc (Target_sparc): Likewise.
1476 * x86_64.cc (Target_x86_64): Likewise.
1477 * powerpc.cc (Target_powerpc): Likewise.
1478 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1479 first tls section has section symbol for optimised local dynamic
1480 output relocs.
1481 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1482 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1483 optimised tls code.
1484 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1485 Rename to relocate_relocs. Update error message.
1486
957564c9
AS
14872012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1488
1489 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1490 --just-symbols.
1491
dd93cd0a
AM
14922012-08-31 Alan Modra <amodra@gmail.com>
1493
1494 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1495 (Powerpc_relobj::toc_base_offset): New stub function.
1496 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1497 got_mod_index_offset to tlsld_got_offset. Update all refs.
1498 (Target_powerpc::Relocate::enum skip_tls): New.
1499 (Target_powerpc::call_tls_get_addr_): New var.
1500 (Target_powerpc::is_branch_reloc): Move to file scope.
1501 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1502 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1503 New functions.
1504 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1505 (powerpc_info): Correct common_pagesize for ppc64.
1506 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1507 (Powerpc_relocate_functions): Add overflow check enums and functions.
1508 Add non-shift version of rela, rela_ua. Delete all rel public
1509 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1510 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1511 addr16_ha3, addr14 functions.
1512 (Output_data_got_powerpc::add_constant_pair): New function.
1513 (Output_data_got_powerpc::got_base_offset): Likewise.
1514 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1515 (instruction constants): Sort, add some more.
1516 (Output_data_glink::do_write): Add and use Address typedef. Use
1517 object->toc_base_offset() stub for 64-bit.
1518 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1519 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1520 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1521 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1522 Always treat .opd relocs as against locally defined symbol.
1523 Correct condition for RELATIVE relocs.
1524 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1525 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1526 for 32-bit syms with a plt entry. Correct ppc64 toc base
1527 calculations. Handle TLS relocs, and more. Add overflow
1528 checking and adjust for Powerpc_relocate_functions changes.
1529 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1530 Reinstate --emit-relocs code with FIXME.
1531
a1373b60
AM
15322012-08-30 Alan Modra <amodra@gmail.com>
1533
1534 * layout.cc (Layout::set_segment_offsets): Set p_align to
1535 abi_pagesize, not common_pagesize.
1536 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1537 to determine whether file header can go in segment.
1538
703d02da
AM
15392012-08-30 Alan Modra <amodra@gmail.com>
1540
1541 * output.h (Output_reloc::Output_reloc <output section>): Add
1542 is_relative param. Adjust calls.
1543 (Output_reloc::add_output_section_relative): New functions.
1544 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1545 is_relative.
1546 (Output_reloc::symbol_value): Handle SECTION_CODE.
1547
16164a6b
ST
15482012-08-24 Sriraman Tallam <tmsriram@google.com>
1549
1550 * gold.cc (queue_middle_tasks): Call layout again when unique
1551 segments for sections is desired.
1552 * layout.cc (Layout::Layout): Initialize new members.
1553 (Layout::get_output_section_flags): New function.
1554 (Layout::choose_output_section): Call get_output_section_flags.
1555 (Layout::layout): Make output section for mapping to a unique segment.
1556 (Layout::insert_section_segment_map): New function.
1557 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 1558 output sections marked so.
16164a6b
ST
1559 (Layout::segment_precedes): Check for unique segments when sorting.
1560 * layout.h (Layout::Unique_segment_info): New struct.
1561 (Layout::Section_segment_map): New typedef.
1562 (Layout::insert_section_segment_map): New function.
1563 (Layout::get_output_section_flags): New function.
1564 (Layout::is_unique_segment_for_sections_specified): New function.
1565 (Layout::set_unique_segment_for_sections_specified): New function.
1566 (Layout::unique_segment_for_sections_specified_): New member.
1567 (Layout::section_segment_map_): New member.
1568 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1569 Rename is_gc_pass_one to is_pass_one.
1570 Rename is_gc_pass_two to is_pass_two.
1571 Rename is_gc_or_icf to is_two_pass.
1572 Check for which pass based on whether symbols data is present.
1573 Make it two pass when unique segments for sections is desired.
1574 * output.cc (Output_section::Output_section): Initialize new
1575 members.
1576 * output.h (Output_section::is_unique_segment): New function.
1577 (Output_section::set_is_unique_segment): New function.
1578 (Output_section::is_unique_segment_): New member.
1579 (Output_section::extra_segment_flags): New function.
1580 (Output_section::set_extra_segment_flags): New function.
1581 (Output_section::extra_segment_flags_): New member.
1582 (Output_section::segment_alignment): New function.
1583 (Output_section::set_segment_alignment): New function.
1584 (Output_section::segment_alignment_): New member.
1585 (Output_segment::Output_segment): Initialize is_unique_segment_.
1586 (Output_segment::is_unique_segment): New function.
1587 (Output_segment::set_is_unique_segment): New function.
1588 (Output_segment::is_unique_segment_): New member.
1589 * plugin.cc (allow_unique_segment_for_sections): New function.
1590 (unique_segment_for_sections): New function.
1591 (Plugin::load): Add new functions to transfer vector.
1592 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1593 * Makefile.in: Regenerate.
1594 * testsuite/plugin_final_layout.sh: Check if unique segment
1595 functionality works.
1596 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1597 are available.
1598 (allow_unique_segment_for_sections): New global.
1599 (unique_segment_for_sections): New global.
1600 (claim_file_hook): Call allow_unique_segment_for_sections.
1601 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1602
1e2bee4f
CC
16032012-08-22 Cary Coutant <ccoutant@google.com>
1604
1605 * layout.cc (Layout::include_section): Don't assert on GROUP
1606 sections with --emit-relocs.
1607
1d5dfe78
CC
16082012-08-21 Cary Coutant <ccoutant@google.com>
1609
1610 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1611 if --export-dynamic-symbol names an undef symbol.
1612
c9269dff
AM
16132012-08-18 Alan Modra <amodra@gmail.com>
1614
1615 * powerpc.cc: Formatting and white space.
1616 (Powerpc_relobj): Rename got2_section_ to special_.
1617 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1618 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1619 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1620 (Target_powerpc): Add Address typedef and invalid_address. Use
1621 throughout.
1622 (Target_powerpc::is_branch_reloc): New function.
1623 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1624 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1625 for dst_mask, value and addend.
1626 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1627 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1628 (Output_data_glink::do_write): Correct toc base. Don't try to use
1629 uint16_t for 24-bit offset. Use get_output_section_offset and
1630 check return.
1631 (Target_powerpc::Scan::local): Handle more relocs.
1632 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1633 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1634 Plug in toc restoring insn after plt calls. Translate branches
1635 to function descriptor symbols to corresponding entry point.
1636 (Target_powerpc::relocate_for_relocatable): Check return from
1637 get_output_section_offset.
1638 * symtab.h: Comment typo.
1639
b1759dce
ILT
16402012-08-14 Ian Lance Taylor <iant@google.com>
1641
1642 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1643 unsupported_relocal_local to call unsupported_reloc_global.
1644
b9b2ae8b
NC
16452012-08-14 Nick Clifton <nickc@redhat.com>
1646
1647 PR ld/14265
1648 * script-sections.cc (Sections_element::output_section_name): Add
1649 keep return parameter.
1650 (Output_section_element::match_name): Add keep return parameter.
1651 Return the value of the keep_ member.
1652 * script-sections.h (class Output_section): Update
1653 output_section_name prototype.
1654 * layout.cc (Layout::keep_input_section): New public member
1655 function.
1656 (Layout::choose_output_section): Pass keep parameter to
1657 output_section_name.
1658 * layout.h (class Layout): Add keep_input_section.
1659 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1660 sections.
1661 * testsuite/Makefile.am: Add a test.
1662 * testsuite/Makefile.in: Regenerate.
1663 * testsuite/pr14265.c: Source file for the test.
1664 * testsuite/pr14265.t: Linker script for the test.
1665 * testsuite/pr14265.sh: Shell script for the test.
1666
921b5322
AM
16672012-08-14 Alan Modra <amodra@gmail.com>
1668
1669 * target.h (Target::output_section_name): New function.
1670 (Target::do_output_section_name): New function.
1671 * layout.cc (Layout::choose_output_section): Call the above.
1672 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1673
6ce78956
AM
16742012-08-14 Alan Modra <amodra@gmail.com>
1675
1676 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1677 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1678 for replace_constant call.
1679 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1680 (Output_data_glink::do_print_to_mapfile): New function.
1681 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1682 (Target_powerpc::Relocate::relocate): Likewise.
1683
d1a8cabd
AM
16842012-08-14 Alan Modra <amodra@gmail.com>
1685
1686 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1687 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1688 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1689 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1690 all references to shndx_. Handle special case for R_PPC_PLTREL24
1691 here.
1692 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1693 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1694 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1695 here.
1696 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1697 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1698
d83ce4e3
AM
16992012-08-12 Alan Modra <amodra@gmail.com>
1700
1701 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1702 (glink insn constants): Use uint32_t.
1703 (Output_data_glink::add_entry): Use insert, not [] operator.
1704
cf43a2fe
AM
17052012-08-11 Alan Modra <amodra@gmail.com>
1706
1707 * object.h (Sized_relobj_file::find_shdr): New function.
1708 (Sized_relobj_file::find_special_sections): New function.
1709 * object.cc (Sized_relobj_file::find_shdr): New function.
1710 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1711 (Sized_relobj_file::find_special_sections): New function, split out..
1712 (Sized_relobj_file::do_read_symbols): ..from here.
1713 * output.h (Output_data_got::replace_constant): New function.
1714 (Output_data_got::num_entries): New function.
1715 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1716 (Output_data_got::got_offset): Protected rather than private.
1717 (Output_data_got::replace_got_entry): New function.
1718 * output.cc (Output_data_got::replace_got_entry): New function.
1719 * powerpc.cc (class Powerpc_relobj): New.
1720 (class Powerpc_relocate_functions): Delete all psymval variants or
1721 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1722 Implement _ha functions using corresponding _hi function.
1723 (Powerpc_relobj::find_special_sections): New function.
1724 (Target_powerpc::do_make_elf_object): New function.
1725 (class Output_data_got_powerpc): New.
1726 (class Output_data_glink): New.
1727 (class Powerpc_scan_relocatable_reloc): New.
1728 Many more changes througout file.
1729
3c892704
NC
17302012-08-09 Nick Clifton <nickc@redhat.com>
1731
1732 * po/vi.po: Updated Vietnamese translation.
1733
82435b3b
ILT
17342012-08-07 Ian Lance Taylor <iant@google.com>
1735
1736 * layout.cc (Layout::add_target_dynamic_tags): If
1737 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1738 plt_rel.
1739
a6dc81d2
NC
17402012-07-30 Nick Clifton <nickc@redhat.com>
1741
1742 * po/gold.pot: Updated template.
1743 * po/es.po: Updated Spanish translation.
1744
f1415016
CC
17452012-07-18 Cary Coutant <ccoutant@google.com>
1746
1747 PR gold/14344
1748 * configure.ac: Add check for -gpubnames support.
1749 * configure: Regenerate.
1750 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1751 support; force -gno-pubnames.
1752 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1753 support.
1754 (gdb_index_test_4): New test.
1755 * testsuite/Makefile.in: Regenerate.
1756 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1757 * testsuite/gdb_index_test_2.sh: Likewise.
1758 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1759 * testsuite/gdb_index_test_4.sh: New script.
1760 * testsuite/gdb_index_test_comm.sh: New script with common code;
1761 don't look for space after colon.
1762
b7fd7c37
ST
17632012-07-16 Sriraman Tallam <tmsriram@google.com>
1764
1765 * gold.cc (queue_middle_tasks): Update function order only after
1766 deferred objects due to plugins are processed.
1767
1f3212db
ILT
17682012-07-11 Ian Lance Taylor <iant@google.com>
1769
1770 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1771 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1772 (Target_arm::scan_reloc_for_stub): Likewise.
1773 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1774 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1775 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1776 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1777 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1778
81c82a68
ILT
17792012-07-10 Dodji Seketeli <dodji@redhat.com>
1780 Ian Lance Taylor <iant@google.com>
1781
1782 PR gold/14309
1783 * configure.ac: Test whether std::tr1::hash<off_t> works.
1784 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1785 needed.
1786 * output.h (class Output_fill): Add virtual destructor.
1787 * configure, config.in: Rebuild.
1788
eabc84f4
RM
17892012-06-22 Roland McGrath <mcgrathr@google.com>
1790
1791 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1792
370e30b6
RÁE
17932012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1794
1795 * plugin.cc (Plugin::load): Handle position independent executables.
1796
fb1b895d
CC
17972012-06-06 Cary Coutant <ccoutant@google.com>
1798
1799 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1800 add .debug_macro.
1801 (lines_only_debug_sections): Likewise.
1802 (gdb_fast_lookup_sections): New static array.
1803 (is_gdb_debug_section): Rename formal parameter.
1804 (is_lines_only_debug_section): Likewise.
1805 (is_gdb_fast_lookup_section): New function.
1806 (Layout::include_section): Check for ".zdebug_" prefix; pass
1807 section name suffix to is_gdb_debug_section, et al.; check for
1808 fast-lookup sections when building .gdb_index.
1809 * options.h (--strip-debug-gdb): Update GDB version number.
1810
7c0640fa
CC
18112012-06-06 Cary Coutant <ccoutant@google.com>
1812
1813 * configure.ac: Add check for fallocate.
1814 * configure: Regenerate.
1815 * config.in: Regenerate.
1816
1817 * options.h (class General_options): Add --mmap-output-file and
1818 --posix-fallocate options.
1819 * output.cc: (posix_fallocate): Remove; replace with...
1820 (gold_fallocate): New function.
1821 (Output_file::map_no_anonymous): Call gold_fallocate.
1822 (Output_file::map): Check --mmap-output-file option.
1823
2a49eb69
DK
18242012-06-05 Jing Yu <jingyu@google.com>
1825
1826 * gold.h (textdomain): Add do {} to empty while(0).
1827 (bindtextdomain): Likewise.
1828
fad072ac
CC
18292012-06-04 Cary Coutant <ccoutant@google.com>
1830
1831 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
1832 has_dynsym_index.
1833
8cc69fb6
ST
18342012-05-25 Sriraman Tallam <tmsriram@google.com>
1835
1836 * symtab.cc (Symbol_table::define_special_symbol):
1837 Initialize *poldsym to prevent uninitialized variable errors.
1838
1be75daa
CC
18392012-05-23 Cary Coutant <ccoutant@google.com>
1840
1841 * layout.cc (Layout::section_name_mapping): Add rules to handle
1842 exact match on .data.rel.ro.local or .data.rel.ro.
1843 (Layout::output_section_name): Check for exact matches.
1844
9b689de0
CC
18452012-05-23 Cary Coutant <ccoutant@google.com>
1846
1847 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
1848 more carefully.
1849
b24fdbf5
CC
18502012-05-22 Cary Coutant <ccoutant@google.com>
1851
1852 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
1853 object before exporting symbol.
1854
e550e1a2
L
18552012-05-21 H.J. Lu <hongjiu.lu@intel.com>
1856
1857 * testsuite/tls_test.cc: Include "config.h" first.
1858 * testsuite/tls_test_c.c: Likewise.
1859
df7b86aa
NC
18602012-05-17 Daniel Richard G. <skunk@iskunk.org>
1861 Nick Clifton <nickc@redhat.com>
1862
1863 PR 14072
1864 * configure.in: Add check that sysdep.h has been included before
1865 any system header files.
1866 * configure: Regenerate.
1867 * config.in: Regenerate.
1868
1007b503
CC
18692012-05-14 Cary Coutant <ccoutant@google.com>
1870
1871 * layout.cc (Layout::make_output_section): Mark .tdata section
1872 as RELRO.
1873 * testsuite/relro_test.cc: Add a TLS variable.
1874
fd885f3a
L
18752012-05-10 H.J. Lu <hongjiu.lu@intel.com>
1876
1877 PR gold/14091
1878 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
1879 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
1880 R_X86_64_64.
1881
80f5885c
CC
18822012-05-08 Cary Coutant <ccoutant@google.com>
1883
1884 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
1885 (lines_only_debug_sections): Likewise.
1886
2e702c99
RM
18872012-05-02 Roland McGrath <mcgrathr@google.com>
1888
1889 * nacl.cc: New file.
1890 * nacl.h: New file.
1891 * Makefile.am (CCFILES, HFILES): Add them.
1892 * Makefile.in: Regenerate.
1893 * i386.cc (Output_data_plt_i386_nacl): New class.
1894 (Output_data_plt_i386_nacl_exec): New class.
1895 (Output_data_plt_i386_nacl_dyn): New class.
1896 (Target_i386_nacl): New class.
1897 (Target_selector_i386_nacl): New class.
1898 (target_selector_i386): Use it instead of Target_selector_i386.
1899 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
1900 (Target_x86_64_nacl): New class.
1901 (Target_selector_x86_64_nacl): New class.
1902 (target_selector_x86_64, target_selector_x32): Use it instead of
1903 Target_selector_x86_64.
1904 * arm.cc (Output_data_plt_arm_nacl): New class.
1905 (Target_arm_nacl): New class.
1906 (Target_selector_arm_nacl): New class.
1907 (target_selector_arm, target_selector_armbe): Use it instead of
1908 Target_selector_arm.
1909
1910 * target-select.cc (select_target): Take new Input_file* and off_t
1911 arguments, pass them on to recognize method of selector.
1912 * object.cc (make_elf_sized_object): Update caller.
1913 * parameters.cc (parameters_force_valid_target): Likewise.
1914 * incremental.cc (make_sized_incremental_binary): Likewise.
1915 * target-select.h: Update decl.
1916 (Target_selector::recognize): Take new Input_file* argument,
1917 pass it on to do_recognize.
1918 (Target_selector::do_recognize): Take new Input_file* argument.
1919 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
1920 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
1921 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
1922 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
1923
1924 * target.h (Target::Target_info): New members isolate_execinstr
1925 and rosegment_gap.
1926 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
1927 * arm.cc (Target_arm::arm_info): Update initializer.
1928 * i386.cc (Target_i386::i386_info): Likewise.
1929 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
1930 * sparc.cc (Target_sparc::sparc_info): Likewise.
1931 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1932 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1933 * layout.cc (Layout::attach_allocated_section_to_segment):
1934 Take new const Target* argument. If target->isolate_execinstr(), act
1935 like --rosegment.
1936 (Layout::find_first_load_seg): Take new const Target* argument;
1937 if target->isolate_execinstr(), reject PF_X segments.
1938 (Layout::relaxation_loop_body): Update caller.
1939 (Layout::set_segment_offsets): If target->isolate_execinstr(),
1940 reset file offset to zero when we hit LOAD_SEG, and then do a second
1941 loop over the segments before LOAD_SEG to reassign offsets after
1942 addresses have been determined. Handle target->rosegment_gap().
1943 (Layout::attach_section_to_segment): Take new const Target* argument;
1944 pass it to attach_allocated_section_to_segment.
1945 (Layout::make_output_section): Update caller.
1946 (Layout::attach_sections_to_segments): Take new const Target* argument;
1947 pass it to attach_section_to_segment.
1948 * gold.cc (queue_middle_tasks): Update caller.
1949 * layout.h (Layout): Update method decls with new arguments.
1950
1951 * arm.cc (Target_arm::Target_arm): Take optional argument for the
1952 Target_info pointer to use.
1953 (Target_arm::do_make_data_plt): New virtual method.
1954 (Target_arm::make_data_plt): New method that calls it.
1955 (Target_arm::make_plt_entry): Use it.
1956 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
1957 for the section alignment.
1958 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
1959 method.
1960 (Output_data_plt_arm::first_plt_entry_offset): Call it.
1961 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
1962 method.
1963 (Output_data_plt_arm::get_plt_entry_size): Call it.
1964 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
1965 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
1966 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
1967 method.
1968 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
1969 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
1970 method instead of sizeof(plt_entry).
1971 (Output_data_plt_arm::add_entry): Likewise.
1972 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
1973 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
1974 than static method.
1975 (Target_arm::plt_entry_size): Likewise.
1976 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
1977 Move to ...
1978 (Output_data_plt_arm_standard): ... here, new class.
1979 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
1980 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
1981 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
1982
1983 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
1984 Take additional argument for the PLT entry size.
1985 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
1986 Use get_plt_entry_size method rather than plt_entry_size variable.
1987 (Output_data_plt_x86_64::reserve_slot): Likewise.
1988 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
1989 (Output_data_plt_x86_64::add_entry): Likewise.
1990 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
1991 (Output_data_plt_x86_64::address_for_global): Likewise.
1992 (Output_data_plt_x86_64::address_for_local): Likewise.
1993 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1994 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
1995 Make method non-static.
1996 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
1997 method.
1998 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
1999 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2000 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2001 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2002 virtual method.
2003 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2004 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2005 virtual method.
2006 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2007 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2008 virtual method.
2009 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2010 (Output_data_plt_x86_64::plt_entry_size)
2011 (Output_data_plt_x86_64::first_plt_entry)
2012 (Output_data_plt_x86_64::plt_entry)
2013 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2014 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2015 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2016 (Output_data_plt_x86_64_standard): ... here, new class.
2017 (Target_x86_64::Target_x86_64): Take optional argument for the
2018 Target_info pointer to use.
2019 (Target_x86_64::do_make_data_plt): New virtual method.
2020 (Target_x86_64::make_data_plt): New method to call it.
2021 (Target_x86_64::init_got_plt_for_update): Use that.
2022 Call this->plt_->add_eh_frame method here.
2023 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2024 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2025 rather than static method.
2026 (Target_x86_64::plt_entry_size): Likewise.
2027 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2028 rather than plt_entry_size variable. Move guts of PLT filling to...
2029 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2030 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2031 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2032
2033 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2034 additional argument for the section alignment.
2035 Don't do add_eh_frame_for_plt here.
2036 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2037 non-static. Use get_plt_entry_size method rather than plt_entry_size
2038 variable.
2039 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2040 method.
2041 (Output_data_plt_i386::get_plt_entry_size): Call it.
2042 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2043 (Output_data_plt_i386::add_eh_frame): New method to call it.
2044 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2045 method.
2046 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2047 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2048 method.
2049 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2050 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2051 method instead of plt_entry_size.
2052 (Output_data_plt_i386::plt_entry_size)
2053 (Output_data_plt_i386::plt_eh_frame_fde_size)
2054 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2055 (Output_data_plt_i386_standard): ... here, new class.
2056 (Output_data_plt_i386_exec): New class.
2057 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2058 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2059 (Output_data_plt_i386::exec_plt_entry): Move to ...
2060 (Output_data_plt_i386_exec::plt_entry): ... here.
2061 (Output_data_plt_i386_dyn): New class.
2062 (Output_data_plt_i386::first_plt_entry): Move to ...
2063 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2064 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2065 (Output_data_plt_i386_dyn::plt_entry): ... here.
2066 (Target_i386::Target_i386): Take optional argument for the Target_info
2067 pointer to use.
2068 (Target_i386::do_make_data_plt): New virtual method.
2069 (Target_i386::make_data_plt): New method to call it.
2070 (Target_i386::make_plt_section): Use that.
2071 Call this->plt_->add_eh_frame method here.
2072 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2073 rather than plt_entry_size variable.
2074 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2075 (Output_data_plt_i386::address_for_local): Likewise.
2076 (Output_data_plt_i386::do_write): Likewise.
2077 Move guts of PLT filling to...
2078 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2079 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2080 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2081 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2082
b9b9f2ee
CC
20832012-05-01 Cary Coutant <ccoutant@google.com>
2084
2085 * dwarf_reader.cc (Dwarf_die::read_attributes)
2086 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2087 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2088 * reduced_debug_output.cc
2089 (Output_reduced_debug_info_section::get_die_end): Remove
2090 DW_FORM_GNU_ref_index. Add default case.
2091
57923f48
MW
20922012-04-26 Mark Wielaard <mjw@redhat.com>
2093
2094 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2095 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2096 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2097 DW_AT_high_pc as offset from DW_AT_low_pc.
2098
2099 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2100 * testsuite/Makefile.in: Regenerate.
2101 * testsuite/gdb_index_test_3.c: New test source file.
2102 * testsuite/gdb_index_test_3.sh: New test source file.
2103
2c54b4f4
ILT
21042012-04-25 Ian Lance Taylor <iant@google.com>
2105
2106 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2107 pointer.
2108 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2109 as a class, not a struct.
2110 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2111 (Target_arm::apply_cortex_a8_workaround): Likewise.
2112 * gc.h: Declare Reloc_types as a struct, not a class.
2113 * object.h: Declare Symbols_data as a struct.
2114 * reloc.h: Declare Read_relocs_data as a struct.
2115 * target.h: Declare Relocate_info as a struct.
2116
a5a5f7a3
DM
21172012-04-24 David S. Miller <davem@davemloft.net>
2118
2119 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2120 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2121 and R_SPARC_WPLT30.
2122
f038d496
CC
21232012-04-24 Cary Coutant <ccoutant@google.com>
2124
2125 * incremental-dump.cc (find_input_containing_global): Replace
2126 magic number with symbolic constant.
2127 (dump_incremental_inputs): Update version number.
2128 * incremental.cc (Output_section_incremental_inputs): Update version
2129 number; import symbolic constants from Incremental_inputs_reader.
2130 (Incremental_inputs::create_data_sections): Align relocations
2131 section correctly for 64-bit targets.
2132 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2133 constants; add padding.
2134 (Output_section_incremental_inputs::write_header): Add assert for
2135 header_size.
2136 (Output_section_incremental_inputs::write_input_files): Add assert
2137 for input_entry_size.
2138 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2139 add assert for object_info_size, input_section_entry_size,
2140 global_sym_entry_size.
2141 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2142 for data structure sizes; use them.
2143 (Incremental_input_entry_reader): Import symbolic constants from
2144 Incremental_inputs_reader; use them.
2145
a4d85145
DM
21462012-04-23 David S. Miller <davem@davemloft.net>
2147
2148 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2149 and elf_flags_set_.
2150 (Target_sparc::Target_sparc): Initialize new fields.
2151 (Target_sparc::do_make_elf_object): New function.
2152 (Target_sparc::do_adjust_elf_header): New function.
2153
1d509098
CC
21542012-04-23 Cary Coutant <ccoutant@google.com>
2155
2156 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2157 CU range table of gdb index.
2158
7ebeff7f
DM
21592012-04-20 David S. Miller <davem@davemloft.net>
2160
2161 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2162 instead of false.
2163
13cf9988
DM
21642012-04-16 David S. Miller <davem@davemloft.net>
2165
2a1079e8
DM
2166 * sparc.cc (Target_sparc::got_address): New function.
2167 (Sparc_relocate_functions::gdop_hix22): New function.
2168 (Sparc_relocate_functions::gdop_lox10): New function.
2169 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2170 relocs.
2171 (Target_sparc::Scan::local): Likewise if the global symbol is not
2172 preemptible and is not IFUNC.
2173 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2174 transformations for local and non-preemptible non-IFUNC global
2175 symbols.
2176
0bc964fc
DM
2177 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2178 writing out 64-bit part of ranges.
2179
661d7a80
DM
2180 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2181 -fpic and -fpie respectively.
2182 * Makefile.in: Regenerate.
2183
8c2bf391
DM
2184 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2185 (Target_sparc::Target_sparc): Initialize new field.
2186 (Target_sparc::do_plt_section_for_global): New function.
2187 (Target_sparc::do_plt_section_for_local): New function.
2188 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2189 (Target_sparc::make_plt_section): New function, broken out of
2190 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2191 (Target_sparc::make_plt_entry): Call make_plt_section.
2192 (Target_sparc::make_local_ifunc_plt_entry): New function.
2193 (Target_sparc::rela_ifunc_section): New function.
2194 (Target_sparc::plt_section): Remove const.
2195 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2196 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2197 and ifunc_count_ fields.
2198 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2199 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2200 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2201 (Output_data_plt_sparc::rela_ifunc): New function.
2202 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2203 (Output_data_plt_sparc::has_ifunc_section): New function.
2204 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2205 (Output_data_plt_sparc::address_for_global): New function.
2206 (Output_data_plt_sparc::address_for_local): New function.
2207 (Output_data_plt_sparc::plt_index_to_offset): New function.
2208 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2209 and entry_count.
2210 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2211 entry_count.
2212 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2213 R_SPARC_JMP_IREL to switch.
2214 (Target_sparc::Scan::check_non_pic): Likewise.
2215 (Target_sparc::Scan::local): Handle IFUNC symbols.
2216 (Target_sparc::Scan::local): Likewise.
2217 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2218 and plt_address_for_local.
2219 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2220 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2221
13cf9988
DM
2222 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2223 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2224 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2225 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2226 global relocs too.
2227 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2228 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2229 calls.
2230 * sparc.cc (Target_sparc::Scan::global): Likewise.
2231 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2232
31821be0
CC
22332012-04-16 Cary Coutant <ccoutant@google.com>
2234
2235 * archive.cc (Library_base::should_include_member): Check for
2236 --export-dynamic-symbol.
2237 * options.h (class General_options): Add --export-dynamic-symbol.
2238 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2239 --export-dynamic-symbol.
2240 (Symbol_table::gc_mark_undef_symbols): Likewise.
2241 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2242
2615994e
DM
22432012-04-12 David S. Miller <davem@davemloft.net>
2244
2245 * sparc.cc (Reloc::wdisp10): New relocation method.
2246 (Reloc::h34): Likewise.
2247 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2248 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2249 R_SPARC_WDISP10.
2250 (Target_sparc::Scan::local): Likewise.
2251 (Target_sparc::Scan::global): Likewise.
2252 (Target_sparc::Relocate::relocate): Likewise.
2253
6782735d
CC
22542012-04-09 Cary Coutant <ccoutant@google.com>
2255
2256 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2257 low_pc == 0.
2258
8c7a0b00
ILT
22592012-04-06 Ian Lance Taylor <iant@google.com>
2260
2261 * timer.cc: #include <unistd.h>.
2262
58797674
RM
22632012-04-06 Roland McGrath <mcgrathr@google.com>
2264
2265 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2266 * config.in: Regenerate.
2267 * configure: Regenerate.
2268
44350750
NC
22692012-04-05 Nick Clifton <nickc@redhat.com>
2270
2271 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2272 (AM_LC_MESSAGES): Add.
2273 * aclocal.m4: Regenerate.
2274 * config.in: Regenerate.
2275 * configure: Regenerate.
2276
c1027032
CC
22772012-03-21 Cary Coutant <ccoutant@google.com>
2278
2279 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2280 * Makefile.in: Regenerate.
2281 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2282 (Sized_elf_reloc_mapper::symbol_section): New function.
2283 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2284 (make_elf_reloc_mapper): New function.
2285 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2286 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2287 (Dwarf_abbrev_table::do_get_abbrev): New function.
2288 (Dwarf_ranges_table::read_ranges_table): New function.
2289 (Dwarf_ranges_table::read_range_list): New function.
2290 (Dwarf_pubnames_table::read_section): New function.
2291 (Dwarf_pubnames_table::read_header): New function.
2292 (Dwarf_pubnames_table::next_name): New function.
2293 (Dwarf_die::Dwarf_die): New function.
2294 (Dwarf_die::read_attributes): New function.
2295 (Dwarf_die::skip_attributes): New function.
2296 (Dwarf_die::set_name): New function.
2297 (Dwarf_die::set_linkage_name): New function.
2298 (Dwarf_die::attribute): New function.
2299 (Dwarf_die::string_attribute): New function.
2300 (Dwarf_die::int_attribute): New function.
2301 (Dwarf_die::uint_attribute): New function.
2302 (Dwarf_die::ref_attribute): New function.
2303 (Dwarf_die::child_offset): New function.
2304 (Dwarf_die::sibling_offset): New function.
2305 (Dwarf_info_reader::check_buffer): New function.
2306 (Dwarf_info_reader::parse): New function.
2307 (Dwarf_info_reader::do_parse): New function.
2308 (Dwarf_info_reader::do_read_string_table): New function.
2309 (Dwarf_info_reader::lookup_reloc): New function.
2310 (Dwarf_info_reader::get_string): New function.
2311 (Dwarf_info_reader::visit_compilation_unit): New function.
2312 (Dwarf_info_reader::visit_type_unit): New function.
2313 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2314 Sized_elf_reloc_mapper.
2315 (Sized_dwarf_line_info::symbol_section): Remove function.
2316 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2317 (Sized_dwarf_line_info::read_line_mappings): Remove object
2318 parameter, adjust callers.
2319 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2320 * dwarf_reader.h: Include <sys/types.h>.
2321 (class Track_relocs): Remove forward declaration.
2322 (class Elf_reloc_mapper): New class.
2323 (class Sized_elf_reloc_mapper): New class.
2324 (class Dwarf_abbrev_table): New class.
2325 (class Dwarf_range_list): New class.
2326 (class Dwarf_ranges_table): New class.
2327 (class Dwarf_pubnames_table): New class.
2328 (class Dwarf_die): New class.
2329 (class Dwarf_info_reader): New class.
2330 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2331 (Sized_dwarf_line_info::symbol_section): Remove member function.
2332 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2333 base class.
2334 * gdb-index.cc: New source file.
2335 * gdb-index.h: New source file.
2336 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2337 and .debug_types sections, call Layout::add_to_gdb_index.
2338 (Sized_relobj_incr::do_section_name): Implement.
2339 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2340 return type; Implement.
2341 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2342 return type.
2343 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2344 parameter list and return type.
2345 (Sized_incr_dynobj::do_section_contents): Likewise.
2346 * layout.cc: Include gdb-index.h.
2347 (Layout::Layout): Initialize gdb_index_data_.
2348 (Layout::init_fixed_output_section): Check for .gdb_index section.
2349 (Layout::add_to_gdb_index): New function. Instantiate.
2350 * layout.h: Add forward declaration for class Gdb_index.
2351 (Layout::add_to_gdb_index): New member function.
2352 (Layout::gdb_index_data_): New data member.
2353 * main.cc: Include gdb-index.h.
2354 (main): Print statistics for gdb index.
2355 * object.cc (Object::section_contents): Move code into
2356 do_section_contents.
2357 (need_decompressed_section): Check for sections needed when building
2358 gdb index.
2359 (build_compressed_section_map): Likewise.
2360 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2361 gdb index.
2362 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2363 sections; call Layout::add_to_gdb_index.
2364 (Sized_relobj_file::do_decompressed_section_contents): Call
2365 do_section_contents directly.
2366 * object.h (Object::do_section_contents): Adjust parameter list and
2367 return type.
2368 (Object::do_decompressed_section_contents): Call do_section_contents
2369 directly.
2370 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2371 return type.
2372 * options.h (class General_options): Add --gdb-index option.
2373 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2374 list and return type.
2375 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2376 * reloc.h (Track_relocs::checkpoint): New function.
2377 (Track_relocs::reset): New function.
2378
2379 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2380 New test cases.
2381 * testsuite/Makefile.in: Regenerate.
2382 * testsuite/gdb_index_test.cc: New test source file.
2383 * testsuite/gdb_index_test_1.sh: New test source file.
2384 * testsuite/gdb_index_test_2.sh: New test source file.
2385
647f1574
DK
23862012-03-19 Doug Kwan <dougkwan@google.com>
2387
2388 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 2389 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
2390 __exidx_start and __exidx_end. Make symbol table parameter
2391 anonymous as it is not used.
2392 * gold.cc (queue_middle_tasks): Call target hook to define any
2393 target-specific symbols.
2394 * target.h (Target::define_standard_symbols): New method.
2395 (Target::do_define_standard_symbols): Same.
2396 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2397 * testsuite/Makefile.in: Regenerate.
2398 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2399 and __exidx_end.
2400 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2401 relocations are generated for __exidx_start and __exidx_end.
2402
7c6109da
DK
24032012-03-16 Doug Kwan <dougkwan@google.com>
2404
2405 * testsuite/Makefile.am: Disable test initpri3b.
2406 * testsuite/Makefile.in: Regenerate.
2407
7b8957f8
DK
24082012-03-15 Doug Kwan <dougkwan@google.com>
2409
2410 * arm.cc (Target_arm::got_section): Make .got section read-only
2411 if -z now is given.
2412
14dc9ef7
ILT
24132012-03-15 Ian Lance Taylor <iant@google.com>
2414
2415 PR gold/13850
2416 * layout.cc (Layout::make_output_section): Correctly mark
2417 SHT_INIT_ARRAY, et. al., as relro.
2418
fa40b62a
DK
24192012-03-14 Doug Kwan <dougkwan@google.com>
2420
2421 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2422 dynamic relocations for protected symbols in shared objects.
2423
fd325007
ILT
24242012-03-13 Ian Lance Taylor <iant@google.com>
2425
2426 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2427 keep the larger alignment.
2428
e8dd54e1
CC
24292012-03-12 Cary Coutant <ccoutant@google.com>
2430
2431 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2432 handling of DW_LNE_define_file.
2433
feb5f3b0
CC
24342012-03-12 Cary Coutant <ccoutant@google.com>
2435
2436 * reduced_debug_output.cc
2437 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2438 codes to switch.
2439
a1fb4256
CC
24402012-02-29 Cary Coutant <ccoutant@google.com>
2441
2442 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2443
5dd8762a
CC
24442012-02-29 Cary Coutant <ccoutant@google.com>
2445
2446 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2447 Call Object::decompressed_section_contents.
2448 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2449 New dtor.
2450 (Sized_dwarf_line_info::buffer_start_): New data member.
2451 * merge.cc (Output_merge_data::do_add_input_section): Call
2452 Object::decompressed_section_contents.
2453 (Output_merge_string::do_add_input_section): Likewise.
2454 * object.cc (need_decompressed_section): New function.
2455 (build_compressed_section_map): Decompress sections needed later.
2456 (Sized_relobj_file::do_decompressed_section_contents): New function.
2457 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2458 * object.h (Object::decompressed_section_contents): New function.
2459 (Object::discard_decompressed_sections): New function.
2460 (Object::do_decompressed_section_contents): New function.
2461 (Object::do_discard_decompressed_sections): New function.
2462 (Compressed_section_info): New type.
2463 (Compressed_section_map): Include decompressed section contents.
2464 (Sized_relobj_file::do_decompressed_section_contents): New function.
2465 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2466
7b5de7ee
CC
24672012-02-16 Cary Coutant <ccoutant@google.com>
2468
2469 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2470 * testsuite/Makefile.in: Regenerate.
2471
f9fa4a63
CC
24722012-02-14 Cary Coutant <ccoutant@google.com>
2473
2474 * options.cc (General_options::finalize): Disallow -pie and -static.
2475
2c175ebc
DK
24762012-02-03 Doug Kwan <dougkwan@google.com>
2477
2478 * arm.cc (Arm_relocate_functions::abs8,
2479 Arm_relocate_functions::abs16): Use
2480 Bits::has_signed_unsigned_overflow32.
2481 (Arm_relocate_functions::thm_abs8): Correct range of
2482 overflow check.
2483 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2484 in assertions.
2485
90cff06f
DK
24862012-02-02 Doug Kwan <dougkwan@google.com>
2487
2488 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2489 position independent outputs, not just shared objects.
2490
63887f3d
L
24912012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2492
2493 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2494 * configure: Regenerated.
2495
bef2b434
ILT
24962012-01-27 Ian Lance Taylor <iant@google.com>
2497
2498 * reloc.h (Bits): New class with static functions, copied from
2499 namespace utils in arm.cc.
2500 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2501 instead.
2502
c335b55d
L
25032012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2504
2505 * incremental.cc (write_info_blocks): Correct relocation offset.
2506
41194d9f
L
25072012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2508
2509 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2510 (Relocate::tls_gd_to_le): Likewise.
2511
1bae613c
L
25122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2513
2514 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2515
24482ca0
L
25162012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2517
2518 * configure.ac: Check if -mcmodel=medium works.
2519 * configure: Regenerated.
2520
c2c7840a
CC
25212012-01-24 Cary Coutant <ccoutant@google.com>
2522
2523 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2524 definition and ...
2525 (read_unsigned_LEB_128_x): ... this new function.
2526 (read_signed_LEB_128): Replaced with inline definition and ...
2527 (read_signed_LEB_128_x): ... this new function.
2528 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2529 (read_unsigned_LEB_128): Add inline definition.
2530 (read_signed_LEB_128_x): New function.
2531 (read_signed_LEB_128): Add inline definition.
2532 * testsuite/Makefile.am (leb128_unittest): New unit test.
2533 * testsuite/Makefile.in: Regenerate.
2534 * testsuite/leb128_unittest.cc: New unit test.
2535
833de760 25362012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
2537
2538 PR gold/13617
2539 * i386.cc (Target_i386::do_code_fill): When using a jmp
2540 instruction, pad with nop instructions.
2541 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2542
618d6666
L
25432012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2544
2545 * x86_64.cc (gc_process_relocs): Add typename on types used in
2546 template.
2547 (scan_relocs): Likewise.
2548 (relocate_section): Likewise.
2549 (apply_relocation): Likewise.
2550
3660ff06
L
25512012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2552
2553 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2554 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2555 under x32.
2556
fc51264f
L
25572012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2558
2559 * x86_64.cc: Initial support for x32.
2560
dd74ae06
CC
25612012-01-03 Cary Coutant <ccoutant@google.com>
2562
2563 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2564 Use abstract base class for GOT.
2565 * gold/output.h (class Output_data_got_base): New abstract base class.
2566 (class Output_data_got): Derive from new base class, adjust ctors.
2567 (Output_data_got::reserve_slot): Make virtual; rename to
2568 do_reserve_slot; Adjust callers.
2569 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2570 pointer to abstract base class.
2571 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2572
83896202
ILT
25732011-12-18 Ian Lance Taylor <iant@google.com>
2574
2575 * object.h (Relobj::local_symbol_value): New function.
2576 (Relobj::local_plt_offset): New function.
2577 (Relobj::local_has_got_offset): New function.
2578 (Relobj::local_got_offset): New function.
2579 (Relobj::set_local_got_offset): New function.
2580 (Relobj::do_local_symbol_value): New pure virtual function.
2581 (Relobj::do_local_plt_offset): Likewise.
2582 (Relobj::do_local_has_got_offset): Likewise.
2583 (Relobj::do_local_got_offset): Likewise.
2584 (Relobj::do_set_local_got_offset): Likewise.
2585 (Sized_relobj::do_local_has_got_offset): Rename from
2586 local_has_got_offset.
2587 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2588 (Sized_relobj::do_set_local_got_offset): Rename from
2589 set_local_got_offset.
2590 (Sized_relobj_file::do_local_plt_offset): Rename from
2591 local_plt_offset.
2592 (Sized_relobj_file::do_local_symbol_value): New function.
2593 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2594 local_plt_offset.
2595 * output.cc (Output_data_got::Got_entry::write): Change object to
2596 Relobj. Use local_symbol_value.
2597 (Output_data_got::add_global_with_rel): Change rel_dyn to
2598 Output_data_reloc_generic*. Use add_global_generic.
2599 (Output_data_got::add_global_with_rela): Remove. Change all
2600 callers to use add_global_with_rel.
2601 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2602 Output_data_reloc_generic*. Use add_global_generic.
2603 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2604 callers to use add_global_pair_with_rel.
2605 (Output_data_got::add_local): Change object to Relobj*.
2606 (Output_data_got::add_local_plt): Likewise.
2607 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2608 change rel_dyn to Output_data_reloc_generic*. Use
2609 add_local_generic.
2610 (Output_data_got::add_local_with_rela): Remove. Change all
2611 callers to use all_local_with_rel.
2612 (Output_data_got::add_local_pair_with_rel): Change object to
2613 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2614 add_output_section_generic.
2615 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2616 callers to use add_local_pair_with_rel.
2617 (Output_data_got::reserve_local): Change object to Relobj*.
2618 * output.h: (class Output_data_reloc_generic): Add pure virtual
2619 declarations for add_global_generic, add_local_generic,
2620 add_output_section_generic.
2621 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2622 functions for Output_data_reloc_generic. Update declarations for
2623 changes listed in output.cc.
2624 (class Output_data_got): Change template parameter to got_size.
2625 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2626 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2627 function.
2628 (Sized_relobj_incr::do_local_plt_offset): New function.
2629 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2630 add_global_generic.
2631
76677ad0
CC
26322011-12-17 Cary Coutant <ccoutant@google.com>
2633
2634 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2635 * resolve.cc (Symbol_table::resolve): Likewise.
2636 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2637 arrays.
2638 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2639
8b8dd8d5
ILT
26402011-12-16 Ian Lance Taylor <iant@google.com>
2641
2642 * output.h (Output_data_reloc_generic::add): Only call
2643 add_dynamic_reloc if this is a dynamic reloc section.
2644
d55525b9
L
26452011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2646
2647 PR gold/13505
2648 * target-reloc.h (apply_relocation): Replace <64, false> with
2649 <size, big_endian>.
2650
ff81c7c1
NC
26512011-11-25 Nick Clifton <nickc@redhat.com>
2652
2653 * po/it.po: New Italian translation.
2654
628f39be
SA
26552011-11-17 Sterling Augustine <saugustine@google.com>
2656
2657 * script.cc (script_include_directive): Implement.
2658 (read_script_file): New local variables name and search_path. Update
2659 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2660 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2661 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2662
98ef3ea4
SA
26632011-11-11 Sterling Augustine <saugustine@google.com>
2664
2665 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2666 (file_or_sections_cmd): Likewise.
2667
f4a8b6d7
DK
26682011-11-11 Doug Kwan <dougkwan@google.com>
2669
2670 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2671 if --just-symbols is given.
2672
29ab395d
DK
26732011-11-10 Doug Kwan <dougkwan@google.com>
2674
2675 PR gold/13362
2676 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2677 when processing data relocs.
2678 * reloc.h (Relocate_functions::rel_unaligned): New method.
2679 (Relocate_functions::pcrel_unaligned): Ditto.
2680 (Relocate_functions::rel32_unaligned): Ditto.
2681 (Relocate_functions::pcrel32_unaligned): Ditto.
2682
2c339f71
DK
26832011-11-09 Doug Kwan <dougkwan@google.com>
2684
2685 PR gold/13362
2686 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2687 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2688 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2689 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2690 (Relocate_functions::rel_unaligned): New.
2691 (Relocate_functions::rel32_unaligned): New.
2692 * target-reloc.h (relocate_for_relocatable): Add code to handle
2693 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2694 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2695 arm_unaligned_reloc_r): New targets.
2696 * testsuite/Makefile.in: Regenerate.
2697 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2698 linking.
2699
3f3cddf1
ILT
27002011-11-02 Ian Lance Taylor <iant@google.com>
2701
2702 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2703 NATIVE_LINKER.
2704 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2705 * options.cc (General_options::finalize): Use library search path
2706 from configure script if specified. If not native and no sysroot,
2707 only search TOOLLIBDIR.
2708 * options.h (Search_directory::Search_directory): Change name to
2709 const std::string&.
2710 (General_options::add_to_library_path_with_sysroot): Change arg to
2711 const std::string&.
2712 * configure, Makefile.in, config.in: Rebuild.
2713
a8e2273b
ILT
27142011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2715
2716 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2717 we are working around the ARM1176 Erratum.
2718 * options.h (General_options::fix_arm1176): Add option.
2719 * testsuite/Makefile.am: Add testcases, and keep current ones
2720 working.
2721 * testsuite/Makefile.in: Regenerate.
2722 * testsuite/arm_fix_1176.s: New file.
2723 * testsuite/arm_fix_1176.sh: Likewise.
2724
cd6eab1c
ILT
27252011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2726
2727 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2728 may_use_blx_.
2729 (Target_arm::may_use_blx): Remove method.
2730 (Target_arm::set_may_use_blx): Likewise.
2731 (Target_arm::may_use_v4t_interworking): New method.
2732 (Target_arm::may_use_v5t_interworking): Likewise.
2733 (Target_arm::may_use_blx_): Remove member variable.
2734 (Arm_relocate_functions::arm_branch_common): Check for v5T
2735 interworking.
2736 (Arm_relocate_functions::thumb_branch_common): Likewise.
2737 (Reloc_stub::stub_type_for_reloc): Likewise.
2738 (Target_arm::do_finalize_sections): Correct interworking checks.
2739 * testsuite/Makefile.am: Add new tests.
2740 * testsuite/Makefile.in: Regenerate.
2741 * testsuite/arm_farcall_arm_arm.s: New test.
2742 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2743 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2744 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2745 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2746 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2747 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2748 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2749
286adcf4
CC
27502011-10-31 Cary Coutant <ccoutant@google.com>
2751
2752 PR gold/13023
2753 * expression.cc (Expression::eval_with_dot): Add
2754 is_section_dot_assignment parameter.
2755 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2756 absolute and assigning to dot within a section.
2757 * script-sections.cc
2758 (Output_section_element_assignment::set_section_addresses): Pass
2759 dot_section to set_if_absolute.
2760 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2761 as is_section_dot_assignment flag to eval_with_dot.
2762 (Output_section_element_dot_assignment::set_section_addresses):
2763 Likewise.
2764 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2765 parameter. Also set value if relative to dot_section; set the
2766 symbol's output_section.
2767 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2768 parameter. Adjust all callers.
2769 (Expression::eval_maybe_dot): Likewise.
2770 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2771 Adjust all callers.
2772 * testsuite/script_test_2.t: Test assignment of an absolute value
2773 to dot within an output section element.
2774
9634ed06
CC
27752011-10-31 Cary Coutant <ccoutant@google.com>
2776
2777 * options.h (class General_options): Add --[no-]gnu-unique options.
2778 * symtab.cc (Symbol_table::sized_write_globals): Convert
2779 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2780
de4101c7
CC
27812011-10-31 Cary Coutant <ccoutant@google.com>
2782
2783 PR gold/13359
2784 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2785 unnecessary assertion.
2786 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2787
7257cc92
ST
27882011-10-31 Sriraman Tallam <tmsriram@google.com>
2789
2790 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2791 gc_mark_symbol.
2792 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2793 gc_mark_symbol.
2794 Change to just keep the section associated with symbol.
2795 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2796 they are externally visible and --export-dynamic is turned on.
2797 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2798
bfc34b3f
ILT
27992011-10-19 Ian Lance Taylor <iant@google.com>
2800
2801 PR gold/13163
2802 * script-sections.cc
2803 (Output_section_element_dot_assignment::needs_output_section): New
2804 function.
2805
ea0d8c47
ILT
28062011-10-19 Ian Lance Taylor <iant@google.com>
2807
2808 PR gold/13204
2809 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2810 --section-start option was seen.
2811 * options.h (General_options::any_section_start): New function.
2812
abd242a9
DM
28132011-10-18 David S. Miller <davem@davemloft.net>
2814
2815 PR binutils/13301
2816 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2817 member to track relocation locations that have moved during TLS
2818 reloc optimizations.
2819 (Target_sparc::Relocate::Relocate): Initialize to NULL.
2820 (Target_sparc::Relocate::relocate): Adjust view down by 4
2821 bytes if it matches reloc_adjust_addr_.
2822 (Target_sparc::Relocate::relocate_tls): Always move the
2823 __tls_get_addr call delay slot instruction forward 4 bytes when
2824 performing relaxation.
2825
bab9090f
CC
28262011-10-18 Cary Coutant <ccoutant@google.com>
2827
2828 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
2829 (Output_file::map_no_anonymous): Check for non-zero
2830 return code from posix_fallocate.
2831
f7c5b166
CC
28322011-10-17 Cary Coutant <ccoutant@google.com>
2833
2834 PR gold/13245
2835 * plugin.cc (is_visible_from_outside): Check for symbols
2836 referenced from dynamic objects.
2837 * resolve.cc (Symbol_table::resolve): Don't count references
2838 from dynamic objects as references from real ELF files.
2839 * testsuite/plugin_test_2.sh: Adjust expected result.
2840
b490c0bb
CC
28412011-10-17 Cary Coutant <ccoutant@google.com>
2842
2843 * gold.cc: Include timer.h.
2844 (queue_middle_tasks): Stamp time.
2845 (queue_final_tasks): Likewise.
2846 * main.cc (main): Store timer in parameters. Print timers
2847 for each pass.
2848 * parameters.cc (Parameters::Parameters): Initialize timer_.
2849 (Parameters::set_timer): New function.
2850 (set_parameters_timer): New function.
2851 * parameters.h (Parameters::set_timer): New function.
2852 (Parameters::timer): New function.
2853 (Parameters::timer_): New data member.
2854 (set_parameters_timer): New function.
2855 * timer.cc (Timer::stamp): New function.
2856 (Timer::get_pass_time): New function.
2857 * timer.h (Timer::stamp): New function.
2858 (Timer::get_pass_time): New function.
2859 (Timer::pass_times_): New data member.
2860
f475cf7b
CC
28612011-10-17 Cary Coutant <ccoutant@google.com>
2862
2863 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
2864 task for members of lib groups.
2865
cdd7e244
CC
28662011-10-17 Cary Coutant <ccoutant@google.com>
2867
2868 PR gold/13288
4f95c8b4 2869 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
2870 (File_read::make_view): Move bounds check (replace with assert)...
2871 (File_read::find_or_make_view): ... to here.
2872
dfb45471
CC
28732011-10-12 Cary Coutant <ccoutant@google.com>
2874
4f95c8b4 2875 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
2876 ::read returns less than requested size.
2877
53bbcc1b
CC
28782011-10-10 Cary Coutant <ccoutant@google.com>
2879
4f95c8b4 2880 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
2881 Initialize defined_count_.
2882 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
2883 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
2884 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
2885 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
2886 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 2887 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
2888 member.
2889 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 2890 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
2891 Return zeroes instead of internal error.
2892
397b129b
CC
28932011-10-10 Cary Coutant <ccoutant@google.com>
2894
2895 PR gold/13249
4f95c8b4 2896 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 2897 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 2898 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
2899 (Output_reloc::type_): Adjust size of bit field.
2900 (Output_reloc::use_plt_offset_): New bit field.
2901 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
2902 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
2903 flag. Adjust all callers.
4f95c8b4 2904 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
2905 creating RELATIVE relocations.
2906
d5698657
NC
29072011-10-10 Nick Clifton <nickc@redhat.com>
2908
2909 * po/es.po: Updated Spanish translation.
2910 * po/fi.po: Updated Finnish translation.
2911
6a59a5c2
DN
29122011-10-03 Diego Novillo <dnovillo@google.com>
2913
2914 * options.cc (parse_uint): Fix dereference of RETVAL.
2915
f0558624
ST
29162011-09-29 Sriraman Tallam <tmsriram@google.com>
2917
2918 * layout.h (section_order_map_): New member.
2919 (get_section_order_map): New member function.
2920 * output.cc (Output_section::add_input_section): Check for patterns
2921 only when --section-ordering-file is specified.
2922 * gold.cc (queue_middle_tasks): Delay updating order of sections till
2923 output_sections have been formed.
2924 * layout.cc (Layout_Layout): Initialize section_order_map_.
2925 * plugin.cc (update_section_order): Store order in order_map. Do not
2926 update the order.
2927 * testsuite/Makefile.am: Add test case for plugin_final_layout.
2928 * testsuite/Makefile.in: Regenerate.
2929 * testsuite/plugin_section_order.c: New file.
2930 * testsuite/plugin_final_layout.cc: New file.
2931 * testsuite/plugin_final_layout.sh: New file.
2932
a7dac153
CC
29332011-09-29 Cary Coutant <ccoutant@google.com>
2934
4f95c8b4 2935 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 2936 Check for NULL.
4f95c8b4 2937 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
2938 symbols during incremental update.
2939 (Symbol_table::add_from_dynobj): Likewise.
2940
eebd87a5
ILT
29412011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2942 Ian Lance Taylor <iant@google.com>
2943
2944 * symtab.cc (Symbol_table::define_special_symbol): Always
2945 canonicalize version string.
2946
403a3331
CC
29472011-09-26 Cary Coutant <ccoutant@google.com>
2948
4f95c8b4
CC
2949 * gold.cc (queue_initial_tasks): Move option checks ...
2950 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
2951 some options; make others fatal.
2952
235061c2
CC
29532011-09-26 Cary Coutant <ccoutant@google.com>
2954
2955 gcc PR lto/47247
2956 * plugin.cc (get_symbols_v2): New function.
2957 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
2958 (is_referenced_from_outside): New function.
2959 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
2960 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
2961 (get_symbols): Pass version parameter.
2962 (get_symbols_v2): New function.
2963 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
2964 parameter.
2965 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
2966 (onload): Add LDPT_GET_SYMBOLS_V2.
2967 (all_symbols_read_hook): Use get_symbols_v2; check for
2968 LDPR_PREVAILING_DEF_IRONLY_EXP.
2969 * testsuite/plugin_test_3.sh: Update expected results.
2970
dc87f620
ILT
29712011-09-23 Simon Baldwin <simonb@google.com>
2972
2973 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
2974 configuration options.
2975 * configure: Regenerate.
2976 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
2977 * Makefile.in: Regenerate.
2978 * testsuite/Makefile.in: Regenerate.
2979
a8279f82
ST
29802011-09-19 Sriraman Tallam <tmsriram@google.com>
2981
2982 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
2983
0c9350c8
CC
29842011-09-19 Cary Coutant <ccoutant@google.com>
2985
2986 * incremental.cc (can_incremental_update): Fix typo in comment.
2987 * incremental.h (can_incremental_update): Likewise.
2988
aa06ae28
CC
29892011-09-18 Cary Coutant <ccoutant@google.com>
2990
2991 * incremental.cc (can_incremental_update): New function.
2992 * incremental.h (can_incremental_update): New function.
2993 * layout.cc (Layout::init_fixed_output_section): Call it.
2994 (Layout::make_output_section): Don't allow patch space in .eh_frame.
2995 * object.cc (Sized_relobj_file::do_layout): Call
2996 can_incremental_update.
2997
ebb300b2
CC
29982011-09-13 Cary Coutant <ccoutant@google.com>
2999
3000 * configure.ac: Check for glibc support for gnu_indirect_function
3001 support with static linking, setting automake conditional
3002 IFUNC_STATIC.
3003 * Makefile.in: Regenerate.
3004 * configure: Regenerate.
3005
3006 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3007 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3008 for IFUNC_STATIC.
3009 * testsuite/Makefile.in: Regenerate.
3010
1206d0d5
CC
30112011-09-13 Cary Coutant <ccoutant@google.com>
3012
3013 * incremental.cc (Sized_relobj_incr::do_layout): Call
3014 report_comdat_group for kept comdat sections.
3015 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3016 * testsuite/Makefile.in: Regenerate.
3017 * testsuite/incr_comdat_test_1.cc: New source file.
3018 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3019 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3020 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3021
40b29874
ILT
30222011-09-13 Ian Lance Taylor <iant@google.com>
3023
3024 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3025 variable external_symbols_offset.
3026
1b045aac
ILT
30272011-09-12 Ian Lance Taylor <iant@google.com>
3028
3029 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3030 triggered if object has no symbols.
3031
24c6c55a
DM
30322011-09-09 David S. Miller <davem@davemloft.net>
3033
3034 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3035 (Output_fill_debug_line::do_write): Likewise.
3036
66570254
CC
30372011-08-29 Cary Coutant <ccoutant@google.com>
3038
3039 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3040 casts to match formatting specs.
3041 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3042
8ea8cd50
CC
30432011-08-26 Cary Coutant <ccoutant@google.com>
3044
3045 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3046 remaining hole size when allocating.
3047 (Layout::make_output_section): Set fill methods for debug sections.
3048 * layout.h (Free_list::Free_list_node): Move from private to
3049 public.
3050 (Free_list::set_min_hole_size): New function.
3051 (Free_list::begin, Free_list::end): New functions.
3052 (Free_list::min_hole_): New data member.
3053 * output.cc: Include dwarf.h.
3054 (Output_fill_debug_info::do_minimum_hole_size): New function.
3055 (Output_fill_debug_info::do_write): New function.
3056 (Output_fill_debug_line::do_minimum_hole_size): New function.
3057 (Output_fill_debug_line::do_write): New function.
3058 (Output_section::Output_section): Initialize new data member.
3059 (Output_section::set_final_data_size): Ensure patch space is larger
3060 than minimum hole size.
3061 (Output_section::do_write): Fill holes in debug sections.
3062 * output.h (Output_fill): New class.
3063 (Output_fill_debug_info): New class.
3064 (Output_fill_debug_line): New class.
3065 (Output_section::set_free_space_fill): New function.
3066 (Output_section::free_space_fill_): New data member.
3067 * testsuite/Makefile.am (incremental_test_3): Add
3068 --incremental-patch option.
3069 (incremental_test_4): Likewise.
3070 (incremental_test_5): Likewise.
3071 (incremental_test_6): Likewise.
3072 (incremental_copy_test): Likewise.
3073 (incremental_common_test_1): Likewise.
3074 * testsuite/Makefile.in: Regenerate.
3075
7cf80422
NC
30762011-08-26 Nick Clifton <nickc@redhat.com>
3077
3078 * po/es.po: Updated Spanish translation.
3079
c3f7b0e5
CC
30802011-08-01 Cary Coutant <ccoutant@google.com>
3081
3082 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3083 * gold/testsuite/Makefile.in: Regenerate.
3084 * gold/testsuite/justsyms_exec.c: New source file.
3085 * gold/testsuite/justsyms_lib.c: New source file.
3086
9590bf25
CC
30872011-08-01 Cary Coutant <ccoutant@google.com>
3088
3089 * layout.cc (Layout::set_segment_offsets): Don't realign text
3090 segment if -Ttext was specified.
3091 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3092 file type.
3093 * object.h (Sized_relobj_file::e_type): New function.
3094 (Sized_relobj_file::e_type_): New data member.
3095 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3096 base address for ET_EXEC files.
3097 * target.cc (Target::do_make_elf_object_implementation): Allow
3098 ET_EXEC files with --just-symbols option.
3099
dcd8d12e
CC
31002011-07-28 Cary Coutant <ccoutant@google.com>
3101
3102 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3103 Add thread_number parameter.
3104 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3105 * workqueue-threads.cc
3106 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3107 current thread if its thread number is greater than desired thread
3108 count.
3109 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3110 Add thread_number parameter.
3111 (Workqueue::should_cancel_thread): Likewise.
3112 (Workqueue::find_runnable_or_wait): Pass thread_number to
3113 should_cancel_thread.
3114 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3115 parameter.
3116
804eb480
ST
31172011-07-22 Sriraman Tallam <tmsriram@google.com>
3118
3119 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3120 only after checking if it cannot be forced local.
3121 * symtab.h (is_externally_visible): Check if the symbol is not forced
3122 local.
3123
f1ddb600
ILT
31242011-07-15 Ian Lance Taylor <iant@google.com>
3125
3126 * options.h (class General_options): Add --print-output-format.
3127 Move -EL next to -EB, for better --help output.
3128 * target-select.cc: Include <cstdio>, "options.h", and
3129 "parameters.h".
3130 (Target_selector::do_target_bfd_name): New function.
3131 (print_output_format): New function.
3132 * target-select.h (class Target_selector): Update declarations.
3133 (Target_selector::target_bfd_name): New function.
3134 (print_output_format): Declare.
3135 * main.cc: Include "target-select.h".
3136 (main): Handle --print-output-format.
3137 * gold.cc: Include "target-select.h".
3138 (queue_initial_tasks): Handle --print-output-format when there are
3139 no input files.
3140 * parameters.cc (parameters_force_valid_target): Give a better
3141 error message if -EB/-EL does not match target.
3142 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3143 function.
3144
7d172687
ILT
31452011-07-15 Ian Lance Taylor <iant@google.com>
3146
3147 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3148 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3149 (Output_data_plt_i386::do_write): Write address of .dynamic
3150 section to first entry in .got.plt section.
3151 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3152 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3153 Initialize layout_.
3154 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3155 section to first entry in .got.plt section.
3156 * layout.h (Layout::dynamic_section): New function.
3157
e9552f7e
ST
31582011-07-13 Sriraman Tallam <tmsriram@google.com>
3159
3160 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3161 to claim_file call.
3162 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3163 input_section_position_, and input_section_glob_.
3164 (read_layout_from_file): Call function section_ordering_specified.
3165 * layout.h (is_section_ordering_specified): New function.
3166 (section_ordering_specified): New function.
3167 (section_ordering_specified_): New boolean member.
3168 * main.cc(main): Call load_plugins after layout object is defined.
3169 * output.cc (Output_section::add_input_section): Use
3170 function section_ordering_specified to check if section ordering is
3171 needed.
3172 * output.cc (Output_section::add_relaxed_input_section): Use
3173 function section_ordering_specified to check if section ordering is
3174 needed.
3175 (Output_section::update_section_layout): New function.
3176 (Output_section::sort_attached_input_sections): Check if input section
3177 must be reordered.
3178 * output.h (Output_section::update_section_layout): New function.
3179 * plugin.cc (get_section_count): New function.
3180 (get_section_type): New function.
3181 (get_section_name): New function.
3182 (get_section_contents): New function.
3183 (update_section_order): New function.
58797674 3184 (allow_section_ordering): New function.
e9552f7e
ST
3185 (Plugin::load): Add the new interfaces to the transfer vector.
3186 (Plugin_manager::load_plugins): New parameter.
3187 (Plugin_manager::all_symbols_read): New parameter.
3188 (Plugin_manager::claim_file): New parameter. Save the elf object for
3189 unclaimed objects.
3190 (Plugin_manager::get_elf_object): New function.
3191 (Plugin_manager::get_view): Change to directly use the bool to check
3192 if get_view is called from claim_file_hook.
3193 * plugin.h (input_objects): New function
3194 (Plugin__manager::load_plugins): New parameter.
3195 (Plugin_manager::claim_file): New parameter.
3196 (Plugin_manager::get_elf_object): New function.
3197 (Plugin_manager::in_claim_file_handler): New function.
3198 (Plugin_manager::in_claim_file_handler_): New member.
3199 (layout): New function.
3200 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3201 handler with an extra parameter. Make the elf object before calling
3202 claim_file handler.
3203 * testsuite/plugin_test.c (get_section_count): New function pointer.
3204 (get_section_type): New function pointer.
3205 (get_section_name): New function pointer.
3206 (get_section_contents): New function pointer.
3207 (update_section_order): New function pointer.
3208 (allow_section_ordering): New function pointer.
3209 (onload): Check if the new interfaces exist.
3210
9446efde
ILT
32112011-07-13 Ian Lance Taylor <iant@google.com>
3212
3213 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3214 relro section.
3215 * x86_64.cc (Target_x86_64::got_section): Likewise.
3216 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3217 (relro_now_test_SOURCES): New variable.
3218 (relro_now_test_DEPENDENCIES): New variable.
3219 (relro_now_test_LDFLAGS): New variable.
3220 (relro_now_test_LDADD): New variable.
3221 (relro_now_test.so): New target.
3222 * testsuite/Makefile.in: Rebuild.
3223
07aa62f2
ILT
32242011-07-12 Ian Lance Taylor <iant@google.com>
3225
3226 PR gold/12980
3227 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3228 GLOB_DAT relocation rather than a RELATIVE relocation for a
3229 protected symbol when creating a shared library.
3230 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3231 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3232 * testsuite/protected_main_1.cc (main): Test that protected
3233 function has same address.
3234
e2153196
ILT
32352011-07-11 Ian Lance Taylor <iant@google.com>
3236
3237 PR gold/12979
3238 * options.h (class General_options): Add -Bgroup.
3239 * options.cc (General_options::finalize): If -Bgroup is set,
3240 default to --unresolved-symbols=report-all.
3241 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3242 * target-reloc.h (issue_undefined_symbol_error): Handle
3243 --unresolved-symbols=report-all.
3244
6daf5215
ILT
32452011-07-08 Ian Lance Taylor <iant@google.com>
3246
3247 PR gold/11985
3248 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3249 if linker script discards key sections.
3250 (Layout::create_dynamic_symtab): Likewise.
3251 (Layout::assign_local_dynsym_offsets): Likewise.
3252 (Layout::sized_create_version_sections): Likewise.
3253 (Layout::create_interp): Likewise.
3254 (Layout::finish_dynamic_section): Likewise.
3255 (Layout::set_dynamic_symbol_size): Likewise.
3256
beabb2c6
ILT
32572011-07-08 Ian Lance Taylor <iant@google.com>
3258
3259 PR gold/12386
3260 * options.h (class General_options): Add --unresolved-symbols.
3261 * target-reloc.h (issue_undefined_symbol_error): Check
3262 --unresolved-symbols. Add comments.
3263
9c16daf1
ILT
32642011-07-08 Ian Lance Taylor <iant@google.com>
3265
3266 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3267 expression more complex.
3268
191f1a2d
ILT
32692011-07-08 Ian Lance Taylor <iant@google.com>
3270
3271 PR gold/11317
3272 * target-reloc.h (issue_undefined_symbol_error): New inline
3273 function, broken out of relocate_section.
3274 (relocate_section): Call issue_undefined_symbol_error.
3275 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3276 there is no TLS segment if we are about to issue an undefined
3277 symbol error.
3278 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3279
62855347
ILT
32802011-07-08 Ian Lance Taylor <iant@google.com>
3281
3282 PR gold/12279
3283 * resolve.cc (Symbol_table::should_override): Add fromtype
3284 parameter. Change all callers. Give error when linking together
3285 TLS and non-TLS symbol.
3286 (Symbol_table::should_override_with_special): Add fromtype
3287 parameter. Change all callers.
3288 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3289 there is no TLS segment if we have reported some errors.
3290 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3291
67181c72
ILT
32922011-07-08 Ian Lance Taylor <iant@google.com>
3293
3294 PR gold/12372
3295 * target.h (Target::plt_address_for_global): New function.
3296 (Target::plt_address_for_local): New function.
3297 (Target::plt_section_for_global): Remove.
3298 (Target::plt_section_for_local): Remove.
3299 (Target::do_plt_address_for_global): New virtual function.
3300 (Target::do_plt_address_for_local): New virtual function.
3301 (Target::do_plt_section_for_global): Remove.
3302 (Target::do_plt_section_for_local): Remove.
3303 (Target::register_global_plt_entry): Add Symbol_table and Layout
3304 parameters.
3305 * output.cc (Output_data_got::Got_entry::write): Use
3306 plt_address_for_global and plt_address_for_local.
3307 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3308 address of output section.
3309 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3310 got_irelative_, and irelative_count_ fields. Update
3311 declarations.
3312 (Output_data_plt_i386::has_irelative_section): New function.
3313 (Output_data_plt_i386::entry_count): Add irelative_count_.
3314 (Output_data_plt_i386::set_final_data_size): Likewise.
3315 (class Target_i386): Add got_irelative_ and rel_irelative_
3316 fields. Update declarations.
3317 (Target_i386::Target_i386): Initialize new fields.
3318 (Target_i386::do_plt_address_for_global): New function replacing
3319 do_plt_section_for_global.
3320 (Target_i386::do_plt_address_for_local): New function replacing
3321 do_plt_section_for_local.
3322 (Target_i386::got_section): Create got_irelative_.
3323 (Target_i386::rel_irelative_section): New function.
3324 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3325 fields. Don't define __rel_iplt_{start,end}.
3326 (Output_data_plt_i386::add_entry): Add symtab and layout
3327 parameters. Change all callers. Use different PLT and GOT for
3328 IFUNC symbols.
3329 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3330 layout parameters. Change all callers. Use different PLT and
3331 GOT.
3332 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3333 (Output_data_plt_i386::rel_irelative): New function.
3334 (Output_data_plt_i386::address_for_global): New function.
3335 (Output_data_plt_i386::address_for_local): New function.
3336 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3337 IRELATIVE GOT when changing IFUNC GOT entries.
3338 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3339 reloc.
3340 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3341 if we didn't create an IRELATIVE GOT.
3342 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3343 plt_address_for_local.
3344 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3345 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3346 got_irelative_, and irelative_count_ fields. Update
3347 declarations.
3348 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3349 Initialize new fields. Remove symtab parameter. Change all
3350 callers.
3351 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3352 irelative_count_.
3353 (Output_data_plt_x86_64::has_irelative_section): New function.
3354 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3355 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3356 fields. Update declarations.
3357 (Target_x86_64::Target_x86_64): Initialize new fields.
3358 (Target_x86_64::do_plt_address_for_global): New function replacing
3359 do_plt_section_for_global.
3360 (Target_x86_64::do_plt_address_for_local): New function replacing
3361 do_plt_section_for_local.
3362 (Target_x86_64::got_section): Create got_irelative_.
3363 (Target_x86_64::rela_irelative_section): New function.
3364 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3365 all callers. Don't create __rel_iplt_{start,end}.
3366 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3367 parameters. Change all callers. Use different PLT and GOT for
3368 IFUNC symbols.
3369 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3370 layout parameters. Change all callers. Use different PLT and
3371 GOT.
3372 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3373 parameters. Change all callers. Use different PLT and GOT for
3374 IFUNC symbols.
3375 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3376 (Output_data_plt_x86_64::rela_irelative): New function.
3377 (Output_data_plt_x86_64::address_for_global): New function.
3378 (Output_data_plt_x86_64::address_for_local): New function.
3379 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3380 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3381 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3382 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3383 parameters.
3384 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3385 reloc.
3386 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3387 symbols if we didn't create an IRELATIVE GOT.
3388 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3389 plt_address_for_local.
3390 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3391 * testsuite/ifuncvar1.c: New test file.
3392 * testsuite/ifuncvar2.c: New test file.
3393 * testsuite/ifuncvar3.c: New test file.
3394 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3395 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3396 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3397 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3398 * testsuite/Makefile.in: Rebuild.
3399
33c15b45
CC
34002011-07-07 Cary Coutant <ccoutant@google.com>
3401
3402 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3403 (two_file_test_1_ndebug.o): Likewise.
3404 (two_file_test_1b_ndebug.o): Likewise.
3405 (two_file_test_2_ndebug.o): Likewise.
3406 (two_file_test_main_ndebug.o): Likewise.
3407 (incremental_test_2): Link with no-debug versions.
3408
f48b5fb7
CC
34092011-07-06 Cary Coutant <ccoutant@google.com>
3410
3411 * gold/incremental.cc
3412 (Output_section_incremental_inputs::write_info_blocks): Check for
3413 hidden and internal symbols.
3414
221597a5
CC
34152011-07-06 Cary Coutant <ccoutant@google.com>
3416
3417 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3418 Check disposition for startup file.
3419 (Incremental_inputs::report_command_line): Ignore
3420 --incremental-startup-unchanged option.
3421 * options.cc (General_options::parse_incremental_startup_unchanged):
3422 New function.
3423 (General_options::General_options): Initialize new data member.
3424 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3425 (General_options): Add --incremental-startup-unchanged option.
3426 (General_options::incremental_startup_disposition): New function.
3427 (General_options::incremental_startup_disposition_): New data member.
3428
e24719f6
CC
34292011-07-06 Cary Coutant <ccoutant@google.com>
3430
3431 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3432 input file index to Script_info ctor.
3433 (Sized_incremental_binary::do_file_has_changed): Find the
3434 command-line argument for files named in scripts.
3435 * incremental.h (Script_info::Script_info): New ctor
3436 with input file index.
3437 (Script_info::input_file_index): New function.
3438 (Script_info::input_file_index_): New data member.
3439 (Incremental_binary::get_library): Add const.
3440 (Incremental_binary::get_script_info): Add const.
3441 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3442 * testsuite/Makefile.am (incremental_test_5): New test case.
3443 (incremental_test_6): New test case.
3444 * testsuite/Makefile.in: Regenerate.
3445
8f7c81e8
CC
34462011-07-06 Cary Coutant <ccoutant@google.com>
3447
3448 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3449 debug output when command lines differ.
3450
9fbd3822
CC
34512011-07-06 Cary Coutant <ccoutant@google.com>
3452
3453 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3454 --incremental-patch option.
3455 * layout.cc (Free_list::allocate): Extend allocation beyond original
3456 end if enabled.
3457 (Layout::make_output_section): Mark sections that should get
3458 patch space.
3459 * options.cc (parse_percent): New function.
3460 * options.h (parse_percent): New function.
3461 (DEFINE_percent): New macro.
3462 (General_options): Add --incremental-patch option.
3463 * output.cc (Output_section::Output_section): Initialize new data
3464 members.
3465 (Output_section::add_input_section): Print section name when out
3466 of patch space.
3467 (Output_section::add_output_section_data): Likewise.
3468 (Output_section::set_final_data_size): Add patch space when
3469 doing --incremental-full.
3470 (Output_section::do_reset_address_and_file_offset): Remove patch
3471 space.
3472 (Output_segment::set_section_list_addresses): Print debug output
3473 only if --incremental-update.
3474 * output.h (Output_section::set_is_patch_space_allowed): New function.
3475 (Output_section::is_patch_space_allowed_): New data member.
3476 (Output_section::patch_space_): New data member.
3477 * parameters.cc (Parameters::incremental_full): New function.
3478 * parameters.h (Parameters::incremental_full): New function
3479 * testsuite/Makefile.am (incremental_test_2): Add test for
3480 --incremental-patch option.
3481 * testsuite/Makefile.in: Regenerate.
3482 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3483 (t18): Remove function body.
3484
f6cccc2c
DK
34852011-07-05 Doug Kwan <dougkwan@google.com>
3486
3487 PR gold/12771
3488 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3489 Arm_Address type for relocation result.
3490 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3491 overflow check.
3492 (Arm_relocate_functions::abs32): Use unaligned access.
3493 (Arm_relocate_functions::rel32): Ditto.
3494 (Arm_relocate_functions::prel31): Ditto.
3495 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3496 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3497 static data relocations.
3498 * testsuite/Makefile.in: Regnerate.
3499 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3500
28a13fec
ILT
35012011-07-05 Ian Lance Taylor <iant@google.com>
3502
3503 PR gold/12392
3504 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3505 symbols if necessary.
3506 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3507
24d47b34
ILT
35082011-07-05 Ian Lance Taylor <iant@google.com>
3509
3510 PR gold/12952
3511 * resolve.cc (Symbol::override_base_with_special): Simply override
3512 version with special symbol version, ignoring previous version.
3513
41f9cbbe
ILT
35142011-07-05 Ian Lance Taylor <iant@google.com>
3515
3516 * object.cc (Sized_relobj_file::include_section_group): Add
3517 information to comment about signature location.
3518
886288f1
ILT
35192011-07-02 Ian Lance Taylor <iant@google.com>
3520
3521 PR gold/12957
3522 * options.h (class General_options): Add -f and -F.
3523 * options.cc (General_options::finalize): Fatal error if -f/-F
3524 are used without -shared.
3525 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3526
ae3a6d4f
ILT
35272011-07-02 Ian Lance Taylor <iant@google.com>
3528
3529 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3530
21131061
ILT
35312011-07-01 Ian Lance Taylor <iant@google.com>
3532
3533 PR gold/12525
3534 PR gold/12952
3535 * resolve.cc (Symbol::override_base_with_special): Don't override
3536 the version if the overriding symbol has a different name.
3537 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3538 all callers. If we give an error about an undefined version,
3539 define the base version if necessary.
3540 * dynobj.h (class Versions): Update declaration.
3541 * testsuite/weak_alias_test_5.cc: New file.
3542 * testsuite/weak_alias_test.script: New file.
3543 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3544 and versioned_alias have the right value, and call t2.
3545 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3546 weak_alias_test_5.so.
3547 (weak_alias_test_LDADD): Likewise.
3548 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3549 * testsuite/Makefile.in: Rebuild.
3550
611062c0
ILT
35512011-07-01 Ian Lance Taylor <iant@google.com>
3552
3553 PR gold/12525
3554 * options.h (class General_options): Support -z notext.
3555 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3556 -Wl,-z,notext.
3557 (two_file_shared_nonpic.so): Likewise.
3558 (two_file_shared_mixed.so): Likewise.
3559 (two_file_shared_mixed_1.so): Likewise.
3560 (weak_undef_lib_nonpic.so): Likewise.
3561 (alt/weak_undef_lib_nonpic.so): Likewise.
3562 (tls_test_shared_nonpic.so): Likewise.
3563 * testsuite/Makefile.in: Rebuild.
3564
328c7c2f
ILT
35652011-07-01 Ian Lance Taylor <iant@google.com>
3566
3567 PR gold/12525
3568 * configure.ac: Test whether static linking works, setting
3569 the automake conditional HAVE_STATIC.
3570 * testsuite/Makefile.am: Disable tests using -static if
3571 HAVE_STATIC is not true.
3572 * configure, testsuite/Makefile.in: Rebuild.
3573
02d7cd44
ILT
35742011-07-01 Ian Lance Taylor <iant@google.com>
3575
3576 PR gold/12525
3577 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3578 Assert if we see DW_EH_PE_indirect.
3579 * target.h (Target::ehframe_datarel_base): New function.
3580 (Target::do_ehframe_datarel_base): New target function.
3581 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3582 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3583 function.
3584
07a60597
ILT
35852011-07-01 Ian Lance Taylor <iant@google.com>
3586
3587 PR gold/12571
3588 * options.h (class General_options): Add
3589 --ld-generated-unwind-info.
3590 * ehframe.cc (Fde::write): Add address parameter. Change all
3591 callers. If associated with PLT, fill in address and size.
3592 (Cie::set_output_offset): Only add merge mapping if there is an
3593 object.
3594 (Cie::write): Add address parameter. Change all callers.
3595 (Eh_frame::add_ehframe_for_plt): New function.
3596 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3597 input_offset_ fields into union u_, with new plt field.
3598 (Fde::Fde): Adjust for new union field.
3599 (Fde::Fde) [Output_data version]: New constructor.
3600 (Fde::add_mapping): Only add merge mapping if there is an object.
3601 (class Cie): Update declarations.
3602 (class Eh_frame): Declare add_ehframe_for_plt.
3603 * layout.cc (Layout::layout_eh_frame): Break out code into
3604 make_eh_frame_section, and call it.
3605 (Layout::make_eh_frame_section): New function.
3606 (Layout::add_eh_frame_for_plt): New function.
3607 * layout.h (class Layout): Update declarations.
3608 * merge.cc (Merge_map::add_mapping): Add assertion.
3609 * i386.cc: Include "dwarf.h".
3610 (class Output_data_plt_i386): Make first_plt_entry,
3611 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3612 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3613 and plt_eh_frame_fde.
3614 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3615 boundary. Call add_eh_frame_for_plt if appropriate.
3616 * x86_64.cc: Include "dwarf.h".
3617 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3618 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3619 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3620 and plt_eh_frame_fde.
3621 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3622 appropriate.
3623
14788a3f
ILT
36242011-06-29 Ian Lance Taylor <iant@google.com>
3625
3626 PR gold/12629
3627 * object.cc (Sized_relobj_file::layout_section): Change shdr
3628 parameter to be const.
3629 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3630 out of do_layout.
3631 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3632 appropriate. Call layout_eh_frame_section.
3633 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3634 sections.
3635 * object.h (class Sized_relobj_file): Update declarations.
3636
6c21fce1
ILT
36372011-06-29 Ian Lance Taylor <iant@google.com>
3638
37e41b03 3639 PR gold/12652
6c21fce1
ILT
3640 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3641 modifier.
3642 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3643
4d5e4e62
ILT
36442011-06-29 Ian Lance Taylor <iant@google.com>
3645
3646 PR gold/12675
3647 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3648 SHT_X86_64_UNWIND.
3649 * layout.cc (Layout::layout_eh_frame): Likewise.
3650
886f533a
ILT
36512011-06-29 Ian Lance Taylor <iant@google.com>
3652
3653 PR gold/12695
3654 * layout.cc (Layout::symtab_section_shndx): New function.
3655 * layout.h (class Layout): Declare symtab_section_shndx.
3656 * output.cc (Output_section::write_header): Call it.
3657
f3ae1b28
ILT
36582011-06-29 Ian Lance Taylor <iant@google.com>
3659
3660 PR gold/12818
3661 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3662 symbols which are not used in a relocation.
3663
aecf301f
ILT
36642011-06-28 Ian Lance Taylor <iant@google.com>
3665
3666 PR gold/12898
3667 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3668 script create indistinguishable segments.
3669 (Layout::set_segment_offsets): Use stable_sort when sorting
3670 segments. Pass this to Compare_segments constructor.
3671 * layout.h (class Layout): Make segment_precedes non-static.
3672 (class Compare_segments): Change from struct to class. Add
3673 layout_ field. Add constructor.
3674 * script-sections.cc
3675 (Script_sections::attach_sections_using_phdrs_clause): Rename
3676 local orphan to is_orphan. Don't report failure to put empty
3677 section in segment. On attachment failure, report name of
3678 section, and attach to first PT_LOAD segment.
3679
03ef7571
ILT
36802011-06-28 Ian Lance Taylor <iant@google.com>
3681
3682 PR gold/12934
3683 * target-select.cc (Target_selector::Target_selector): Add
3684 emulation parameter. Change all callers.
3685 (select_target_by_bfd_name): Rename from select_target_by_name.
3686 Change all callers.
3687 (select_target_by_emulation): New function.
3688 (supported_emulation_names): New function.
3689 * target-select.h (class Target_selector): Add emulation_ field.
3690 Update declarations.
3691 (Target_selector::recognize_by_bfd_name): Rename from
3692 recognize_by_name. Change all callers.
3693 (Target_selector::supported_bfd_names): Rename from
3694 supported_names. Change all callers.
3695 (Target_selector::recognize_by_emulation): New function.
3696 (Target_selector::supported_emulations): New function.
3697 (Target_selector::emulation): New function.
3698 (Target_selector::do_recognize_by_bfd_name): Rename from
3699 do_recognize_by_name. Change all callers.
3700 (Target_selector::do_supported_bfd_names): Rename from
3701 do_supported_names. Change all callers.
3702 (Target_selector::do_recognize_by_emulation): New function.
3703 (Target_selector::do_supported_emulations): New function.
3704 (select_target_by_bfd_name): Change name in declaration.
3705 (select_target_by_emulation): Declare.
3706 (supported_emulation_names): Declare.
3707 * parameters.cc (parameters_force_valid_target): Try to find
3708 target based on emulation from -m option.
3709 * options.h (class General_options): Change doc string for -m.
3710 * options.cc (help): Print emulations.
3711 (General_options::parse_V): Likewise.
3712 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3713 Add emulation parameter. Change all callers.
3714
200b2bb9
ILT
37152011-06-28 Ian Lance Taylor <iant@google.com>
3716
3717 * target.h (class Target): Add osabi_ field.
3718 (Target::osabi): New function.
3719 (Target::set_osabi): New function.
3720 (Target::Target): Initialize osabi_.
3721 (Target::do_adjust_elf_header): Make pure virtual.
3722 (Sized_target::do_adjust_elf_header): Declare.
3723 * target.cc (Sized_target::do_adjust_elf_header): New function.
3724 (class Sized_target): Instantiate all versions.
3725 * freebsd.h (class Target_freebsd): Remove.
3726 (Target_selector_freebsd::do_recognize): Call set_osabi on
3727 Target.
3728 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3729 (Target_selector_freebsd::set_osabi): Remove.
3730 * i386.cc (class Target_i386): Inherit from Sized_target rather
3731 than Target_freebsd.
3732 * x86_64.cc (class Target_x86_64): Likewise.
3733
b3ce541e
ILT
37342011-06-28 Ian Lance Taylor <iant@google.com>
3735
3736 * target.h (Target::can_check_for_function_pointers): Rewrite.
3737 Make non-virtual.
3738 (Target::can_icf_inline_merge_sections): Likewise.
3739 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3740 (Target::Target_info): Add can_icf_inline_merge_sections field.
3741 (Target::do_can_check_for_function_pointers): New virtual
3742 function.
3743 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3744 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3745 from can_check_for_function_pointers, move in file.
3746 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3747 section_may_have_icf_unsafe_poineters, move in file.
3748 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3749 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3750 Rename from can_check_for_function_pointers, move in file.
3751 (Target_i386::can_icf_inline_merge_sections): Remove.
3752 (Target_i386::i386_info): Initialize
3753 can_icf_inline_merge_sections.
3754 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3755 Initialize can_icf_inline_merge_sections.
3756 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3757 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3758 Rename from can_check_for_function_pointers, move in file.
3759 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3760 (Target_x86_64::x86_64_info): Initialize
3761 can_icf_inline_merge_sections.
3762 * testsuite/testfile.cc (Target_test::test_target_info):
3763 Likewise.
3764 * icf.cc (get_section_contents): Correct formatting.
3765
6d1c4efb
ILT
37662011-06-27 Ian Lance Taylor <iant@google.com>
3767
3768 * symtab.cc (Symbol::versioned_name): New function.
3769 (Symbol_table::add_to_final_symtab): Use versioned_name when
3770 appropriate.
3771 (Symbol_table::sized_write_symbol): Likewise.
3772 * symtab.h (class Symbol): Declare versioned_name.
3773 * stringpool.h (class Stringpool_template): Add variant of add
3774 which takes a std::basic_string.
3775 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3776 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3777 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3778 (ver_test_12.o): New target.
3779 * testsuite/Makefile.in: Rebuild.
3780
57eb9b50
DK
37812011-06-27 Doug Kwan <dougkwan@google.com>
3782
3783 * arm.cc (Arm_relocate_functions::thm_jump8,
3784 Arm_relocate_functions::thm_jump11): Use a wider signed
3785 type to compute offset.
3786 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3787 arm_thm_jump8.
3788 * testsuite/Makefile.in: Regenerate.
3789 * testsuite/arm_branch_in_range.sh: Check test results of
3790 arm_thm_jump11 and arm_thm_jump8.
3791 * testsuite/arm_thm_jump11.s: New test source file.
3792 * testsuite/arm_thm_jump11.t: New linker script.
3793 * testsuite/arm_thm_jump8.s: New test source file.
3794 * testsuite/arm_thm_jump8.t: New linker script.
3795
487b39df
ILT
37962011-06-24 Ian Lance Taylor <iant@google.com>
3797
3798 * layout.cc: Include "object.h".
3799 (ctors_sections_in_init_array): New static variable.
3800 (Layout::is_ctors_in_init_array): New function.
3801 (Layout::layout): Add entry to ctors_sections_in_init_array if
3802 appropriate.
3803 * layout.h (class Layout): Declare is_ctors_in_init_array.
3804 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3805 is_ctors_reverse_view is set.
3806 (Sized_relobj_file::write_sections): Add layout parameter. Change
3807 all callers. Set is_ctors_reverse_view field of View_size.
3808 (Sized_relobj_file::reverse_words): New function.
3809 * object.h (Sized_relobj_file::View_size): Add
3810 is_ctors_reverse_view field.
3811 (class Sized_relobj_file): Update declarations.
3812 * testsuite/initpri3.c: New test.
3813 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3814 initpri3b.
3815 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3816 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3817 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3818 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
3819 * testsuite/Makefile.in: Rebuild.
3820
472076e4
CC
38212011-06-24 Cary Coutant <ccoutant@google.com>
3822
3823 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
3824 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
3825 (debug_msg_cdebug.err): New targets.
3826 * testsuite/Makefile.in: Regenerate.
3827 * testsuite/debug_msg.sh: Check output of link with compressed debug.
3828 Fix checks for link with shared library.
3829
a60af0db
DK
38302011-06-24 Doug Kwan <dougkwan@google.com>
3831
3832 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
3833 skip empty text sections.
3834 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
3835
5393d741
ILT
38362011-06-22 Ian Lance Taylor <iant@google.com>
3837
3838 PR gold/12910
3839 * options.h (class General_options): Add --ctors-in-init-array.
3840 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
3841 friends as SHT_PROGBITS for merging sections.
3842 (Layout::layout): Remove special handling of .init_array and
3843 friends. Don't sort if doing relocatable link. Sort for .ctors
3844 and .dtors if ctors_in_init_array.
3845 (Layout::make_output_section): Force correct section types for
3846 .init_array and friends. Don't sort if doing relocatable link,
3847 Don't sort .ctors and .dtors if ctors_in_init_array.
3848 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
3849 (Layout::output_section_name): Add relobj parameter. Change all
3850 callers. Handle .ctors. and .dtors. in code rather than table.
3851 Handle .ctors and .dtors if ctors_in_init_array.
3852 (Layout::match_file_name): New function, moved from output.cc.
3853 * layout.h (class Layout): Update declarations.
3854 * output.cc: Include "layout.h".
3855 (Input_section_sort_entry::get_priority): New function.
3856 (Input_section_sort_entry::match_file_name): Just call
3857 Layout::match_file_name.
3858 (Output_section::Input_section_sort_init_fini_compare::operator()):
3859 Handle .ctors and .dtors. Sort by explicit priority rather than
3860 by name.
3861 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
3862 * testsuite/initpri2.c: New test.
3863 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
3864 (check_PROGRAMS): Add initpri2.
3865 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
3866 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
3867 * configure, testsuite/Makefile.in: Rebuild.
3868
e1f74f98
ILT
38692011-06-19 Ian Lance Taylor <iant@google.com>
3870
3871 PR gold/12880
3872 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
3873 .interp section to a PT_INTERP segment even if we have seen a
3874 --dynamic-linker option. Don't do it if we have seen a PHDRS
3875 clause in a linker script.
3876 (Layout::finalize): Don't create a .interp section if we've
3877 already create a PT_INTERP segment.
3878 (Layout::create_interp): Always call choose_output_section (revert
3879 patch of 2011-06-17). Don't create PT_INTERP segment.
3880 * script-sections.cc
3881 (Script_sections::create_note_and_tls_segments): Add a .interp
3882 section to a PT_INTERP segment even if we have seen a
3883 --dynamic-linker option.
3884
766f91bb
ILT
38852011-06-18 Ian Lance Taylor <iant@google.com>
3886
3887 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
3888 merely because a non-PT_LOAD segment has a dynamic reloc.
3889
0d212c3a
ILT
38902011-06-18 Ian Lance Taylor <iant@google.com>
3891
3892 * layout.cc (Layout::finish_dynamic_section): Don't create
3893 DT_FLAGS entry if not needed.
3894
911a5072
ILT
38952011-06-18 Ian Lance Taylor <iant@google.com>
3896
3897 PR gold/12745
3898 * layout.cc (Layout::layout_eh_frame): Correct handling of
3899 writable .eh_frame section.
3900
534b4e5f
ILT
39012011-06-17 Ian Lance Taylor <iant@google.com>
3902
3903 PR gold/12893
3904 * resolve.cc (Symbol_table::resolve): Don't give an error if a
3905 symbol is redefined with the exact same object and value.
3906
10b4f102
ILT
39072011-06-17 Ian Lance Taylor <iant@google.com>
3908
3909 PR gold/12880
3910 * layout.h (class Layout): Add interp_segment_ field.
3911 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
3912 (Layout::attach_allocated_section_to_segment): If making shared
3913 library, put .interp section in PT_INTERP segment.
3914 (Layout::finalize): Also call create_interp if -dynamic-linker
3915 option was used.
3916 (Layout::create_interp): Assert that there is no PT_INTERP
3917 segment. If not using a SECTIONS clause, use make_output_section.
3918 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
3919 * script-sections.cc
3920 (Script_sections::create_note_and_tls_segments): If making shared
3921 library, put .interp section in PT_INTERP segment.
3922
a29b0dad
ILT
39232011-06-17 Ian Lance Taylor <iant@google.com>
3924
e588ea8d
ILT
3925 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
3926 when making a shared library.
3927
39282011-06-17 Ian Lance Taylor <iant@google.com>
3929
3930 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
3931 parameter. Change all callers. Don't issue warning about PC32
3932 against locally defined symbol.
a29b0dad 3933
9d3b0698
ILT
39342011-06-16 Ian Lance Taylor <iant@google.com>
3935
3936 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
3937 occurs in same object.
3938
85b0f90c
AM
39392011-06-14 Alan Modra <amodra@gmail.com>
3940
3941 * po/POTFILES.in: Regenerate.
3942
a94907d9
ILT
39432011-06-09 Ian Lance Taylor <iant@google.com>
3944
3945 * script-sections.cc
3946 (Orphan_output_section::set_section_addresses): For a relocatable
3947 link set address to 0.
3948
4fb3a1c3
CC
39492011-06-09 Cary Coutant <ccoutant@google.com>
3950
3951 PR gold/12804
3952 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
3953 used with --compress-debug-sections.
3954 * gold/object.cc (Sized_relobj_file::do_layout): Report
3955 uncompressed size of compressed input sections.
3956
61220854
CC
39572011-06-08 Cary Coutant <ccoutant@google.com>
3958
3959 PR gold/12804
3960 * testsuite/two_file_test_2_v1.cc: Change initialization of
3961 v2 to keep it in .data.
3962
e6455dfb
CC
39632011-06-07 Cary Coutant <ccoutant@google.com>
3964
3965 * common.cc (Symbol_table::do_allocate_commons_list): Call
3966 gold_fallback.
3967 * errors.cc (Errors::fatal): Adjust call to gold_exit.
3968 (Errors::fallback): New function.
3969 (gold_fallback): New function.
3970 * errors.h (Errors::fallback): New function.
3971 * gold.cc (gold_exit): Change status parameter to enum; adjust
3972 all callers.
3973 (queue_initial_tasks): Call gold_fallback.
3974 * gold.h: Include cstdlib.
3975 (Exit_status): New enum type.
3976 (gold_exit): Change status parameter to enum.
3977 (gold_fallback): New function.
3978 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
3979 (Layout::create_symtab_sections): Likewise.
3980 (Layout::create_shdrs): Likewise.
3981 * main.cc (main): Adjust call to gold_exit.
3982 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
3983 (Output_data_got::add_got_entry_pair): Likewise.
3984 (Output_section::add_input_section): Likewise.
3985 (Output_section::add_output_section_data): Likewise.
3986 (Output_segment::set_section_list_addresses): Likewise.
3987 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
3988
fb0e076f
CC
39892011-06-07 Cary Coutant <ccoutant@google.com>
3990
3991 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
3992 for incremental links.
3993 * output.cc (Output_segment::set_section_list_addresses): Remove
3994 FIXME and test for TLS or BSS.
3995
a5ee4d5d
CC
39962011-06-07 Cary Coutant <ccoutant@google.com>
3997
3998 * testsuite/Makefile.am: Add incremental_copy_test,
3999 incremental_common_test_1.
4000 * testsuite/Makefile.in: Regenerate.
4001 * testsuite/common_test_1_v1.c: New source file.
4002 * testsuite/common_test_1_v2.c: New source file.
4003 * testsuite/copy_test_v1.cc: New source file.
4004
5146f448
CC
40052011-06-07 Cary Coutant <ccoutant@google.com>
4006
4007 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4008 update, allocate common from bss section's free list.
4009 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4010 linker-defined symbols.
4011 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4012 Skip GOT and PLT entries that are no longer referenced.
4013 (Output_section_incremental_inputs::write_info_blocks): Mark
4014 linker-defined symbols.
4015 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4016 * output.cc (Output_section::allocate): New function.
4017 * output.h (Output_section::allocate): New function.
4018 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4019 linker-defined symbols.
4020 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4021 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4022 (Symbol::init_base_output_data): Likewise.
4023 (Symbol::init_base_output_segment): Likewise.
4024 (Symbol::init_base_constant): Likewise.
4025 (Sized_symbol::init_output_data): Likewise.
4026 (Sized_symbol::init_output_segment): Likewise.
4027 (Sized_symbol::init_constant): Likewise.
4028 (Symbol_table::do_define_in_output_data): Likewise.
4029 (Symbol_table::do_define_in_output_segment): Likewise.
4030 (Symbol_table::do_define_as_constant): Likewise.
4031 * symtab.h (Symbol::is_predefined): New function.
4032 (Symbol::init_base_output_data): Add is_predefined parameter.
4033 (Symbol::init_base_output_segment): Likewise.
4034 (Symbol::init_base_constant): Likewise.
4035 (Symbol::is_predefined_): New data member.
4036 (Sized_symbol::init_output_data): Add is_predefined parameter.
4037 (Sized_symbol::init_output_segment): Likewise.
4038 (Sized_symbol::init_constant): Likewise.
4039 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4040
26d3c67d
CC
40412011-06-07 Cary Coutant <ccoutant@google.com>
4042
4043 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4044 instead of emit_copy_reloc.
4045 (Copy_relocs::emit_copy_reloc): Refactor.
4046 (Copy_relocs::make_copy_reloc): New function.
4047 (Copy_relocs::add_copy_reloc): Remove.
4048 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4049 section.
4050 (Copy_relocs::make_copy_reloc): New function.
4051 (Copy_relocs::add_copy_reloc): Remove.
4052 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4053 unchanged input files.
4054 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4055 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4056 Reserve BSS space for COPY relocations.
4057 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4058 (Output_section_incremental_inputs::write_info_blocks): Record
4059 whether a symbol is copied from a shared object.
4060 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4061 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4062 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4063 (Incremental_input_entry_reader::get_output_symbol_index): Add
4064 is_copy parameter.
4065 (Incremental_binary::emit_copy_relocs): New function.
4066 (Incremental_binary::do_emit_copy_relocs): New function.
4067 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4068 new data member.
4069 (Sized_incremental_binary::add_copy_reloc): New function.
4070 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4071 (Sized_incremental_binary::Copy_reloc): New struct.
4072 (Sized_incremental_binary::Copy_relocs): New typedef.
4073 (Sized_incremental_binary::copy_relocs_): New data member.
4074 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4075 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4076 * target.h (Sized_target::emit_copy_reloc): New function.
4077 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4078
7cdb37d9
CC
40792011-06-02 Cary Coutant <ccoutant@google.com>
4080
4081 PR gold/12163
4082 * gold/archive.cc (Archive::Archive): Initialize new data member.
4083 (Archive::include_all_members): Return if archive has already been
4084 included.
4085 * gold/archive.h (Archive::include_all_members_): New data member.
4086
cc643b88
NC
40872011-06-02 Nick Clifton <nickc@redhat.com>
4088
4089 * dynobj.h: Fix spelling mistake in comment.
4090 * output.cc: Likewise.
4091
f62a3ca7 40922011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4093 Asier Llano
f62a3ca7
DK
4094
4095 PR gold/12826
cc643b88 4096 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4097 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4098 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4099 redundant arm_exidx_test.so.
4100 * testsuite/Makefile.in: Regenerate.
4101 (check_SCRIPTS): Add pr12826.sh
4102 (check_DATA): Add pr12826.stdout
4103 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4104 * testsuite/pr12826.sh: New file.
4105 * testsuite/pr12826_1.s: Ditto.
4106 * testsuite/pr12826_1.s: Ditto.
4107
8dbe1edc
ILT
41082011-05-30 Ian Lance Taylor <iant@google.com>
4109
4110 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4111 sections.
4112
c49875be
ILT
41132011-05-29 Ian Lance Taylor <iant@google.com>
4114
4115 PR gold/12804
4116 * testsuite/Makefile.am: Use different file name for two_file_test
4117 temporary file for each incremental test.
4118 * testsuite/Makefile.in: Rebuild.
4119
69d53f7a
ILT
41202011-05-29 Ian Lance Taylor <iant@google.com>
4121
4122 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4123 binary input file is empty.
4124
41d0ab5f
ILT
41252011-05-27 Ian Lance Taylor <iant@google.com>
4126
4127 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4128 (ver_test_9.so): Likewise.
4129 * testsuite/Makefile.in: Rebuild.
4130
89d8a36b
CC
41312011-05-26 Cary Coutant <ccoutant@google.com>
4132
4133 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4134 * incremental.cc (Incremental_inputs::report_input_section): Fix
4135 comment, indentation.
4136 (Incremental_inputs::report_comdat_group): New function.
4137 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4138 of data for incremental input file entry.
4139 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4140 group count, COMDAT group signatures.
4141 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4142 an unchanged input file.
4143 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4144 Initialize new data member.
4145 (Incremental_object_entry::add_comdat_group): New function.
4146 (Incremental_object_entry::get_comdat_group_count): New function.
4147 (Incremental_object_entry::get_comdat_signature_key): New function.
4148 (Incremental_object_entry::groups_): New data member.
4149 (Incremental_inputs::report_comdat_group): New function.
4150 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4151 data for incremental input file entry.
4152 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4153 (Incremental_input_entry_reader::get_input_section): Adjust size of
4154 data for incremental input file entry.
4155 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4156 (Incremental_input_entry_reader::get_comdat_group_signature): New
4157 function.
4158 * object.cc (Sized_relobj::include_section_group): Report kept
4159 COMDAT groups for incremental links.
4160
1706a06f
ILT
41612011-05-24 David Meyer <pdox@google.com>
4162
4163 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4164 with name parameter. Add found_name parameter.
4165 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4166 * dirsearch.h (class Dirsearch): Update declaration.
4167
a10ae760
ILT
41682011-05-24 Ian Lance Taylor <iant@google.com>
4169
4170 * archive.cc (Library_base::should_include_member): Pull in object
4171 from archive if it defines the entry symbol.
4172 * parameters.cc (Parameters::entry): New function.
4173 * parameters.h (class Parameters): Declare entry.
4174 * output.h (class Output_file_header): Remove entry_ field.
4175 * output.cc (Output_file_header::Output_file_header): Remove entry
4176 parameter. Change all callers.
4177 (Output_file_header::entry): Use parameters->entry.
4178 * gold.cc (queue_middle_tasks): Likewise.
4179 * plugin.cc (Plugin_hook::run): Likewise.
4180
aa92d6ed
CC
41812011-05-24 Cary Coutant <ccoutant@google.com>
4182
4183 * gold.cc (queue_initial_tasks): Pass incremental base filename
4184 to Output_file::open_base_file; don't print error message.
4185 * incremental-dump.cc (main): Adjust call to
4186 Output_file::open_for_modification.
4187 * incremental-dump.cc (main): Likewise.
4188 * incremental.cc (Incremental_inputs::report_command_line):
4189 Ignore --incremental-base option when comparing command lines.
4190 Ignore parameter when given as separate argument.
4191 * options.h (class General_options): Add --incremental-base.
4192 * output.cc (Output_file::Output_file):
4193 (Output_file::open_base_file): Add base_name and writable parameters;
4194 read base file into new file; print error message here.
4195 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4196 callers.
4197 * output.h (Output_file::open_for_modification): Rename to...
4198 (Output_file::open_base_file): ...this; add base_name and
4199 writable parameters; adjust all callers.
4200 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4201 callers.
4202 * testsuite/Makefile.am (incremental_test_4): Test
4203 --incremental-base.
4204 * testsuite/Makefile.in: Regenerate.
4205
2eedd706
CC
42062011-05-24 Cary Coutant <ccoutant@google.com>
4207
4208 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4209 incremental_test_4.
4210 * testsuite/Makefile.in: Regenerate.
4211 * testsuite/two_file_test_1_v1.cc: New test source file.
4212 * testsuite/two_file_test_1b_v1.cc: New test source file.
4213 * testsuite/two_file_test_2_v1.cc: New test source file.
4214
0f1c85a6
CC
42152011-05-24 Cary Coutant <ccoutant@google.com>
4216
4217 * dynobj.h (Dynobj::do_dynobj): New function.
4218 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4219 flag and soname for shared objects.
4220 * incremental.cc (Incremental_inputs::report_object): Make
4221 either Incremental_object_entry or Incremental_dynobj_entry; add
4222 soname to string table.
4223 (Incremental_inputs::report_input_section): Add assertion.
4224 (Output_section_incremental_inputs::set_final_data_size): Adjust
4225 type of input file entry for shared libraries; adjust size of
4226 shared library info entry.
4227 (Output_section_incremental_inputs::write_input_files): Write
4228 as_needed flag for shared libraries.
4229 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4230 of input file entry for shared libraries; write soname.
4231 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4232 soname from incremental info.
4233 * incremental.h (enum Incremental_input_flags): Add
4234 INCREMENTAL_INPUT_AS_NEEDED.
4235 (Incremental_input_entry::Incremental_input_entry): Initialize new
4236 data member.
4237 (Incremental_input_entry::set_as_needed): New function.
4238 (Incremental_input_entry::as_needed): New function.
4239 (Incremental_input_entry::do_dynobj_entry): New function.
4240 (Incremental_input_entry::as_needed_): New data member.
4241 (Incremental_object_entry::Incremental_object_entry): Don't check
4242 for shared library.
4243 (Incremental_object_entry::do_type): Likewise.
4244 (class Incremental_dynobj_entry): New class.
4245 (Incremental_input_entry_reader::as_needed): New function.
4246 (Incremental_input_entry_reader::get_soname): New function.
4247 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4248 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4249 size of shared library info entry.
58797674 4250 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
4251 incremental link when adding DT_NEEDED entries.
4252 * object.h (Object::Object): Initialize new data member.
4253 (Object::dynobj): New function.
4254 (Object::set_as_needed): New function.
4255 (Object::as_needed): New function.
4256 (Object::do_dynobj): New function.
4257 (Object::as_needed_): New data member.
4258
6fa2a40b
CC
42592011-05-24 Cary Coutant <ccoutant@google.com>
4260
4261 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4262 info; adjust display of GOT entries.
4263 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4264 vector of input objects; remove file_status_.
4265 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4266 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4267 got_plt reader; call target hooks to reserve GOT entries.
4268 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4269 of input file info header and GOT info entry.
4270 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4271 relocation info.
4272 (Got_plt_view_info::got_descriptor): Remove.
4273 (Got_plt_view_info::sym_index): New data member.
4274 (Got_plt_view_info::input_index): New data member.
4275 (Local_got_offset_visitor::visit): Write input file index.
4276 (Global_got_offset_visitor::visit): Write 0 for input file index.
4277 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4278 with sym_index and input_index.
4279 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4280 incremental info GOT entry; replace got_descriptor with input_index.
4281 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4282 map from input file index to object.
4283 (Sized_relobj_incr::do_layout): Replace direct data member reference
4284 with accessor function.
4285 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4286 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4287 Adjust size of input file info header.
4288 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4289 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4290 (Incremental_input_entry_reader::get_input_section): Adjust size of
4291 input file info header.
4292 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4293 of incremental info GOT entry.
4294 (Incremental_got_plt_reader::get_got_desc): Remove.
4295 (Incremental_got_plt_reader::get_got_symndx): New function.
4296 (Incremental_got_plt_reader::get_got_input_index): New function.
4297 (Sized_incremental_binary::Sized_incremental_binary): Remove
4298 file_status_; add input_objects_.
4299 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4300 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4301 (Sized_incremental_binary::file_is_unchanged): Remove.
4302 (Sized_incremental_binary::set_input_object): New function.
4303 (Sized_incremental_binary::input_object): New function.
4304 (Sized_incremental_binary::file_status_): Remove.
4305 (Sized_incremental_binary::input_objects_): New data member.
4306 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4307 references.
4308 (Sized_relobj_incr::invalid_address): Move to base class.
4309 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4310 class.
4311 (Sized_relobj_incr::do_output_section_offset): Likewise.
4312 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4313 (Sized_relobj_incr::section_offsets_): Likewise.
4314 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4315 function.
4316 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4317 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4318 with accessor function.
4319 (Sized_relobj_file::do_layout): Likewise.
4320 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4321 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4322 (Sized_relobj_file::compute_final_local_value): Replace refs to
4323 section_offsets_ with accessor function.
4324 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4325 * object.h (Relobj::Relobj): Initialize new data members.
4326 (Relobj::add_dyn_reloc): New function.
4327 (Relobj::first_dyn_reloc): New function.
4328 (Relobj::dyn_reloc_count): New function.
4329 (Relobj::first_dyn_reloc_): New data member.
4330 (Relobj::dyn_reloc_count_): New data member.
4331 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4332 references.
4333 (Sized_relobj::Address): New typedef.
4334 (Sized_relobj::invalid_address): Move here from child class.
4335 (Sized_relobj::Sized_relobj): Initialize new data members.
4336 (Sized_relobj::sized_relobj): New function.
4337 (Sized_relobj::is_output_section_offset_invalid): Move here from
4338 child class.
4339 (Sized_relobj::get_output_section_offset): Likewise.
4340 (Sized_relobj::local_has_got_offset): Likewise.
4341 (Sized_relobj::local_got_offset): Likewise.
4342 (Sized_relobj::set_local_got_offset): Likewise.
4343 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4344 (Sized_relobj::clear_got_offsets): New function.
4345 (Sized_relobj::section_offsets): Move here from child class.
4346 (Sized_relobj::do_output_section_offset): Likewise.
4347 (Sized_relobj::do_set_section_offset): Likewise.
4348 (Sized_relobj::Local_got_offsets): Likewise.
4349 (Sized_relobj::local_got_offsets_): Likewise.
4350 (Sized_relobj::section_offsets_): Likewise.
4351 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4352 references.
4353 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4354 class.
4355 (Sized_relobj_file::sized_relobj): New function
4356 (Sized_relobj_file::local_has_got_offset): Move to base class.
4357 (Sized_relobj_file::local_got_offset): Likewise.
4358 (Sized_relobj_file::set_local_got_offset): Likewise.
4359 (Sized_relobj_file::get_output_section_offset): Likewise.
4360 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4361 (Sized_relobj_file::do_output_section_offset): Likewise.
4362 (Sized_relobj_file::do_set_section_offset): Likewise.
4363 (Sized_relobj_file::Local_got_offsets): Likewise.
4364 (Sized_relobj_file::local_got_offsets_): Likewise.
4365 (Sized_relobj_file::section_offsets_): Likewise.
4366 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4367 (all constructors).
4368 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4369 (Output_reloc::get_symbol_index): Likewise.
4370 (Output_reloc::local_section_offset): Likewise.
4371 (Output_reloc::get_address): Likewise.
4372 (Output_reloc::symbol_value): Likewise.
4373 (Output_data_got::reserve_slot): Move to class definition.
4374 (Output_data_got::reserve_local): New function.
4375 (Output_data_got::reserve_slot_for_global): Remove.
4376 (Output_data_got::reserve_global): New function.
4377 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4378 (all constructors, two instantiations).
4379 (Output_reloc::get_relobj): New function (two instantiations).
4380 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4381 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4382 (Output_data_reloc::add_global): Adjust type of relobj.
4383 (Output_data_reloc::add_global_relative): Likewise.
4384 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4385 (Output_data_reloc::add_local): Likewise.
4386 (Output_data_reloc::add_local_relative): Likewise.
4387 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4388 (Output_data_reloc::add_local_section): Likewise.
4389 (Output_data_reloc::add_output_section): Likewise.
4390 (Output_data_reloc::add_absolute): Likewise.
4391 (Output_data_reloc::add_target_specific): Likewise.
4392 (Output_data_got::reserve_slot): Move definition here.
4393 (Output_data_got::reserve_local): New function.
4394 (Output_data_got::reserve_global): New function.
4395 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4396 section_offsets_ with accessor function.
4397 (Sized_relobj_file::write_sections): Likewise.
4398 (Sized_relobj_file::do_relocate_sections): Likewise.
4399 * target.h (Sized_target::reserve_local_got_entry): New function.
4400 (Sized_target::reserve_global_got_entry): New function.
4401 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4402 (Target_x86_64::reserve_global_got_entry): New function.
4403 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4404
4829d394
CC
44052011-05-23 Cary Coutant <ccoutant@google.com>
4406
4407 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4408 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4409 bit when checking got_type.
4410 * incremental.cc (Sized_incremental_binary::setup_readers):
4411 Store symbol table and string table locations; initialize bit vector
4412 of file status flags.
4413 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4414 unchanged files.
4415 (Sized_incremental_binary::do_process_got_plt): New function.
4416 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4417 (Output_section_incremental_inputs::set_final_data_size): Record
4418 file index for each input file.
4419 (Output_section_incremental_inputs::write_got_plt): Store file index
4420 instead of input entry offset for each GOT entry.
4421 * incremental.h
4422 (Incremental_input_entry::Incremental_input_entry): Initialize new
4423 data member.
4424 (Incremental_input_entry::set_offset): Store file index.
4425 (Incremental_input_entry::get_file_index): New function.
4426 (Incremental_input_entry::file_index_): New data member.
4427 (Incremental_binary::process_got_plt): New function.
4428 (Incremental_binary::do_process_got_plt): New function.
4429 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4430 data members.
4431 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4432 (Sized_incremental_binary::set_file_is_unchanged): New function.
4433 (Sized_incremental_binary::file_is_unchanged): New function.
4434 (Sized_incremental_binary::do_process_got_plt): New function.
4435 (Sized_incremental_binary::file_status_): New data member.
4436 (Sized_incremental_binary::main_symtab_loc_): New data member.
4437 (Sized_incremental_binary::main_strtab_loc_): New data member.
4438 * output.cc (Output_data_got::Got_entry::write): Add case
4439 RESERVED_CODE.
4440 (Output_data_got::add_global): Call add_got_entry.
4441 (Output_data_got::add_global_plt): Likewise.
4442 (Output_data_got::add_global_with_rel): Likewise.
4443 (Output_data_got::add_global_with_rela): Likewise.
4444 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4445 (Output_data_got::add_global_pair_with_rela): Likewise.
4446 (Output_data_got::add_local): Call add_got_entry.
4447 (Output_data_got::add_local_plt): Likewise.
4448 (Output_data_got::add_local_with_rel): Likewise.
4449 (Output_data_got::add_local_with_rela): Likewise.
4450 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4451 (Output_data_got::add_local_pair_with_rela): Likewise.
4452 (Output_data_got::reserve_slot): New function.
4453 (Output_data_got::reserve_slot_for_global): New function.
4454 (Output_data_got::add_got_entry): New function.
4455 (Output_data_got::add_got_entry_pair): New function.
4456 (Output_section::add_output_section_data): Edit FIXME.
4457 * output.h
4458 (Output_section_data_build::Output_section_data_build): New
4459 constructor with size parameter.
4460 (Output_data_space::Output_data_space): Likewise.
4461 (Output_data_got::Output_data_got): Initialize new data member; new
4462 constructor with size parameter.
4463 (Output_data_got::add_constant): Call add_got_entry.
4464 (Output_data_got::reserve_slot): New function.
4465 (Output_data_got::reserve_slot_for_global): New function.
4466 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4467 (Output_data_got::add_got_entry): New function.
4468 (Output_data_got::add_got_entry_pair): New function.
4469 (Output_data_got::free_list_): New data member.
4470 * target.h (Sized_target::init_got_plt_for_update): New function.
4471 (Sized_target::register_global_plt_entry): New function.
4472 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4473 Initialize new data member; call init; add constructor with PLT count.
4474 (Output_data_plt_x86_64::init): New function.
4475 (Output_data_plt_x86_64::add_relocation): New function.
4476 (Output_data_plt_x86_64::reserve_slot): New function.
4477 (Output_data_plt_x86_64::free_list_): New data member.
4478 (Target_x86_64::init_got_plt_for_update): New function.
4479 (Target_x86_64::register_global_plt_entry): New function.
4480 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4481 incremental updates.
4482 (Output_data_plt_x86_64::add_relocation): New function.
4483 * testsuite/object_unittest.cc (Object_test): Set default options.
4484
ec69d6da
ILT
44852011-05-16 Ian Lance Taylor <iant@google.com>
4486
4487 * options.h (class General_options): Make -i a synonym for -r.
4488
732e31de
ILT
44892011-05-16 Ian Lance Taylor <iant@google.com>
4490
4491 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4492
403676b5
CC
44932011-05-10 Cary Coutant <ccoutant@google.com>
4494
4495 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4496 strip_all (-s).
4497
5b7b7d6e
ILT
44982011-05-06 Ian Lance Taylor <iant@google.com>
4499
4500 * layout.cc (Layout::layout): If the output section flags change,
4501 update the ordering.
4502
f0f9babf
CC
45032011-04-25 Cary Coutant <ccoutant@google.com>
4504
4505 * incremental-dump.cc (dump_incremental_inputs): Print local
4506 symbol info for each input file.
4507 * incremental.cc
4508 (Output_section_incremental_inputs::set_final_data_size): Add local
4509 symbol info to input file entries in incremental info.
4510 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4511 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4512 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4513 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4514 implementation.
4515 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4516 (Sized_incr_relobj::do_relocate): Write the local symbols.
4517 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4518 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4519 Adjust size of input file header.
4520 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4521 (Incremental_inputs_reader::get_local_symbol_count): New function.
4522 (Incremental_inputs_reader::get_input_section): Adjust size of input
4523 file header.
4524 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4525 (Sized_incr_relobj::This): New typedef.
4526 (Sized_incr_relobj::sym_size): New const data member.
4527 (Sized_incr_relobj::Local_symbol): New struct.
4528 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4529 (Sized_incr_relobj::do_local_symbol_offset): New function.
4530 (Sized_incr_relobj::local_symbol_count_): New data member.
4531 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4532 (Sized_incr_relobj::local_symbol_index_): New data member.
4533 (Sized_incr_relobj::local_symbol_offset_): New data member.
4534 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4535 (Sized_incr_relobj::local_symbols_): New data member.
4536 * object.h (Relobj::output_local_symbol_count): New function.
4537 (Relobj::local_symbol_offset): New function.
4538 (Relobj::do_output_local_symbol_count): New function.
4539 (Relobj::do_local_symbol_offset): New function.
4540 (Sized_relobj::do_output_local_symbol_count): New function.
4541 (Sized_relobj::do_local_symbol_offset): New function.
4542
d0a9ace3
ILT
45432011-04-22 Vladimir Simonov <sv@sw.ru>
4544
4545 * descriptors.cc (set_close_on_exec): New function.
4546 (Descriptors::open): Use set_close_on_exec.
4547 * output.cc (S_ISLNK): Define if not defined.
4548
94a3fc8b
CC
45492011-04-22 Cary Coutant <ccoutant@google.com>
4550
4551 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4552 global symbol map.
4553 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4554 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4555 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4556 relocations.
4557 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4558 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4559 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4560 * incremental.h
4561 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4562 function.
4563 (Incremental_binary::apply_incremental_relocs): New function.
4564 (Incremental_binary::do_apply_incremental_relocs): New function.
4565 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4566 data member.
4567 (Sized_incremental_binary::add_global_symbol): New function.
4568 (Sized_incremental_binary::global_symbol): New function.
4569 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4570 (Sized_incremental_binary::symbol_map_): New data member.
4571 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4572 * target.h (Sized_target::apply_relocation): New function.
4573 * target-reloc.h (apply_relocation): New function.
4574 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4575
c87e4302
DK
45762011-04-22 Doug Kwan <dougkwan@google.com>
4577
4578 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4579 flag of a SHT_ARM_EXIDX section.
2e702c99 4580 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
4581 * testsuite/Makefile.in: Regenerate.
4582 * testsuite/arm_exidx_test.s: New file.
4583 * testsuite/arm_exidx_test.sh: Same.
4584
e7782cf6
CC
45852011-04-20 Cary Coutant <ccoutant@google.com>
4586
4587 PR gold/12689
4588 * archive.h (Incremental_archive_entry::Archive_member):
4589 Initialize arg_serial_ (second constructor).
4590
308ecdc7
ILT
45912011-04-17 Ian Lance Taylor <iant@google.com>
4592
4593 * object.cc (Relocate_info::location): Simplify location string.
4594 * errors.cc (Errors::error_at_location): Don't print program
4595 name.
4596 (Errors::warning_at_location): Likewise.
4597 (Errors::undefined_symbol): Likewise.
4598 * testsuite/debug_msg.sh: Update accordingly.
4599
bec5b579
CC
46002011-04-14 Cary Coutant <ccoutant@google.com>
4601
4602 * gold/layout.cc (Layout::symtab_section_offset): New function.
4603 * gold/layout.h (Layout::symtab_section_offset): New function.
4604 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4605
88597d34
ILT
46062011-04-12 Ian Lance Taylor <iant@google.com>
4607
4608 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4609 with MREMAP_MAYMOVE.
4610 * output.h (class Output_file): Add map_is_allocated_ field.
4611 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4612 not available, provide stubs. If mremap is not available, #define
4613 it to gold_mremap.
4614 (MREMAP_MAYMOVE): Define if not defined.
4615 (Output_file::Output_file): Initialize map_is_allocated_.
4616 (Output_file::resize): Check map_is_allocated_.
4617 (Output_file::map_anonymous): If mmap fails, use malloc.
4618 (Output_file::unmap): Don't do anything for an anonymous map.
4619 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4620 is not available, provide stubs.
4621 (File_read::View::~View): Use free rather than delete[].
4622 (File_read::make_view): Use malloc rather than new[]. If mmap
4623 fails, use malloc.
4624 (File_read::find_or_make_view): Use malloc rather than new[].
4625 * gold.h: Remove HAVE_REMAP code.
4626 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4627 exists. Rename mremap to gold_mremap. If mmap is not available
4628 don't do anything.
4629 * configure, config.in: Rebuild.
4630
11e361bc
ILT
46312011-04-11 Ian Lance Taylor <iant@google.com>
4632
4633 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4634 initialize local variable v.
4635
cdc29364
CC
46362011-04-11 Cary Coutant <ccoutant@google.com>
4637
4638 * archive.cc (Archive::include_member): Adjust call to
4639 report_object.
4640 (Add_archive_symbols::run): Track argument serial numbers.
4641 (Lib_group::include_member): Likewise.
4642 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4643 * archive.h (Incremental_archive_entry::Archive_member):
4644 Initialize arg_serial_.
4645 (Archive_member::arg_serial_): New data member.
4646 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4647 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4648 incremental link.
4649 (Sized_dynobj::do_for_all_local_got_entries): New function.
4650 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4651 function.
4652 * fileread.cc (get_mtime): New function.
4653 * fileread.h (get_mtime): New function.
4654 * gold.cc (queue_initial_tasks): Check for incremental update.
4655 (process_incremental_input): New function.
4656 (queue_middle_tasks): Don't force valid target for incremental
4657 update.
4658 * incremental-dump.cc (find_input_containing_global): Adjust
4659 size of symbol info entry.
4660 (dump_incremental_inputs): Dump argument serial number and
4661 in_system_directory flag; bias shndx by 1; print symbol names
4662 when dumping per-file symbol lists; use new symbol info readers.
4663 * incremental.cc
4664 (Output_section_incremental_inputs:update_data_size): New function.
4665 (Sized_incremental_binary::setup_readers): Setup input readers
4666 for each input file; build maps for files added from libraries
4667 and scripts.
4668 (Sized_incremental_binary::check_input_args): New function.
4669 (Sized_incremental_binary::do_check_inputs): Build map of argument
4670 serial numbers to input arguments.
4671 (Sized_incremental_binary::do_file_has_changed): Rename
4672 do_file_is_unchanged to this; compare file modification times.
4673 (Sized_incremental_binary::do_init_layout): New function.
4674 (Sized_incremental_binary::do_reserve_layout): New function.
4675 (Sized_incremental_binary::do_get_input_reader): Remove.
4676 (Sized_incremental_binary::get_symtab_view): New function.
4677 (Incremental_checker::can_incrementally_link_output_file): Remove.
4678 (Incremental_inputs::report_command_line): Exclude --debug options.
4679 (Incremental_inputs::report_archive_begin): Add parameter; track
4680 argument serial numbers; don't put input file entry for archive
4681 before archive members.
4682 (Incremental_inputs::report_archive_end): Put input file entry
4683 for archive after archive members.
4684 (Incremental_inputs::report_object): Add parameter; track argument
4685 serial numbers and in_system_directory flag.
4686 (Incremental_inputs::report_script): Add parameter; track argument
4687 serial numbers.
4688 (Output_section_incremental_inputs::set_final_data_size): Adjust
4689 size of symbol info entry; check for forwarding symbols.
4690 (Output_section_incremental_inputs::write_input_files): Write
4691 in_system_directory flag and argument serial number.
4692 (Output_section_incremental_inputs::write_info_blocks): Map section
4693 indices between incremental info and original input file; store
4694 input section index for each symbol.
4695 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4696 change operator() to visit().
4697 (class Global_got_offset_visitor): Likewise.
4698 (class Global_symbol_visitor_got_plt):
4699 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4700 classes.
4701 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4702 (Sized_incr_relobj::do_read_symbols): New function.
4703 (Sized_incr_relobj::do_layout): New function.
4704 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4705 (Sized_incr_relobj::do_add_symbols): New function.
4706 (Sized_incr_relobj::do_should_include_member): New function.
4707 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4708 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4709 (Sized_incr_relobj::do_section_size): New function.
4710 (Sized_incr_relobj::do_section_name): New function.
4711 (Sized_incr_relobj::do_section_contents): New function.
4712 (Sized_incr_relobj::do_section_flags): New function.
4713 (Sized_incr_relobj::do_section_entsize): New function.
4714 (Sized_incr_relobj::do_section_address): New function.
4715 (Sized_incr_relobj::do_section_type): New function.
4716 (Sized_incr_relobj::do_section_link): New function.
4717 (Sized_incr_relobj::do_section_info): New function.
4718 (Sized_incr_relobj::do_section_addralign): New function.
4719 (Sized_incr_relobj::do_initialize_xindex): New function.
4720 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4721 (Sized_incr_relobj::do_read_relocs): New function.
4722 (Sized_incr_relobj::do_gc_process_relocs): New function.
4723 (Sized_incr_relobj::do_scan_relocs): New function.
4724 (Sized_incr_relobj::do_count_local_symbols): New function.
4725 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4726 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4727 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4728 (Sized_incr_relobj::do_relocate): New function.
4729 (Sized_incr_relobj::do_set_section_offset): New function.
4730 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4731 (Sized_incr_dynobj::do_read_symbols): New function.
4732 (Sized_incr_dynobj::do_layout): New function.
4733 (Sized_incr_dynobj::do_add_symbols): New function.
4734 (Sized_incr_dynobj::do_should_include_member): New function.
4735 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4736 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4737 (Sized_incr_dynobj::do_section_size): New function.
4738 (Sized_incr_dynobj::do_section_name): New function.
4739 (Sized_incr_dynobj::do_section_contents): New function.
4740 (Sized_incr_dynobj::do_section_flags): New function.
4741 (Sized_incr_dynobj::do_section_entsize): New function.
4742 (Sized_incr_dynobj::do_section_address): New function.
4743 (Sized_incr_dynobj::do_section_type): New function.
4744 (Sized_incr_dynobj::do_section_link): New function.
4745 (Sized_incr_dynobj::do_section_info): New function.
4746 (Sized_incr_dynobj::do_section_addralign): New function.
4747 (Sized_incr_dynobj::do_initialize_xindex): New function.
4748 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4749 (make_sized_incremental_object): New function.
4750 (Incremental_library::copy_unused_symbols): New function.
4751 (Incremental_library::do_for_all_unused_symbols): New function.
4752 * incremental.h (enum Incremental_input_flags): New type.
4753 (class Incremental_checker): Remove.
4754 (Incremental_input_entry::Incremental_input_entry): Add argument
4755 serial number.
4756 (Incremental_input_entry::arg_serial): New function.
4757 (Incremental_input_entry::set_is_in_system_directory): New function.
4758 (Incremental_input_entry::is_in_system_directory): New function.
4759 (Incremental_input_entry::arg_serial_): New data member.
4760 (Incremental_input_entry::is_in_system_directory_): New data member.
4761 (class Script_info): Move here from script.h.
4762 (Script_info::Script_info): Add filename parameter.
4763 (Script_info::filename): New function.
4764 (Script_info::filename_): New data member.
4765 (Incremental_script_entry::Incremental_script_entry): Add argument
4766 serial number.
4767 (Incremental_object_entry::Incremental_object_entry): Likewise.
4768 (Incremental_object_entry::add_input_section): Build list of input
4769 sections with map to original shndx.
4770 (Incremental_object_entry::get_input_section_index): New function.
4771 (Incremental_object_entry::shndx_): New data member.
4772 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4773 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4774 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4775 serial number.
4776 (Incremental_inputs::report_archive_begin): Likewise.
4777 (Incremental_inputs::report_object): Likewise.
4778 (Incremental_inputs::report_script): Likewise.
4779 (class Incremental_global_symbol_reader): New class.
4780 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4781 and store flags and input file type.
4782 (Incremental_input_entry_reader::arg_serial): New function.
4783 (Incremental_input_entry_reader::type): Extract type from flags.
4784 (Incremental_input_entry_reader::is_in_system_directory): New function.
4785 (Incremental_input_entry_reader::get_input_section_count): Call
4786 accessor function for type.
4787 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4788 function for type; adjust size of global symbol entry.
4789 (Incremental_input_entry_reader::get_global_symbol_count): Call
4790 accessor function for type.
4791 (Incremental_input_entry_reader::get_object_count): Likewise.
4792 (Incremental_input_entry_reader::get_object_offset): Likewise.
4793 (Incremental_input_entry_reader::get_member_count): Likewise.
4794 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4795 (Incremental_input_entry_reader::get_member_offset): Likewise.
4796 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4797 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4798 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4799 (Incremental_input_entry_reader::get_global_symbol_reader): New
4800 function.
4801 (Incremental_input_entry_reader::get_output_symbol_index): New
4802 function.
4803 (Incremental_input_entry_reader::type_): Remove.
4804 (Incremental_input_entry_reader::flags_): New data member.
4805 (Incremental_inputs_reader::input_file_offset): New function.
4806 (Incremental_inputs_reader::input_file_index): New function.
4807 (Incremental_inputs_reader::input_file): Call input_file_offset.
4808 (Incremental_inputs_reader::input_file_at_offset): New function.
4809 (Incremental_relocs_reader::get_r_type): Reformat.
4810 (Incremental_relocs_reader::get_r_shndx): Reformat.
4811 (Incremental_relocs_reader::get_r_offset): Reformat.
4812 (Incremental_relocs_reader::data): New function.
4813 (Incremental_binary::Incremental_binary): Initialize new data members.
4814 (Incremental_binary::check_inputs): Add cmdline parameter.
4815 (Incremental_binary::file_is_unchanged): Remove.
4816 (Input_reader::arg_serial): New function.
4817 (Input_reader::get_unused_symbol_count): New function.
4818 (Input_reader::get_unused_symbol): New function.
4819 (Input_reader::do_arg_serial): New function.
4820 (Input_reader::do_get_unused_symbol_count): New function.
4821 (Input_reader::do_get_unused_symbol): New function.
4822 (Incremental_binary::input_file_count): New function.
4823 (Incremental_binary::get_input_reader): Change signature to use
4824 index instead of filename.
4825 (Incremental_binary::file_has_changed): New function.
4826 (Incremental_binary::get_input_argument): New function.
4827 (Incremental_binary::get_library): New function.
4828 (Incremental_binary::get_script_info): New function.
4829 (Incremental_binary::init_layout): New function.
4830 (Incremental_binary::reserve_layout): New function.
4831 (Incremental_binary::output_file): New function.
4832 (Incremental_binary::do_check_inputs): New function.
4833 (Incremental_binary::do_file_is_unchanged): Remove.
4834 (Incremental_binary::do_file_has_changed): New function.
4835 (Incremental_binary::do_init_layout): New function.
4836 (Incremental_binary::do_reserve_layout): New function.
4837 (Incremental_binary::do_input_file_count): New function.
4838 (Incremental_binary::do_get_input_reader): Change signature.
4839 (Incremental_binary::input_args_map_): New data member.
4840 (Incremental_binary::library_map_): New data member.
4841 (Incremental_binary::script_map_): New data member.
4842 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4843 new data members.
4844 (Sized_incremental_binary::output_section): New function.
4845 (Sized_incremental_binary::inputs_reader): Add const.
4846 (Sized_incremental_binary::symtab_reader): Add const.
4847 (Sized_incremental_binary::relocs_reader): Add const.
4848 (Sized_incremental_binary::got_plt_reader): Add const.
4849 (Sized_incremental_binary::get_symtab_view): New function.
4850 (Sized_incremental_binary::Inputs_reader): New typedef.
4851 (Sized_incremental_binary::Input_entry_reader): New typedef.
4852 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
4853 (Sized_incremental_binary::do_file_is_unchanged): Remove.
4854 (Sized_incremental_binary::do_file_has_changed): New function.
4855 (Sized_incremental_binary::do_init_layout): New function.
4856 (Sized_incremental_binary::do_reserve_layout): New function.
4857 (Sized_input_reader::Inputs_reader): Remove.
4858 (Sized_input_reader::Input_entry_reader): Remove.
4859 (Sized_input_reader::do_arg_serial): New function.
4860 (Sized_input_reader::do_get_unused_symbol_count): New function.
4861 (Sized_input_reader::do_get_unused_symbol): New function.
4862 (Sized_incremental_binary::do_input_file_count): New function.
4863 (Sized_incremental_binary::do_get_input_reader): Change signature;
4864 use index instead of filename.
4865 (Sized_incremental_binary::section_map_): New data member.
4866 (Sized_incremental_binary::input_entry_readers_): New data member.
4867 (class Sized_incr_relobj): New class.
4868 (class Sized_incr_dynobj): New class.
4869 (make_sized_incremental_object): New function.
4870 (class Incremental_library): New class.
4871 * layout.cc (Free_list::num_lists): New static data member.
4872 (Free_list::num_nodes): New static data member.
4873 (Free_list::num_removes): New static data member.
4874 (Free_list::num_remove_visits): New static data member.
4875 (Free_list::num_allocates): New static data member.
4876 (Free_list::num_allocate_visits): New static data member.
4877 (Free_list::init): New function.
4878 (Free_list::remove): New function.
4879 (Free_list::allocate): New function.
4880 (Free_list::dump): New function.
4881 (Free_list::print_stats): New function.
4882 (Layout_task_runner::run): Resize output file for incremental updates.
4883 (Layout::Layout): Initialize new data members.
4884 (Layout::set_incremental_base): New function.
4885 (Layout::init_fixed_output_section): New function.
4886 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
4887 incremental updates.
4888 (Layout::create_gold_note): Do not create gold note section for
4889 incremental updates.
4890 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
4891 for incremental updates.
4892 (Layout::set_section_offsets): For incremental updates, allocate space
4893 from free list.
4894 (Layout::create_symtab_sections): Layout with offsets relative to
4895 start of section; for incremental updates, allocate space from free
4896 list.
4897 (Layout::create_shdrs): For incremental updates, allocate space from
4898 free list.
4899 (Layout::finish_dynamic_section): For incremental updates, do not
4900 check --as-needed (fixed in subsequent patch).
4901 * layout.h (class Free_list): New class.
4902 (Layout::set_incremental_base): New function.
4903 (Layout::incremental_base): New function.
4904 (Layout::init_fixed_output_section): New function.
4905 (Layout::allocate): New function.
4906 (Layout::incremental_base_): New data member.
4907 (Layout::free_list_): New data member.
4908 * main.cc (main): Print Free_list statistics.
4909 * object.cc (Relobj::finalize_incremental_relocs): Add
4910 clear_counts parameter; clear counts only when clear_counts is set.
4911 (Sized_relobj::Sized_relobj): Initialize new base class.
4912 (Sized_relobj::do_layout): Don't report special sections.
4913 (Sized_relobj::do_for_all_local_got_entries): New function.
4914 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
4915 symtab_off to all symbol table offsets.
4916 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
4917 * object.h (class Got_offset_list): Move to top of file.
4918 (Object::Object): Allow case where input_file == NULL.
4919 (Object::~Object): Likewise.
4920 (Object::input_file): Assert that input_file != NULL.
4921 (Object::lock): Allow case where input_file == NULL.
4922 (Object::unlock): Likewise.
4923 (Object::is_locked): Likewise.
4924 (Object::token): Likewise.
4925 (Object::release): Likewise.
4926 (Object::is_incremental): New function.
4927 (Object::get_mtime): New function.
4928 (Object::for_all_local_got_entries): New function.
4929 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
4930 (Object::set_is_in_system_directory): New function.
4931 (Object::is_in_system_directory): New function.
4932 (Object::do_is_incremental): New function.
4933 (Object::do_get_mtime): New function.
4934 (Object::do_for_all_local_got_entries): New function.
4935 (Object::is_in_system_directory_): New data member.
4936 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
4937 (class Sized_relobj_base): New class.
4938 (class Sized_relobj): Derive from Sized_relobj_base.
4939 (class Sized_relobj::Symbols): Redeclare from base class.
4940 (class Sized_relobj::local_got_offset_list): Remove.
4941 (class Sized_relobj::Output_sections): Redeclare from base class.
4942 (class Sized_relobj::do_for_all_local_got_entries): New function.
4943 (class Sized_relobj::write_local_symbols): Add offset parameter.
4944 (class Sized_relobj::local_symbol_offset_): Update comment.
4945 (class Sized_relobj::local_dynsym_offset_): Update comment.
4946 * options.cc (Input_arguments::add_file): Remove const.
4947 * options.h (Input_file_argument::Input_file_argument):
4948 Initialize arg_serial_ (all constructors).
4949 (Input_file_argument::set_arg_serial): New function.
4950 (Input_file_argument::arg_serial): New function.
4951 (Input_file_argument::arg_serial_): New data member.
4952 (Input_arguments::Input_arguments): Initialize file_count_.
4953 (Input_arguments::add_file): Remove const.
4954 (Input_arguments::number_of_input_files): New function.
4955 (Input_arguments::file_count_): New data member.
4956 (Command_line::number_of_input_files): Call
4957 Input_arguments::number_of_input_files.
4958 * output.cc (Output_segment_headers::Output_segment_headers):
4959 Set current size.
4960 (Output_section::Input_section::current_data_size): New function.
4961 (Output_section::Output_section): Initialize new data members.
4962 (Output_section::add_input_section): Don't do merge sections for
4963 an incremental link; allocate space from free list for an
4964 incremental update.
4965 (Output_section::add_output_section_data): Allocate space from
4966 free list for an incremental update.
4967 (Output_section::update_data_size): New function.
4968 (Output_section::set_fixed_layout): New function.
4969 (Output_section::reserve): New function.
4970 (Output_segment::set_section_addresses): Remove const.
4971 (Output_segment::set_section_list_addresses): Remove const; allocate
4972 space from free list for an incremental update.
4973 (Output_segment::set_offset): Adjust size of RELRO segment for an
4974 incremental update.
4975 * output.h (Output_data::current_data_size): Move here from
4976 child classes.
4977 (Output_data::pre_finalize_data_size): New function.
4978 (Output_data::update_data_size): New function.
4979 (Output_section_headers::update_data_size): new function.
4980 (Output_section_data_build::current_data_size): Move to Output_data.
4981 (Output_data_strtab::update_data_size): New function.
4982 (Output_section::current_data_size): Move to Output_data.
4983 (Output_section::set_fixed_layout): New function.
4984 (Output_section::has_fixed_layout): New function.
4985 (Output_section::reserve): New function.
4986 (Output_section::update_data_size): New function.
4987 (Output_section::has_fixed_layout_): New data member.
4988 (Output_section::free_list_): New data member.
4989 (Output_segment::set_section_addresses): Remove const.
4990 (Output_segment::set_section_list_addresses): Remove const.
4991 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
4992 New function.
4993 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
4994 New function.
4995 * readsyms.cc (Read_symbols::do_read_symbols): Add library
4996 parameter when calling Add_symbols constructor; store argument
4997 serial number for members of a lib group.
4998 (Add_symbols::locks): Allow case where token == NULL.
4999 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5000 (Read_member::~Read_member): New function.
5001 (Read_member::is_runnable): New function.
5002 (Read_member::locks): New function.
5003 (Read_member::run): New function.
5004 (Check_script::~Check_script): New function.
5005 (Check_script::is_runnable): New function.
5006 (Check_script::locks): New function.
5007 (Check_script::run): New function.
5008 (Check_library::~Check_library): New function.
5009 (Check_library::is_runnable): New function.
5010 (Check_library::locks): New function.
5011 (Check_library::run): New function.
5012 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5013 (Add_symbols::library_): New data member.
5014 (class Read_member): New class.
5015 (class Check_script): New class.
5016 (class Check_library): New class.
5017 * reloc.cc (Read_relocs::is_runnable): Allow case where
5018 token == NULL.
5019 (Read_relocs::locks): Likewise.
5020 (Scan_relocs::locks): Likewise.
5021 (Relocate_task::locks): Likewise.
5022 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5023 to clear counters.
5024 (Sized_relobj::incremental_relocs_scan): Fix comment.
5025 (Sized_relobj::do_relocate): Pass output file offset to
5026 write_local_symbols.
5027 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5028 from class declaration.
5029 * script.cc (read_input_script): Allocate Script_info; pass
5030 argument serial number to report_script.
5031 * script.h (class Script_info): Move to incremental.h.
5032 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5033 * symtab.h (Symbol_table::add_from_incrobj): New function.
5034 (Symbol_table::set_file_offset): New function.
5035
b961d0d7
CC
50362011-04-05 Cary Coutant <ccoutant@google.com>
5037
5038 * incremental-dump.cc (dump_incremental_inputs): Change signature
5039 to take a Sized_incremental_binary; change caller. Use readers
5040 in Sized_incremental_binary.
5041 * incremental.cc
5042 (Sized_incremental_binary::find_incremental_inputs_sections):
5043 Rename do_find_incremental_inputs_sections to this.
5044 (Sized_incremental_binary::setup_readers): New function.
5045 (Sized_incremental_binary::do_check_inputs): Check
5046 has_incremental_info_ flag; move setup code to setup_readers;
5047 use input readers.
5048 (Sized_incremental_binary::do_file_is_unchanged): New function.
5049 (Sized_incremental_binary::do_get_input_reader): New function.
5050 * incremental.h (class Incremental_binary): Move to end of file.
5051 (Incremental_binary::file_is_unchanged): New function.
5052 (Incremental_binary::do_file_is_unchanged): New function.
5053 (Incremental_binary::Input_reader): New class.
5054 (Incremental_binary::get_input_reader): New function.
5055 (class Sized_incremental_binary): Move to end of file.
5056 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5057 input section reader classes.
5058 (Sized_incremental_binary::has_incremental_info): New function.
5059 (Sized_incremental_binary::inputs_reader): New function.
5060 (Sized_incremental_binary::symtab_reader): New function.
5061 (Sized_incremental_binary::relocs_reader): New function.
5062 (Sized_incremental_binary::got_plt_reader): New function.
5063 (Sized_incremental_binary::do_file_is_unchanged): New function.
5064 (Sized_incremental_binary::Sized_input_reader): New class.
5065 (Sized_incremental_binary::get_input_reader): New function.
5066 (Sized_incremental_binary::find_incremental_inputs_sections):
5067 Rename do_find_incremental_inputs_sections to this.
5068 (Sized_incremental_binary::setup_readers): New function.
5069 (Sized_incremental_binary::has_incremental_info_): New data member.
5070 (Sized_incremental_binary::inputs_reader_): New data member.
5071 (Sized_incremental_binary::symtab_reader_): New data member.
5072 (Sized_incremental_binary::relocs_reader_): New data member.
5073 (Sized_incremental_binary::got_plt_reader_): New data member.
5074 (Sized_incremental_binary::current_input_file_): New data member.
5075
a869183f
PP
50762011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5077
5078 PR gold/12640
5079 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5080 violation.
5081
50822011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5083
5084 * archive.cc (Archive::include_member): Adjust call to report_object.
5085 (Add_archive_symbols::run): Add script_info to call to
5086 report_archive_begin.
5087 (Lib_group::include_member): Adjust call to report_object.
5088 (Add_lib_group_symbols::run): Adjust call to report_object.
5089 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5090 blocks. Add object count for script input files.
5091 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5092 script_info parameter; change all callers.
5093 (Incremental_inputs::report_object): Add script_info parameter;
5094 change all callers.
5095 (Incremental_inputs::report_script): Store backpointer to
5096 incremental info entry.
5097 (Output_section_incremental_inputs::set_final_data_size): Record
5098 additional information for scripts.
5099 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5100 * incremental.h (Incremental_script_entry::add_object): New function.
5101 (Incremental_script_entry::get_object_count): New function.
5102 (Incremental_script_entry::get_object): New function.
5103 (Incremental_script_entry::objects_): New data member; adjust
5104 constructor.
5105 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5106 (Incremental_inputs::report_object): Add script_info parameter.
5107 (Incremental_inputs_reader::get_object_count): New function.
5108 (Incremental_inputs_reader::get_object_offset): New function.
5109 * options.cc (Input_arguments::add_file): Return reference to
5110 new input argument.
5111 * options.h (Input_argument::set_script_info): New function.
5112 (Input_argument::script_info): New function.
5113 (Input_argument::script_info_): New data member; adjust all
5114 constructors.
5115 (Input_file_group::add_file): Return reference to new input argument.
5116 (Input_file_lib::add_file): Likewise.
5117 (Input_arguments::add_file): Likewise.
5118 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5119 * script.cc (Parser_closure::Parser_closure): Add script_info
5120 parameter; adjust all callers.
5121 (Parser_closure::script_info): New function.
5122 (Parser_closure::script_info_): New data member.
5123 (read_input_script): Report scripts earlier to incremental info.
5124 (script_add_file): Set script_info in Input_argument.
5125 (script_add_library): Likewise.
5126 * script.h (Script_options::Script_info): Rewrite class.
5127
a869183f 51282011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
5129
5130 * archive.cc (Library_base::should_include_member): Move
5131 method here from class Archive.
5132 (Archive::Archive): Initialize base class.
5133 (Archive::should_include_member): Move to base class.
5134 (Archive::do_for_all_unused_symbols): New function.
5135 (Add_archive_symbols::run): Remove redundant access to
5136 incremental_inputs.
5137 (Lib_group::Lib_group): Initialize base class.
5138 (Lib_group::do_filename): New function.
5139 (Lib_group::include_member): Pass pointer to Lib_group to
5140 report_object.
5141 (Lib_group::do_for_all_unused_symbols): New function.
5142 (Add_lib_group_symbols::run): Report archive information for
5143 incremental links.
5144 * archive.h (class Library_base): New base class.
5145 (class Archive): Derive from Library_base.
5146 (Archive::filename): Move to base class.
5147 (Archive::set_incremental_info): Likewise.
5148 (Archive::incremental_info): Likewise.
5149 (Archive::Should_include): Likewise.
5150 (Archive::should_include_member): Likewise.
5151 (Archive::Armap_entry): Remove.
5152 (Archive::Unused_symbol_iterator): Remove.
5153 (Archive::unused_symbols_begin): Remove.
5154 (Archive::unused_symbols_end): Remove.
5155 (Archive::do_filename): New function.
5156 (Archive::do_get_mtime): New function.
5157 (Archive::do_for_all_unused_symbols): New function.
5158 (Archive::task_): Move to base class.
5159 (Archive::incremental_info_): Likewise.
5160 (class Lib_group): Derive from Library_base.
5161 (Lib_group::do_filename): New function.
5162 (Lib_group::do_get_mtime): New function.
5163 (Lib_group::do_for_all_unused_symbols): New function.
5164 (Lib_group::task_): Move to base class.
5165 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5166 function.
5167 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5168 function.
5169 * incremental.cc (Incremental_inputs::report_archive_begin):
5170 Use Library_base; call library's get_mtime; add incremental inputs
5171 entry before members.
5172 (class Unused_symbol_visitor): New class.
5173 (Incremental_inputs::report_archive_end): Use Library_base; use
5174 visitor class to record unused symbols; don't add incremental inputs
5175 entry after members.
5176 (Incremental_inputs::report_object): Use Library_base.
5177 * incremental.h
5178 (Incremental_archive_entry::Incremental_archive_entry): Remove
5179 unused Archive parameter.
5180 (Incremental_inputs::report_archive_begin): Use Library_base.
5181 (Incremental_inputs::report_archive_end): Likewise.
5182 (Incremental_inputs::report_object): Likewise.
5183 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5184 function.
5185 * object.h (Object::for_all_global_symbols): New function.
5186 (Object::do_for_all_global_symbols): New function.
5187 (Sized_relobj::do_for_all_global_symbols): New function.
5188 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5189 function.
5190 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5191 function.
5192
61ab3e40
ILT
51932011-03-27 Ian Lance Taylor <iant@google.com>
5194
5195 * archive.cc (Archive::interpret_header): Return -1 if something
5196 goes wrong. Change callers accordingly.
5197
30e1f9e6
CC
51982011-03-25 Cary Coutant <ccoutant@google.com>
5199
5200 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5201 * testsuite/Makefile.in: Regenerate.
5202
9370ce59 52032011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
5204
5205 * plugin.cc (get_view): New.
5206 (Plugin::load): Pass get_view to the plugin.
5207 (Plugin_manager::get_view): New.
5208
9312bb0a
ILT
52092011-03-21 Ian Lance Taylor <iant@google.com>
5210
5211 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 5212 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 5213
7e12ba9e
ST
52142011-03-21 Sriraman Tallam <tmsriram@google.com>
5215
5216 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5217 Change == to -eq.
5218 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5219 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5220 Change == to -eq.
5221 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5222 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5223
fd7a005d
ILT
52242011-03-14 Ian Lance Taylor <iant@google.com>
5225
5226 * script-sections.cc (Sort_output_sections::script_compare):
5227 Rename from is_before, change return type.
5228 (Sort_output_sections::operator()): Adjust accordingly.
5229
ed16fd1b
ILT
52302011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5231
5232 PR gold/12572
5233 * testsuite/odr_violation2.cc: Add comment to make all error line
5234 numbers double digits.
5235 * testsuite/debug_msg.sh: Adjust expected errors.
5236
71ff8986
ILT
52372011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5238
5239 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5240 but mark earlier ones as non-canonical
5241 (offset_to_iterator): Update search target and example
5242 (do_addr2line): Return extra lines in a vector*
5243 (format_file_lineno): Extract from do_addr2line
5244 (one_addr2line): Add vector* out-param
5245 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5246 when a lineno entry appeared last for its instruction
5247 (Dwarf_line_info): Add vector* out-param
5248 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5249 * symtab.cc (Odr_violation_compare): Include the lineno in the
5250 comparison again.
5251 (linenos_from_loc): New. Combine the canonical line for an
5252 address with its other lines.
5253 (True_if_intersect): New. Helper functor to make
5254 std::set_intersection a query.
5255 (detect_odr_violations): Compare sets of lines instead of just
5256 one line for each function. This became less deterministic, but
5257 has fewer false positives.
5258 * symtab.h: Declarations.
5259 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5260 mix an optimized and non-optimized object in the same binary
5261 (odr_violation2.so): Same.
5262 * testsuite/Makefile.in: Regenerate from Makefile.am.
5263 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5264 * testsuite/debug_msg.sh: Update line numbers and add
5265 assertions.
5266 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5267 non-optimized context.
5268 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5269 isn't inlined, and use OdrDerived in an optimized context.
5270 * testsuite/odr_header1.h: Defines OdrDerived, where
5271 optimization will change the
5272 first-instruction-in-the-destructor's file and line number.
5273 * testsuite/odr_header2.h: Defines OdrBase.
5274
a19fefdc
ILT
52752011-03-09 Ian Lance Taylor <iant@google.com>
5276
5277 * fileread.cc (File_read::clear_views): Don't delete the whole
5278 file view.
5279
ecb351e9
ILT
52802011-03-08 Ian Lance Taylor <iant@google.com>
5281
5282 PR gold/12525
5283 * fileread.cc: #include <climits>.
5284 (GOLD_IOV_MAX): Define.
5285 (File_read::read_multiple): Limit number of entries by iov_max.
5286 * fileread.h (class File_read): Always set max_readv_entries to
5287 128.
5288
b821d13c
ILT
52892011-03-07 Ian Lance Taylor <iant@google.com>
5290
5291 PR gold/12525
5292 * options.h (class General_options): Add -dy and -dn.
5293
89243142
CC
52942011-03-02 Cary Coutant <ccoutant@google.com>
5295
5296 * testsuite/script_test_9.t: Add TLS segment.
5297
d0773f31
ILT
52982011-03-02 Simon Baldwin <simonb@google.com>
5299
5300 * configure.ac: Add check for gnu_indirect_function support in
5301 the toolchain building binutils.
5302 * configure: Rebuild.
5303
9370ce59 53042011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
5305
5306 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5307 plugin only symbols.
5308 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5309 in plugin files as not needed in the symbol table.
5310
4cf7a849
ST
53112011-02-11 Sriraman Tallam <tmsriram@google.com>
5312
5313 * output.cc (Output_section::add_input_section): Delay fill
5314 generation for section ordering.
5315
b578bd7d
ILT
53162011-02-09 Ian Lance Taylor <iant@google.com>
5317
5318 PR gold/12316
5319 * object.h (class Sized_relobj): Remove clear_local_symbols.
5320 * reloc.cc (Sized_relobj::do_relocate): Don't call
5321 clear_local_symbols.
5322
9370ce59 53232011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
5324
5325 * plugin.cc (is_visible_from_outside): Return true for symbols
5326 in the -u option.
5327
55382fb7
ILT
53282011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5329
5330 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5331 filename.
5332
4e271fff
ST
53332011-02-02 Sriraman Tallam <tmsriram@google.com>
5334
5335 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 5336 to std::string.
4e271fff 5337 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 5338 section_name to be std::string.
4e271fff
ST
5339 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5340
d433c3ac
ILT
53412011-01-25 Ian Lance Taylor <iant@google.com>
5342
5343 * script.cc (script_add_extern): Rewrite to use
5344 add_symbol_reference.
5345
880473a6
DK
53462011-01-25 Doug Kwan <dougkwan@google.com>
5347
d433c3ac 5348 * icf.cc (get_section_contents): Always lock section's object.
880473a6 5349
f30f86fa
ILT
53502011-01-24 Ian Lance Taylor <iant@google.com>
5351
5352 * options.h (class General_options): Accept
5353 --no-detect-odr-violations.
5354
8e51a0b9
ILT
53552011-01-24 Ian Lance Taylor <iant@google.com>
5356
5357 * version.cc (version_string): Bump to 1.11.
5358
0f3b89d8
ILT
53592011-01-24 Ian Lance Taylor <iant@google.com>
5360
5361 * plugin.cc (class Plugin_rescan): Define new class.
5362 (Plugin_manager::claim_file): Set any_claimed_.
5363 (Plugin_manager::save_archive): New function.
5364 (Plugin_manager::save_input_group): New function.
5365 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5366 necessary.
5367 (Plugin_manager::new_undefined_symbol): New function.
5368 (Plugin_manager::rescan): New function.
5369 (Plugin_manager::rescannable_defines): New function.
5370 (Plugin_manager::add_input_file): Set any_added_.
5371 * plugin.h (class Plugin_manager): define new fields rescannable_,
5372 undefined_symbols_, any_claimed_, and any_added_. Declare
5373 Plugin_rescan as friend. Declare new functions.
5374 (Plugin_manager::Rescannable): Define type.
5375 (Plugin_manager::Rescannable_list): Define type.
5376 (Plugin_manager::Undefined_symbol_list): Define type.
5377 (Plugin_manager::Plugin_manager): Initialize new fields.
5378 * archive.cc (Archive::defines_symbol): New function.
5379 (Add_archive_symbols::run): Pass archive to plugins if any.
5380 * archive.h (class Archive): Declare defines_symbol.
5381 * readsyms.cc (Input_group::~Input_group): New function.
5382 (Finish_group::run): Pass input_group to plugins if any.
5383 * readsyms.h (class Input_group): Declare destructor.
5384 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5385 any.
5386
3bb951e5
ILT
53872011-01-10 Ian Lance Taylor <iant@google.com>
5388
5389 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5390 section as relro.
5391 (Layout::set_segment_offsets): Reset increase_relro before calling
5392 set_section_addresses a second time.
5393
0aa45fac
CC
53942011-01-04 Cary Coutant <ccoutant@google.com>
5395
5396 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5397 sections before NOBITS sections.
5398
0db46eb4
L
53992011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5400
5401 * version.cc (print_version): Update copyright to 2011.
5402
829c9745
CC
54032010-12-23 Cary Coutant <ccoutant@google.com>
5404
5405 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5406 of OS to this->add. Add OD parameter to second form of the function.
5407
7500420b
ILT
54082010-12-20 Ian Lance Taylor <iant@google.com>
5409
5410 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5411 second of two consecutive entries with same offset.
5412
f8e9a930
RW
54132010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5414
5415 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5416 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5417 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5418 to avoid unneeded links against $(LDADD).
5419 * testsuite/Makefile.in: Regenerate.
5420
2fbb4320
ILT
54212010-12-15 Ian Lance Taylor <iant@google.com>
5422
5423 PR gold/12324
5424 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5425 for R_X86_64_32 and R_X86_64_PC32.
5426 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5427 ver_matching_def_pic.o.
5428 (ver_matching_def_pic.o): New target.
5429
fedb228d
RW
54302010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5431
5432 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5433 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5434 Move definition before File_read::View member definitions.
5435 (File_read::View::~View): Initialize and hold lock before
5436 updating current_mapped_bytes.
5437
9b547ce6
RW
54382010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5439
5440 * dwarf_reader.cc: Remove outdated comment.
5441 * gold-threads.cc: Fix typo in error message.
5442 * archive.cc: Fix typos in comments.
5443 * archive.h: Likewise.
5444 * arm-reloc-property.cc: Likewise.
5445 * arm-reloc-property.h: Likewise.
5446 * arm-reloc.def: Likewise.
5447 * arm.cc: Likewise.
5448 * attributes.h: Likewise.
5449 * cref.cc: Likewise.
5450 * ehframe.cc: Likewise.
5451 * fileread.h: Likewise.
5452 * gold.h: Likewise.
5453 * i386.cc: Likewise.
5454 * icf.cc: Likewise.
5455 * incremental.h: Likewise.
5456 * int_encoding.cc: Likewise.
5457 * layout.h: Likewise.
5458 * main.cc: Likewise.
5459 * merge.h: Likewise.
5460 * object.cc: Likewise.
5461 * object.h: Likewise.
5462 * options.cc: Likewise.
5463 * readsyms.cc: Likewise.
5464 * reduced_debug_output.cc: Likewise.
5465 * reloc.cc: Likewise.
5466 * script-sections.cc: Likewise.
5467 * sparc.cc: Likewise.
5468 * symtab.h: Likewise.
5469 * target-reloc.h: Likewise.
5470 * target.cc: Likewise.
5471 * target.h: Likewise.
5472 * timer.cc: Likewise.
5473 * timer.h: Likewise.
5474 * x86_64.cc: Likewise.
5475
83e17bd5
CC
54762010-12-09 Cary Coutant <ccoutant@google.com>
5477
5478 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5479 stack.
5480 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5481 parameter; change all callers.
5482 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5483 * options.h (warn_execstack): New option.
5484
017257f8
DK
54852010-12-07 Doug Kwan <dougkwan@google.com>
5486
5487 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5488 like function call relocations.
5489
c20cbc06
ILT
54902010-12-07 Ian Lance Taylor <iant@google.com>
5491
5492 * archive.cc (Archive::get_elf_object_for_member): Permit
5493 punconfigured to be NULL.
5494 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5495 (Archive::include_member): Pass NULL to get_elf_object_for_member
5496 if we searched for the archive and this is the first included
5497 object.
5498
4dbfafcc
ILT
54992010-12-01 Ian Lance Taylor <iant@google.com>
5500
5501 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5502 track_relocs_type_ field.
5503 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5504 Set track_relocs_type_.
5505 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5506 contents when using RELA relocs.
5507 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5508 reloc_map_.
5509 * reloc.cc (Track_relocs::next_addend): New function.
5510 * reloc.h (class Track_relocs): Declare next_addend.
5511
e5e19edd
ILT
55122010-12-01 Ian Lance Taylor <iant@google.com>
5513
5514 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5515 virtual destructor.
5516
9a5ce24c
ILT
55172010-12-01 Ian Lance Taylor <iant@google.com>
5518
5519 * README: Update compilers known to work and fail.
5520
c7791212
NC
55212010-11-23 Matthias Klose <doko@ubuntu.com>
5522
5523 * configure.in: For --enable-gold, handle value `default' instead of
5524 `both*'. Always install ld as ld.bfd, install as ld if gold is
5525 not the default.
5526 * configure: Regenerate.
5527
0ad220c9
DK
55282010-11-18 Doug Kwan <dougkwan@google.com>
5529
5530 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5531 and right_alignment to be zero. Store result alignment only if it is
5532 greater than existing alignment.
5533
ab8056e0
CC
55342010-11-16 Cary Coutant <ccoutant@google.com>
5535
5536 PR gold/12220
5537 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5538 Check for ".zdebug_line".
5539
fd064a5b
CC
55402010-11-16 Doug Kwan <dougkwan@google.com>
5541 Cary Coutant <ccoutant@google.com>
5542
5543 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5544 by reference; adjust all callers.
5545 * output.cc (Output_segment::set_section_addresses): Adjust references
5546 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5547 list is empty.
5548 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5549 end at page boundary.
5550
6fc6ea19
CC
55512010-11-16 Cary Coutant <ccoutant@google.com>
5552
5553 PR gold/12220
5554 * layout.cc (Layout::choose_output_section): Transform names of
5555 compressed sections even when using a script with a SECTIONS clause.
5556 (Layout::output_section_name): Remove code to transform
5557 compressed debug section names.
5558 * output.cc (Output_section::add_input_section): Use uncompressed
5559 section size when tracking input sections.
5560
95a2c8d6
RS
55612010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5562
5563 * symtab.h (Symbol::NON_PIC_REF): Remove.
5564 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5565 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5566 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5567 (Symbol::use_plt_offset): Take a flags argument and pass it
5568 directly to needs_dynamic_reloc. Restrict check for undefined
5569 weak symbols to function calls.
5570 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5571 (Target_arm::Scan::global): Use it.
5572 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5573 (Target_arm::Relocate::relocate): Likewise.
5574 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5575 parameter with an r_type parameter. Use get_reference_flags
5576 to get the flags.
5577 (Target_arm::Relocate::relocate): Update accordingly.
5578 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5579 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5580 (Target_i386::Scan::global): Likewise.
5581 (Target_i386::Relocate::relocate): Likewise.
5582 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5583 parameter with an r_type parameter. Use get_reference_flags
5584 to get the flags.
5585 (Target_i386::Relocate::relocate): Update accordingly.
5586 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5587 (Target_powerpc::Scan::global): Use it.
5588 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5589 (Target_powerpc::Relocate::relocate): Likewise.
5590 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5591 (Target_sparc::Scan::global): Use it.
5592 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5593 (Target_sparc::Relocate::relocate): Likewise.
5594 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5595 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5596 (Target_x86_64::Scan::global): Likewise.
5597 (Target_x86_64::Relocate::relocate): Likewise.
5598
f625ae50
DK
55992010-11-08 Doug Kwan <dougkwan@google.com>
5600 Cary Coutant <ccoutant@google.com>
5601
5602 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5603 (Arm_exidx_merge_section::section_contents_): New data member.
5604 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5605 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5606 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5607 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5608 in parameters instead of calling Object::section_contents without
5609 locking.
5610 (Arm_output_section::group_section): New parameter TASK. Pass it
5611 to callees that need locking objects.
5612 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5613 to lock EXIDX input sections. Fix a formatting issue. Call
5614 Arm_exidx_merged_section::build_contents to create merged section
5615 contents.
5616 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5617 to lock object of stub table owner.
5618 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5619 TEXT_SIZE to initialize data member TEXT_SIZE_.
5620 (Arm_exidx_input_section::addralign): Fix typo in comment.
5621 (Arm_exidx_input_section::text_size): New method.
5622 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5623 that require locking objects. Lock objects before scanning for stubs
5624 and updating local symbols.
5625 (Arm_input_section<big_endian>::init): Copy contents of original
5626 input section.
2e702c99 5627 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5628 original input section instead of calling Object::section_contents
5629 without locking.
5630 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5631 size without calling Object::section_size().
5632 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5633 for size. Allocate a buffer for merged EXIDX entries.
5634 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5635 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5636 building code to Arm_exidx_merged_section::build_contetns. Write
5637 out contetns in buffer instead of building it on the fly.
5638 (Arm_relobj::make_exidx_input_section): Also pass text section size
5639 to Arm_exidx_input_section constructor.
5640 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5641 (Arm_dynobj::do_read_symbols): Fix memory leak.
5642 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5643 * target.h: (class Task): Add forward declaration.
5644 (Target::relax): Add new parameter TASK and pass it to
5645 Target::do_relax().
5646 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5647
5f9bcf58
CC
56482010-11-05 Cary Coutant <ccoutant@google.com>
5649
5650 PR gold/10708
5651 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5652 object when reading from the file.
5653 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5654 second layout pass.
5655 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5656 when reading section contents.
5657 (get_section_contents): Likewise.
5658 (icf::find_identical_sections): Likewise.
5659 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5660 object when reading from the file.
5661 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5662 the object when doing deferred section layout.
5663
e597fa08
NC
56642010-11-03 Nick Clifton <nickc@redhat.com>
5665
5666 PR gold/12001
5667 * script.h (class Symbol_assignment: name): New member. Returns
5668 the name of the symbol.
5669 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5670 Returns true if the given symbol name is on the list of
5671 assignments wating to be processed.
5672 * archive.cc (should_incldue_member): If the symbol is undefined,
5673 check to see if it is on the list of symbols pending assignment.
5674
3f9a3278
ILT
56752010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5676
5677 * script-sections.cc (Script_sections::find_memory_region): Check
5678 for a NULL output section pointer.
5679
d06fb4d1
DK
56802010-10-29 Doug Kwan <dougkwan@google.com>
5681
5682 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5683 Output_section::add_relaxed_input_section.
5684 * output.cc (Output_section::add_relaxed_input_section): Add new
5685 arguments LAYOUT and NAME. Set section order index.
5686 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5687 Copy section order index.
5688 * output.h (Output_section::add_relaxed_input_section): Add new
5689 arguments LAYOUT and NAME.
5690
90e24de5
ILT
56912010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5692
5693 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5694 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5695 * testsuite/Makefile.in: Regenerate.
5696
c9484ea5
DK
56972010-10-20 Doug Kwan <dougkwan@google.com>
5698
5699 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5700 without SHF_LINK_ORDER flags.
5701 * layout.cc (Layout::choose_output_section): Do not filter
5702 SHF_LINK_ORDER flag in a relocatable link.
5703
5bc2f5be
CC
57042010-10-17 Cary Coutant <ccoutant@google.com>
5705
5706 * output.h (Output_segment::set_section_addresses): Change function
5707 signature. Update all callers.
5708 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5709 sections.
5710 (Output_segment::set_section_addresses): Align after last TLS
5711 section. Add padding before last relro section instead of after.
5712
0c91cf04
DK
57132010-10-17 Doug Kwan <dougkwan@google.com>
5714
5715 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5716 GOT output section to be writable.
5717
8c21d9d3
CC
57182010-10-14 Cary Coutant <ccoutant@google.com>
5719
5720 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5721 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5722 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5723 mode.
5724 * incremental.cc (report_command_line): Ignore all forms of
5725 --incremental.
5726 * layout.cc (Layout::Layout): Check parameters for incremental link
5727 mode.
5728 * options.cc (General_options::parse_incremental): New function.
5729 (General_options::parse_no_incremental): New function.
5730 (General_options::parse_incremental_full): New function.
5731 (General_options::parse_incremental_update): New function.
5732 (General_options::incremental_mode_): New data member.
5733 (General_options::finalize): Check incremental_mode_.
5734 * options.h (General_options): Update help text for --incremental.
5735 Add --no-incremental, --incremental-full, --incremental-update.
5736 (General_options::Incremental_mode): New enum type.
5737 (General_options::incremental_mode): New function.
5738 (General_options::incremental_mode_): New data member.
5739 * parameters.cc (Parameters::incremental_mode_): New data member.
5740 (Parameters::set_options): Set incremental_mode_.
5741 (Parameters::set_incremental_full): New function.
5742 (Parameters::incremental): New function.
5743 (Parameters::incremental_update): New function.
5744 (set_parameters_incremental_full): New function.
5745 * parameters.h (Parameters::set_incremental_full): New function.
5746 (Parameters::incremental): New function.
5747 (Parameters::incremental_update): New function.
5748 (Parameters::incremental_mode_): New data member.
5749 (set_parameters_incremental_full): New function.
5750 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5751 incremental link mode.
5752 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5753 (Sized_relobj::do_relocate_sections): Likewise.
5754 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5755 option.
5756 * testsuite/Makefile.in: Regenerate.
5757 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5758
bb32aa18 57592010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5760
5761 * script-sections.h (class Script_sections): Make
5762 Sections_elements typedef public.
5763 * script-sections.cc (class Sort_output_sections): Add elements_
5764 field. Add constructor which sets it; change all callers.
5765 (Sort_output_sections::is_before): New function.
5766 (Sort_output_sections::operator()): Call is_before.
5767 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5768 conditional.
5769 * testsuite/script_test_10.sh: New test. Test script section
5770 order.
5771 * testsuite/script_test_10.t: Likewise.
5772 * testsuite/script_test_10.s: Likewise.
5773 * testsuite/Makefile.am: Wrap the cross linker tests and the
5774 common tests into NATIVE_OR_CROSS_LINKER.
5775 (check_SCRIPTS): Add script_test_10.sh.
5776 (check_DATA): Add script_test_10.stdout.
5777 (script_test_10.o, script_test_10): New targets.
5778 (script_test_10.stdout): New target.
5779 * configure, testsuite/Makefile.in: Regenerate.
5780
3cef7179
ILT
57812010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5782
5783 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5784 error for the deprecated relocations.
5785 (Target_arm::Scan::global): Likewise.
5786 (Target_arm::Relocate::relocate): Likewise.
5787
7411e9a8
RS
57882010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5789
5790 * fileread.cc (Input_file::find_file): Initialize *found_name
5791 and *namep when using the fallback search for case 4.
5792
6a9da32a
CC
57932010-10-11 Cary Coutant <ccoutant@google.com>
5794
5795 * options.h (class General_options): Redefine -z lazy as an alias for
5796 the negation of -z now.
5797
ac897c20
ILT
57982010-10-11 Ian Lance Taylor <iant@google.com>
5799
5800 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5801 binding.
5802
ea5cae92
NC
58032010-10-06 Nick Clifton <nickc@redhat.com>
5804
5805 * script-sections.cc(class Memory_region): Remove
5806 current_lma_offset_ field. Rename current_vma_offset_ to
5807 current_offset_. Add last_section_ field.
5808 (Memory_region::get_current_vma_address): Rename to
5809 get_current_address.
5810 (Memory_region::get_current_lma_address): Delete.
5811 (Memory_region::increment_vma_offset): Rename to
5812 increment_offset.
5813 (Memory_region::increment_lma_offset): Delete.
5814 (Memory_region::attributes_compatible): New method. Returns
5815 true if the provided section is compatible with the region.
5816 (Memory_region::get_last_section): New method. Returns the last
5817 section to use the region.
5818 (Memory_region::set_last_section): New method. Stores the last
5819 section to use the region.
5820 (Script_sections::block_in_region): New method. Returns true if
5821 a block of memory is contained within a region.
5822 (Script_sections::find_memory_region): New method. Locates a
5823 memory region to be used to set a VMA or LMA address.
5824 (Output_section_definition::set_section_addresses): Add code to
5825 check for addresses set by memory regions.
5826 (Output_segment::set_section_addresses): Remove memory region
5827 walking code.
5828 (Script_sections::create_segment): Add a warning if a header
5829 segment is created outside of any region.
5830 * script-sections.h (class Script_sections): Add prototypes for
5831 find_memory_region and block_in_region methods.
5832 * testsuite/memory_test.s: Use .long instead of .word.
5833 * testsuite/memory_test.t: Add some more output sections.
5834 * testsuite/memory_test.sh: Update expected output.
5835
a9bfd952
DK
58362010-10-02 Doug Kwan <dougkwan@google.com>
5837
5838 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
5839 defintion to symtab.h
5840 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
5841 declaration to defintion.
5842
bacff3ab
NC
58432010-10-01 Nick Clifton <nickc@redhat.com>
5844
5845 * expression.cc (eval): Replace dummy argument with NULL.
5846 (eval_maybe_dot): Check for a NULL result section pointer.
5847 (Symbol_expression::value): Likewise.
5848 (Dot_expression::value): Likewise.
5849 (BINARY_EXPRESSION): Likewise.
5850 (Max_expression::value): Likewise.
5851 (Min_expression::value): Likewise.
5852 (Absolute_expression::value): Likewise.
5853 (Addr_expression::value_from_output_section): Likewise.
5854 (Loaddddr_expression::value_from_output_section): Likewise.
5855 (Segment_start_expression::value): Likewise.
5856 * script-sections.cc
5857 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
5858 argument with NULL.
5859 (Sections_elememt_dot_assignment::set_section_addresses):
5860 Likewise.
5861 (Output_data_expression::do_write_to_buffer): Likewise.
5862 (Output_section_definition::finalize_symbols): Likewise.
5863 (Output_section_definition::set_section_addresses): Likewise.
5864
f81bc8b5
DK
58652010-09-30 Doug Kwan <dougkwan@google.com>
5866
5867 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
5868
c95e9f27
ST
58692010-09-28 Sriraman Tallam <tmsriram@google.com>
5870
5871 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 5872 function.
c95e9f27
ST
5873 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
5874 virtual function.
5875 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
5876 virtual function.
5877 * icf.cc (get_section_contents): Inline merge sections only when
5878 target allows it.
5879
3cac54d2
RW
58802010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5881
5882 * configure: Regenerate.
5883
2904037a
ILT
58842010-09-17 Ian Lance Taylor <iant@google.com>
5885
5886 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
5887 * testsuite/Makefile.am (memory_test.o): New target.
5888 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
5889 memory_test.t.
5890 * testsuite/Makefile.in: Rebuild.
2904037a 5891
bca7fb63
DK
58922010-09-17 Doug Kwan <dougkwan@google.com>
5893
5894 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
5895 defintion if relocation uses GOT entries of the symbol.
5896 * testsuite/icf_safe_test.sh: Fix test.
5897 * testsuite/icf_safe_so_test.sh: Fix test.
5898
4ef28648
CC
58992010-09-16 Cary Coutant <ccoutant@google.com>
5900
5901 * script_sections.cc (class Memory_region): Remove "NULL" from
5902 vector initializations.
5903
793990de
CC
59042010-09-15 Cary Coutant <ccoutant@google.com>
5905
5906 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
5907 Resolve forwarding symbols.
5908
81e015e2
DK
59092010-09-15 Doug Kwan <dougkwan@google.com>
5910
5911 * gold/testsuite/script_test_3.t: Add ARM special sections.
5912 * gold/testsuite/script_test_4.t: Same.
5913 * gold/testsuite/script_test_5.t: Same.
5914 * gold/testsuite/script_test_6.t: Same.
5915 * gold/testsuite/script_test_7.t: Same.
5916 * gold/testsuite/script_test_7.t: Same.
5917 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
5918
36171d64
CC
59192010-09-14 Cary Coutant <ccoutant@google.com>
5920
5921 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
5922 (Target_x86_64::Relocate::relocate_tls): Replace check for
5923 saw_tls_block_reloc_ with test for executable section.
5924
d89051bd
CC
59252010-09-12 Cary Coutant <ccoutant@google.com>
5926
5927 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
5928 position-independent executables to shared libraries need dynamic
5929 relocations.
5930 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
5931 position-independent executables.
5932 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
5933 * testsuite/Makefile.in: Regenerate.
5934
fca41f0f
NC
59352010-09-10 Nick Clifton <nickc@redhat.com>
5936
5937 PR gold/11997
5938 * testsuite/memory_test.t: Discard any sections that are not
5939 needed.
5940
6695e4b3
L
59412010-09-09 H.J. Lu <hongjiu.lu@intel.com>
5942
5943 PR gold/11996
5944 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
5945 "This::" to work around a bug in gcc 4.2.
5946
5947 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
5948
0f72bf6f
RÁE
59492010-09-09 Rafael Espindola <espindola@google.com>
5950
5951 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
5952 sections with different PF_X flags in the same segment.
5953 (Layout::find_first_load_seg): Search all segments to find the first
5954 one.
5955 * options.h (rosegment): New.
5956
59572010-09-08 Rafael Espindola <espindola@google.com>
a6577478 5958
05a79166 5959 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 5960
aa98ff75
DK
59612010-09-08 Doug Kwan <dougkwan@google.com>
5962
5963 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
5964 (Arm_relobj::do_relocate_sections): Add new parameter for output
5965 file to match the parent.
5966 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
5967 of local symbols instead of input values. Update code to track
5968 changes in gold::relocate_section.
5969 * object.cc (Sized_relobj::compute_final_local_value): New methods.
5970 (Sized_relobj::compute_final_local_value_internal): New methods.
5971 (Sized_relobj::do_finalize_local_symbols): Move code from loop
5972 body into private version of Sized_relobj::compute_final_local_value.
5973 Call the inline method.
5974 * object.h (Symbol_value::Symbol_value): Define destructor. Free
5975 merged symbol value if there is one.
5976 (Symbol_value::has_output_value): New method defintiion.
5977 (Sized_relobj::Compute_final_local_value_status): New enum type.
5978 (Sized_relobj::compute_final_local_value): New methods.
5979 (Sized_relobj::compute_final_local_value_internal): New methods.
5980 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
5981 and arm_cortex_a8.sh.
5982 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
5983 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
5984 New tests.
5985 * Makefile.in: Regenerate.
5986 * testsuite/arm_bl_out_of_range.s: Update test.
5987 * testsuite/thumb_bl_out_of_range.s: Ditto.
5988 * testsuite/thumb_blx_out_of_range.s: Ditto.
5989 * testsuite/arm_branch_out_of_range.sh: New file.
5990 * testsuite/arm_cortex_a8.sh: Ditto.
5991 * testsuite/arm_cortex_a8_b.s: Ditto.
5992 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
5993 * testsuite/arm_cortex_a8_b_local.s: Ditto.
5994 * testsuite/arm_cortex_a8_bl.s: Ditto.
5995 * testsuite/arm_cortex_a8_blx.s: Ditto.
5996 * testsuite/arm_cortex_a8_local.s: Ditto.
5997 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
5998 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
5999
05a79166
L
60002010-09-08 Rafael Espindola <espindola@google.com>
6001
6002 * Makefile.am (memory_test.stdout): Run readelf with -W.
6003 * Makefile.in: Regenerate.
6004 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6005 64 bit output.
6006
33dbc701
RÁE
60072010-09-08 Rafael Espindola <espindola@google.com>
6008
6009 * script-sections.cc (Script_sections::add_memory_region): Convert
6010 field precision to int.
6011 * script.cc (script_set_section_region, script_set_section_region):
6012 Convert field precision to int.
6013
731ca54a
RÁE
60142010-09-08 Rafael Espindola <espindola@google.com>
6015
6016 * arm.cc (do_finalize_sections): Create the __exidx_start and
6017 __exdix_end symbols even when the section is missing.
6018
7f8cd844
NC
60192010-09-08 Nick Clifton <nickc@redhat.com>
6020
6021 * README: Remove claim that MEMORY is not supported.
6022 * expression.cc (script_exp_function_origin)
6023 (script_exp_function_length): Move from here to ...
6024 * script.cc: ... here.
6025 (script_set_section_region, script_add_memory)
6026 (script_parse_memory_attr, script_include_directive): New
6027 functions.
6028 * script-sections.cc
6029 (class Memory_region): New class.
6030 (class Output_section_definition): Add set_memory_region,
6031 set_section_vma, set_section_lma and get_section_name methods.
6032 (class Script_Sections): Add add_memory_region,
6033 find_memory_region, find_memory_region_origin,
6034 find_memory_region_length and set_memory_region methods.
6035 Have set_section_addresses method walk the list of set memory
6036 regions.
6037 Extend the print methos to display memory regions.
6038 * script-sections.h: Add prototypes for new methods.
6039 Add enum for MEMORY region attributes.
6040 * yyscript.y: Add support for parsing MEMORY regions.
6041 * script-c.h: Add prototypes for new functions.
6042 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6043 * testsuite/Makefile.in: Regenerate.
6044 * testsuite/memory_test.sh: New script.
6045 * testsuite/memory_test.s: New assembler source file.
6046 * testsuite/memory_test.t: New linker script.
6047
a4649286
DK
60482010-08-27 Doug Kwan <dougkwan@google.com>
6049
6050 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6051 reference override an existing dynamic weak reference.
6052 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6053 * testsuite/Makefile.in: Regenerate.
6054 * testsuite/dyn_weak_ref.sh: New file.
6055 * testsuite/dyn_weak_ref_1.c: Ditto.
6056 * testsuite/dyn_weak_ref_2.c: Ditto.
6057
b56648ad
ILT
60582010-08-27 Ian Lance Taylor <iant@google.com>
6059
6060 * incremental.h (class Incremental_input_entry): Add virtual
6061 destructor.
6062
809313cb
ILT
60632010-08-27 Ian Lance Taylor <iant@google.com>
6064
6065 * testsuite/start_lib_test_3.c: Mark t3 as used.
6066
11e32464
NC
60672010-08-27 Nick Clifton <nickc@redhat.com>
6068
6069 * options.cc (version_script): Fix small typo in previous
6070 whitespace tidyup.
6071
ca09d69a
NC
60722010-08-25 Nick Clifton <nickc@redhat.com>
6073
6074 * archive.cc: Formatting fixes: Remove whitespace between
6075 typename and following asterisk. Remove whitespace between
6076 function name and opening parenthesis.
6077 * archive.h: Likewise.
6078 * arm.cc: Likewise.
6079 * attributes.cc: Likewise.
6080 * attributes.h: Likewise.
6081 * common.cc: Likewise.
6082 * copy-relocs.cc: Likewise.
6083 * dirsearch.h: Likewise.
6084 * dynobj.cc: Likewise.
6085 * ehframe.cc: Likewise.
6086 * ehframe.h: Likewise.
6087 * expression.cc: Likewise.
6088 * fileread.cc: Likewise.
6089 * fileread.h: Likewise.
6090 * gc.h: Likewise.
6091 * gold-threads.cc: Likewise.
6092 * gold.cc: Likewise.
6093 * i386.cc: Likewise.
6094 * icf.h: Likewise.
6095 * incremental-dump.cc: Likewise.
6096 * incremental.cc: Likewise.
6097 * layout.cc: Likewise.
6098 * layout.h: Likewise.
6099 * main.cc: Likewise.
6100 * merge.cc: Likewise.
6101 * merge.h: Likewise.
6102 * object.cc: Likewise.
6103 * object.h: Likewise.
6104 * options.cc: Likewise.
6105 * options.h: Likewise.
6106 * output.cc: Likewise.
6107 * output.h: Likewise.
6108 * plugin.cc: Likewise.
6109 * plugin.h: Likewise.
6110 * powerpc.cc: Likewise.
6111 * reloc.cc: Likewise.
6112 * script-c.h: Likewise.
6113 * script-sections.cc: Likewise.
6114 * script.cc: Likewise.
6115 * stringpool.cc: Likewise.
6116 * symtab.cc: Likewise.
6117 * symtab.h: Likewise.
6118 * target.cc: Likewise.
6119 * timer.cc: Likewise.
6120 * timer.h: Likewise.
6121 * version.cc: Likewise.
6122 * x86_64.cc: Likewise.
6123
b8fa8750
NC
61242010-08-24 Nick Clifton <nickc@redhat.com>
6125
6126 PR 11899
6127 * layout.cc (segment_precedes): Sort segments by their physical
6128 addresses, if they have been set.
6129
9919d93b
CC
61302010-08-23 Cary Coutant <ccoutant@google.com>
6131
6132 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6133 symbols data.
6134 (Lib_group::include_member): Unlock object after deleting its
6135 symbols data.
6136 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6137 the bug fixed here.
6138
97b4be1c
CC
61392010-08-19 Neil Vachharajani <nvachhar@google.com>
6140 Cary Coutant <ccoutant@google.com>
6141
6142 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6143 constructor, and set_blocker.
6144 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6145 readsyms_blocker_.
6146 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6147 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6148 * testsuite/Makefile.am (start_lib_test): New test case.
6149 * testsuite/Makefile.in: Regenerate.
6150 * testsuite/start_lib_test_main.c: New file.
6151 * testsuite/start_lib_test_1.c: New file.
6152 * testsuite/start_lib_test_2.c: New file.
6153 * testsuite/start_lib_test_3.c: New file.
6154
dd0b1884
ILT
61552010-08-19 Ian Lance Taylor <iant@google.com>
6156
6157 * Makefile.in: Rebuild with automake 1.11.1.
6158 * aclocal.m4: Likewise.
6159 * testsuite/Makefile.in: Likewise.
6160
7223e9ca
ILT
61612010-08-19 Ian Lance Taylor <iant@google.com>
6162
6163 PR 10893
6164 * i386.cc (class Output_data_plt_i386): Update declarations.
6165 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6166 local_ifuncs_ fields.
6167 (Target_i386::do_plt_section_for_global): New function.
6168 (Target_i386::do_plt_section_for_local): New function.
6169 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6170 parameter; change all callers. Initialize global_ifuncs_ and
6171 local_ifuncs_. If doing a static link define __rel_iplt_start and
6172 __rel_iplt_end.
6173 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6174 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6175 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6176 symbols.
6177 (Target_i386::make_plt_section): New function, broken out of
6178 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6179 (Target_i386::make_plt_entry): Call make_plt_section.
6180 (Target_i386::make_local_ifunc_plt_entry): New function.
6181 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6182 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6183 R_386_IRELATIVE to switch.
6184 (Target_i386::Scan::global): Likewise.
6185 (Target_i386::Relocate::relocate): Likewise.
6186 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6187 switch.
6188 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6189 (Target_x86_64::do_plt_section_for_global): New function.
6190 (Target_x86_64::do_plt_section_for_local): New function.
6191 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6192 parameter; change all callers. If doing a static link define
6193 __rela_iplt_start and __rela_iplt_end.
6194 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6195 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6196 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6197 to point to .plt.
6198 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6199 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6200 switch.
6201 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6202 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6203 R_X86_64_IRELATIVE to switch.
6204 (Target_x86_64::Scan::global): Likewise.
6205 (Target_x86_64::Relocate::relocate): Likewise.
6206 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6207 switch.
6208 * target.h (class Target): Add plt_section_for_global and
6209 plt_section_for_local functions. Add do_plt_section_for_global
6210 and do_plt_section_for_local virtual functions.
6211 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6212 clarifying comments.
6213 (Symbol::use_plt_offset): Handle IFUNC symbol.
6214 * object.cc (Sized_relobj::Sized_relobj): Initialize
6215 local_plt_offsets_.
6216 (Sized_relobj::local_has_plt_offset): New function.
6217 (Sized_relobj::local_plt_offset): New function.
6218 (Sized_relobj::set_local_plt_offset): New function.
6219 (Sized_relobj::do_count): Handle IFUNC symbol.
6220 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6221 a bit away from input_shndx_ field. Add set_is_func_symbol and
6222 is_ifunc_symbol functions.
6223 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6224 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6225 local_plt_offsets_ field.
6226 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6227 * output.h (class Output_section_data): Add non-const
6228 output_section function.
6229 (class Output_data_got): Update declarations.
6230 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6231 Add use_plt_offset parameter to global and local constructors.
6232 Change all callers. Change local_sym_index_ field to 31 bits.
6233 Change GSYM_CODE and CONSTANT_CODE accordingly.
6234 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6235 doing a static link don't set sh_link field.
6236 (Output_data_got::Got_entry::write): Use PLT offset if
6237 appropriate.
6238 (Output_data_got::add_global_plt): New function.
6239 (Output_data_got::add_local_plt): New function.
6240 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6241 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6242 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6243 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6244 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6245 IFUNC conditional.
6246 * testsuite/ifunc-sel.h: New file.
6247 * testsuite/ifuncmain1.c: New file.
6248 * testsuite/ifuncmain1vis.c: New file.
6249 * testsuite/ifuncmod1.c: New file.
6250 * testsuite/ifuncdep2.c: New file.
6251 * testsuite/ifuncmain2.c: New file.
6252 * testsuite/ifuncmain3.c: New file.
6253 * testsuite/ifuncmod3.c: New file.
6254 * testsuite/ifuncmain4.c: New file.
6255 * testsuite/ifuncmain5.c: New file.
6256 * testsuite/ifuncmod5.c: New file.
6257 * testsuite/ifuncmain6pie.c: New file.
6258 * testsuite/ifuncmod6.c: New file.
6259 * testsuite/ifuncmain7.c: New file.
6260 * configure, testsuite/Makefile.in: Rebuild.
6261
56f75c03
ILT
62622010-08-18 Ian Lance Taylor <iant@google.com>
6263
6264 * incremental.cc
6265 (Output_section_incremental_inputs::write_input_files): Add cast
6266 to avoid signed/unsigned comparison warning.
6267 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6268
55455f89
CC
62692010-08-12 Cary Coutant <ccoutant@google.com>
6270
6271 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6272
e2054bcb
ILT
62732010-08-13 Ian Lance Taylor <iant@google.com>
6274
6275 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6276
74f67560
DK
62772010-08-12 Cary Coutant <ccoutant@google.com>
6278 Doug Kwan <dougkwan@google.com>
6279
6280 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6281 defintion overrides non-weak undef, remember that the original undef
6282 is not weak.
6283 * symtab.cc (Symbol_table::sized_write_global): For undef without
6284 an original weak binding, set binding to global in output.
6285 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6286 * testsuite/Makefile.in: Regenerate.
6287 * testsuite/strong_ref_weak_def.sh: New file.
6288 * testsuite/strong_ref_weak_def_1.c: Ditto.
6289 * testsuite/strong_ref_weak_def_2.c: Ditto.
6290
d1238d12
CC
62912010-08-12 Cary Coutant <ccoutant@google.com>
6292
6293 * testsuite/incremental_test.sh: Rewrite.
6294 * testsuite/incremental_test_1.c: Rewrite.
6295 * testsuite/incremental_test_2.c: Rewrite.
6296
0e70b911
CC
62972010-08-12 Cary Coutant <ccoutant@google.com>
6298
6299 * arm.cc (Target_arm::got_size): Add const.
6300 (Target_arm::got_entry_count): New function.
6301 (Target_arm::plt_entry_count): New function.
6302 (Target_arm::first_plt_entry_offset): New function.
6303 (Target_arm::plt_entry_size): New function.
6304 (Output_data_plt_arm::entry_count): New function.
6305 (Output_data_plt_arm::first_plt_entry_offset): New function.
6306 (Output_data_plt_arm::get_plt_entry_size): New function.
6307 * i386.cc (Target_i386::got_size): Add const.
6308 (Target_i386::got_entry_count): New function.
6309 (Target_i386::plt_entry_count): New function.
6310 (Target_i386::first_plt_entry_offset): New function.
6311 (Target_i386::plt_entry_size): New function.
6312 (Output_data_plt_i386::entry_count): New function.
6313 (Output_data_plt_i386::first_plt_entry_offset): New function.
6314 (Output_data_plt_i386::get_plt_entry_size): New function.
6315 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6316 find_incremental_inputs_sections. Dump incremental_got_plt section.
6317 * incremental.cc: Include target.h.
6318 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6319 parameter. Adjust all callers. Find incremental_got_plt section.
6320 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6321 section.
6322 (Output_section_incremental_inputs::set_final_data_size): Calculate
6323 size of incremental_got_plt section.
6324 (Output_section_incremental_inputs::do_write): Write the
6325 incremental_got_plt section.
6326 (Got_plt_view_info): New struct.
6327 (Local_got_offset_visitor): New class.
6328 (Global_got_offset_visitor): New class.
6329 (Global_symbol_visitor_got_plt): New class.
6330 (Output_section_incremental_inputs::write_got_plt): New function.
6331 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6332 Add parameter. Adjust all callers.
6333 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6334 (Incremental_inputs::got_plt_section): New function.
6335 (Incremental_inputs::got_plt_section_): New data member.
6336 (Incremental_got_plt_reader): New class.
6337 * layout.cc (Layout::create_incremental_info_sections): Add the
6338 incremental_got_plt section.
6339 * object.h (Got_offset_list::get_list): New function.
6340 (Got offset_list::for_all_got_offsets): New function.
6341 (Sized_relobj::local_got_offset_list): New function.
6342 * powerpc.cc (Target_powerpc::got_size): Add const.
6343 (Target_powerpc::got_entry_count): New function.
6344 (Target_powerpc::plt_entry_count): New function.
6345 (Target_powerpc::first_plt_entry_offset): New function.
6346 (Target_powerpc::plt_entry_size): New function.
6347 (Output_data_plt_powerpc::entry_count): New function.
6348 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6349 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6350 * sparc.cc (Target_sparc::got_size): Add const.
6351 (Target_sparc::got_entry_count): New function.
6352 (Target_sparc::plt_entry_count): New function.
6353 (Target_sparc::first_plt_entry_offset): New function.
6354 (Target_sparc::plt_entry_size): New function.
6355 (Output_data_plt_sparc::entry_count): New function.
6356 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6357 (Output_data_plt_sparc::get_plt_entry_size): New function.
6358 * symtab.h (Symbol::got_offset_list): New function.
6359 (Symbol_table::for_all_symbols): New function.
6360 * target.h (Sized_target::got_entry_count): New function.
6361 (Sized_target::plt_entry_count): New function.
6362 (Sized_target::plt_entry_size): New function.
6363 * x86_64.cc (Target_x86_64::got_size): Add const.
6364 (Target_x86_64::got_entry_count): New function.
6365 (Target_x86_64::plt_entry_count): New function.
6366 (Target_x86_64::first_plt_entry_offset): New function.
6367 (Target_x86_64::plt_entry_size): New function.
6368 (Output_data_plt_x86_64::entry_count): New function.
6369 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6370 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6371
09ec0418
CC
63722010-08-12 Cary Coutant <ccoutant@google.com>
6373
6374 * archive.cc: Include incremental.h.
6375 (Archive::Archive): Initialize incremental_info_.
6376 (Archive::include_member): Record archive members in incremental info.
6377 (Add_archive_symbols::run): Record begin and end of an archive in
6378 incremental info.
6379 (Lib_group::include_member): Record objects in incremental info.
6380 * archive.h (Incremental_archive_entry): Forward declaration.
6381 (Archive::set_incremental_info): New member function.
6382 (Archive::incremental_info): New member function.
6383 (Archive::Unused_symbol_iterator): New class.
6384 (Archive::unused_symbols_begin): New member function.
6385 (Archive::unused_symbols_end): New member function.
6386 (Archive::incremental_info_): New data member.
6387 * incremental-dump.cc (find_input_containing_global): New function.
6388 (dump_incremental_inputs): Dump new incremental info sections.
6389 * incremental.cc: Include symtab.h.
6390 (Output_section_incremental_inputs): New class.
6391 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6392 new incremental info sections.
6393 (Sized_incremental_binary::do_check_inputs): Likewise.
6394 (Incremental_inputs::report_archive): Remove.
6395 (Incremental_inputs::report_archive_begin): New function.
6396 (Incremental_inputs::report_archive_end): New function.
6397 (Incremental_inputs::report_object): New function.
6398 (Incremental_inputs::finalize_inputs): Remove.
6399 (Incremental_inputs::report_input_section): New function.
6400 (Incremental_inputs::report_script): Rewrite.
6401 (Incremental_inputs::finalize): Do nothing but finalize string table.
6402 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6403 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6404 (Incremental_inputs::create_data_sections): New function.
6405 (Incremental_inputs::relocs_entsize): New function.
6406 (Output_section_incremental_inputs::set_final_data_size): New function.
6407 (Output_section_incremental_inputs::do_write): New function.
6408 (Output_section_incremental_inputs::write_header): New function.
6409 (Output_section_incremental_inputs::write_input_files): New function.
6410 (Output_section_incremental_inputs::write_info_blocks): New function.
6411 (Output_section_incremental_inputs::write_symtab): New function.
6412 * incremental.h (Incremental_script_entry): Forward declaration.
6413 (Incremental_object_entry): Forward declaration.
6414 (Incremental_archive_entry): Forward declaration.
6415 (Incremental_inputs): Forward declaration.
6416 (Incremental_inputs_header_data): Remove.
6417 (Incremental_inputs_header): Remove.
6418 (Incremental_inputs_header_write): Remove.
6419 (Incremental_inputs_entry_data): Remove.
6420 (Incremental_inputs_entry): Remove.
6421 (Incremental_inputs_entry_write): Remove.
6422 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6423 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6424 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6425 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6426 Likewise.
6427 (Incremental_input_entry): New class.
6428 (Incremental_script_entry): New class.
6429 (Incremental_object_entry): New class.
6430 (Incremental_archive_entry): New class.
6431 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6432 (Incremental_inputs::report_inputs): Remove.
6433 (Incremental_inputs::report_archive): Remove.
6434 (Incremental_inputs::report_archive_begin): New function.
6435 (Incremental_inputs::report_archive_end): New function.
6436 (Incremental_inputs::report_object): Change prototype.
6437 (Incremental_inputs::report_input_section): New function.
6438 (Incremental_inputs::report_script): Change prototype.
6439 (Incremental_inputs::get_reloc_count): New function.
6440 (Incremental_inputs::set_reloc_count): New function.
6441 (Incremental_inputs::create_data_sections): New function.
6442 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6443 (Incremental_inputs::inputs_section): New function.
6444 (Incremental_inputs::symtab_section): New function.
6445 (Incremental_inputs::relocs_section): New function.
6446 (Incremental_inputs::get_stringpool): Add const.
6447 (Incremental_inputs::command_line): Add const.
6448 (Incremental_inputs::inputs): Remove.
6449 (Incremental_inputs::command_line_key): New function.
6450 (Incremental_inputs::input_file_count): New function.
6451 (Incremental_inputs::input_files): New function.
6452 (Incremental_inputs::relocs_entsize): New function.
6453 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6454 (Incremental_inputs::finalize_inputs): Remove.
6455 (Incremental_inputs::Input_info): Remove.
6456 (Incremental_inputs::lock_): Remove.
6457 (Incremental_inputs::inputs_): Change type.
6458 (Incremental_inputs::inputs_map_): Remove.
6459 (Incremental_inputs::current_object_entry_): New data member.
6460 (Incremental_inputs::inputs_section_): New data member.
6461 (Incremental_inputs::symtab_section_): New data member.
6462 (Incremental_inputs::relocs_section_): New data member.
6463 (Incremental_inputs::reloc_count_): New data member.
6464 (Incremental_inputs_reader): New class.
6465 (Incremental_symtab_reader): New class.
6466 (Incremental_relocs_reader): New class.
6467 * layout.cc (Layout::finalize): Move finalization of incremental info
6468 and creation of incremental info sections to follow finalization of
6469 symbol table. Set offsets for postprocessing sections.
6470 (Layout::create_incremental_info_sections): Call
6471 Incremental_inputs::create_data_sections. Add incremental symtab
6472 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6473 sections to layout after input sections.
6474 * layout.h (struct Timespec): Forward declaration.
6475 (Layout::incremental_inputs): Add const.
6476 (Layout::create_incremental_info_sections): Add parameter.
6477 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6478 * object.cc: Include incremental.h.
6479 (Relobj::finalize_incremental_relocs): New function.
6480 (Sized_relobj::do_layout): Record input sections in incremental info.
6481 * object.h (Object::output_section): New function.
6482 (Object::output_section_offset): Moved from Relobj.
6483 (Object::get_incremental_reloc_base): New function.
6484 (Object::get_incremental_reloc_count): New function.
6485 (Object::do_output_section): New function.
6486 (Object::do_output_section_offset): Moved from Relobj.
6487 (Object::do_get_incremental_reloc_base): New function.
6488 (Object::do_get_incremental_reloc_count): New function.
6489 (Object::Object): Initialize new data members.
6490 (Relobj::output_section): Renamed do_output_section and moved to
6491 protected.
6492 (Relobj::output_section_offset): Moved to Object.
6493 (Relobj::do_get_incremental_reloc_base): New function.
6494 (Relobj::do_get_incremental_reloc_count): New function.
6495 (Relobj::allocate_incremental_reloc_counts): New function.
6496 (Relobj::count_incremental_reloc): New function.
6497 (Relobj::finalize_incremental_relocs): New function.
6498 (Relobj::next_incremental_reloc_index): New function.
6499 (Relobj::reloc_counts_): New data member.
6500 (Relobj::reloc_bases_): New data member.
6501 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6502 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6503 (Sized_relobj::incremental_relocs_scan): New function.
6504 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6505 (Sized_relobj::incremental_relocs_write): New function.
6506 (Sized_relobj::incremental_relocs_write_reltype): New function.
6507 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6508 incremental link.
6509 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6510 archives and object files elsewhere.
6511 (Add_symbols::run): Report object files here.
6512 (Finish_group::run): Report end of archive at end of group.
6513 * reloc.cc: Include layout.h, incremental.h.
6514 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6515 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6516 (Sized_relobj::incremental_relocs_scan): New function.
6517 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6518 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6519 (Sized_relobj::incremental_relocs_write): New function.
6520 (Sized_relobj::incremental_relocs_write_reltype): New function.
6521 * script.cc (read_input_script): Rewrite test for incremental link.
6522 Change call to Incremental_inputs::report_script.
6523 * symtab.h (Symbol_table::first_global_index): New function.
6524 (Symbol_table::output_count): New function.
6525
ce0d1972
DK
65262010-08-12 Doug Kwan <dougkwan@google.com>
6527
6528 * arm.cc (Target_arm::merge_object_attributes): Check command line
6529 options --no-wchar-size-warning and --no-enum-size-warning.
6530 * options.h (General_options): Add ld-compatible options
6531 --no-enum-size-warning and --no-wchar-size-warning.
6532
6e5710ce
ILT
65332010-08-04 Ian Lance Taylor <iant@google.com>
6534
6535 * x86_64.cc (Target_x86_64::Scan::local): Use
6536 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6537 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6538 (Target_x86_64::Scan::global): Likewise.
6539 (Target_x86_64::Relocate::relocate): Likewise.
6540 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6541 Likewise.
6542
fef830db
CC
65432010-08-03 Cary Coutant <ccoutant@google.com>
6544
6545 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6546 to reserve space in merged_strings vector. Keep total input size
6547 for stats.
6548 (Output_merge_string::do_print_merge_stats): Print total input size.
6549 * merge.h (Output_merge_string): Add input_size_ field.
6550 * stringpool.cc (Stringpool_template::string_length): Move
6551 implementations out of Stringpool_template class and place in
6552 stringpool.h.
6553 * stringpool.h (string_length): Move out of Stringpool_template.
6554
1e3811b0
ILT
65552010-08-03 Ian Lance Taylor <iant@google.com>
6556
6557 PR 11712
6558 * layout.cc (relaxation_loop_body): If address of load segment is
6559 set, adjust address to include headers if possible.
6560
7af0c620
ILT
65612010-08-03 Ian Lance Taylor <iant@google.com>
6562
6563 * version.cc (version_string): Bump to 1.10.
6564
22f0da72
ILT
65652010-08-03 Ian Lance Taylor <iant@google.com>
6566
6567 PR 11805
6568 * layout.h (enum Output_section_order): Define.
6569 (class Layout): Update declarations.
6570 * layout.cc (Layout::get_output_section): Add order parameter.
6571 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6572 is_first_non_relro parameters. Change all callers.
6573 (Layout::choose_output_section): Likewise.
6574 (Layout::add_output_section_data): Likewise.
6575 (Layout::make_output_section): Likewise. Set order.
6576 (Layout::default_section_order): New function.
6577 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6578 * output.cc (Output_section::Output_section): Initialize order_.
6579 Don't initialize deleted fields.
6580 (Output_segment::Output_segment): Don't initialize deleted
6581 fields.
6582 (Output_segment::add_output_section_to_load): New function
6583 replacing add_output_section. Change all callers to call this or
6584 add_output_section_to_nonload.
6585 (Output_segment::add_output_section_to_nonload): New function.
6586 (Output_segment::remove_output_section): Rewrite.
6587 (Output_segment::add_initial_output_data): Likewise.
6588 (Output_segment::has_any_data_sections): Likewise.
6589 (Output_segment::is_first_section_relro): Likewise.
6590 (Output_segment::maximum_alignment): Likewise.
6591 (Output_segment::has_dynamic_reloc): New function replacing
6592 dynamic_reloc_count. Change all callers.
6593 (Output_segment::has_dynamic_reloc_list): New function replacing
6594 dynamic_reloc_count_list. Change all callers.
6595 (Output_segment::set_section_addresses): Rewrite.
6596 (Output_segment::set_offset): Rewrite.
6597 (Output_segment::find_first_and_last_list): Remove.
6598 (Output_segment::set_tls_offsets): Rewrite.
6599 (Output_segment::first_section_load_address): Likewise.
6600 (Output_segment::output_section_count): Likewise.
6601 (Output_segment::section_with_lowest_load_address): Likewise.
6602 (Output_segment::write_section_headers): Likewise.
6603 (Output_segment::print_sections_to_map): Likewise.
6604 * output.h (class Output_data): Remove dynamic_reloc_count_
6605 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6606 (Output_data::add_dynamic_reloc): Rewrite.
6607 (Output_data::has_dynamic_reloc): New function.
6608 (Output_data::dynamic_reloc_count): Remove.
6609 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6610 is_last_relro_, is_first_non_relro_, is_interp_,
6611 is_dynamic_linker_section_ fields. Add order and set_order
6612 functions. Remove is_relro_local, set_is_relro_local,
6613 is_last_relro, set_is_last_relro, is_first_non_relro,
6614 set_is_first_non_relro functions, is_interp, set_is_interp,
6615 is_dynamic_linker_section, and set_is_dynamic_linker_section
6616 functions.
6617 (class Output_segment): Change Output_data_list from std::list to
6618 std:;vector. Add output_lists_ field. Remove output_data_ and
6619 output_bss_ fields. Update declarations.
6620
3ff2ccb0
ILT
66212010-08-02 Ian Lance Taylor <iant@google.com>
6622
6623 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6624 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6625 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6626
88a4108b
ILT
66272010-08-02 Ian Lance Taylor <iant@google.com>
6628
6629 PR 11855
6630 * script.cc (Script_options::Script_options): Initialize
6631 symbol_definitions_ and symbol_references_.
6632 (Script_options::add_symbol_assignment): Update
6633 symbol_definitions_ and symbol_references_.
6634 (Script_options::add_symbol_reference): New function.
6635 (script_symbol): New function.
6636 * script.h (class Script_options): Add symbol_definitions_ and
6637 symbol_references_ fields.
6638 (Script_options::referenced_const_iterator): New type.
6639 (Script_options::referenced_begin): New function.
6640 (Script_options::referenced_end): New function.
6641 (Script_options::is_referenced): New function.
6642 (Script_options::any_unreferenced): New function.
6643 * script-c.h (script_symbol): Declare.
6644 * yyscript.y (exp): Call script_symbol.
6645 * symtab.cc: Include "script.h".
6646 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6647 Change all callers. Check symbols referenced by scripts.
6648 (Symbol_table::add_undefined_symbols_from_command_line): Add
6649 layout parameter. Change all callers.
6650 (Symbol_table::do_add_undefined_symbols_from_command_line):
6651 Likewise. Break out loop body. Check symbols referenced by
6652 scripts.
6653 (Symbol_table::add_undefined_symbol_from_command_line): New
6654 function broken out of
6655 do_add_undefined_symbols_from_command_line.
6656 * symtab.h (class Symbol_table): Update declarations.
6657 * archive.cc: Include "layout.h".
6658 (Archive::should_include_member): Add layout parameter. Change
6659 all callers. Check for symbol mentioned in expression.
6660 * archive.h (class Archive): Update declaration.
6661 * object.cc (Sized_relobj::do_should_include_member): Add layout
6662 parameter.
6663 * object.h (Object::should_include_member): Add layout parameter.
6664 Change all callers.
6665 (Object::do_should_include_member): Add layout parameter.
6666 (class Sized_relobj): Update declaration.
6667 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6668 parameter.
6669 * dynobj.h (class Sized_dynobj): Update declaration.
6670 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6671 layout parameter.
6672 * plugin.h (class Sized_pluginobj): Update declaration.
6673
5f1ab67a
ILT
66742010-08-02 Ian Lance Taylor <iant@google.com>
6675
6676 PR 11866
6677 * output.cc (Output_segment::set_offset): Search for the first and
6678 last sections rather than assuming that the list is in order.
6679 (Output_segment::find_first_and_last_list): New function.
6680 * output.h (class Output_segment): Update declarations.
6681 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6682 (relro_strip_test_SOURCES): New variable.
6683 (relro_strip_test_DEPENDENCIES): New variable.
6684 (relro_strip_test_LDFLAGS): New variable.
6685 (relro_strip_test_LDADD): New variable.
6686 (relro_strip_test.so): New target.
6687
a8df5856
ILT
66882010-08-02 Ian Lance Taylor <iant@google.com>
6689
6690 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6691 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6692 (Target_i386::got_tlsdesc_section): New function.
6693 (Target_i386::got_section): Create space for GOT entries for
6694 TLSDESC relocations.
6695 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6696 R_386_TLS_GOTDESC.
6697 (Target_i386::Scan::global): Likewise.
6698 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6699 using TLSDESC GOT.
6700 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6701 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6702 (Target_x86_64::got_tlsdesc_section): New function.
6703 (Target_x86_64::got_section): Create space for GOT entries for
6704 TLSDESC relocations.
6705 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6706 R_386_TLS_GOTDESC.
6707 (Target_x86_64::Scan::global): Likewise.
6708 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6709 using TLSDESC GOT.
6710
0c10a0a6
ILT
67112010-08-02 Ian Lance Taylor <iant@google.com>
6712
6713 * testsuite/final_layout.sh: Use dc to convert from hex to
6714 decimal.
6715
41cbeecc
ST
67162010-07-29 Sriraman Tallam <tmsriram@google.com>
6717
6718 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6719 paramter to the call to gold::gc_process_relocs.
6720 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6721 paramter to the call to gold::gc_process_relocs.
6722 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6723 parameter to the call to gold::gc_process_relocs.
6724 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6725 template parameter to the call to gold::gc_process_relocs.
6726 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6727 paramter to the call to gold::gc_process_relocs.
6728 * gc.h (get_embedded_addend_size): New function.
6729 (gc_process_relocs): Save the size of the reloc for use by ICF.
6730 * icf.cc (get_section_contents): Get the addend from the text section
6731 for SHT_REL relocation sections.
6732 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6733 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6734 * int_encoding.h (read_from_pointer): New overloaded function.
6735 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6736 * testsuite/icf_sht_rel_addend_test.sh: New file.
6737 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6738 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6739
6ea55b82
RW
67402010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6741
6742 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6743 * Makefile.in: Regenerate.
6744 * testsuite/Makefile.in: Regenerate.
6745
9691462b
ILT
67462010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6747
6748 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6749 * gold/testsuite/debug_msg.cc: Likewise.
6750 * gold/testsuite/odr_violation1.cc
6751 * gold/testsuite/odr_violation2.cc
6752
76897331
CC
67532010-07-21 Cary Coutant <ccoutant@google.com>
6754
6755 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6756 string, and length fields.
6757 (Output_merge_string::Merged_strings_list): New type.
6758 (Output_merge_string::Merged_strings_lists): New typedef.
6759 (Output_merge_string): Replace merged_strings_ with
6760 merged_strings_lists_.
6761 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6762 Merged_strings_list per input object and section. Don't store pointer
6763 to the string. Don't store length with each merged string entry.
6764 (Output_merge_string::finalize_merged_data): Loop over list of merged
6765 strings lists. Recompute length of each merged string.
6766
78384e8f
CC
67672010-07-15 Cary Coutant <ccoutant@google.com>
6768
6769 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6770 here.
6771
783659f9
ILT
67722010-07-14 Ian Lance Taylor <iant@google.com>
6773
6774 * descriptors.cc (Descriptors::open): Report correct name in error
6775 message.
6776
131687b4
DK
67772010-07-13 Doug Kwan <dougkwan@google.com>
6778
6779 * arm.cc (Arm_input_section::Arm_input_section): For a
6780 SHT_ARM_EXIDX section, always keeps the input sections.
6781 (Arm_input_section::set_exidx_section_link): New method.
6782 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6783 has_errors_ to false.
6784 (Arm_exidx_input_section::has_errors,
6785 Arm_exidx_input_section::set_has_errors): New methods.
6786 (Arm_exidx_input_section::has_errors_): New data member.
6787 (Arm_relobj::get_exidx_shndx_list): New method.
6788 (Arm_output_section::append_text_sections_to_list): Do not skip
6789 section without SHF_EXECINSTR.
6790 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6791 errors.
2e702c99 6792 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6793 section header. Make error messages more verbose. Check for
6794 a non-executable section linked to an EXIDX section.
6795 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6796 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6797 check that there is no deferred EXIDX section if we exit early.
6798 Instead of not making an EXIDX section in case of an error, make one
6799 and set the has_errors flag of it.
6800 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6801 in a relocatable link.
6802 (Target_arm::do_relax): Look for the EXIDX output section instead of
6803 assuming that it is called .ARM.exidx.
2e702c99 6804 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6805 section list. Do not check for SHF_EXECINSTR section flags but
6806 skip any input section with errors.
6807 * output.cc (Output_section::Output_section): Initialize
6808 always_keeps_input_sections_ to false.
6809 (Output_section::add_input_section): Check for
6810 always_keeps_input_sections_.
6811 * output.h (Output_section::always_keeps_input_sections,
6812 Output_section::set_always_keeps_input_sections): New methods.
6813 (Output_section::always_keeps_input_sections): New data member.
6814
69517287
RÁE
68152010-07-13 Rafael Espindola <espindola@google.com>
6816
6817 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6818 * fileread.h (Input_file): Add try_extra_search_path and find_file.
6819
82742395
ILT
68202010-07-13 Philip Herron <herron.philip@googlemail.com>
6821 Ian Lance Taylor <iant@google.com>
6822
6823 * output.h (Output_section_lookup_maps::add_merge_section):
6824 Correct check of whether value was inserted.
6825 (Output_section_lookup_maps::add_merge_input_section): Likewise.
6826 (Output_section_lookup_maps::add_relaxed_input_section):
6827 Likewise.
6828 * arm.cc (Target_arm::got_section): Remove used local os.
6829 * i386.cc (Target_i386::got_section): Likewise.
6830 * x86_64.cc (Target_x86_64::got_section): Likewise.
6831 * sparc.cc (Target_sparc::got_section): Likewise.
6832 (Target_sparc::relocate): Remove unused local have_got_offset.
6833 * powerpc.cc (Target_powerpc::relocate): Likewise.
6834
f2d707b5
ILT
68352010-07-13 Ian Lance Taylor <iant@google.com>
6836
241531d6
ILT
6837 * compressed_output.cc (zlib_decompress): Fix signature in
6838 !HAVE_ZLIB_H case.
6839
f2d707b5
ILT
6840 * archive.cc (Archive::include_member): Unlock an external member
6841 of a thin archive. Don't bother to delete an object we know is
6842 NULL.
6843
a2e47362
CC
68442010-07-12 Cary Coutant <ccoutant@google.com>
6845
6846 * compressed_output.cc (zlib_decompress): New function.
6847 (get_uncompressed_size): New function.
6848 (decompress_input_section): New function.
6849 * compressed_output.h (get_uncompressed_size): New function.
6850 (decompress_input_section): New function.
6851 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
6852 Handle compressed debug sections.
6853 * layout.cc (is_compressed_debug_section): New function.
6854 (Layout::output_section_name): Map compressed section names to
6855 canonical names.
6856 * layout.h (is_compressed_debug_section): New function.
6857 (is_debug_info_section): Recognize compressed debug sections.
6858 * merge.cc: Include compressed_output.h.
6859 (Output_merge_data::do_add_input_section): Handle compressed
6860 debug sections.
6861 (Output_merge_string::do_add_input_section): Handle compressed
6862 debug sections.
6863 * object.cc: Include compressed_output.h.
6864 (Sized_relobj::Sized_relobj): Initialize new data members.
6865 (build_compressed_section_map): New function.
6866 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
6867 * object.h (Object::section_is_compressed): New method.
6868 (Object::do_section_is_compressed): New method.
6869 (Sized_relobj::Compressed_section_map): New type.
6870 (Sized_relobj::do_section_is_compressed): New method.
6871 (Sized_relobj::compressed_sections_): New data member.
6872 * output.cc (Output_section::add_input_section): Handle compressed
6873 debug sections.
6874 * reloc.cc: Include compressed_output.h.
6875 (Sized_relobj::write_sections): Handle compressed debug sections.
6876
ce279a62
CC
68772010-07-08 Cary Coutant <ccoutant@google.com>
6878
6879 * resolve.cc (Symbol_table::resolve): Remember whether undef was
6880 weak when resolving to a dynamic def.
6881 (Symbol_table::should_override): Add adjust_dyndef flag; set it
6882 for weak undef/dynamic def cases. Adjust callers.
6883 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
6884 undef_binding_weak_.
6885 (Symbol_table::sized_write_globals): Adjust symbol binding.
6886 (Symbol_table::sized_write_symbol): Add binding parameter.
6887 * symtab.h (Symbol::set_undef_binding): New method.
6888 (Symbol::is_undef_binding_weak): New method.
6889 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
6890 (Symbol_table::should_override): Add new parameter.
6891 (Symbol_table::sized_write_symbol): Add new parameter.
6892
6893 * testsuite/weak_undef_file1.cc: Add new test case.
6894 * testsuite/weak_undef_file2.cc: Fix header comment.
6895 * testsuite/weak_undef_test.cc: Add new test case.
6896
b2286c10
DK
68972010-06-29 Doug Kwan <dougkwan@google.com>
6898
6899 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
6900 Initialize USE_SYMBOL_.
6901 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
6902 definition.
6903 (Arm_reloc_property::uses_symbol_): New data member declaration.
6904 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
6905 uses symbol value and symbol is undefined but not weakly undefined.
6906
4802450a
RÁE
69072010-06-28 Rafael Espindola <espindola@google.com>
6908
6909 * plugin.cc (Plugin::load): Use dlerror.
6910
e5ca47ba
ILT
69112010-06-26 Jeffrey Yaskin <jyasskin@google.com>
6912
6913 * symtab.cc (detect_odr_violations): When reporting an ODR
6914 violation, report an object where the symbol is defined.
6915
8a75a161
DK
69162010-06-25 Doug Kwan <dougkwan@google.com>
6917
6918 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
6919 (Target_arm::section_may_have_icf_unsafe_pointers): New method
6920 definition.
6921 (Target_arm::Scan::local_reloc_may_be_function_pointer,
6922 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
6923 target hook to detect function points.
6924 (Target_arm::Scan::possible_function_pointer_reloc): New method.
6925 * icf.h (Icf::check_section_for_function_pointers): Change type of
6926 parameter SECTION_NAME to const reference to std::string. Use
6927 target hook to determine if section may have unsafe pointers.
6928 * target.h (Target::section_may_have_icf_unsafe_pointers): New
6929 method definition.
6930
42218b9f
RÁE
69312010-06-21 Rafael Espindola <espindola@google.com>
6932
6933 * fileread.cc (Input_file::find_fie): New
6934 (Input_file::open): Use Input_file::find_fie.
6935 * fileread.h (Input_file::find_fie): New
6936 * plugin.cc (set_extra_library_path): New.
6937 (Plugin::load): Add set_extra_library_path to the transfer vector.
6938 (Plugin_manager::set_extra_library_path): New.
6939 (Plugin_manager::add_input_file): Use the extra search path if set.
6940 (set_extra_library_path(): New.
6941 * plugin.h (Plugin_manager): Add set_extra_library_path and
6942 extra_search_path_.
6943
a0506cca
CC
69442010-06-19 Cary Coutant <ccoutant@google.com>
6945
6946 * layout.cc (gdb_sections): Add .debug_types.
6947 (lines_only_debug_sections): Likewise.
6948
6508b958
RÁE
69492010-06-18 Rafael Espindola <espindola@google.com>
6950
6951 * plugin.cc (add_input_file,add_input_library)
6952 (Plugin_manager::add_input_file): Make filename arguments const.
6953 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
6954 const.
6955
3e235302
DK
69562010-06-16 Doug Kwan <dougkwan@google.com>
6957
6958 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
6959 .ARM.attributes section if we have not merged any input
6960 attributes sections.
6961
106e8a6c
DK
69622010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6963
6964 * arm.cc: Allow combining objects with no EABI version
6965 information.
6966
91ff43fe
RÁE
69672010-06-15 Rafael Espindola <espindola@google.com>
6968
6969 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
6970
68ed838c
ILT
69712010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6972
6973 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
6974 (struct iovec): Correct !HAVE_READV definition.
6975
f3a2388f
CC
69762010-06-10 Cary Coutant <ccoutant@google.com>
6977
6978 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
6979 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
6980 reloc sections.
6981 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
6982
6983 PR 11683
6984 * symtab.h (Symbol::is_placeholder): New member function.
6985 * target-reloc.h (relocate_section): Check for placeholder symbols.
6986
6987 * testsuite/Makefile.am (plugin_test_8): New test.
6988 (plugin_test_9): New test.
6989 * testsuite/Makefile.in: Regenerate.
6990
e1df38aa
NC
69912010-06-09 Nick Clifton <nickc@redhat.com>
6992
6993 * yyscript.y (input_list_element): Allow strings prefixed with
6994 the '-' character. Treat these as libraries.
6995 * script.cc (script_add_library): New function. Adds a library
6996 specified by "-l<name>" found in an input script.
6997 * script-c.h: Add prototype for script_add_library.
6998
25bbe950
DK
69992010-06-07 Doug Kwan <dougkwan@google.com>
7000
7001 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7002 Restrict stub-group size to be within long conditional branch
7003 range when working around cortex-A8 erratum.
7004
0f32ea4c
ILT
70052010-06-07 Damien Diederen <dd@crosstwine.com>
7006
7007 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7008 #ifdef typo.
7009
8fe2a369
ST
70102010-06-03 Sriraman Tallam <tmsriram@google.com>
7011
7012 PR gold/11658
7013 * output.cc
7014 (Output_section::Input_section_sort_entry::compare_section_ordering):
7015 Change to return non-zero correctly.
7016 (Output_section::Input_section_sort_section_order_index_compare
7017 ::operator()): Change to fix ambiguity in comparisons.
7018
6e9ba2ca
ST
70192010-06-01 Sriraman Tallam <tmsriram@google.com>
7020
7021 * gold.h (is_wildcard_string): New function.
7022 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7023 (Layout::layout_eh_frame): Ditto.
7024 (Layout::find_section_order_index): New method.
7025 (Layout::read_layout_from_file): New method.
7026 * layout.h (Layout::find_section_order_index): New method.
7027 (Layout::read_layout_from_file): New method.
7028 (Layout::input_section_position_): New private member.
7029 (Layout::input_section_glob_): New private member.
7030 * main.cc (main): Call read_layout_from_file here.
7031 * options.h (--section-ordering-file): New option.
7032 * output.cc (Output_section::input_section_order_specified_): New
7033 member.
7034 (Output_section::Output_section): Initialize new member.
7035 (Output_section::add_input_section): Add new parameter.
7036 Keep input sections when --section-ordering-file is used.
7037 (Output_section::set_final_data_size): Sort input sections when
7038 section ordering file is specified.
7039 (Output_section::Input_section_sort_entry): Add new parameter.
7040 Check sorting type.
7041 (Output_section::Input_section_sort_entry::compare_section_ordering):
7042 New method.
7043 (Output_section::Input_section_sort_compare::operator()): Change to
7044 consider section_order_index.
7045 (Output_section::Input_section_sort_init_fini_compare::operator()):
7046 Change to consider section_order_index.
7047 (Output_section::Input_section_sort_section_order_index_compare
7048 ::operator()): New method.
7049 (Output_section::sort_attached_input_sections): Change to sort
7050 according to section order when specified.
e1df38aa
NC
7051 (Output_section::add_input_section<32, true>): Add new parameter.
7052 (Output_section::add_input_section<64, true>): Add new parameter.
7053 (Output_section::add_input_section<32, false>): Add new parameter.
7054 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7055 * output.h (Output_section::add_input_section): Add new parameter.
7056 (Output_section::input_section_order_specified): New
7057 method.
7058 (Output_section::set_input_section_order_specified): New method.
7059 (Input_section::Input_section): Initialize section_order_index_.
7060 (Input_section::section_order_index): New method.
7061 (Input_section::set_section_order_index): New method.
7062 (Input_section::section_order_index_): New member.
7063 (Input_section::Input_section_sort_section_order_index_compare): New
7064 struct.
7065 (Output_section::input_section_order_specified_): New member.
7066 * script-sections.cc (is_wildcard_string): Delete and move modified
7067 method to gold.h.
7068 (Output_section_element_input::Output_section_element_input): Modify
7069 call to is_wildcard_string.
7070 (Output_section_element_input::Input_section_pattern
7071 ::Input_section_pattern): Ditto.
7072 (Output_section_element_input::Output_section_element_input): Ditto.
7073 * testsuite/Makefile.am (final_layout): New test case.
7074 * testsuite/Makefile.in: Regenerate.
7075 * testsuite/final_layout.cc: New file.
7076 * testsuite/final_layout.sh: New file.
7077
3537c84b
RÁE
70782010-06-01 Rafael Espindola <espindola@google.com>
7079
7080 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7081
105b6afd
RÁE
70822010-06-01 Rafael Espindola <espindola@google.com>
7083
7084 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7085 visibility of symbols.
7086
29e11421
DK
70872010-05-27 Doug Kwan <dougkwan@google.com>
7088
7089 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7090 from start of output section instead of address for a local symbol
7091 in a merged or relaxed section when doing a relocatable link.
7092
5e0f337e
RÁE
70932010-05-26 Rafael Espindola <espindola@google.com>
7094
703d02da 7095 PR 11604
5e0f337e
RÁE
7096 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7097 adding sections the garbage collector removed.
7098 * gold/testsuite/Makefile.am: Add test.
7099 * gold/testsuite/Makefile.in: Regenerate.
7100 * gold/testsuite/plugin_test_7.sh: New.
7101 * gold/testsuite/plugin_test_7_1.c: New.
7102 * gold/testsuite/plugin_test_7_2.c: New.
7103
f4187277
RÁE
71042010-05-26 Rafael Espindola <espindola@google.com>
7105
7106 * script-sections.cc (Output_section_definition::set_section_addresses):
7107 Check for --section-start.
7108
5c388529
DK
71092010-05-26 Doug Kwan <dougkwan@google.com>
7110
7111 * arm.cc (Arm_scan_relocatable_relocs): New class.
7112 (Target_arm::relocate_special_relocatable): New method.
7113 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7114 (Arm_relocate_functions::thumb_branch_common): Same.
7115 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7116 instead of Default_scan_relocatable_relocs.
7117 * target-reloc.h (relocate_for_relocatable): Let target handle
7118 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7119 * target.h (Sized_target::relocate_special_relocatable): New method.
7120
bca1c3ae
ILT
71212010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7122
7123 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7124
0439c796
DK
71252010-05-23 Doug Kwan <dougkwan@google.com>
7126
7127 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7128 instead of a cast.
7129 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7130 with a direct branch, not a conditional branch, to a stub.
7131 * merge.cc (Output_merge_base::record_input_section): New method
7132 defintion.
7133 (Output_merge_data::do_add_input_section): Record input section if
7134 keeps-input-sections flag is set.
7135 (Output_merge_string::do_add_input_section): Ditto.
7136 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7137 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7138 INPUT_SECTIONS_.
7139 (Output_merge_base::keeps_input_sections,
7140 Output_merge_base::set_keeps_input_sections,
7141 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7142 method definitions.
7143 (Output_merge_base::Input_sections): New type declaration.
7144 (Output_merge_base::input_sections_begin,
7145 Output_merge_base::input_sections_end,
7146 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7147 (Output_merge_base::bool keeps_input_sections_,
7148 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7149 Output_merge_base::input_sections_): New data members.
7150 (Output_merge_data::do_set_keeps_input_sections): New method
7151 defintion.
7152 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7153 * output.cc (Output_section::Input_section::relobj): Move method
7154 defintion from class declaration to here and handle merge sections.
7155 (Output_section::Input_section::shndx): Ditto.
7156 (Output_section::Output_section): Remove initializations of removed
7157 data members and initialize new data member LOOKUP_MAPS_.
7158 (Output_section::add_input_section): Set keeps-input-sections flag
7159 for a newly created merge output section as appropriate. Adjust code
7160 to use Output_section_lookup_maps class.
7161 (Output_section::add_relaxed_input_section): Adjst code for lookup
7162 maps code refactoring.
2e702c99 7163 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
7164 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7165 class. If adding input section to a newly created merge output
7166 section fails, remove the new merge section.
7167 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 7168 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 7169 (Output_section::find_merge_section): Ditto.
0439c796 7170 (Output_section::build_lookup_maps): New method defintion.
2e702c99 7171 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
7172 Output_section_lookup_maps class.
7173 (Output_section::get_input_sections): Export merge sections. Adjust
7174 code to use Output_section_lookup_maps class.
7175 (Output_section:::add_script_input_section): Adjust code to use
7176 Output_section_lookup_maps class. Update lookup maps for merge
7177 sections also.
7178 (Output_section::discard_states): Use Output_section_lookup_maps.
7179 (Output_section::restore_states): Same.
7180 * output.h (Merge_section_properties): Move class defintion out of
7181 Output_section.
7182 (Output_section_lookup_maps): New class.
7183 (Output_section::Input_section::is_merge_section): New method
7184 defintion.
7185 (Output_section::Input_section::relobj): Move defintion out of class
7186 defintion. Declare method only.
7187 (Output_section::Input_section::shndx): Ditto.
7188 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 7189 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
7190 (Output_section::Merge_section_by_properties_map,
7191 Output_section::Output_section_data_by_input_section_map,
7192 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7193 Remove types.
2e702c99 7194 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
7195 KEEPS_INPUT_SECTIONS.
7196 (Output_section::build_lookup_maps): New method declaration.
7197 (Output_section::merge_section_map_,
7198 Output_section::merge_section_by_properties_map_,
7199 Output_section::relaxed_input_section_map_,
7200 Output_section::is_relaxed_input_section_map_valid_): Remove data
7201 members.
7202 (Output_section::lookup_maps_): New data member.
7203
76295588
L
72042010-05-21 Doug Kwan <dougkwan@google.com>
7205
7206 PR gold/11619
7207 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7208 avoid a compilation error.
7209
d103a984
RÁE
72102010-05-19 Rafael Espindola <espindola@google.com>
7211
7212 * script-sections.cc (Output_section_definition::allocate_to_segment):
7213 Update the phdrs_list even when the output section is NULL.
7214 * testsuite/Makefile.am: Add test.
7215 * testsuite/Makefile.in: Regenerate.
7216 * testsuite/script_test_9.cc: New.
7217 * testsuite/script_test_9.sh: New.
7218 * testsuite/script_test_9.t: New.
7219
6625d24e
DK
72202010-05-19 Doug Kwan <dougkwan@google.com>
7221
7222 * arm.cc (Arm_input_section::original_size): New method.
7223 (Arm_input_section::do_addralign): Add a cast.
7224 (Arm_input_section::do_output_offset): Remove static cast.
7225 (Arm_input_section::original_addralign,
7226 Arm_input_section::original_size_): Change type to uint32_t.
7227 (Arm_input_section::init): Add safe casts for section alignment
7228 and size.
7229 (Arm_input_section::set_final_data_size): Do not set address and
7230 offset of stub table.
7231 (Arm_output_section::fix_exidx_coverage): Change use of of
7232 Output_section::Simple_input_section to that of
7233 Output_section::Input_section.
7234 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7235 except for the first pass.
7236 * output.cc (Output_section::get_input_sections): Change type of
7237 input_sections to std::list<Input_section>.
7238 (Output_section::add_script_input_section): Rename from
7239 Output_section::add_simple_input_section. Change type of SIS
7240 parameter from Simple_input_section to Input_section.
7241 * output.h (Output_section::Simple_input_section): Remove class.
7242 (Output_section::Input_section): Change class visibility to public.
7243 (Output_section::Input_section::addralign): Use stored alignments
7244 for special input sections if set.
7245 (Output_section::Input_section::set_addralign): New method.
7246 (Output_section::get_input_sections): Change parameter type from
7247 list of Simple_input_section to list of Input_section.
7248 (Output_section::add_script_input_section): Rename from
7249 Output_section::add_simple_input_section. Change first parameter's
7250 type from Simple_input_section to Input_section and remove the
7251 second and third parameters.
7252 * script-sections.cc (Input_section::Input_section_list): Change
7253 type to list of Output_section::Input_section/
7254 (Input_section_info::Input_section_info): Change parameter type of
7255 INPUT_SECTION to Output_section::Input_section.
7256 (Input_section_info::input_section): Change return type.
7257 (Input_section_info::input_section_): Change type to
7258 Output_section::Input_section.
7259 (Output_section_element_input::set_section_addresses): Adjust code
7260 to use Output_section::Input_section instead of
7261 Output_section::Simple_input_section. Adjust code for renaming
7262 of Output_section::add_simple_input_section.
7263 (Orphan_output_section::set_section_addresses): Ditto.
7264
e1e82ea4
RW
72652010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7266
7267 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7268 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7269
91e75c8a
RÁE
72702010-05-18 Rafael Espindola <espindola@google.com>
7271
7272 * options.cc (General_options::finalize): Handle -nostdlib.
7273 * options.h (nostdlib): New option.
7274 * script.cc (script_add_search_dir): Handle -nostdlib.
7275
da59ad79
DK
72762010-05-12 Doug Kwan <dougkwan@google.com>
7277
7278 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7279 attributes section only if there no attributes section after merging.
7280 (Target_arm::merge_object_attributes): Move value of
e1df38aa 7281 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
7282 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7283 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7284 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7285 and arm_attr_merge_7.stdout.
7286 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7287 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7288 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7289 arm_attr_merge_7b.o): New rules.
7290 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7291 arm_attr_merge_7
7292 * testsuite/Makefile.in: Regenerate.
7293 * testsuite/arm_attr_merge.sh: New file.
7294 * testsuite/arm_attr_merge_[67][ab].s: Same.
7295
3e01a7fd
NC
72962010-05-05 Nick Clifton <nickc@redhat.com>
7297
7298 * po/es.po: Updated Spanish translation.
7299
7ad2014a
L
73002010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7301
7302 * Makefile.am (install-exec-local): Properly install gold as
7303 default cross linker.
7304 * Makefile.in: Regenerated.
7305
4fda8867
NC
73062010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7307 Nick Clifton <nickc@redhat.com>
7308
7309 * configure.ac (install_as_default): Define and set to false
7310 unless --enable-gold or --enable-gold=both/gold has been
7311 specified.
7312 * configure: Regenerate.
7313
7314 * Makefile.am (install-exec-local): Install the executable as
7315 'ld.gold'. If install_as_default is true then also install it as
7316 'ld'.
7317 * Makefile.in: Regenerated.
7318
bd288ea2
ILT
73192010-04-24 Ian Lance Taylor <iant@google.com>
7320
7321 * layout.cc (Layout::layout_reloc): In relocatable link don't
7322 combine reloc sections for grouped sections.
7323
ef38fd8a
ST
73242010-04-23 Sriraman Tallam <tmsriram@google.com>
7325
7326 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7327 sections that are not ordinary to icf.
7328 * icf.cc (get_section_contents): Handle relocation pointing to section
7329 with no object or shndx information.
7330 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7331 * testsuite/Makefile.in: Regenerate.
7332 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7333 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7334
f6973bdc
ILT
73352010-04-22 Ian Lance Taylor <iant@google.com>
7336
7337 * expression.cc (Expression::Expression_eval_info): Add
7338 result_alignment_pointer field.
7339 (Expression::eval_with_dot): Add result_alignment_pointer
7340 parameter. Change all callers.
7341 (Expression::eval_maybe_dot): Likewise.
7342 (class Binary_expression): Add alignment_pointer parameter to
7343 left_value and right_value. Change all callers.
7344 (BINARY_EXPRESSION): Set result alignment.
7345 (class Trinary_expression): Add alignment_pointer parameter to
7346 arg2_value and arg3_value. Change all callers.
7347 (Trinary_cond::value): Set result alignment.
7348 (Max_expression::value, Min_expression::value): Likewise.
7349 (Align_expression::value): Likewise.
7350 * script-sections.cc (class Sections_element): Add dot_alignment
7351 parameter to set_section_addresses virtual function. Update
7352 instantiations.
7353 (class Output_section_element): Likewise.
7354 (Script_sections::create_segments): Add dot_alignment parameter.
7355 Change all callers.
7356 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7357 (Script_sections::set_phdrs_clause_addresses): Likewise.
7358 * script-sections.h: Update declarations.
7359 * script.h: Update declarations.
7360 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7361 min_p_align.
7362 * testsuite/script_test_3.t: Set large alignment.
7363 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7364 segment has expected alignment.
7365
9c9c98a5
NC
73662010-04-22 Nick Clifton <nickc@redhat.com>
7367
7368 * po/gold.pot: Updated by the Translation project.
7369 * po/vi.po: Updated Vietnamese translation.
7370
2253bfba
L
73712010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7372
7373 * testsuite/Makefile.am (check_PROGRAMS): Add
7374 icf_virtual_function_folding_test.
7375 * testsuite/Makefile.in: Regenerated.
7376
85fdf906
AH
73772010-04-15 Andrew Haley <aph@redhat.com>
7378
7379 * options.h (merge_exidx_entries): New option.
7380 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7381 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7382 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7383 (Target_arm::merge_exidx_entries): New function.
7384 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7385 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7386 to Arm_exidx_fixup constructor.
7387 Add new arg, merge_exidx_entries.
7388 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7389 Arm_output_section::fix_exidx_coverage.
7390
ce97fa81
ST
73912010-04-18 Sriraman Tallam <tmsriram@google.com>
7392
7393 * icf.cc (get_section_contents): Check for preemptible functions.
7394 Ignore addend when appropriate.
7395 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7396 section folded.
7397 (add_from_relobj): Check for section folded.
7398 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7399 * symtab.h (should_add_dynsym_entry): Add new parameter.
7400 * target-reloc.h (scan_relocs): Check for section folded.
7401 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7402 Check reloc types for function pointers in shared objects.
7403 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7404 case.
7405 (icf_preemptible_functions_test): New test case.
7406 (icf_string_merge_test): New test case.
7407 * testsuite.Makefile.in: Regenerate.
7408 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7409 bar_glob. Refactor code.
7410 * testsuite/icf_preemptible_functions_test.cc: New file.
7411 * testsuite/icf_preemptible_functions_test.sh: New file.
7412 * testsuite/icf_string_merge_test.cc: New file.
7413 * testsuite/icf_string_merge_test.sh: New file.
7414 * testsuite/icf_virtual_function_folding_test.cc: New file.
7415 * testsuite/icf_virtual_function_folding_test.sh: New file.
7416
04ceb17c
DK
74172010-04-14 Doug Kwan <dougkwan@google.com>
7418
7419 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7420 for local symbol recounting if we remove a section due to ICF.
7421 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7422 there are no regular objects in input.
7423
153e7da4
DK
74242010-04-13 Doug Kwan <dougkwan@google.com>
7425
7426 * arm.cc (Arm_input_section::set_final_data_size): Compute
7427 accurate final data size instead of using current data size.
7428
4dbd9faf
DK
74292010-04-09 Doug Kwan <dougkwan@google.com>
7430
7431 * layout.cc (Layout::choose_output_section): Handle script section
7432 types.
7433 (Layout::make_output_section_for_script): Add section type parameter.
7434 Handle script section types.
7435 * layout.h (Layout::make_output_section_for_script): Add section
7436 type parameter.
7437 * output.cc (Output_section::Output_section): Initialize data member
7438 is_noload_.
7439 (Output_section::do_reset_address_and_file_offset): Do not set address
7440 to 0 if section is a NOLOAD section.
7441 * output.h (Output_section::is_noload): New method.
7442 (Output_section::set_is_noload): Ditto.
7443 (Output_section::is_noload_): New data member.
7444 * script-c.h (Script_section_type): New enum type.
7445 (struct Parser_output_section_header): Add new file section_type.
7446 * script-sections.cc (Sections_element::output_section_name): Add
7447 parameter for returning script section type.
7448 (Output_section_definition::output_section_name): Ditto.
7449 (Output_section_definition::section_type)P; New method.
7450 (Output_section_definiton::script_section_type_name): Ditto.
7451 (Output_section_definition::script_section_type_): New data member.
7452 (Output_section_definition::Output_section_definition): Initialize
7453 data member Output_section_definition::script_section_type_.
7454 (Output_section_definition::create_sections): Pass script section type
7455 to Layout::make_output_section_for_script.
7456 (Output_section_definition::output_section_name): Return script
7457 section type to caller.
7458 (Output_section_definition::set_section_address): Do not advance
7459 dot value and load address if section type is NOLOAD. Set address
7460 of NOLOAD sections regardless of section flags.
7461 (Output_section_definition::print): Print section type if it is
7462 not SCRIPT_SECTION_TYPE_NONE.
7463 (Output_section_definition::section_type): New method.
7464 (Output_section_definition::script_section_type_name): Ditto.
7465 (Script_sections::output_section_name): Add new parameter
7466 PSECTION_TYPE for returning script section type. Pass it to
7467 section elements. Handle discard sections.
7468 (Sort_output_sections::operator()): Handle NOLOAD sections.
7469 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 7470 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
7471 returning script section type.
7472 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7473 INFO and NOLOAD.
7474 * yyscript.y (union): Add new field SECTION_TYPE.
7475 (COPY, DSECT, INFO, NOLOAD): New tokens.
7476 (opt_address_and_section_type): Change type to output_section_header.
7477 (section_type): New non-terminal
7478 (section_header): Handle section type.
2253bfba 7479 (opt_address_and_section_type): Return section type value.
4dbd9faf 7480
721ea635
L
74812010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7482
7483 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7484 * testsuite/plugin_common_test_2.c (foo): Likewise.
7485
6bf924b0
DK
74862010-04-08 Doug Kwan <dougkwan@google.com>
7487
7488 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7489 Output_merge_data.
7490 * output.cc (Output_section::add_merge_input_section): Simplify
7491 code and return status of Output_merge_base::add_input_section.
e1df38aa 7492 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
7493 returns true.
7494
24af6f92
DK
74952010-04-07 Doug Kwan <dougkwan@google.com>
7496
7497 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7498 if section is marked as containing instructions but has no mapping
7499 symbols.
7500 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7501 correct section index.
7502 (Arm_relobj::find_linked_text_section): Ditto.
7503
00698fc5
CC
75042010-04-07 Cary Coutant <ccoutant@google.com>
7505
7506 * archive.cc (include_member): Destroy Read_symbols_data object before
7507 releasing file.
7508 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7509 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7510 (Read_symbols_data::~Read_symbols_data) New destructor.
7511 (Section_relocs::Section_relocs) New constructor.
7512 (Section_relocs::~Section_relocs) New destructor.
7513 (Read_relocs_data::Read_relocs_data) New constructor.
7514 (Read_relocs_data::~Read_relocs_data) New destructor.
7515 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7516 pointers to NULL after deleting.
7517
7296d933
DK
75182010-04-07 Doug Kwan <dougkwan@google.com>
7519
7520 * arm.cc: Replace "endianity" with "endianness" in comments.
7521 (Arm_exidx_cantunwind): Ditto.
7522 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7523 (Arm_relobj::merge_flags_and_attributes): New method.
7524 (Arm_relobj::merge_flags_and_attributes_): New data member.
7525 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7526 (Arm_relobj::scan_sections_for_stubs): Ditto.
7527 (Arm_relobj::do_read_symbols): Check to see if we really want to
7528 merge processor-specific flags and attributes. Exit early if
7529 an object is empty except for section names and the undefined symbol.
7530 (Target_arm::do_finalize_sections): Move check for ELF format to
7531 Arm_relobj::do_read_symbols. Merge processor specific flags and
7532 attributes from a regular object only when we have determined that
7533 it is aapropriate. Do not create an .ARM.attributes section in
7534 output if there is no regular input object.
7535 (Target_arm::merge_processor_specific_flags): Check
7536 --warn-mismatch before printing any error.
7537 (Target_arm::merge_object_attributes): Ditto.
7538 * gold.cc (queue_middle_tasks): Handle the case in which there is
7539 no regular object in input.
7540 * options.cc (General_options::parse_EB): New method.
7541 (General_options::parse_EL): Same.
7542 (General_options::General_options): Initialize endianness_.
7543 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7544 New options.
7545 (General_options::Endianness): New enum.
7546 (General_options::endianness): New method.
7547 (General_options::endianness_): New data member.
7548 * parameters.cc (Parameters::set_options): Check target endianness.
7549 (Parameters::set_target_once): Ditto.
7550 (Parameters::check_target_endianness): New method.
7551 (parameters_force_valid_target): If either -EL or -EB is specified,
7552 use it to define endianness of default target.
7553 * parameters.h (Parameters::check_target_endianness): New method
7554 declaration.
7555 * target.h (class Target): Change "endianity" to "endianness"
7556 in comments.
7557
efc8d4f2
RW
75582010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7559
7560 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7561 * configure: Regenerate.
7562 * Makefile.in: Regenerate.
7563 * testsuite/Makefile.in: Regenerate.
7564
be234d88
CC
75652010-04-06 Cary Coutant <ccoutant@google.com>
7566
7567 gcc PR lto/42757
7568 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7569 prevailing definitions of common symbols.
7570 * testsuite/plugin_test_6.sh: New test case.
7571 * testsuite/plugin_common_test_1.c: New test case.
7572 * testsuite/plugin_common_test_2.c: New test case.
7573 * testsuite/Makefile.am (plugin_test_6): New test case.
7574 * testsuite/Makefile.in: Regenerate.
7575
bd32c6bd
NC
75762010-04-06 Nick Clifton <nickc@redhat.com>
7577
7578 * po/vi.po: New Vietnamese translation.
7579
323c532f
DK
75802010-03-30 Doug Kwan <dougkwan@google.com>
7581
7582 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7583
4fcd97eb
DK
75842010-03-25 Doug Kwan <dougkwan@google.com>
7585
7586 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7587 to avoid a conversion warning on a 32-bit host.
7588
4ebf39db
ILT
75892010-03-24 Ian Lance Taylor <iant@google.com>
7590
7591 * testsuite/script_test_3.t: Add a TLS segment.
7592 * testsuite/Makefile.am (check_PROGRAMS): Add
7593 tls_phdrs_script_test.
7594 (tls_phdrs_script_test_SOURCES): Define.
7595 (tls_phdrs_script_test_DEPENDENCIES): Define.
7596 (tls_phdrs_script_test_LDFLAGS): Define.
7597 (tls_phdrs_script_test_LDADD): Define.
7598 * testsuite/Makefile.in: Rebuild.
7599
4a599bdd
CC
76002010-03-23 Cary Coutant <ccoutant@google.com>
7601
7602 * fileread.cc (find_or_make_view): Fix comment.
7603
6c93b22c
ILT
76042010-03-23 Ian Lance Taylor <iant@google.com>
7605
7606 * script-sections.cc (class Orphan_section_placement): Define
7607 PLACE_TLS and PLACE_TLS_BSS.
7608 (Orphan_section_placement::Orphan_section_placement): Initialize
7609 new places.
7610 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7611 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7612 (tls_script_test_SOURCES): Define.
7613 (tls_script_test_DEPENDENCIES): Define.
7614 (tls_script_test_LDFLAGS): Define.
7615 (tls_script_test_LDADD): Define.
7616 * testsuite/Makefile.in: Rebuild.
7617
a2c7281b
DK
76182010-03-22 Doug Kwan <dougkwan@google.com>
7619
7620 * arm.cc (Arm_relocate_functions::abs8,
7621 Arm_relocate_functions::abs16): Use correct check for overflow
7622 specified in the ARM ELF specs.
7623 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7624 target of a BLX instruction specially.
7625 (Reloc_stub::stub_type_for_reloc): Ditto.
7626 (Relocate::relocate): Use symbolic names instead of numeric relocation
7627 codes to report error.
7628 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7629 workaround.
7630 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7631 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7632 thumb2_blx_out_of_range.stdout
7633 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7634 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7635 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7636 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7637 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7638 thumb2_blx_in_range, thumb2_blx_in_range.o,
7639 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7640 thumb2_blx_out_of_range.o): New rules.
2e702c99 7641 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7642 thumb2_blx_in_range and thumb2_blx_out_of_range.
7643 * testsuite/Makefile.in: Regenerate.
7644 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7645 * testsuite/thumb_blx_in_range.s: New file.
7646 * testsuite/thumb_blx_out_of_range.s: New file.
7647
b0193076
RÁE
76482010-03-22 Rafael Espindola <espindola@google.com>
7649
7650 * archive.cc (Should_include): Move to archive.h.
7651 (should_include_member): Make it a member of Archive.
7652 (Lib_group): New.
7653 (Add_lib_group_symbols): New.
7654 * archive.h: Include options.h.
7655 (Archive_member): Moved from Archive.
7656 (Should_include): Moved from archive.cc.
7657 (Lib_group): New.
7658 (Add_lib_group_symbols): New.
7659 * dynobj.cc (do_should_include_member): New.
7660 * dynobj.h (do_should_include_member): New.
7661 * gold.cc (queue_initial_tasks): Update call to queue.
7662 * main.cc (main): Print lib group stats.
7663 * object.cc (do_should_include_member): New.
7664 * object.h: Include archive.h.
7665 (Object::should_include_member): New.
7666 (Object::do_should_include_member): New.
7667 (Sized_relobj::do_should_include_member): New.
7668 * options.cc (General_options::parse_start_lib): New.
7669 (General_options::parse_end_lib): New.
7670 (Input_arguments::add_file): Handle lib groups.
7671 (Input_arguments::start_group): Check we are not in a lib.
7672 (Input_arguments::start_lib): New.
7673 (Input_arguments::end_lib): New.
7674 * options.h (General_options): Add start_lib and end_lib.
7675 (Input_argument::lib_): New.
7676 (Input_argument::lib): New.
7677 (Input_argument::is_lib): New.
7678 (Input_file_lib): New.
7679 (Input_arguments::in_lib_): New.
7680 (Input_arguments::in_lib): New.
7681 (Input_arguments::start_lib): New.
7682 (Input_arguments::end_lib_): New.
7683 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7684 in unused members as preempted.
7685 (Sized_pluginobj::do_should_include_member): New.
7686 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7687 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7688 return the blocker.
7689 (Read_symbols::do_whole_lib_group): New.
7690 (Read_symbols::do_lib_group): New.
7691 (Read_symbols::do_read_symbols): Handle lib groups.
7692 (Read_symbols::get_name): Handle lib groups.
7693 * readsyms.h (Read_symbols): Add an archive member pointer.
7694 (Read_symbols::do_whole_lib_group): New.
7695 (Read_symbols::do_lib_group): New.
7696 (Read_symbols::member_): New.
7697 * script.cc (read_input_script): Update call to queue_soon.
7698
d099120c
DK
76992010-03-19 Doug Kwan <dougkwan@google.com>
7700
7701 * arm.cc (Stub_table::Stub_table): Initialize new data members
7702 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7703 (Stub_table::add_reloc_stub): Assign stub offset and update
7704 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7705 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7706 New data members.
2e702c99 7707 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7708 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7709 instead of going over all reloc stubs.
2e702c99 7710 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7711 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7712 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7713 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7714 Stringpool_template::offset_.
7715 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7716 Stringpool_template::offset_ to zero.
7717
1aa37384
DK
77182010-03-15 Doug Kwan <dougkwan@google.com>
7719
7720 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7721 offset_.
7722 (Stringpool_template::new_key_offset): New method.
7723 (Stringpool_template::add_string): Assign offsets when adding new
7724 strings.
7725 (Stringpool_template::set_string_offsets): Do not set string offsets
7726 when not optimizing.
7727 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7728 member size_.
2e702c99
RM
7729 (Chunked_vector::clear): Clear size_.
7730 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7731 (Chunked_vector::size): Return size_.
7732 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7733 (Chunked_vector::size_): New data member.
1aa37384
DK
7734 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7735 (Stringpool_template::new_key_offset): New method declaration.
7736 (Stringpool_template::offset_): New data member.
7737
b672b057
RÁE
77382010-03-15 Rafael Espindola <espindola@google.com>
7739
7740 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7741 Add_symbols' constructor.
7742 * readsyms.h (Add_symbols): Remove the input_group member.
7743
b6848d3c
ILT
77442010-03-10 Ian Lance Taylor <iant@google.com>
7745
7746 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7747 target to ask whether a reference to a symbol requires a stack
7748 split.
7749 * target.h (Target::is_call_to_non_split): New function.
7750 (Target::do_is_call_to_non_split): Declare virtual function.
7751 * target.cc: Include "symtab.h".
7752 (Target::do_is_call_to_non_split): New function.
7753 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7754
a2a5469e
CC
77552010-03-10 Cary Coutant <ccoutant@google.com>
7756
7757 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7758 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7759 (File_read::open[2]): Add whole_file_view_ to list of views.
7760 (File_read::make_view): Remove test of whole_file_view_.
7761 (File_read::find_or_make_view): Create whole_file_view_ if
7762 necessary.
7763 (File_read::clear_views): Replace bool parameter with enum;
7764 adjust all callers. Don't delete views with permanent data;
7765 do delete cached views and views from archives if
7766 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7767 if clearing the corresponding view.
7768 * fileread.h (File_read::Clear_views_mode): New enum.
7769 (File_read::View::is_permanent_view): New method.
7770 (File_read::clear_views): Replace bool parameter
7771 with enum; adjust all callers.
7772 * options.h (General_options): Change keep_files_mapped option;
7773 add map_whole_files.
7774 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7775 releasing the file.
7776 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7777 the file.
7778
8861f32b
DM
77792010-03-10 David S. Miller <davem@davemloft.net>
7780
7781 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7782
d62d0f5f
ST
77832010-03-09 Sriraman Tallam <tmsriram@google.com>
7784
7785 * icf.cc (get_section_contents): Add '@' marker after processing the
7786 merge reloc.
7787
9177756d
DK
77882010-03-08 Doug Kwan <dougkwan@google.com>
7789
7790 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7791 due to a conversion warning.
7792 (Arm_relobj::update_output_local_symbol_count): Check for local
7793 symbol with unset output index.
7794
9e9e071b
ILT
77952010-03-05 Ian Lance Taylor <iant@google.com>
7796
7797 * options.h (class General_options): Add --spare-dynamic-tags.
7798 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7799 --spare-dynamic-tags.
7800
a81ee015
ILT
78012010-03-05 Ian Lance Taylor <iant@google.com>
7802
7803 * incremental.cc: Include "libiberty.h".
7804
44ec90b9
RO
78052010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7806
7807 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7808 function, is_info_ member.
7809 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7810 (Versions::Versions): Update caller.
7811 (Versions::define_base_version): Likewise.
7812 (Versions::add_def): Likewise.
7813
0897ed3b
ST
78142010-03-03 Sriraman Tallam <tmsriram@google.com>
7815
7816 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7817 (Scan::possible_function_pointer_reloc): New function.
7818 (Scan::local_reloc_may_be_function_pointer): Change to call
7819 possible_function_pointer_reloc.
7820 (Scan::global_reloc_may_be_function_pointer): Ditto.
7821 * icf.h (Icf::check_section_for_function_pointers): Change to reject
7822 relocations in ".data.rel.ro._ZTV" section.
7823 * testsuite/icf_safe_so_test.sh: Change to pass i386.
7824 * testsuite/icf_safe_so_test.cc: Ditto.
7825 * testsuite/icf_safe_test.cc: Ditto.
7826 * testsuite/icf_safe_test.sh: Ditto.
7827
d3bbad62
ILT
78282010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7829 Ian Lance Taylor <iant@google.com>
7830
7831 * target-reloc.h (relocate_section): Check the symbol table index
7832 for -1U before setting the local symbol index.
7833 (scan_relocatable_relocs): If copying the relocation, record that
7834 the local symbol is required.
7835 * object.h (Symbol_value::is_output_symtab_index_set): New
7836 function.
7837 (Symbol_value::may_be_discarded_from_output_symtab): New
7838 function.
7839 (Symbol_value::has_output_symtab_entry): New function.
7840 (Symbol_value::needs_output_symtab_entry): Remove.
7841 (Symbol_value::output_symtab_index): Make sure the symbol index is
7842 set.
7843 (Symbol_value::set_output_symtab_index): Make sure the symbol
7844 index is not set. Make sure the new index is valid.
7845 (Symbol_value::set_must_have_output_symtab_entry): New function.
7846 (Symbol_value::has_output_dynsym_entry): New function.
7847 (Symbol_value::set_output_dynsym_index): Make sure the new index
7848 is valid.
7849 (Sized_relobj::set_must_have_output_symtab_entry): New function.
7850 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
7851 local symbol if permitted.
7852 (Sized_relobj::do_finalize_local_symbols): Call
7853 is_output_symtab_index_set rather than needs_output_symtab_entry.
7854 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
7855 rather than needs_output_symtab_entry. Call
7856 has_output_dynsym_entry rather than needs_output_dynsym_entry.
7857 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
7858 is_output_symtab_index_set rather than needs_output_symtab_entry.
7859 * testsuite/discard_locals_relocatable_test.c: New file.
7860 * testsuite/discard_locals_test.sh: Test -r.
7861 * testsuite/Makefile.am (check_DATA): Add
7862 discard_locals_relocatable_test1.syms,
7863 discard_local_relocatable_test2.syms.
7864 (MOSTLYCLEANFILES): Likewise. Also add
7865 discard_locals_relocatable_test1.lout and
7866 discard_locals_relocatable_test2.out.
7867 (discard_locals_relocatable_test1.syms): New target.
7868 (discard_locals_relocatable_test.o): New target.
7869 (discard_locals_relocatable_test1.out): New target.
7870 (discard_locals_relocatable_test2.syms): New target.
7871 (discard_locals_relocatable_test2.out): New target.
7872 (various): Add missing ../ld-new dependencies.
7873 * testsuite/Makefile.in: Rebuild.
7874
7e8ccf26
NC
78752010-03-03 Nick Clifton <nickc@redhat.com>
7876
7877 * po/fi.po: New Finnish translation.
7878
2a0ff005
DK
78792010-03-01 Doug Kwan <dougkwan@google.com>
7880
7881 * layout.cc (Layout::Layout): Force section types of .init_array*,
7882 .preinit_array* and .fini_array* sections.
7883 * output.cc (Output_section::Input_section_sort_entry::has_priority):
7884 Fix check of return value of std::string::find.().
7885 (Output_section::Input_section_sort_compare::operator()): Remove
7886 comment about .init_array.
7887 (Output_section::Input_section_sort_init_fini_compare::operator()):
7888 New method.
7889 (Output_section::sort_attached_input_sections): Handle .init_array
7890 and .fini_array specially.
7891 * output.h (Output_section::Inut_section_sort_compare): Update
7892 comment.
7893 (Output_section::Input_section_sort_init_fini_compare): New struct.
7894
c3e4ae29
DK
78952010-02-26 Doug Kwan <dougkwan@google.com>
7896
7897 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
7898 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
7899 * testsuite/debug_msg.sh: Avoid matching source line number for
7900 use of global variable undef_int.
7901
2fd9ae7a
DK
79022010-02-26 Doug Kwan <dougkwan@google.com>
7903
7904 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
7905 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
7906 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
7907 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
7908 * options.cc (General_options::General_options): Initialize member
7909 fix_v4bx_.
7910 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
7911 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
7912 and rm_no_fix_v4bx.stdout
7913 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
7914 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
7915 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
7916 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
7917 and arm_no_fix_v4bx.
7918 * Makefile.in: Regenerate.
7919 * testsuite/arm_fix_v4bx.s: New file.
7920 * testsuite/arm_fix_v4bx.sh: Ditto.
7921
67ec7d0b
DK
79222010-02-24 Doug Kwan <dougkwan@google.com>
7923
7924 * arm.cc (Target_arm::got_section): Make the .got section the first
7925 non RELRO section in the data segment.
7926 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
7927 suffixes of section names.
7928
10165461
DK
79292010-02-24 Doug Kwan <dougkwan@google.com>
7930
7931 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
7932 flags and attributes merging if an input file is a binary file.
7933 * fileread.cc (Input_file::open): Record format of original file.
7934 * fileread.h (Input_file::Format): New enum type.
2e702c99 7935 (Input_file::Input_file): Initialize data member format_.
10165461
DK
7936 (Input_file::format): New method definition.
7937 (Input_file::format_):: New data member.
7938
4a54abbb
DK
79392010-02-24 Doug Kwan <dougkwan@google.com>
7940
7941 * arm.cc (Arm_output_data_got): New class.
7942 (ARM_TCB_SIZE): New constant
7943 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
7944 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
7945 If user uses a script with a SECTIONS clause, issue only a warning
7946 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 7947 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
7948 garbage collection.
7949 (Target_arm::got_mode_index_entry): Handle static linking.
7950 (Target_arm::Scan::local): Ditto.
7951 (Target_arm::Scan::global): Ditto.
7952 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
7953 all incorrectly implemented relocations.
e1df38aa 7954 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
7955 Arm_output_section::fix_exidx_coverage.
7956 * layout.cc (Layout::section_name_mapping): Remove trailing dots
7957 from ".ARM.exidx." and ".ARM.extab.".
7958
ca419a6f
ILT
79592010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7960
7961 * arm.cc (Target_arm::do_finalize_sections): Create attribute
7962 section if it does not already exist.
7963 * attributes.cc (Attributes_section_data::Attributes_section_data):
7964 Don't crash if size is zero.
7965
135b9c78
ILT
79662010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7967 Ian Lance Taylor <iant@google.com>
7968
7969 * gold.cc (queue_middle_tasks): If no input files were opened,
7970 exit.
7971 * workqueue.h (Task_function::Task_function): Assert that there is
7972 a blocker.
7973
bb0bfe4f
DK
79742010-02-22 Doug Kwan <dougkwan@google.com>
7975
7976 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
7977 * icf.cc (get_section_contents): Cast snprintf arguments to long long
7978 types to avoid warnings due to different uint64_t implementations
7979 on different hosts.
7980
2a2b6d42
DK
79812010-02-21 Doug Kwan <dougkwan@google.com>
7982
7983 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
7984 handling of the maximum backward branch offset.
2e702c99 7985 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
7986 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
7987 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 7988 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
7989 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
7990 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
7991 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
7992 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
7993 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
7994 thumb_bl_out_of_range thumb_bl_out_of_range.o,
7995 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
7996 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
7997 thumb2_bl_out_of_range.o): New rules.
7998 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
7999 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8000 thumb2_bl_out_of_range
8001 * testsuite/Makefile.in: Regenerate.
8002 * testsuite/arm_bl_in_range.s: New file.
8003 * testsuite/arm_bl_out_of_range.s: Ditto.
8004 * testsuite/arm_branch_in_range.sh: Ditto.
8005 * testsuite/arm_branch_range.t: Ditto.
8006 * testsuite/thumb2_branch_range.t: Ditto.
8007 * testsuite/thumb_bl_in_range.s: Ditto.
8008 * testsuite/thumb_bl_out_of_range.s: Ditto.
8009 * testsuite/thumb_branch_range.t: Ditto.
8010
b487ad64
ST
80112010-02-20 Sriraman Tallam <tmsriram@google.com>
8012
8013 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8014 Add reloc offset information.
8015 * icf.cc (get_section_contents): Change iterators to point to the new
8016 vectors. Add reloc offset information to the contents.
8017 * icf.h (Icf::Sections_reachable_info): New typedef.
8018 (Icf::Sections_reachable_list): New typedef.
8019 (Icf::Offset_info): New typedef.
8020 (Icf::Reloc_info): New struct typedef.
8021 (Icf::Reloc_info_list): New typedef.
8022 (Icf::symbol_reloc_list): Delete method.
8023 (Icf::addend_reloc_list): Delete method.
8024 (Icf::section_reloc_list): Delete method.
8025 (Icf::reloc_info_list): New method.
8026 (Icf::reloc_info_list_): New member.
8027
f96accdf
DK
80282010-02-19 Doug Kwan <dougkwan@google.com>
8029
8030 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8031 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8032 * arm.cc (Arm_relocation_functions): New forward declaration.
8033 (Target_arm::Target_arm): Initialize new data members
8034 got_mod_index_offset_ and tls_base_symbol_defined_.
8035 (Target_arm::Relocate::relocate_tls): New method.
8036 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8037 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8038 New methods.
2e702c99 8039 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8040 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8041 (Target_arm::got_mod_index_offset_,
8042 Target_arm::tls_base_symbol_defined_): New data members.
8043 (Target_arm::Scan::local, Target::Scan::global,
8044 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8045 relocations.
8046
c8761b9a
DK
80472010-02-18 Doug Kwan <dougkwan@google.com>
8048
8049 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8050 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8051 text section as a parameter becuase some broken tools may not set
8052 the link in section header.
8053 (Target_arm::has_got_section): New method.
8054 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8055 without any mapping symbol as data only. Remove warning.
8056 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8057 link in its section header, try to discover the link by inspecting the
8058 REL31 relocation at the beginning of the section.
8059 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8060 in error message.
8061 (Target_arm::Scan::global): Treat any reference to the symbol
8062 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8063
21bb3914
ST
80642010-02-12 Sriraman Tallam <tmsriram@google.com>
8065
8066 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8067 (Scan::global_reloc_may_be_function_pointer): New function.
8068 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8069 (Scan::global_reloc_may_be_function_pointer): New function.
8070 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8071 (Scan::global_reloc_may_be_function_pointer): New function.
8072 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8073 (Scan::global_reloc_may_be_function_pointer): New function.
8074 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8075 (Scan::global_reloc_may_be_function_pointer): New function.
8076 (Scan::possible_function_pointer_reloc): New function.
8077 (Target_x86_64::can_check_for_function_pointers): New function.
8078 * gc.h (gc_process_relocs): Scan relocation types to determine if
8079 function pointers were taken for targets that support it.
8080 * icf.cc (Icf::find_identical_sections): Include functions for
8081 folding in safe ICF whose pointer is not taken.
8082 * icf.h (Secn_fptr_taken_set): New typedef.
8083 (fptr_section_id_): New member.
8084 (section_has_function_pointers): New function.
8085 (set_section_has_function_pointers): New function.
8086 (check_section_for_function_pointers): New function.
8087 * options.h: Fix comment for safe ICF option.
8088 * target.h (can_check_for_function_pointers): New function.
8089 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8090 Modify icf_safe_test for X86-64.
8091 * testsuite/Makefile.in: Regenerate.
8092 * testsuite/icf_safe_so_test.cc: New file.
8093 * testsuite/icf_safe_so_test.sh: New file.
8094 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8095 (main): Change to take pointer to function kept_func_3.
8096 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8097 folding is done correctly for X86-64.
8098
0da6fa6c
DM
80992010-02-12 David S. Miller <davem@davemloft.net>
8100
8101 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8102 is_symbolless parameter.
8103 (Output_reloc<SHT_REL>::is_symbolless): New.
8104 (Output_reloc<SHT_REL>::is_symbolless_): New.
8105 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8106 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8107 (Output_reloc<SHT_RELA>::is_symbolless): New.
8108 (Output_data_reloc::add_global): Handle is_symbolless.
8109 (Output_data_reloc::add_global_relative): Likewise.
8110 (Output_data_reloc::add_local): Likewise.
8111 (Output_data_reloc::add_local_relative): Likewise.
8112 (Output_data_reloc::add_symbolless_global_addend): New.
8113 (Output_data_reloc::add_symbolless_local_addend): New.
8114 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8115 is_symbolless.
8116 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8117 instead of ->is_relative_
8118 (Output_reloc::write): Likewise.
8119 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8120 (Output_reloc::write_rel): Simplify.
8121
8122 * sparc.cc (Target_sparc::Scan::local): Use
8123 ->add_symbolless_local_addend as needed.
8124 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8125 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8126 based upon relocation offset.
8127
e4782e83
DK
81282010-02-11 Doug Kwan <dougkwan@google.com>
8129
8130 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8131 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8132 beginning of function.
8133 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8134 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8135 parameter is_32bit in calls to should_apply_static_reloc.
8136 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8137 (check_DATA): Add arm_abs_global.stdout.
8138 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8139 arm_abs_global.stdout): New rules.
8140 (MOSTLLYCLEANFILES): Add arm_abs_global
8141 * Makefile.in: Regenerate.
8142 * testsuite/arm_abs_global.s: New file.
8143 * testsuite/arm_abs_global.sh: Ditto.
8144 * testsuite/arm_abs_lib.s: Ditto.
8145
93ceb764
ILT
81462010-02-11 Ian Lance Taylor <iant@google.com>
8147
8148 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8149 Read_relocs task.
8150 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8151 Allocate_commons_task first.
8152 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8153 task, rather than symtab_lock_.
8154 (Gc_process_relocs::~Gc_process_relocs): New function.
8155 (Gc_process_relocs::is_runnable): Check this_blocker_.
8156 (Gc_process_relocs::locks): Use next_blocker_ rather than
8157 blocker_.
8158 (Scan_relocs::~Scan_relocs): New function.
8159 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8160 symtab_lock_.
8161 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8162 next_blocker_.
8163 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8164 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8165 constructor accordingly.
8166 (class Gc_process_relocs): Likewise.
8167 (class Scan_relocs): Likewise.
8168 * common.h (class Allocate_commons_task): Remove symtab_lock_
8169 field, and corresponding constructor parameter.
8170 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8171 symtab_lock_.
8172 (Allocate_commons_task::locks): Likewise.
8173
114dfbe1
ILT
81742010-02-11 Ian Lance Taylor <iant@google.com>
8175
8176 * gold-threads.h (class Once): Define.
8177 (class Initialize_lock): Rewrite as child of Once.
8178 * gold-threads.cc (class Once_initialize): Define.
8179 (once_pointer_control): New static variable.
8180 (once_pointer, once_arg): New static variables.
8181 (c_run_once): New static function.
8182 (Once::Once, Once::run_once, Once::internal_run): New functions.
8183 (class Initialize_lock_once): Remove.
8184 (initialize_lock_control): Remove.
8185 (initialize_lock_pointer): Remove.
8186 (initialize_lock_once): Remove.
8187 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8188 (Initialize_lock::initialize): Rewrite.
8189 (Initialize_lock::do_run_once): New function.
8190 * archive.cc (Archive::interpret_header): Only clear name if it is
8191 not already empty.
8192 * fileread.cc: Include "gold-threads.h"
8193 (file_counts_lock): New static variable.
8194 (file_counts_initialize_lock): Likewise.
8195 (File_read::release): Only increment counts when using --stats.
8196 Use a lock around the increment.
8197 * parameters.cc (class Set_parameters_target_once): Define.
8198 (set_parameters_target_once): New static variable.
8199 (Parameters::Parameters): Move here from parameters.h.
8200 (Parameters::set_target): Rewrite.
8201 (Parameters::set_target_once): New function.
8202 (Parameters::clear_target): Move here and rewrite.
8203 * parameters.h (class Parameters): Update declarations. Add
8204 set_parameters_target_once_ field.
8205 (Parameters::Parameters): Move to parameters.cc.
8206 (Parameters::clear_target): Likewise.
8207 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8208 task.
8209 (Start_group::~Start_group): New function.
8210 (Start_group::is_runnable): New function.
8211 (Start_group::locks, Start_group::run): New functions.
8212 (Finish_group::run): Change saw_undefined to size_t.
8213 * readsyms.h (class Start_group): Define.
8214 (class Finish_group): Change saw_undefined_ field to size_t.
8215 (Finish_group::Finish_group): Remove saw_undefined and
8216 this_blocker parameters. Change all callers.
8217 (Finish_group::set_saw_undefined): New function.
8218 (Finish_group::set_blocker): New function.
8219 * symtab.h (class Symbol_table): Change saw_undefined to return
8220 size_t. Change saw_undefined_ field to size_t.
8221 * target-select.cc (Set_target_once::do_run_once): New function.
8222 (Target_selector::Target_selector): Initialize set_target_once_
8223 field. Don't initialize lock_ and initialize_lock_ fields.
8224 (Target_selector::instantiate_target): Rewrite.
8225 (Target_selector::set_target): New function.
8226 * target-select.h (class Set_target_once): Define.
8227 (class Target_selector): Update declarations. Make
8228 Set_target_once a friend. Remove lock_ and initialize_lock_
8229 fields. Add set_target_once_ field.
8230
fa17a3f4
ILT
82312010-02-10 Ian Lance Taylor <iant@google.com>
8232
8233 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8234 queueing any tasks.
8235 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8236 (queue_middle_tasks): Add all blockers before queueing any tasks.
8237 (queue_final_tasks): Likewise.
8238 * token.h (Task_token::add_blockers): New function.
8239 * object.h (Input_objects::number_of_relobjs): New function.
8240
c7177d31
ILT
82412010-02-10 Ian Lance Taylor <iant@google.com>
8242
5de0e392
ILT
8243 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8244 shared, not if not position independent.
8245 * x86_64.cc (Relocate::relocate_tls): Likewise.
8246 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8247 (tls_pie_pic_test): New target.
8248 * testsuite/Makefile.in: Rebuild.
8249
c7177d31
ILT
8250 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8251 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8252 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8253 * testsuite/Makefile.in: Rebuild.
8254
684b268a
DM
82552010-02-09 David S. Miller <davem@davemloft.net>
8256
8257 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8258 R_SPARC_RELATIVE using ->add_local_relative().
8259 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8260
612a8d3d
DM
8261 * output.h (Output_data_dynamic::add_section_size): New method
8262 that takes two Output_data objects.
8263 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8264 entry param. Handle it in initializers.
8265 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8266 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8267 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8268 arg.
8269 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8270 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8271 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8272 for dynrel_includes_plt.
8273 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8274 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8275 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8276 before .rela.plt
8277 (Target_sparc::do_finalize_sections): Update to pass true for
8278 dynrel_includes_plt.
8279 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8280 output before .rela.plt
8281 (Target_powerpc::do_finalize_sections): Update to pass true for
8282 dynrel_includes_plt when 32-bit.
8283
cb1be87e
DK
82842010-02-08 Doug Kwan <dougkwan@google.com>
8285
8286 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8287 method.
8288 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8289 Arm_relobj::scan_section_for_cortex_a8_stubs,
8290 Arm_relobj::do_relocation_section): Instead of calling
8291 Output_section::output_address, use faster
8292 Arm_relobj::simple_input_section_output_address.
8293
705b5121
DM
82942010-02-08 David S. Miller <davem@davemloft.net>
8295
8296 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8297 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8298 relocation helper function.
8299
024c4466
DM
8300 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8301 just like R_SPARC_GOT{10,13,22}.
8302 (Target_sparc::Scan::local): Likewise.
8303 (Target_sparc::Relocate:relocate): Likewise.
8304
9109c078
ILT
83052010-02-06 Ian Lance Taylor <iant@google.com>
8306
8307 * configure.ac: Rewrite targetobjs duplicate removal code to use
8308 only shell constructs.
8309 * configure: Rebuild.
8310
cf846138
DK
83112010-02-05 Doug Kwan <dougkwan@google.com>
8312
8313 PR 11247
8314 * arm.cc (Arm_relobj::section_is_scannable): New method.
8315 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8316 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8317
6cfaf60b
DK
83182010-02-04 Doug Kwan <dougkwan@google.com>
8319
8320 PR 11247
8321 * arm-reloc-property.cc (cstdio): Include.
8322 * configure.ac (targetobjs): Remove duplicates.
8323 * configure: Regenerate.
8324 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8325 big and little endian version for a given address size.
8326
5c57f1be
DK
83272010-02-03 Doug Kwan <dougkwan@google.com>
8328
8329 * arm-reloc-property.cc
8330 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8331 definition.
8332 * arm-reloc-property.h
8333 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8334 New method definition.
8335 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8336 declaration.
8337 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8338 overflow to N.
8339 (GOT_PREL): Change implemented to Y.
8340 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8341 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8342 (Arm_relocate_functions::movw_abs_nc): Remove method.
8343 (Arm_relocate_functions::movt_abs): Ditto.
8344 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8345 (Arm_relocate_functions::thm_movt_abs): Ditto.
8346 (Arm_relocate_functions::movw_rel_nc): Ditto.
8347 (Arm_relocate_functions::movw_rel): Ditto.
8348 (Arm_relocate_functions::movt_rel): Ditto.
8349 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8350 (Arm_relocate_functions:thm_movw_rel): Ditto.
8351 (Arm_relocate_functions:thm_movt_rel): Ditto.
8352 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8353 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8354 New method definitions.
8355 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8356 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8357 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8358 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8359 (Target_arm::Relocate::relocate): Check for non-static or
8360 unimplemented relocation code and exit early. Change calls to
8361 Target_arm::reloc_uses_thumb_bit and
8362 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8363 instead. Refactor code to handle similar relocations to increase
8364 code sharing. Remove check for unsupported relocation code in switch
8365 statement.
8366 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8367 relocation property table to find out size. Change error message to
8368 print out the name of a relocation code instead of the numeric value.
8369 (Target_arm::scan_reloc_for_stub): Use relocation property table
8370 instead of calling Target_arm::reloc_uses_thumb_bit().
8371
218c5831
DK
83722010-02-02 Doug Kwan <dougkwan@google.com>
8373
8374 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8375 types of relaxed input section.
8376
0d31c79d
DK
83772010-02-02 Doug Kwan <dougkwan@google.com>
8378
8379 * Makefile.am (HFILES): Add arm-reloc-property.h.
8380 (DEFFILES): New.
2e702c99
RM
8381 (TARGETSOURCES): Add arm-reloc-property.cc
8382 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
8383 (libgold_a_SOURCES): $(DEFFILES)
8384 * Makefile.in: Regenerate.
8385 * arm-reloc-property.cc: New file.
8386 * arm-reloc-property.h: New file.
8387 * arm-reloc.def: New file.
8388 * arm.cc: Update comments.
8389 (arm-reloc-property.h): New included header.
8390 (arm_reloc_property_table): New global variable.
8391 (Target_arm::do_select_as_default_target): New method definition.
8392 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8393 arm-reloc-property to targ_extra_obj.
8394 * parameters.cc (set_parameters_target): Call
8395 Target::select_as_default_target().
8396 * target.h (Target::select_as_default_target): New method definition.
8397 (Target::do_select_as_default_target): Same.
8398
546c7457
DK
83992010-02-01 Doug Kwan <dougkwan@google.com>
8400
8401 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8402 first_output_text_section_.
8403 (Arm_exidx_fixup::first_output_text_section): New method definition.
8404 (Arm_exidx_fixup::first_output_text_section_): New data member.
8405 (Arm_exidx_fixup::process_exidx_section): Record the first text
8406 output section seen.
8407 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8408 and entsize in output section header.
8409
11b861d5
DK
84102010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8411
8412 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8413 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8414 (Arm_relocate_functions::thm_alu11): New Method.
8415 (Arm_relocate_functions::thm_pc8): New Method.
8416 (Arm_relocate_functions::thm_pc12): New Method.
8417 (Target_arm::Scan::local): Handle the relocations.
8418 (Target_arm::Scan::global): Likewise.
8419 (Target_arm::Relocate::relocate): Likewise.
8420 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8421
c9a2c125
DK
84222010-01-29 Doug Kwan <dougkwan@google.com>
8423
8424 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8425 of relocation types as ld.
8426
1521477a
DK
84272010-01-29 Doug Kwan <dougkwan@google.com>
8428
8429 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8430 to public.
8431 (Arm_relocate_functions::thumb_branch_common): Ditto.
8432 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8433 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8434 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8435 Arm_relocate_functions::jump24): Remove.
8436 (Target_arm::Relocate::relocate): Adjust code to call
8437 Arm_relocation_functions::arm_branch_common and
8438 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 8439 wrappers. Merge switch-cases together to reduce source code size.
1521477a 8440
e7eca48c
DK
84412010-01-29 Doug Kwan <dougkwan@google.com>
8442
8443 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8444 output_local_symbol_count_needs_update_.
8445 (Arm_relobj::output_local_symbol_count_needs_update,
8446 Arm_relobj::set_output_local_symbol_count_needs_update,
8447 Arm_relobj::update_output_local_symbol_count): New methods.
8448 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8449 member.
8450 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8451 of pointed function as in a R_ARM_PREL31 relocation.
8452 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8453 for output local symbol count updating.
8454 (Target_arm::do_relax): Update output local symbol counts in objects
8455 if necessary.
8456 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8457
02961d7e
ILT
84582010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8459
8460 * arm.cc: Added support for the ARM relocations:
8461 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8462 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8463 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8464 movw_prel_nc).
8465 (Arm_relocate_functions::movw_rel): New method.
8466 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8467 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8468 thm_movw_prel_nc).
8469 (Arm_relocate_functions::thm_movw_rel): New method.
8470 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8471 thm_movt_prel).
8472 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8473 relocations.
8474 (Target_arm::Scan::global): Likewise.
8475 (Target_arm::Relocate::relocate): Likewise.
8476 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8477 Likewise.
8478
b10d2873
ILT
84792010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8480
8481 * arm.cc: Added support for ARM group relocations.
8482 (Target_arm::reloc_needs_sym_origin): New method.
8483 (Arm_relocate_functions::calc_grp_kn): New method.
8484 (Arm_relocate_functions::calc_grp_residual): New method.
8485 (Arm_relocate_functions::calc_grp_gn): New method.
8486 (Arm_relocate_functions::arm_grp_alu): New Method.
8487 (Arm_relocate_functions::arm_grp_ldr): New Method.
8488 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8489 (Arm_relocate_functions::arm_grp_ldc): New Method.
8490 (Target_arm::Scan::local): Handle the ARM group relocations.
8491 (Target_arm::Scan::global): Likewise.
8492 (Target_arm::Relocate::relocate): Likewise.
8493 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8494 Likewise.
8495
2b328d4e
DK
84962010-01-26 Doug Kwan <dougkwan@google.com>
8497
8498 * arm.cc (set): Include.
8499 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8500 pointer type.
2e702c99 8501 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
8502 (Arm_output_section::append_text_sections_to_list): New method.
8503 (Arm_output_section::fix_exidx_coverage): Ditto.
8504 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 8505 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
8506 Relobj::set_section_offset() instead of
8507 Sized_relobj::invalidate_section_offset().
2e702c99 8508 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
8509 parameter for section headers. Ignore relocation sections for
8510 unallocated sections and EXIDX sections.
8511 (Target_arm::fix_exidx_coverage): New method.
8512 (Target_arm::output_section_address_less_than): New type.
8513 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8514 linked text section instead of the EXIDX section.
8515 (Arm_output_section::create_stub_group): Add an assertion to check
8516 that this is not an EXIDX output section.
8517 (Arm_output_section::append_text_sections_to_list): New method.
8518 (Arm_output_section::fix_exidx_coverage): Ditto.
8519 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 8520 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
8521 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8522 first pass.
8523 (Target_arm::fix_exidx_coverage): New method.
8524 * object.h (Relobj::set_output_section): New method.
8525 (Sized_relobj::invalidate_section_offset): Remove method.
8526 (Sized_relobj::do_invalidate_section_offset): Remove method.
8527 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8528
c7f3c371
DK
85292010-01-25 Doug Kwan <dougkwan@google.com>
8530
8531 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8532 Fix warning due to signed and unsigned comparison on a 32-bit host.
8533
8923b24c
DK
85342010-01-22 Doug Kwan <dougkwan@google.com>
8535
8536 * arm.cc (Target_arm::do_relax): Record an output section for section
8537 offset adjustment it contains any stub table that has changed.
8538 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8539 offsets in an output section if necessary.
8540 * output.cc (Output_section::Output_section): Initialize
8541 section_offsets_need_adjustments_.
8542 (Output_section::add_input_section_for_script): Renamed to
8543 Output_section::add_simple_input_section.
8544 (Output_section::save_states): Add a comment.
8545 (Output_section::discard_states): New method defintion.
8546 (Output_section::adjust_section_offsets): Same.
8547 * output.h (Output_section::add_input_section_for_script): Renamed to
8548 Output_section::add_simple_input_section.
8549 (Output_section::discard_states): New method declaration.
8550 (Output_section::adjust_section_offsets): Same.
8551 (Output_section::section_offsets_need_adjustment,
8552 Output_section::set_section_offsets_need_adjustment): New method
8553 definitions.
8554 (Output_section::section_offsets_need_adjustment_): New data member.
8555 * script-sections.cc
8556 (Output_section_element_input::set_section_address): Adjust code for
8557 renaming of Output_section::add_input_section_for_script.
8558 (Orphan_output_section::set_section_address): Same.
8559
9b2fd367
DK
85602010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8561
8562 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8563 Fix_v4bx enum values .
8564 * gold/options.h (General_options): New option definitions.
8565 (General_options::fix_v4bx): New method.
8566 (General_options::Fix_v4bx): New enum.
8567 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8568 (General_options::parse_fix_v4bx_interworking): New method.
8569
80d0d023
DK
85702010-01-22 Doug Kwan <dougkwan@google.com>
8571
8572 * arm.cc (Arm_exidx_fixup): New class.
8573
af2cdeae
DK
85742010-01-21 Doug Kwan <dougkwan@google.com>
8575
8576 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8577 classes.
8578 (Arm_exidx_section_offset_map): New type.
8579
993d07c1
DK
85802010-01-21 Doug Kwan <dougkwan@google.com>
8581
8582 * arm.cc (Arm_exidx_input_section): New class.
8583 (Arm_relobj::exidx_input_section_by_link,
8584 Arm_relobj::exidx_input_section_by_shndx,
8585 Arm_relobj::make_exidx_input_section): New methods.
8586 (read_arm_attributes_section): Remove.
8587 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8588 information about them.
8589 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8590 to here.
8591
5ac169d4
DK
85922010-01-20 Doug Kwan <dougkwan@google.com>
8593
8594 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8595 Input_section_specifier to Section_id.
8596 (Target_arm::new_arm_input_section: Adjust code for change of key
8597 type.
8598 (Target_arm::find_arm_input_section): Ditto.
8599 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8600 (Section_id): Remove.
8601 (Garbage_collection::Section_id_hash): Remove.
8602 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8603 (Section_id): Remove.
8604 (Icf::Section_id_hash): Remove.
8605 * object.h (Section_id, Const_section_id, Section_id_hash,
8606 Const_section_id_hash): New type definitions.
8607 * output.cc (Output_section::add_relaxed_input_section): Change to
8608 use Const_section_id instead of Input_section_specifier as key type.
8609 (Output_section::add_merge_input_section): Ditto.
8610 (Output_section::build_relaxation_map): Change to use Section_id
8611 instead of Input_section_specifier as key type.
2e702c99 8612 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8613 Ditto.
8614 (Output_section::convert_input_sections_to_relaxed_sections): Change
8615 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8616 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8617 (Output_section::find_relaxed_input_section): Ditto.
8618 * output.h (Input_section_specifier): Remove class.
8619 (Output_section::Output_section_data_by_input_section_map): Change
8620 key type to Const_section_id.
8621 (Output_section::Output_relaxed_input_section_by_input_section_map):
8622 Ditto.
8623 (Output_section::Relaxation_map): Change key type to Section_id.
8624
a2162063
ILT
86252010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8626
8627 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8628 (class Arm_v4bx_stub): New class.
8629 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8630 (Stub_factory::make_arm_v4bx_stub): New method.
8631 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8632 (Stub_table::empty): Handle v4bx stubs.
8633 (Stub_table::add_arm_v4bx_stub): New method.
8634 (Stub_table::find_arm_v4bx_stub): New method.
8635 (Arm_relocate_functions::v4bx): New method.
8636 (Target_arm::fix_v4bx): New method.
8637 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8638 (Stub_table::relocate_stubs): Likewise.
8639 (Stub_table::do_write): Likewise.
8640 (Stub_table::update_data_size_and_addralign): Likewise.
8641 (Stub_table::finalize_stubs): Likewise.
8642 (Target_arm::Scan::local): Likewise.
8643 (Target_arm::Scan::global): Likewise.
8644 (Target_arm::do_finalize_sections): Likewise.
8645 (Target_arm::Relocate::relocate): Likewise.
8646 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8647 Likewise.
8648 (Target_arm::scan_reloc_for_stub): Likewise.
8649 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8650
5696ab0b
ILT
86512010-01-19 Ian Lance Taylor <iant@google.com>
8652
8653 * output.cc (Output_section_headers::do_sized_write): Write large
8654 segment count to sh_info field.
8655 (Output_file_header::do_sized_write): For large segment count,
8656 write PN_XNUM to e_phnum field.
8657
800d0f56
ILT
86582010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8659
8660 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8661 (Arm_relocate_functions::thm_jump8): New function.
8662 (Arm_relocate_functions::thm_jump11): New function.
8663 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8664 R_ARM_THM_JUMP11.
8665 (Target_arm::Scan::global): Likewise.
8666 (Target_arm::Relocate::relocate): Likewise.
8667 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8668 Likewise.
8669
41263c05
DK
86702010-01-14 Doug Kwan <dougkwan@google.com>
8671
8672 * arm.cc (map, utility): Include headers.
8673 (Target_arm::apply_cortex_a8_workaround): New method.
8674 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8675 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8676 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8677 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8678 the --[no-]fix-cortex-a8 command line options.
8679 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8680 (Target_arm::relocate_stub): Use addend in instruction template.
8681 * options.h (DEFINE_bool): Set the user-set flag.
8682 (General_options): Add --[no-]-fix-cortex options.
8683 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8684 : Update fast look-up map after conversion.
41263c05 8685
459e9b03
ST
86862010-01-14 Sriraman Tallam <tmsriram@google.com>
8687
8688 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8689 in the first pass of do_layout.
8690
b521dfe4
DK
86912010-01-13 Doug Kwan <dougkwan@google.com>
8692
8693 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8694 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8695 apparent compiler problem of not folding static constant integral
8696 data members of elfcpp::Elf_sizes<32>.
8697
44272192
DK
86982010-01-13 Doug Kwan <dougkwan@google.com>
8699
8700 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8701 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8702 Arm_relobj::scan_section_for_cortex_a8_erratum,
8703 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8704 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8705 sections to scan for relocation stubs into a new method
8706 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8707 relocation and Cortex-A8 stub scanning.
8708 (Target_arm::do_relax): Force stubs to be after stubbed sections
8709 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8710 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8711 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8712
44b71ece
ILT
87132010-01-12 Ian Lance Taylor <iant@google.com>
8714
8715 * target-reloc.h (visibility_error): New inline function.
8716 (relocate_section): Call visibility_error.
8717 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8718 (MOSTLYCLEANFILES): Likewise.
8719 (protected_4_pic.o, protected_3.err): New targets.
8720 * testsuite/protected_4.cc: New file.
8721
a120bc7f
DK
87222010-01-12 Doug Kwan <dougkwan@google.com>
8723
8724 * arm.cc (Cortex_a8_reloc): New class.
8725 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8726 and cortex_a8_relocs_info_.
8727 (Target_arm::fix_cortex_a8): New method definition.
8728 (Target_arm::Cortex_a8_relocs_info): New type.
8729 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8730 New data member declarations.
8731 (Target_arm::scan_reloc_for_stub): Record information about
8732 relocations for THUMB branches that might be exempted from the
8733 Cortex-A8 workaround.
8734 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8735 at the beginning of a relaxation pass.
8736
20138696
DK
87372010-01-12 Doug Kwan <dougkwan@google.com>
8738
8739 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8740 (Arm_relobj::Mapping_symbol_position,
8741 Arm_reloj::Mapping_symbol_position_less,
8742 Arm_relobj::Mapping_symbols_info): New types.
8743 (Target_arm::is_mapping_symbol_name): New method definition.
8744 (Arm_relobj::do_count_local_symbols): Save information about mapping
8745 symbols.
8746
089d69dc
DK
87472010-01-11 Doug Kwan <dougkwan@google.com>
8748
8749 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8750 Arm_relocate_functions::thumb32_branch_upper,
8751 Arm_relocate_functions::thumb32_branch_lower,
8752 Arm_relocate_functions::thumb32_cond_branch_offset,
8753 Arm_relocate_functions::thumb32_cond_branch_upper,
8754 Arm_relocate_functions::thumb32_cond_branch_lower,
8755 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8756 branch offset encoding.
8757 (Arm_relocate_functions::thumb_branch_common): Use new branch
8758 offset encoding methods to avoid code duplication.
8759 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8760 (Stub_addend_reader::operator()): Use new branch encoding method
8761 to avoid code duplication.
8762
99e5bff2
DK
87632010-01-11 Doug Kwan <dougkwan@google.com>
8764
8765 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8766 (Target_arm::do_finalize_sections): Define special EXIDX section
8767 symbols only if referenced.
8768 * gc.h (Garbage_collection::add_reference): New method.
8769 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8770 code duplication.
8771
98e090bd
ILT
87722010-01-11 Ian Lance Taylor <iant@google.com>
8773
d0a91bd8
ILT
8774 * script.cc (Version_script_info::build_expression_list_lookup):
8775 Change complaing about duplicate wildcard match from error to
8776 warning.
8777
98e090bd
ILT
8778 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8779 of 2009-12-30.
8780 (Version_script_info::Version_script_info): Initialize globs_,
8781 default_version_, default_is_global_, and exact_. Don't
8782 initialize globals_ or locals_.
8783 (Version_script_info::build_lookup_tables): Build local symbols
8784 first.
8785 (Version_script_info::unquote): New function.
8786 (Version_script_info::add_exact_match): New function.
8787 (Version_script_info::build_expression_list_lookup): Remove lookup
8788 parameter. Add is_global parameter. Change all callers. Handle
8789 wildcard pattern specially. Unquote pattern. Call
8790 add_exact_match.
8791 (Version_script_info::get_name_to_match): New function.
8792 (Version_script_info::get_symbol_version): New function.
8793 (Version_script_info::get_symbol_version_helper): Remove.
8794 (Version_script_info::check_unmatched_names): Call unquote.
8795 * script.h (class Version_script_info): Change get_symbol_version
8796 to be non-inline and add is_global parameter; change all callers.
8797 Rewrite symbol_is_local. Update declarations. Define struct
8798 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8799 Remove globals_ and locals_ members. Add exact_, globs_,
8800 default_version_, is_global_.
8801 (Version_script_info::Glob): Remove pattern, add expression and
8802 is_global. Update constructor. Change all callers.
8803 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8804 default version.
8805 (Versions::symbol_section_contents): If a symbol is undefined, or
8806 defined in a dynamic object, set the version index to
8807 VER_NDX_LOCAL.
8808 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8809 symbol_is_local.
8810 (Symbol_table::add_from_pluginobj): Likewise.
8811 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8812
d56962d3
DK
88132010-01-11 Doug Kwan <dougkwan@google.com>
8814
8815 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8816 (incremental_dump_LDADD): Add linking option for libintl.
8817 * Makefile.in: Regenerate.
8818
94e6ee91
L
88192010-01-11 H.J. Lu <hongjiu.lu@intel.com>
8820
8821 PR gold/11144
8822 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
8823 instead of -Ds.
8824 * testsuite/Makefile.in: Regenerated.
8825
e96c574b
DK
88262010-01-10 Doug Kwan <dougkwan@google.com>
8827
8828 * options.h (DEFINE_var): Use parentheses around argument varname__
8829 in macro body to avoid any unintended subsequent substitutions.
8830
7198066b
ILT
88312010-01-10 Ian Lance Taylor <iant@google.com>
8832
ba4d53bf
ILT
8833 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
8834 candidates before doing symbol resolution.
8835
7198066b
ILT
8836 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
8837 ODR candidates if only one is weak.
8838
a2beed37
ILT
88392010-01-08 Ian Lance Taylor <iant@google.com>
8840
8841 * script.cc (Version_script_info::build_expression_list_lookup):
8842 Don't warn about ambiguous version, just record the ambiguity.
8843 (Version_script_info::get_symbol_version_helper): Give error if
8844 version is ambiguous.
8845
2fb7225c
DK
88462010-01-08 Doug Kwan <dougkwan@google.com>
8847
8848 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
8849 prev_data_size_ and prev_addralign_. Remove initializer for
8850 deleted data member has_been_changed_.
8851 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
8852 to determine if the table is empty.
8853 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
8854 Remove.
8855 (Stub_table::add_reloc_stub): Define method in class definition
8856 instead of just declaring it there.
8857 (Stub_table::add_cortex_a8_stub): New method definition.
8858 (Stub_table::update_data_size_and_addralign): Ditto.
8859 (Stub_table::finalize_stubs): Ditto.
8860 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
8861 (Stub_table::do_addralign_): Return address alignment in the
8862 (Stub_table::do_reset_address_and_file_offset): Define method in
8863 class definition instead of declaring it there. Set current data
8864 size to be the data size of the previous pass.
8865 (Stub_table::set_final_data_size): Use current data size as the
8866 final data size.
8867 (Stub_table::relocate_stub): Change parameter type of stub from
8868 Reloc_stub pointer to Stub pointer.
8869 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
8870 (Stub_table::Cortex_a8_stub_list): New typedef.
8871 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
8872 Stub_table::prev_addralign_): New data member.
8873 (Arm_relobj::Arm_relobj): Initialize data member
8874 section_has_cortex_a8_workaround_.
8875 (Arm_relobj::section_has_cortex_a8_workaround,
8876 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
8877 definitions.
8878 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
8879 declarations.
8880 (Target_arm::relocate_stub): Change parameter type of stub from
8881 Reloc_stub pointer to Stub pointer.
8882 (Insn_template::size, Insn_template::alignment): Handle
8883 THUMB16_SPECIAL_TYPE.
8884 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
8885 Stub_table::update_data_size_and_addralign,
8886 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
8887 definitions.
8888 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
8889 (Stub_table::do_write): Ditto.
8890 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 8891
880cd20d
ILT
88922010-01-08 Ian Lance Taylor <iant@google.com>
8893
8894 PR 11108
8895 * symtab.h (class Symbol): Remove fields is_target_special_ and
8896 has_plt_offset_. Add field is_defined_in_discarded_section_.
8897 (Symbol::is_defined_in_discarded_section): New function.
8898 (Symbol::set_is_defined_in_discarded_section): New function.
8899 (Symbol::has_plt_offset): Rewrite.
8900 (Symbol::set_plt_offset): Verify that new offset is not -1U.
8901 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
8902 Don't initialize is_target_special_ or has_plt_offset_.
8903 Initialize is_defined_in_discarded_section_.
8904 (Symbol_table::add_from_relobj): If appropriate, set
8905 is_defined_in_discarded_section.
8906 * resolve.cc (Symbol::override_base_with_special): Don't test
8907 is_target_special_. Change has_plt_offset_ to has_plt_offset().
8908 * target-reloc.h (relocate_section): Do special handling for
8909 symbols defined in discarded sections for global symbols as well
8910 as local symbols.
8911
2703e3eb
ILT
89122010-01-08 Ian Lance Taylor <iant@google.com>
8913
8914 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
8915 the SHT_SYMTAB case.
8916
339d40a3
ILT
89172010-01-08 Ian Lance Taylor <iant@google.com>
8918
8919 * object.cc (Sized_relobj::do_layout): Don't get confused if
8920 layout_eh_frame returns NULL.
8921
abecea76
ILT
89222010-01-08 Ian Lance Taylor <iant@google.com>
8923
8924 PR 11084
8925 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
8926 dynamic symbol table, use the normal symbol table.
8927 (Sized_dynobj::do_read_symbols): Remove assertion about type of
8928 symbol table.
8929
6b7dd3f3
ILT
89302010-01-08 Ian Lance Taylor <iant@google.com>
8931
8932 PR 11072
8933 * layout.cc (Layout::include_section): Remove .gnu_debuglink
8934 sections.
8935
36c50e63
L
89362010-01-08 H.J. Lu <hongjiu.lu@intel.com>
8937
8938 * version.cc (print_version): Change to "Copyright 2010".
8939
e291e7b9
ILT
89402010-01-08 Ian Lance Taylor <iant@google.com>
8941
8942 PR 10287
8943 PR 11063
8944 * i386.cc (class Target_i386): Change return type of plt_section
8945 to be non-const.
8946 (class Output_data_plt_i386): Add tls_desc_rel_ field.
8947 (Output_data_plt_i386::Output_data_plt_i386): Initialize
8948 tls_desc_rel_ field.
8949 (Output_data_plt_i386::rel_tls_desc): New function.
8950 (Target_i386::rel_tls_desc_section): New function.
8951 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
8952 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
8953 R_386_TLS_DESC reloc in rel_tls_desc_section.
8954 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
8955 Define struct Tlsdesc_info.
8956 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
8957 (Target_x86_64::do_reloc_symbol_index): New function.
8958 (Target_x86_64::add_tlsdesc_info): New function.
8959 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
8960 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
8961 tlsdesc_rel_ field.
8962 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
8963 all callers.
8964 (Output_data_plt_x86_64::rela_tlsdesc): New function.
8965 (Target_x86_64::rela_tlsdesc_section): New function.
8966 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
8967 handling.
8968 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
8969 (Target_x86_64::do_reloc_addend): New function.
8970 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
8971 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
8972 declarations. Define TARGET_CODE. Add arg field to u1_ union.
8973 (Output_reloc::type): New function.
8974 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
8975 (Output_reloc::is_target_specific): New function.
8976 (Output_reloc::target_arg): New function.
8977 (class Output_reloc) [SHT_RELA]: Add four new constructors for
8978 absolute relocs and target specific relocs.
8979 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
8980 add_target_specific.
8981 (class Output_data_reloc) [SHT_RELA]: Likewise.
8982 * output.cc (Output_reloc::Output_reloc): Add four new versions
8983 for absolute relocs and target specific relocs.
8984 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
8985 (Output_reloc::get_symbol_index): Likewise.
8986 (Output_reloc::local_section_offset): Check that local_sym_index_
8987 is not TARGET_CODE or 0.
8988 (Output_reloc::symbol_value): Likewise.
8989 (Output_reloc::write) [SHT_RELA]: Call target for target specific
8990 reloc.
8991 * target.h (class Target): Add reloc_symbol_index and reloc_addend
8992 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
8993 functions.
8994 * layout.cc (add_target_dynamic_tags): Use output section for
8995 DT_PLTRELSZ and DT_JMPREL.
8996
3a44184e
ILT
89972010-01-07 Ian Lance Taylor <iant@google.com>
8998
8999 PR 11061
9000 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9001 function.
9002 (class Output_data_reloc_generic): Define.
9003 (class Output_data_reloc_base): Change base class to
9004 Output_data_reloc_generic. Change add() method to call
9005 bump_relative_reloc_count for a relative reloc. Remove
9006 sort_relocs_ field.
9007 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9008 to sort_relocs().
9009 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9010 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9011 appropriate.
9012 * layout.h (class Layout): Update declaration.
9013
ea715a34
ILT
90142010-01-07 Ian Lance Taylor <iant@google.com>
9015
9016 * output.h (class Output_data): Add const version of
9017 output_section and do_output_section.
9018 (class Output_section_data): Add const version of
9019 do_output_section.
9020 (class Output_section): Likewise.
9021 * layout.cc (Layout::add_target_dynamic_tags): New function.
9022 * layout.h (class Layout): Update declarations.
9023 * arm.cc (Target_arm::do_finalize_sections): Use
9024 add_target_dynamic_tags.
9025 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9026 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9027 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9028 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9029
659948a4
ILT
90302010-01-07 Ian Lance Taylor <iant@google.com>
9031
9032 PR 11042
9033 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9034 object as needed.
9035
9d3b86f6
ILT
90362010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9037 Ian Lance Taylor <iant@google.com>
9038
9039 PR 11019
9040 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9041 Xindex::read_symtab_xindex.
9042
bb0d3eb0
DK
90432010-01-07 Doug Kwan <dougkwan@google.com>
9044
9045 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9046 (Insn_template::thumb16_bcond_insn): New method declaration.
9047 (Insn_template): Fix spelling.
9048 (Stub::thumb16_special): New method declaration.
9049 (Stub::do_write): Define virtual method which was previously pure
9050 virtual.
9051 (Stub::do_thumb16_special): New method declaration.
9052 (Stub::do_fixed_endian_write): New template member.
9053 (Reloc_stub::do_write): Remove.
9054 (Reloc_stub::do_fixed_endian_write): Remove.
9055 (Cortex_a8_stub): New class definition.
9056 (Stub_factory::make_cortex_a8_stub): New method definition.
9057 (Stub_factory::Stub_factory): Add missing static storage class
9058 qualifier for elf32_arm_stub_a8_veneer_blx.
9059
ffeef7df
ILT
90602010-01-07 Ian Lance Taylor <iant@google.com>
9061
dc3f80fe
ILT
9062 PR 10980
9063 * options.h (class General_options): Add --warn-unresolved-symbols
9064 and --error-unresolved-symbols.
9065 * errors.cc (Errors::undefined_symbol): Implement
9066 --warn-unresolved-symbols.
9067
ffeef7df
ILT
9068 * options.h (class General_options): Add -z text and -z textoff.
9069 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9070
f1ec9ded
ST
90712010-01-06 Sriraman Tallam <tmsriram@google.com>
9072
9073 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9074 (Garbage_collection::cident_sections): New function.
9075 (Garbage_collection::add_cident_section): New function.
9076 (Garbage_collection::cident_sections_): New member.
9077 (gc_process_relocs): Add references to sections whose names are C
9078 identifiers.
9079 * gold.h (cident_section_start_prefix): New constant.
9080 (cident_section_stop_prefix): New constant.
9081 (is_cident): New function.
9082 * layout.cc (Layout::define_section_symbols): Replace string constants
9083 with the newly defined constants.
9084 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9085 C identifiers.
9086 * testsuite/Makefile.am: Add gc_orphan_section_test.
9087 * testsuite/Makefile.in: Regenerate.
9088 * testsuite/gc_orphan_section_test.cc: New file.
9089 * testsuite/gc_orphan_section_test.sh: New file.
9090
6eda8c29
ILT
90912010-01-06 Ian Lance Taylor <iant@google.com>
9092
b9674e17
ILT
9093 PR 10980
9094 * options.h (class General_options): Add --warn-shared-textrel.
9095 * layout.cc (Layout::finish_dynamic_section): Implement
9096 --warn-shared-textrel.
9097
6eda8c29
ILT
9098 PR 10980
9099 * options.h (class General_options): Add --warn-multiple-gp.
9100
32dcd44e
ILT
91012010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9102
9103 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9104 $(THREADSLIB) and $(LIBDL).
9105 * Makefile.in: Rebuild.
9106
a192ba05
ILT
91072010-01-06 Ian Lance Taylor <iant@google.com>
9108
9109 PR 10980
9110 * options.cc (General_options::parse_section_start): New function.
9111 (General_options::section_start): New function.
9112 (General_options::General_options): Initialize all members.
9113 * options.h: Include <map>
9114 (class General_options): Add --section-start. Add section_starts_
9115 member.
9116 * layout.cc (Layout::attach_allocated_section_to_segment): If
9117 --section-start was used, set the address of the segment. Remove
9118 local sort_sections.
9119 (Layout::relaxation_loop_body): If the address of the load segment
9120 has been set by --section-start, don't use it.
9121 * output.h (Output_segment::update_flags_for_output_section): New
9122 function.
9123 * output.cc (Output_segment::add_output_section): Call
9124 update_flags_for_output_section.
9125
dde3f402
ILT
91262010-01-05 Ian Lance Taylor <iant@google.com>
9127
62dfdd4d
ILT
9128 PR 10980
9129 * options.h (class General_options): Add --undefined-version.
9130 * script.cc (struct Version_expression): Add was_matched_by_symbol
9131 field.
9132 (Version_script_info::matched_symbol): New function.
9133 (Version_script_info::get_symbol_version_helper): Call
9134 matched_symbol.
9135 (Version_script_info::check_unmatched_names): New function.
9136 * script.h (class Version_script_info): Update declarations.
9137 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9138
9c4ae156
ILT
9139 * options.h (class General_options): Use DEFINE_bool_alias for
9140 allow_multiple_definition.
9141 * resolve.cc (Symbol_table::should_override): Don't test
9142 allow_multiple_definition.
9143
dde3f402
ILT
9144 PR 10980
9145 * options.h (class General_options): Add --cref.
9146 * main.cc (main): Print cref table if --cref. Don't close mapfile
9147 until after printing cref table.
9148 * cref.cc: Include "symtab.h".
9149 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9150 (Cref_table_compare::operator()): New function.
9151 (Cref_inputs::gather_cref): New function.
9152 (filecol): New static const.
9153 (Cref_inputs::print_cref): New function.
9154 (Cref::print_cref): New function.
9155 * cref.h: Include <cstdio>.
9156 (class Cref): Update declarations.
9157 * mapfile.h (Mapfile::file): New function.
9158 * object.h (class Object): Define Symbols. Declare virtual
9159 do_get_global_symbols.
9160 (Object::get_global_symbols): New function.
9161 * object.cc (Input_objects::add_object): Pass object to cref_ if
9162 --cref.
9163 (Input_objects::archive_start): Likewise.
9164 (Input_objects::archive_stop): Likewise.
9165 (Input_objects::print_cref): New function.
9166 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9167 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9168 --cref.
9169 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9170 function.
9171 * plugin.h (class Sized_pluginobj): Update declarations.
9172
8781f709
ILT
91732010-01-05 Ian Lance Taylor <iant@google.com>
9174
9175 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9176 to is_default_version. Rename insdef to insdefault.
9177 (Symbol_table::add_from_relobj): Rename def to is_default_version
9178 and local to is_forced_local.
9179 (Symbol_table::add_from_pluginobj): Likewise.
9180 (Symbol_table::add_from_dynobj): Likewise.
9181 (Symbol_table::define_special_symbol): Rename insdef to
9182 insdefault.
9183
fe35d28d
ILT
91842010-01-04 Ian Lance Taylor <iant@google.com>
9185
30bc8c46
ILT
9186 PR 10980
9187 * options.h (class General_options): Add
9188 --allow-multiple-definition and -z muldefs.
9189 * resolve.cc (Symbol_table::should_override): Don't warn about a
9190 multiple symbol definition if --allow-multiple-definition or -z
9191 muldefs.
9192
7eaea549
ILT
9193 PR 10980
9194 * options.h (class General_options): Add --add-needed and
9195 --copy-dt-needed-entries. Tweak --as-needed help entry.
9196 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9197 error if --copy-dt-needed-entries aka --add-needed is used and
9198 would cause a change in behaviour.
9199
fe35d28d
ILT
9200 PR 10980
9201 * options.h (class General_options): Add -G as a short version of
9202 --shared. Add no-op options -assert, -g, and -i.
9203
55a2bb35
ST
92042010-01-04 Sriraman Tallam <tmsriram@google.com>
9205
9206 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9207 check for .text or .gnu.linkonce.t sections.
9208 * icf.cc (Icf::find_identical_sections): Ditto.
9209 Change the detection for mangled function name within the section
9210 name.
9211 * icf.h (is_section_foldable_candidate): New function.
9212
719328e1
ILT
92132009-12-30 Ian Lance Taylor <iant@google.com>
9214
9215 PR 10980
9216 * options.h (class General_options): Permit two dashes with
9217 --retain-symbols-file.
9218
d7bb5745
ILT
92192009-12-30 Ian Lance Taylor <iant@google.com>
9220
403a15dd
ILT
9221 PR 10979
9222 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9223 don't put the file header and segment headers in the text
9224 segment.
9225
eda294df
ILT
9226 PR 10979
9227 * common.cc (Sort_commons::operator()): Stabilize sort when both
9228 entries are NULL.
9229 (Symbol_table::do_allocate_commons_list): When allocating common
9230 symbols, skip a symbol which is no longer common.
9231 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9232 an object before checking its type.
9233 * testsuite/common_test_2.c: New file.
9234 * testsuite/common_test_3.c: New file.
9235 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9236 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9237 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9238 (common_test_2_pic.o, common_test_2.so): New targets.
9239 (common_test_3_pic.o, common_test_3.so): New targets.
9240 * testsuite/Makefile.in: Rebuild.
9241
d7bb5745
ILT
9242 PR 10979
9243 * script.cc (read_input_script): If we see a new SECTIONS clause,
9244 and we have added an input section, give an error.
9245 * layout.h (class Layout): Add have_added_input_section function.
9246 Add have_added_input_section_ field.
9247 * layout.cc (Layout::Layout): Initialize
9248 have_added_input_section_.
9249 (Layout::layout): Set have_added_input_section_.
9250 (Layout::layout_eh_frame): Likewise.
9251
fc59c572
ILT
92522009-12-30 Ian Lance Taylor <iant@google.com>
9253
9254 PR 10931
9255 * options.h (class General_options): Add --sort-common option.
9256 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9257 * common.cc (Sort_common): Add sort_order parameter to
9258 constructor. Add sort_order_ field.
9259 (Sort_commons::operator): Check sort_order_.
9260 (Symbol_table::allocate_commons): Determine the sort order.
9261 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9262 Change all callers.
9263 (Symbol_table::do_allocate_commons_list): Likewise.
9264
1c74fab0
ILT
92652009-12-30 Ian Lance Taylor <iant@google.com>
9266
9267 PR 10916
9268 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9269 symbols from this object, don't change the visibility of an
9270 undefined symbol.
9271 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9272
6affe781
ILT
92732009-12-30 Ian Lance Taylor <iant@google.com>
9274
9275 PR 10861
9276 * script.h (class Version_script_info): Define Language enum.
9277 Update declarations. Define Glob, Exact, and Lookup types. Add
9278 new fields globals_, locals_, and is_finalized_.
9279 * script.cc: Various formatting fixes.
9280 (class Parser_closure): Change language_stack_ from a vector of
9281 std::string to one of Version_script_info::Language. Adjust all
9282 uses accordingly.
9283 (class Lazy_demangler): Remove.
9284 (struct Version_expression): Change language from std::string to
9285 Version_script_info::Language.
9286 (Version_script_info::Version_script_info): New function.
9287 (Version_script_info::~Version_script_info): Don't call clear.
9288 (Version_script_info::finalize): New function.
9289 (Version_script_info::build_lookup_tables): New function.
9290 (Version_script_info::build_expression_list_lookup): New
9291 function.
9292 (Version_script_info::get_symbol_version_helper): Rewrite to use
9293 lookup tables.
9294 (Version_script_info::print_expression_list): Adjust to use
9295 Version_script_info::Language.
9296 (script_push_lex_into_version_mode): Check that the version script
9297 has not been finalized.
9298 (version_script_push_lang): Change language string to
9299 Version_script_info::Language.
9300 * options.cc (Command_line::version_script): New function.
9301 * options.h (class General_options): Add finalize_dynamic_list
9302 function. Change version_script from declaration to definition.
9303 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9304 * testsuite/version_script.map: Remove duplicate def of foo.
9305 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9306 version_script.map.
9307 * testsuite/Makefile.in: Rebuild.
9308
818bf354
ILT
93092009-12-30 Ian Lance Taylor <iant@google.com>
9310
9311 PR 10843
9312 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9313 if the input symbol index is 0, make the output symbol index 0.
9314
ebcc8304
ILT
93152009-12-30 Ian Lance Taylor <iant@google.com>
9316
9317 PR 10670
9318 * options.h (class General_options): Add -x/--discard-all.
9319 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9320 --discard-all. If the local symbol needs a dynamic entry, check
9321 that before handling --discard-locals.
9322
176fe33f
ILT
93232009-12-30 Ian Lance Taylor <iant@google.com>
9324
bb321bb1
ILT
9325 PR 10450
9326 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9327 flags to PF_R.
9328 (Output_segment::add_output_section): Don't change the flags if
9329 the type is PT_TLS.
9330
176fe33f
ILT
9331 PR 10450
9332 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9333 GNU hash table if they need a dynamic value. Otherwise, don't add
9334 them if they are defined in a dynamic object or are forced local.
9335
e8cd95c7
ILT
93362009-12-29 Ian Lance Taylor <iant@google.com>
9337
1b81fb71
ILT
9338 PR 10450
9339 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9340 .gnu.hash table for a 32-bit target.
9341
8d6d383d
ILT
9342 PR 10450
9343 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9344 regular and a dynamic object only needs a dynamic symbol table
9345 entry if it is externally visible.
9346
e785ec03
ILT
9347 PR 10450
9348 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9349 constructor. Add global_offset_table_ field.
9350 (Target_i386::got_section): Set global_offset_table_.
9351 (Target_i386::do_finalize_sections): Set global_offset_table_
9352 size.
9353 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9354 in constructor. Add global_offset_table_ field.
9355 (Target_x86_64::got_section): Set global_offset_table_.
9356 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9357 size.
9358
1a2dff53
ILT
9359 * layout.cc (Layout::Layout): Initialize increase_relro_.
9360 (Layout::get_output_section): Add is_relro, is_last_relro, and
9361 is_first_non_relro parameters. Change all callers.
9362 (Layout::choose_output_section): Likewise.
9363 (Layout::add_output_section_data): Likewise.
9364 (Layout::make_output_section): Likewise.
9365 (Layout::set_segment_offsets): Clear increase_relro when using a
9366 linker script.
9367 * layout.h (class Layout): Add increase_relro method. Add
9368 increase_relro_ field. Update declarations.
9369 * output.cc (Output_section::Output_section): Initialize
9370 is_last_relro_ and is_first_non_relro_.
9371 (Output_segment::add_output_section): Group relro sections is
9372 do_sort is true. Handle is_last_relro and is_first_non_relro.
9373 (Output_segment::maximum_alignment): Remove relro handling.
9374 (Output_segment::set_section_addresses): Add increase_relro
9375 parameter. Change all callers. Add initial alignment to align
9376 relro sections on separate page. Remove old relro handling.
9377 (Output_segment::set_section_list_addresses): Remove in_relro
9378 parameter. Change all callers.
9379 (Output_segment::set_offset): Add increase parameter. Change all
9380 callers. Remove old relro handling.
9381 * output.h (class Output_section): Add new methods: is_last_relro,
9382 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9383 Add is_last_relro_ and is_first_non_relro_ fields.
9384 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9385 Create separate .got.plt section. Call increase_relro.
9386 * x86_64.cc (Target_x86_64::got_section): Likewise.
9387 * testsuite/relro_script_test.t: Add .got.plt.
9388
f0ba79e2
ILT
9389 PR 10450
9390 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9391 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9392 (Layout::finalize): Call set_dynamic_symbol_size.
9393 (Layout::set_dynamic_symbol_size): New function.
9394 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9395 set_dynamic_symbol_size.
9396
e8cd95c7
ILT
9397 PR 10450
9398 * output.h (class Output_section): Add is_entsize_zero_ field.
9399 * output.cc (Output_section::Output_section): Initialize
9400 is_entsize_zero_.
9401 (Output_section::set_entsize): If two different entsizes are
9402 requested, force it to zero.
9403 (Output_section::add_input_section): Set flags for .debug_str
9404 before updating section flags. Set entsize.
9405 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9406 and SHF_STRING if all input sections have those flags.
9407
3e1b9a8a
RÁE
94082009-12-29 Rafael Espindola <espindola@google.com>
9409
9410 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
9411 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9412 reporting.
3e1b9a8a 9413
3dcad376
ST
94142009-12-29 Sriraman Tallam <tmsriram@google.com>
9415
9416 * options.cc (General_options::parse_version): Allow -v to exit
9417 without an error if there is nothing to link.
9418
084e2665
ILT
94192009-12-29 Ian Lance Taylor <iant@google.com>
9420
9421 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9422 using a version of gcc before 4.1.
9423 * configure: Rebuild.
9424
250acde3
CD
94252009-12-28 Chris Demetriou <cgd@google.com>
9426
9427 * attributes.cc (Output_attributes_section_data::do_write): Use
9428 std::vector::front rather than std::vector::data.
9429
99fff23b
ILT
94302009-12-28 Ian Lance Taylor <iant@google.com>
9431
9432 * symtab.h (class Symbol_table): Add enum Defined.
9433 * resolve.cc (Symbol_table::should_override): Add defined
9434 parameter. Change all callers. Test whether object is NULL
9435 before calling a method on it.
9436 (Symbol_table::report_resolve_problem): Add defined parameter.
9437 Change all callers.
9438 (Symbol_table::should_override_with_special): Likewise.
9439 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9440 parameter. Change all callers.
9441 (Symbol_table::do_define_in_output_data): Likewise.
9442 (Symbol_table::define_in_output_segment): Likewise.
9443 (Symbol_table::do_define_in_output_segment): Likewise.
9444 (Symbol_table::define_as_constant): Likewise.
9445 (Symbol_table::do_define_as_constant): Likewise.
9446 * script.h (class Symbol_assignment): Add is_defsym parameter to
9447 constructor; change all callers.
9448 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9449 parameter. Change all callers. Add is_defsym_ field.
9450 (class Parser_closure): Add parsing_defsym parameter to
9451 constructor; change all callers. Add parsing_defsym accessor
9452 function. Add parsing_defsym_ field.
9453
556bd683
ILT
94542009-12-28 Ian Lance Taylor <iant@google.com>
9455
9456 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 9457 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 9458
1782c879
ILT
94592009-12-23 Ian Lance Taylor <iant@google.com>
9460
9461 * i386.cc (Target_i386::do_calls_non_split): Recognize
9462 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
9463 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9464 -fsplit-stack prologue when using %r11.
1782c879 9465
329ca2b1
ST
94662009-12-21 Sriraman Tallam <tmsriram@google.com>
9467
9468 * options.cc (General_options::parse_version): Make -v continue and do
9469 the link like GNU ld does.
9470
d675ff46
RÁE
94712009-12-17 Rafael Avila de Espindola <espindola@google.com>
9472
9473 * Makefile.am (CCFILES): Add timer.cc.
9474 (HFILES): Add timer.h.
9475 * configure.ac: Check for sysconf and times.
9476 * main.cc: include timer.h.
9477 (main): Use Timer instead of get_run_time.
9478 * timer.cc: New.
9479 * timer.h: New.
9480 * workqueue.cc: include timer.h.
9481 (Workqueue::find_and_run_task):
9482 Report user, sys and wall time.
9483 * Makefile.in: Regenerate.
9484 * config.in: Regenerate.
9485 * configure: Regenerate.
9486
d6344fb5
DK
94872009-12-16 Doug Kwan <dougkwan@google.com>
9488
9489 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9490 sections.
9491 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9492 relaxed input sections.
9493 * output.cc (Output_section::find_relaxed_input_section): Change
9494 return type to Output_relaxed_input_section pointer. Adjust code
9495 for new type of relaxed_input_section_map_.
9496 * output.h (Output_section::find_relaxed_input_section): Change
9497 return type to Output_relaxed_input_section pointer.
9498 (Output_section::Output_relaxed_input_section_by_input_section_map):
9499 New type.
9500 (Output_section::relaxed_input_section_map_): Change type to
9501 Output_section::Output_relaxed_input_section_by_input_section_map.
9502 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9503 input section.
9504
0e0d5469
ILT
95052009-12-15 Ian Lance Taylor <iant@google.com>
9506
9507 * layout.cc (Layout::create_shstrtab): Only write out after input
9508 sections if we are compressing debug sections.
9509
0649a889
ILT
95102009-12-15 Ian Lance Taylor <iant@google.com>
9511
9512 * archive.cc (Archive::add_symbols): Only look up a symbol without
9513 a version if there is, in fact, a version.
9514
2ea97941
ILT
95152009-12-14 Ian Lance Taylor <iant@google.com>
9516
9517 Revert -Wshadow changes, all changes from:
9518 2009-12-11 Doug Kwan <dougkwan@google.com>
9519 2009-12-11 Nick Clifton <nickc@redhat.com>
9520 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9521
b0eec2cc
DK
95222009-12-11 Doug Kwan <dougkwan@google.com>
9523
9524 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9525 due to -Wshadow.
9526 * attributes.cc (Object_attribute::size): Ditto.
9527 (Attributes_section_data::size): Ditto.
9528 (Attributes_section_data::Attributes_section_data): Ditto.
9529 (Output_attributes_section_data::do_write): Ditto.
9530 * attributes.h (Object_attribute::set_type): Ditto.
9531 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9532
91d6fa6a
NC
95332009-12-11 Nick Clifton <nickc@redhat.com>
9534
9535 * archive.cc: Fix shadowed variable warnings.
9536 * arm.cc: Likewise.
9537 * compressed_output.cc: Likewise.
9538 * compressed_output.h: Likewise.
9539 * configure: Likewise.
9540 * dwarf_reader.cc: Likewise.
9541 * dynobj.cc: Likewise.
9542 * dynobj.h: Likewise.
9543 * ehframe.cc: Likewise.
9544 * ehframe.h: Likewise.
9545 * errors.cc: Likewise.
9546 * expression.cc: Likewise.
9547 * fileread.cc: Likewise.
9548 * fileread.h: Likewise.
9549 * freebsd.h: Likewise.
9550 * i386.cc: Likewise.
9551 * icf.cc: Likewise.
9552 * incremental.h: Likewise.
9553 * layout.cc: Likewise.
9554 * layout.h: Likewise.
9555 * mapfile.cc: Likewise.
9556 * merge.cc: Likewise.
9557 * merge.h: Likewise.
9558 * object.cc: Likewise.
9559 * object.h: Likewise.
9560 * options.h: Likewise.
9561 * output.cc: Likewise.
9562 * output.h: Likewise.
9563 * parameters.cc: Likewise.
9564 * plugin.cc: Likewise.
9565 * powerpc.cc: Likewise.
9566 * reduced_debug_output.cc: Likewise.
9567 * reduced_debug_output.h: Likewise.
9568 * reloc.cc: Likewise.
9569 * reloc.h: Likewise.
9570 * resolve.cc: Likewise.
9571 * script-sections.cc: Likewise.
9572 * script.cc: Likewise.
9573 * script.h: Likewise.
9574 * sparc.cc: Likewise.
9575 * symtab.cc: Likewise.
9576 * symtab.h: Likewise.
9577 * target-select.cc: Likewise.
9578 * target-select.h: Likewise.
9579 * token.h: Likewise.
9580 * workqueue.cc: Likewise.
9581 * workqueue.h: Likewise.
9582 * x86_64.cc: Likewise.
9583
a0351a69
DK
95842009-12-10 Doug Kwan <dougkwan@google.com>
9585
9586 * arm.cc (attributes.h): New include.
9587 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9588 (Arm_relobj::~Arm_relobj): Delete object pointed by
9589 attributes_section_data_.
9590 (Arm_relobj::attributes_section_data): New method definition.
9591 (Arm_relobj::attributes_section_data_): New data member declaration.
9592 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9593 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9594 attributes_section_data_.
9595 (Arm_dynobj::attributes_section_data): New method definition.
9596 (Arm_dynobj::attributes_section_data_): New data member declaration.
9597 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9598 initialization value of may_use_blx_ to false.
2e702c99 9599 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
9600 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9601 object attributes to compute results instead of hard-coding.
9602 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9603 Target_arm::get_secondary_compatible_arch,
9604 Target_arm::set_secondary_compatible_arch
9605 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9606 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9607 New method declarations.
9608 (Target_arm::get_aeabi_object_attribute): New method definition.
9609 (Target_arm::attributes_section_data_): New data member declaration.
9610 (read_arm_attributes_section): New template definition.
9611 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9612 (Arm_dynobj::do_read_symbols): Ditto.
9613 (Target_arm::do_finalize_sections): Merge attributes sections from
9614 input. Check for BLX use after attributes section merging.
9615 Fix __exidx_start and __exidx_end visibility. Create an
9616 .ARM.attributes section if necessary.
9617 (Target_arm::get_secondary_compatible_arch,
9618 Target_arm::set_secondary_compatible_arch,
9619 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9620 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9621 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9622 New method definitions.
9623
b59befec
ILT
96242009-12-09 Ian Lance Taylor <iant@google.com>
9625
9626 * plugin.cc (Plugin::load): Don't cast from void* to a function
9627 pointer.
9628
1276bc89
ILT
96292009-12-09 Ian Lance Taylor <iant@google.com>
9630
9631 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9632 information fields.
9633
2f2de248
L
96342009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9635
9636 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9637 Replace two_file_shared_1.so with two_file_shared_2.so.
9638 * testsuite/Makefile.in: Regenerated.
9639
4f787271
DK
96402009-12-08 Doug Kwan <dougkwan@google.com>
9641
9642 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9643 (HFILES): Add attributes.h and int_encoding.h.
9644 * Makefile.in: Regenerate.
9645 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9646 function definitions to int_encoding.cc
9647 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9648 prototypes to int_encoding.h
9649 * reduced_debug_output.cc (int_encoding.h): New include.
9650 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9651 function definitions to int_encoding.cc
9652 (insert_into_vector, read_from_pointer): Move template definitions to
9653 int_encoding.h
9654 * attributes.cc: New file.
9655 * attributes.h: New file.
9656 * int_encoding.cc: New file.
9657 * int_encoding.h: New file.
9658
20b52f1a
RÁE
96592009-12-07 Rafael Avila de Espindola <espindola@google.com>
9660
9661 PR gold/11055
9662 * incremental-dump.cc (dump_incremental_inputs): New.
9663 (main): Use dump_incremental_inputs.
9664
53d7974c
L
96652009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9666
9667 PR gold/10893
9668 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9669 checking elfcpp::STT_FUNC.
9670 (Target_i386::Relocate::relocate): Likewise.
9671 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9672
9673 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9674 symbols from shared libraries into normal FUNC symbols.
9675
9676 * symtab.h (Symbol): Add is_func and use it.
9677
05a352e6
DK
96782009-12-05 Doug Kwan <dougkwan@google.com>
9679
9680 * arm.cc (Target_arm::arm_info): Initialize new fields
9681 attributes_section and attributes_vendor.
9682 * i386.cc (Target_i386::i386_info): Same.
9683 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9684 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9685 fields attributes_section and attributes_vendor.
53d7974c 9686 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9687 * target.h (Target::attributes_section, Target::attributes_vendor,
9688 Target::is_attributes_section, Target::attribute_arg_type,
9689 Target::attributes_order): New method definitions.
9690 (Target::Target_info::attributes_section,
9691 Target::Target_info::attributes_vendor): New fields.
9692 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9693 virtual method definitions.
9694 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9695 attributes_section and attributes_vendor.
9696 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9697
f4e5969c
DK
96982009-12-05 Doug Kwan <dougkwan@google.com>
9699
9700 * arm.cc: Update comments about interworking and stub generation.
9701 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9702 considered as non-PIC.
9703 (Arm_relocate_functions::base_abs): Fix formatting.
9704 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9705 of function to use GOT entry address instead of offset.
9706 (Target_arm::Scan::global): Issue an error if a symbol would need a
9707 PLT does not get one because it is untyped. Remove code to create
9708 dynamic symbols for relative branches.
9709 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9710 takes unsigned integer instead of boolean.
9711
1abce4a6
L
97122009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9713
9714 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9715 (two_file_test_LDADD): Likewise.
9716 (common_test_1_LDADD): Likewise.
9717 (exception_test_LDADD) Likewise.
9718 (weak_test_LDADD): Likewise.
9719 (many_sections_test_LDADD): Likewise.
9720 (initpri1_LDADD): Likewise.
9721 (script_test_1_LDADD): Likewise.
9722 (script_test_2_LDADD): Likewise.
9723 (justsyms_LDADD): Likewise.
9724 (binary_test_LDADD): Likewise.
9725 (large_LDADD): Likewise.
9726 * testsuite/Makefile.in: Regenerated.
9727
adcf2816 97282009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9729
adcf2816
L
9730 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9731 (Symbol_table::override_with_special): Likewise.
9732 (Symbol_table::add_from_object): Likewise.
9733
28e67f5d
RÁE
97342009-12-04 Rafael Avila de Espindola <espindola@google.com>
9735
9736 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9737 Don't set the data_offset twice.
9738
ae10a101
RÁE
97392009-12-04 Rafael Avila de Espindola <espindola@google.com>
9740
9741 * testsuite/Makefile.in: Regenerate.
9742
f59f41f3
DK
97432009-12-03 Doug Kwan <dougkwan@google.com>
9744
9745 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9746 (Target_arm::do_finalize_sections): Add parameter for symbol table
9747 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9748 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9749 parameter for symbol table pointer.
9750 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9751 an additional parameter for a pointer to symbol table.
9752 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9753 parameter for a symbol table pointer.
9754 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9755 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9756 Ditto.
9757 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9758 parameter for a symbol table pointer.
9759
ca55d848
RÁE
97602009-12-03 Rafael Avila de Espindola <espindola@google.com>
9761
9762 * incremental.cc (Incremental_inputs_header)
9763 (Incremental_inputs_header_write, Incremental_inputs_entry)
9764 (Incremental_inputs_entry_write): Move ...
9765 * incremental.h (Incremental_inputs_header)
9766 (Incremental_inputs_header_write, Incremental_inputs_entry)
9767 (Incremental_inputs_entry_write): here.
9768
3aec4f9c
RÁE
97692009-12-02 Rafael Avila de Espindola <espindola@google.com>
9770
9771 * incremental.cc (make_sized_incremental_binary): Set the target.
9772 Error if it is incompatible.
9773 * output.h (Output_file): Add filename method.
9774
9c0ae74d
RÁE
97752009-12-02 Rafael Avila de Espindola <espindola@google.com>
9776
9777 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9778 from the get_* methods.
9779
a45500ae
RÁE
97802009-12-02 Rafael Avila de Espindola <espindola@google.com>
9781
9782 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9783 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9784 Write 0 for the data_offset of scripts.
9785
325e6408
RÁE
97862009-12-02 Rafael Avila de Espindola <espindola@google.com>
9787
9788 * testsuite/Makefile.am: Add the incremental_test.sh test.
9789 * testsuite/incremental_test.sh: New.
9790 * testsuite/incremental_test_1.c: New.
9791 * testsuite/incremental_test_2.c: New.
9792
954c3e2e
RÁE
97932009-12-01 Rafael Avila de Espindola <espindola@google.com>
9794
703d02da 9795 * incremental-dump.cc (main): Fix typos.
954c3e2e 9796
f8086623
RÁE
97972009-11-27 Rafael Avila de Espindola <espindola@google.com>
9798
9799 PR gold/11025
9800 * incremental-dump.cc (main): Use llu to print 64 bit values.
9801
3b0dd6ac
L
98022009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9803 H.J. Lu <hongjiu.lu@intel.com>
9804
9805 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9806 $(LIBDL).
9807 (incremental_dump_LDADD): Likewise.
9808 * Makefile.in: Regenerated.
9809
a6d1ef57 98102009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9811
a6d1ef57
DK
9812 Revert:
9813
9814 2009-11-25 Doug Kwan <dougkwan@google.com>
9815
9816 * arm.cc (Target_arm::Target_arm): Move method definition
9817 outside of class definition. Add code to handle
9818 --target1-rel, --target1-abs and --target2= options.
9819 (Target_arm::get_reloc_reloc_type): Change method to be
9820 non-static and const.
9821 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
9822 New data member declaration.
9823 (Target_arm::Scan::local, Target_arm::Scan::global,
9824 Target_arm::Relocate::relocate,
9825 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9826 Adjust call to Target_arm::get_real_reloc_type.
9827 (Target_arm::get_real_reloc_type): Use command line options
9828 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9829 * options.h (--target1-rel, --target1-abs, --target2): New
9830 ARM-only options.
9831
50aeb7d4
DK
98322009-11-25 Doug Kwan <dougkwan@google.com>
9833
9834 * arm.cc (Target_arm::Target_arm): Move method definition outside of
9835 class definition. Add code to handle --target1-rel, --target1-abs
9836 and --target2= options.
9837 (Target_arm::get_reloc_reloc_type): Change method to be non-static
9838 and const.
9839 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
9840 member declaration.
9841 (Target_arm::Scan::local, Target_arm::Scan::global,
9842 Target_arm::Relocate::relocate,
9843 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
9844 call to Target_arm::get_real_reloc_type.
9845 (Target_arm::get_real_reloc_type): Use command line options to
9846 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
9847 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
9848 options.
9849
51938283
DK
98502009-11-25 Doug Kwan <dougkwan@google.com>
9851
9852 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
9853 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
9854 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
9855 formatting.
9856 (Arm_relocate_functions::thm_call): Replace body with a call to
9857 Arm_relocate_functions::thumb_branch_common.
9858 (Arm_relocate_functions::thm_jump24,
9859 Arm_relocate_functions::thm_xpc22): New method definitions.
9860 (Arm_relocate_functions::thumb_branch_common): New method definition.
9861 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
9862 operator.
9863 (Target_arm::Relocate::relocate): Adjust call to thm_call.
9864 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
9865
e2b8f3c4
RÁE
98662009-11-24 Rafael Avila de Espindola <espindola@google.com>
9867
9868 * Makefile.am: Build incremental-dump
9869 * Makefile.in: Regenerate.
9870 * incremental-dump.cc: New.
9871 * incremental.cc (Incremental_inputs_header_data,
9872 Incremental_inputs_entry_data): Move to incremental.h
9873 * incremental.h: (Incremental_inputs_header_data,
9874 Incremental_inputs_entry_data): Move from incremental.cc
9875
bcba9aec
RÁE
98762009-11-24 Rafael Avila de Espindola <espindola@google.com>
9877
9878 * incremental.cc (Incremental_inputs_header,
9879 Incremental_inputs_header_write, Incremental_inputs_entry,
9880 Incremental_inputs_entry_write): Add a typedef with the data type.
9881
7c3afe08
RÁE
98822009-11-24 Rafael Avila de Espindola <espindola@google.com>
9883
9884 * incremental.cc (Incremental_inputs_header,
9885 Incremental_inputs_header_write, Incremental_inputs_entry,
9886 Incremental_inputs_entry_write): Update comment about which
9887 type has the filed descriptions.
9888
d204b6e9
DK
98892009-11-15 Doug Kwan <dougkwan@google.com>
9890
9891 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
9892 (Arm_relocate_functions::arm_branch_common): Change method defintion
9893 in class definition to a method declaration and update list of formal
9894 parameters.
9895 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
9896 Arm_relocation_functions::jump24): Adjust call to
9897 Arm_relocate_functions::arm_branch_common. Update list of formal
9898 parameters.
9899 (Arm_relocate_functions::xpc25): New method definition.
9900 (Arm_relocate_functions::arm_branch_common): Move method defintion
9901 out from class definition. Use stubs for mode-switching and extending
9902 branch ranges.
9903 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
9904 specially. Change code to enable use of stubs in ARM branches.
9905
43d12afe
DK
99062009-11-10 Doug Kwan <dougkwan@google.com>
9907
9908 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
9909 in method declaration.
9910 (Target_arm::relocate_stub): New method declaration.
9911 (Target_arm::default_target): Change to return a pointer instead of
9912 a const reference.
9913 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
9914 Target_arm::default_target.
9915 (Arm_Relobj::do_relocate_sections): Remove options paramater in
9916 method definition.
9917 (Target_arm::relocate_section): Adjust view.
9918 (Target_arm::relocate_stub): New method definition.
9919
ac33a407
DK
99202009-11-10 Doug Kwan <dougkwan@google.com>
9921
9922 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
9923 a format warning.
9924 * incremental.cc (open_incremental_binary): Initialized local
9925 variables to avoid warnings.
9926 * object.cc (make_elf_object): Ditto.
9927 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
9928 a format warning.
e1df38aa 9929
88ee28e9
L
9930009-11-09 H.J. Lu <hongjiu.lu@intel.com>
9931
9932 PR gold/10930
9933 * testsuite/plugin_test.c: Include "config.h".
9934
2daedcd6
DK
99352009-11-09 Doug Kwan <dougkwan@google.com>
9936
9937 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
9938 (arm_symbol_value): Remove.
9939 (Arm_relocate_functions::arm_branch_common,
9940 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
9941 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
9942 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
9943 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
9944 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
9945 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
9946 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
9947 Arm_relocate_functions::thm_mobw_abs_nc,
9948 Arm_relocate_functions::thm_mov_abs,
9949 Arm_relocate_functions::movw_prel_nc,
9950 Arm_relocate_functions::thm_movt_abs,
9951 Arm_relocate_functions::movt_prel,
9952 Arm_relocate_functions::thm_movw_prel_nc,
9953 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
9954 (Target_arm::Relocate::relocate): Only decompose address into two
9955 parts if relocation type uses the thumb-bit and pass the actual
9956 bit instead of a flag indicating that the thumb-bit is used. Adjust
9957 calls to methods in Arm_relocate_functions for this change.
9958
1276bc89 99592009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
9960
9961 PR 10925
9962 * reloc.cc: Instantiate
9963 Sized_relobj::initialize_input_to_output_maps and
9964 Sized_relobj:free_input_to_output_maps.
9965
e53ad1b5
ILT
99662009-11-06 Ian Lance Taylor <iant@google.com>
9967
9968 PR 10876
9969 * defstd.cc (in_segment): Set only_if_ref true for "end".
9970
eb44217c
DK
99712009-11-06 Doug Kwan <dougkwan@google.com>
9972
9973 * arm.cc (class Reloc_stub): Correct a comment.
9974 (Target_arm::Target_arm): Initialize arm_input_section_map_.
9975 (Target_arm::scan_section_for_stubs): New method declaration.
9976 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
9977 Change methods from private to protected.
9978 (Target_arm::do_may_relax): New method definition.
9979 (Target_arm::do_relax, Target_arm::group_sections,
9980 Target_arm::scan_reloc_for_stub,
9981 Target_arm::scan_reloc_section_for_stubs): New method declarations.
9982 (Target_arm::arm_input_section_map_): New data member declaration.
9983 (Target_arm::scan_reloc_for_stub,
9984 Target_arm::scan_reloc_section_for_stubs,
9985 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
9986 Target_arm::do_relax): New method definitions.
9987
5d329b7d
ILT
99882009-11-06 Mikolaj Zalewski <mikolaj@google.com>
9989
9990 * configure.ac: Check for (struct stat)::st_mtim
9991 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
9992 * config.in: Regenerate.
9993 * configure: Regenerate.
9994
96a0d71b
ILT
99952009-11-05 Ian Lance Taylor <iant@google.com>
9996
9997 PR 10910
9998 * output.cc (Output_segment::add_output_section): Add missing
9999 return statement.
10000
594c8e5e
ILT
100012009-11-04 Ian Lance Taylor <iant@google.com>
10002
10003 PR 10880
10004 * object.h (class Object): Add is_needed and set_is_needed
10005 methods. Add is_needed_ field. Make bool fields into bitfields.
10006 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10007 defined in a dynamic object and referenced by a regular object,
10008 set is_needed for the dynamic object.
10009 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10010 if the file is marked with as_needed and it is not needed.
10011
22b127cc
ILT
100122009-11-04 Ian Lance Taylor <iant@google.com>
10013
10014 PR 10887
10015 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10016 tags if data is discarded by linker script.
10017 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10018 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10019 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10020 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10021
f5c870d2
ILT
100222009-11-04 Ian Lance Taylor <iant@google.com>
10023
10024 * layout.cc (Layout::get_output_section): Add is_interp and
10025 is_dynamic_linker_section parameters. Change all callers.
10026 (Layout::choose_output_section): Likewise.
10027 (Layout::make_output_section): Likewise.
10028 (Layout::add_output_section_data): Add is_dynamic_linker_section
10029 parameter. Change all callers.
10030 * layout.h (class Layout): Update declarations.
10031 * output.h (class Output_section): Add is_interp, set_is_interp,
10032 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10033 Add is_interp_, is_dynamic_linker_section_ fields. Change
10034 generate_code_fills_at_write_ to a bitfield.
10035 * output.cc (Output_section::Output_sections): Initialize new
10036 fields.
10037 (Output_segment::add_output_section): Add do_sort parameter.
10038 Change all callers.
10039
1ae4d23b
ILT
100402009-11-03 Ian Lance Taylor <iant@google.com>
10041
10042 PR 10860
10043 * options.h (class General_options): Add --warn-common.
10044 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10045 merging two common symbols.
10046 (Symbol_table::should_override): Handle --warn-common when merging
10047 a common symbol with a defined symbol. Use report_resolve_problem
10048 for multiple definitions.
10049 (Symbol_table::report_resolve_problem): New function.
10050 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10051
55da9579
DK
100522009-11-03 Doug Kwan <dougkwan@google.com>
10053
10054 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10055 stub_factory_.
10056 (Target_arm::stub_factory): New method definition.
10057 (Target_arm::new_arm_input_section,
10058 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10059 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10060 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10061 New type definitions.
10062 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10063 member declarations.
10064 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10065 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10066 New method definitions.
10067
37a9ac43
ILT
100682009-11-03 Ian Lance Taylor <iant@google.com>
10069
10070 * options.h (class General_options): Add --warn_constructors.
10071
b3d6a3d4
ILT
100722009-11-03 Ian Lance Taylor <iant@google.com>
10073
10074 PR 10893
10075 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10076 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10077
934b01dd
ILT
100782009-11-03 Ian Lance Taylor <iant@google.com>
10079
10080 PR 10895
10081 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10082 --msgid-bugs-address.
10083 (install-pdf): New target.
10084 (install-data_yes): Look up one directory to find mkinstalldirs.
10085
03c1939b
L
100862009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10087
10088 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10089 tree.
10090
ebd95253
DK
100912009-10-30 Doug Kwan <dougkwan@google.com>
10092
10093 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10094
e9bbb538
DK
100952009-10-30 Doug Kwan <dougkwan@google.com>
10096
10097 * arm.cc (Stub_addend_reader): New struct template definition
10098 and partial specializations.
10099 (Stub_addend_reader::operator()): New method definition for a
10100 partially specialized template.
10101
d5b40221
DK
101022009-10-30 Doug Kwan <dougkwan@google.com>
10103
10104 * arm.cc (Arm_relobj::processor_specific_flags): New method
10105 definition.
10106 (Arm_relobj::do_read_symbols): New method declaration.
10107 (Arm_relobj::processor_specific_flags_): New data member declaration.
10108 (Arm_dynobj): New class definition.
10109 (Target_arm::do_finalize_sections): Add input_objects parameter.
10110 (Target_arm::do_adjust_elf_header): New method declaration.
10111 (Target_arm::are_eabi_versions_compatible,
10112 (Target_arm::merge_processor_specific_flags): New method declaration.
10113 (Target_arm::do_make_elf_object): New overloaded method definitions
10114 and declaration.
10115 (Arm_relobj::do_read_symbols): New method definition.
10116 (Arm_dynobj::do_read_symbols): Ditto.
10117 (Target_arm::do_finalize_sections): Add input_objects parameters.
10118 Merge processor-specific flags from all input objects.
10119 (Target_arm::are_eabi_versions_compatible,
10120 Target_arm::merge_processor_specific_flags,
10121 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10122 New method definitions.
10123 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10124 Input_objects pointer type parameter.
10125 * layout.cc (Layout::finalize): Pass input objects to target's.
10126 finalize_sections function.
10127 * output.cc (Output_file_header::do_sized_write): Set ELF file
10128 header's processor-specific flags.
10129 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10130 Input_objects pointer type parameter.
10131 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10132 * target.h (Input_objects): New forward class declaration.
10133 (Target::processor_specific_flags,
10134 Target::are_processor_specific_flags_sect): New method definitions.
10135 (Target::finalize_sections): Add input_objects parameter.
10136 (Target::Target): Initialize processor_specific_flags_ and
10137 are_processor_specific_flags_set_.
10138 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10139 parameter.
10140 (Target::set_processor_specific_flags): New method definition.
10141 (Target::processor_specific_flags_,
10142 Target::are_processor_specific_flags_set_): New data member
10143 declarations.
10144 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10145 Input_objects pointer type parameter.
10146
ebabffbd
DK
101472009-10-30 Doug Kwan <dougkwan@google.com>
10148
10149 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10150
ad0f2072
ILT
101512009-10-28 Ian Lance Taylor <iant@google.com>
10152
10153 * object.h (class Relobj): Drop options parameter from
10154 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10155 do_scan_relocs, do_relocate. Change all callers.
10156 (class Sized_relobj): Drop options parameters from
10157 do_gc_process_relocs, do_scan_relocs, do_relocate,
10158 do_relocate_sections, relocate_sections, emit_relocs_scan,
10159 emit_relocs_scan_reltype. Change all callers.
10160 (struct Relocate_info): Remove options field and all references to
10161 it.
10162 * reloc.h (class Read_relocs): Remove options constructor
10163 parameter and options_ field. Change all callers.
10164 (class Gc_process_relocs, class Scan_relocs): Likewise.
10165 (class Relocate_task): Likewise.
10166 * target-reloc.h (scan_relocs): Remove options parameter. Change
10167 all callers.
10168 (scan_relocatable_relocs): Likewise.
10169 * target.h (class Sized_target): Remove options parameter from
10170 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10171 all callers.
10172 * gc.h (gc_process_relocs): Remove options parameter. Change all
10173 callers.
10174 * arm.cc: Update functions to remove options parameters.
10175 * i386.cc: Likewise.
10176 * powerpc.cc: Likewise.
10177 * sparc.cc: Likewise.
10178 * x86_64.cc: Likewise.
10179 * testsuite/testfile.cc: Likewise.
10180
8ffa3667
DK
101812009-10-28 Doug Kwan <dougkwan@google.com>
10182
10183 * arm.cc (Arm_relobj): New class definition.
e1df38aa 10184 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
10185 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10186 New method definitions.
10187
40f36857
CC
101882009-10-28 Cary Coutant <ccoutant@google.com>
10189
10190 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10191 (Plugin::cleanup_done_): New member.
10192 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10193 (Plugin_manager::cleanup_done_): Remove.
10194 (Plugin_manager::add_input_file): Edit error message.
10195 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10196 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10197
2c849493
ILT
101982009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10199
10200 * fileread.cc: (File_read::View::~View): Use the new
10201 data_ownership_ filed.
10202 (File_read::~File_read): Dispose the new whole_file_view_.
10203 (File_read::open): Mmap the whole file if needed.
10204 (File_read::open): Use whole_file_view_ instead of contents_.
10205 (File_read::find_view): Use whole_file_view_ if applicable.
10206 (File_read::do_read): Use whole_file_view_ instead of contents_.
10207 (File_read::make_view): Use whole_file_view_ instead of contents_,
10208 update File_read::View::View call.
10209 (File_read::find_or_make_view): Update File_read::View::View
10210 call.
10211 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10212 remove contents_
10213 (File_read::View::Data_ownership): New enum.
10214 (File_read::View::View): Replace bool mapped_ with Data_ownership
10215 argument.
10216 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10217 (File_read::View::data_ownership_): New field.
10218 (File_read::contents_): Remove (replaced by whole_file_view_).
10219 (File_read::whole_file_view_): New field.
10220 * options.h (class General_options): Add --keep-files-mapped.
10221
24998053
CC
102222009-10-27 Cary Coutant <ccoutant@google.com>
10223
10224 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10225 * testsuite/Makefile.am (plugin_test_5): New test case.
10226 * testsuite/Makefile.in: Regenerate.
10227
72adc4fa
DK
102282009-10-25 Doug Kwan <dougkwan@google.com>
10229
10230 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10231 from private to protected to allow access by child class.
10232 (Sized_relobj::do_relocate_sections): New method declaration.
10233 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 10234 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
10235 Sized_relobj::relocate_sections. Instantiate template explicitly
10236 for different target sizes and endianity.
10237
07f508a2
DK
102382009-10-24 Doug Kwan <dougkwan@google.com>
10239
10240 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10241 (Arm_input_section::as_arm_input_section): New method.
10242 (Arm_output_section): New class definition.
10243 (Arm_output_section::create_stub_group,
10244 Arm_output_section::group_sections): New method definitions.
10245
10ad9fe5
DK
102462009-10-22 Doug Kwan <dougkwan@google.com>
10247
10248 * arm.cc (Arm_input_section): New class definition.
10249 (Arm_input_section::init, Arm_input_section:do_write,
10250 Arm_input_section::set_final_data_size,
10251 Arm_input_section::do_reset_address_and_file_offset): New method
10252 definitions.
10253
56ee5e00
DK
102542009-10-21 Doug Kwan <dougkwan@google.com>
10255
10256 * arm.cc (Stub_table, Arm_input_section): New forward class
10257 declarations.
10258 (Stub_table): New class defintion.
10259 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10260 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10261 New method definition.
10262
b569affa
DK
102632009-10-21 Doug Kwan <dougkwan@google.com>
10264
10265 * arm.cc: Update copyright comments.
10266 (Target_arm): New forward class template declaration.
10267 (Arm_address): New type.
10268 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10269 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10270 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10271 constants.
10272 (Insn_template): Same.
10273 (DEF_STUBS): New macro.
10274 (Stub_type): New enum type.
10275 (Stub_template): New class definition.
10276 (Stub): Same.
10277 (Reloc_stub): Same.
10278 (Stub_factory): Same.
10279 (Target_arm::Target_arm): Initialize may_use_blx_ and
10280 should_force_pic_veneer_.
10281 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10282 Target_arm::should_force_pic_veneer,
10283 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10284 Target_arm::using_thumb_only, Target_arm:;default_target): New
10285 method defintions.
10286 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10287 New data member declarations.
10288 (Insn_template::size, Insn_template::alignment): New method defintions.
10289 (Stub_template::Stub_template): New method definition.
10290 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10291 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10292 (Stub_factory::Stub_factory): New method definition.
10293 * gold.h (string_hash): New template.
10294 * output.h (Input_section_specifier::hash_value): Use
10295 gold::string_hash.
10296 (Input_section_specifier::string_hash): Remove.
10297 * stringpool.cc (Stringpool_template::string_hash): Use
10298 gold::string_hash.
10299
6c172549
DK
103002009-10-20 Doug Kwan <dougkwan@google.com>
10301
10302 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10303 symbols of relaxed input sections.
10304 * output.h (Output_section::find_relaxed_input_section): Make
10305 method public.
10306
c5617f2f
DK
103072009-10-16 Doug Kwan <dougkwan@google.com>
10308
10309 * dynobj.cc (Versions::Versions): Initialize version_script_.
10310 Only insert base version symbol definition for a shared object
10311 if version script defines any version versions.
10312 (Versions::define_base_version): New method definition.
10313 (Versions::add_def): Check that base version is not needed.
10314 (Versions::add_need): Define base version lazily.
10315 * dynobj.h (Versions::define_base_version): New method declaration.
10316 (Versions::needs_base_version_): New data member declaration.
10317 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10318 (check_DATA): Add no_version_test.stdout.
10319 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10320 New make rules.
10321 * testsuite/Makefile.in: Regenerate.
10322 * testsuite/no_version_test.c: New file.
10323 * testsuite/no_version_test.sh: Ditto.
10324
3c12dcdb
DK
103252009-10-16 Doug Kwan <dougkwan@google.com>
10326
10327 * expression.cc (class Segment_start_expression): New class definition.
10328 (Segment_start_expression::value): New method definition.
10329 (script_exp_function_segment_start): Return a new
10330 Segment_start_expression.
10331 * gold/script-c.h (script_saw_segment_start_expression): New function
10332 prototype.
10333 * script-sections.cc (Script_sections::Script_sections): Initialize
10334 SAW_SEGMENT_START_EXPRESSION_ to false.
10335 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10336 and -Tbbs options to specify section addresses if given in
10337 command line and no SEGMENT_START expression is seen in a script.
10338 * script-sections.h (Script_sections::saw_segment_start_expression,
10339 Script_sections::set_saw_segment_start_expression): New method
10340 definition.
10341 (Script_sections::saw_segment_start_expression_): New data member
10342 declaration.
10343 * script.cc (script_saw_segment_start_expression): New function.
10344 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10345 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10346 script_test_7.sh and script_test_8.sh.
10347 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10348 script_test_8.stdout.
10349 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10350 (script_test_6, script_test_6.stdout, script_test_7,
10351 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10352 * Makefile.in: Regenerate.
10353 * testsuite/script_test_6.sh: New file.
10354 * testsuite/script_test_6.t: Same.
10355 * testsuite/script_test_7.sh: Same.
10356 * testsuite/script_test_7.t: Same.
10357 * testsuite/script_test_8.sh: Same.
10358
64b1ae37
DK
103592009-10-16 Doug Kwan <dougkwan@google.com>
10360
10361 * output.cc (Output_segment::set_section_list_address): Cast
10362 expressions to unsigned long long type to avoid format warnings.
10363
661be1e2
ILT
103642009-10-15 Ian Lance Taylor <iant@google.com>
10365
12edd763 10366 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 10367 dot assignment to script_sections_.
12edd763
ILT
10368 * script-sections.cc (Script_sections::add_dot_assignment):
10369 Initialize if necessary.
10370
68b6574b
ILT
10371 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10372 program headers with no load segment if there is a linker script.
10373
661be1e2
ILT
10374 * layout.cc (Layout::set_segment_offsets): Align the file offset
10375 to the segment aligment for -N or -n with no load segment.
10376 * output.cc (Output_segment::add_output_section): Don't crash if
10377 the first section is a TLS section.
10378 (Output_segment::set_section_list_addresses): Print an error
10379 message if the address moves backward in a linker script.
10380 * script-sections.cc
10381 (Output_section_element_input::set_section_addresses): Don't
10382 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10383 (Orphan_output_section::set_section_addresses): Likewise.
10384
f15f61a7
DK
103852009-10-15 Doug Kwan <dougkwan@google.com>
10386
10387 * layout.cc (Layout::finish_dynamic_section): Generate tags
10388 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10389 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10390 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10391
82bb573a
ILT
103922009-10-14 Ian Lance Taylor <iant@google.com>
10393
10394 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10395 fields.
10396 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10397 data_shdr fields of relinfo.
10398 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10399 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10400 R_386_TLS_LDO_32, adjust based on section flags.
10401 (Target_i386::Relocate::fix_up_ldo): Remove.
10402
374ad285
ILT
104032009-10-13 Ian Lance Taylor <iant@google.com>
10404
10405 Add support for -pie.
10406 * options.h (class General_options): Add -pie and
10407 --pic-executable.
10408 (General_options::output_is_position_independent): Test -pie.
10409 (General_options::output_is_executable): Return true if not shared
10410 and not relocatable.
10411 (General_options::output_is_pie): Remove.
10412 * options.cc (General_options::finalize): Reject incompatible uses
10413 of -pie.
10414 * gold.cc (queue_middle_tasks): A -pie link is not static.
10415 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10416 * symtab.cc (Symbol::final_value_is_known): Return false if
10417 output_is_position_independent.
10418 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10419 output_is_position_independent.
10420 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10421 output_is_position_independent.
10422 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10423 output_is_position_independent.
10424 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10425 two_file_pie_test.
10426 (basic_pie_test.o, basic_pie_test): New targets.
10427 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10428 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10429 (two_file_pie_test): New target.
10430 * testsuite/Makefile.in: Rebuild.
10431 * README: Remove note saying that -pie is not supported.
10432
c6585162
ILT
104332009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10434
10435 * options.h (class General_options): Add -init and -fini.
10436 * layout.cc (Layout::finish_dynamic_section): Emit
10437 given init and fini functions.
10438
032ce4e9
ST
104392009-10-13 Sriraman Tallam <tmsriram@google.com>
10440
10441 * gc.h (gc_process_relocs): Check if icf is enabled using new
10442 function.
10443 * gold.cc (queue_initial_tasks): Likewise.
10444 (queue_middle_tasks): Likewise.
10445 * object.cc (do_layout): Likewise.
10446 * symtab.cc (is_section_folded): Likewise.
10447 * main.cc (main): Likewise.
10448 * reloc.cc (Read_relocs::run): Likewise.
10449 (Sized_relobj::do_scan_relocs): Likewise.
10450 * icf.cc (is_function_ctor_or_dtor): New function.
10451 (Icf::find_identical_sections): Check if function is ctor or dtor when
10452 safe icf is chosen.
10453 * options.h (General_options::icf): Change option to be an enum.
10454 (Icf_status): New enum.
10455 (icf_enabled): New method.
10456 (icf_safe_folding): New method.
10457 (set_icf_status): New method.
10458 (icf_status_): New variable.
10459 * (options.cc) (General_options::finalize): Set icf_status_.
10460 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10461 icf_test and icf_keep_unique_test to use the --icf enum flag.
10462 * testsuite/icf_safe_test.sh: New file.
e1df38aa 10463 * testsuite/icf_safe_test.cc: New file.
032ce4e9 10464
f345227a
ST
104652009-10-12 Sriraman Tallam <tmsriram@google.com>
10466
10467 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10468 includes to gc.h and icf.h.
10469 * arm.cc: Include gc.h.
10470 * gold.cc: Likewise.
10471 * i386.cc: Likewise.
10472 * powerpc.cc: Likewise.
10473 * sparc.cc: Likewise.
10474 * x86_64.cc: Likewise.
10475 * gc.h: Include icf.h.
10476
1c7814ed
ILT
104772009-10-11 Ian Lance Taylor <iant@google.com>
10478
10479 * plugin.cc: Include "gold.h" before other header files.
10480
ae3b5189
CD
104812009-10-10 Chris Demetriou <cgd@google.com>
10482
10483 * options.h (Input_file_argument::Input_file_type): New enum.
10484 (Input_file_argument::is_lib_): Replace with...
10485 (Input_file_argument::type_): New member.
10486 (Input_file_argument::Input_file_argument): Take Input_file_type
10487 'type' rather than boolean 'is_lib' as second argument.
10488 (Input_file_argument::is_lib): Use type_.
10489 (Input_file_argument::is_searched_file): New function.
10490 (Input_file_argument::may_need_search): Handle is_searched_file.
10491 * options.cc (General_options::parse_library): Support -l:filename.
10492 (General_options::parse_just_symbols): Update for Input_file_argument
10493 changes.
10494 (Command_line::process): Likewise.
10495 * archive.cc (Archive::get_file_and_offset): Likewise.
10496 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10497 * script.cc (read_script_file, script_add_file): Likewise.
10498 * fileread.cc (Input_file::Input_file): Likewise.
10499 (Input_file::will_search_for): Handle is_searched_file.
10500 (Input_file::open): Likewise.
10501 * readsyms.cc (Read_symbols::get_name): Likewise.
10502 * testsuite/Makefile.am (searched_file_test): New test.
10503 * testsuite/Makefile.in: Regenerate.
10504 * testsuite/searched_file_test.cc: New file.
10505 * testsuite/searched_file_test_lib.cc: New file.
10506
f3048a1d
ILT
105072009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10508 Ian Lance Taylor <iant@google.com>
10509
10510 * descriptor.cc: Include <cstdio> and "binary-io.h".
10511 (Descriptors::open): Open the files in binary mode always.
10512 * script.cc (Lex::get_token): Treat \r as whitespace.
10513
d4780e57
ILT
105142009-10-09 Ian Lance Taylor <iant@google.com>
10515
10516 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10517
d9a893b8
ILT
105182009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10519 Ian Lance Taylor <iant@google.com>
10520
10521 * configure.ac: Check for readv function also.
10522 * fileread.cc (readv): Define if not HAVE_READV.
10523 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10524 does not exist.
10525 * config.in: Regenerate.
10526 * configure: Regenerate.
10527
c0a62865
DK
105282009-10-09 Doug Kwan <dougkwan@google.com>
10529
10530 * layout.cc (Layout::make_output_section): Call target hook to make
10531 ordinary output section.
10532 (Layout::finalize): Adjust parameter list of call the
10533 Target::may_relax().
10534 * layout.h (class Layout::section_list): New method.
10535 * merge.h (Output_merge_base::entsize): Change visibility to public.
10536 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10537 New methods.
10538 (Output_merge_string::do_is_string): New method.
10539 * object.cc (Sized_relobj::do_setup): renamed from
10540 Sized_relobj::set_up.
10541 * object.h (Sized_relobj::adjust_shndx,
10542 Sized_relobj::initializ_input_to_output_maps,
10543 Sized_relobj::free_input_to_output_maps): Change visibilities to
10544 protected.
10545 (Sized_relobj::setup): Virtualize.
10546 (Sized_relobj::do_setup): New method declaration.
10547 (Sized_relobj::invalidate_section_offset,
10548 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10549 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10550 * options.cc (parse_int): New function.
10551 * options.h (parse_int): New declaration.
10552 (DEFINE_int): New macro.
10553 (stub_group_size): New option.
10554 * output.cc (Output_section::Output_section): Initialize memebers
10555 merge_section_map_, merge_section_by_properties_map_,
10556 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10557 (Output_section::add_input_section): Handled deferred code-fill
10558 generation and remove an old comment.
10559 (Output_section::add_relaxed_input_section): New method definition.
10560 (Output_section::add_merge_input_section): Use merge section by
10561 properties map to speed to search. Update merge section maps
10562 as appropriate.
10563 (Output_section::build_relaxation_map): New method definition.
10564 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10565 Same.
10566 (Output_section::relax_input_section): Renamed to
10567 Output_section::convert_input_sections_to_relaxed_sections and change
10568 interface to take a vector of pointers to relaxed sections.
10569 (Output_section::find_merge_section,
10570 Output_section::find_relaxed_input_section): New method definitions.
10571 (Output_section::is_input_address_mapped,
10572 Output_section::output_offset, Output_section::output_address):
10573 Use output section data maps to speed up searching.
10574 (Output_section::find_starting_output_address): Add comments.
10575 (Output_section::do_write,
10576 Output_section::write_to_postprocessing_buffer): Do code-fill
10577 generation as appropriate.
10578 (Output_section::get_input_sections): Invalidate relaxed input section
10579 map.
10580 (Output_section::restore_states): Adjust type of checkpoint .
10581 Invalidate relaxed input section map.
10582 * output.h (Output_merge_base): New class declaration.
10583 (Input_section_specifier): New class defintion.
10584 (class Output_relaxed_input_section) Change base class to
10585 Output_section_data_build.
10586 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10587 base class initializer.
10588 (Output_section::add_relaxed_input_section): New method declaration.
10589 (Output_section::Input_section): Change visibility to protected.
2e702c99 10590 (Output_section::Input_section::relobj,
c0a62865
DK
10591 Output_section::Input_section::shndx): Handle relaxed input sections.
10592 Output_section::input_sections) Change visibility to protected. Also
10593 define overload to return a non-const pointer.
10594 (Output_section::Merge_section_properties): New class defintion.
10595 (Output_section::Merge_section_by_properties_map,
10596 Output_section::Output_section_data_by_input_section_map,
10597 Output_section::Relaxation_map): New types.
10598 (Output_section::relax_input_section): Rename method to
10599 Output_section::convert_input_sections_to_relaxed_sections and change
10600 interface to take a vector of relaxed section pointers.
10601 (Output_section::find_merge_section,
10602 Output_section::find_relaxed_input_section,
10603 Output_section::build_relaxation_map,
10604 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10605 New method declarations.
10606 (Output_section::merge_section_map_
10607 Output_section::merge_section_by_properties_map_,
10608 Output_section::relaxed_input_section_map_,
10609 Output_section::is_relaxed_input_section_map_valid_,
10610 Output_section::generate_code_fills_at_write_): New data members.
10611 * script-sections.cc
10612 (Output_section_element_input::set_section_addresses): Call
10613 current_data_size and addralign methods of relaxed input sections.
10614 (Orphan_output_section::set_section_addresses): Call current_data_size
10615 and addralign methods of relaxed input sections.
10616 * symtab.cc (Symbol_table::compute_final_value): Extract template
10617 from the body of Symbol_table::sized_finalize_symbol.
10618 (Symbol_table::sized_finalized_symbol): Call
10619 Symbol_table::compute_final_value.
10620 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10621 (Symbol_table::compute_final_value): New templated method declaration.
10622 * target.cc (Target::do_make_output_section): New method defintion.
10623 * target.h (Target::make_output_section): New method declaration.
10624 (Target::relax): Add more parameters for input objects, symbol table
10625 and layout. Adjust call to do_relax.
10626 (Target::do_make_output_section): New method declaration.
10627 (Target::do_relax): Add parameters for input objects, symbol table
10628 and layout.
10629
d446d6c4
ILT
106302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10631
10632 * pread.c: Include stdio.h.
10633
bc06c745
ILT
106342009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10635
10636 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10637 defined.
10638
75aea3d0
ILT
106392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10640
10641 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10642 Change read_shndx type to unsigned int.
10643 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10644 int.
10645 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10646 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10647 Change read_shndx type to unsigned int.
10648 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10649 int.
10650 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10651 * layout.cc (Layout::create_symtab_sections): Cast the result of
10652 local_symcount * symsize to off_t in the gold_assert.
10653
be8fcb75
ILT
106542009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10655
10656 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10657 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10658 R_ARM_BASE_ABS.
10659 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10660 (Arm_relocate_functions::thm_abs5): New function.
10661 (Arm_relocate_functions::abs12): New function.
10662 (Arm_relocate_functions::abs16): New function.
10663 (Arm_relocate_functions::base_abs): New function.
10664 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10665 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10666 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10667 R_ARM_BASE_ABS.
10668 (Scan::global): Likewise.
10669 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10670 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10671 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10672 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10673 R_ARM_BASE_ABS.
10674
c2a122b6
ILT
106752009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10676
10677 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10678 (Arm_relocate_functions::movt_prel): New function.
10679 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10680 (Arm_relocate_functions::thm_movt_prel): New function.
10681 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10682 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10683 (Scan::global, Relocate::relocate): Likewise.
10684 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10685
c4aa1e2d
ILT
106862009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10687
10688 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10689 Incremental_checker.
10690 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10691 unsigned int.
10692 (class Incremental_inputs_header): New class.
10693 (Incremental_inputs_header_writer): Edit comment.
10694 (Incremental_inputs_entry): New class.
10695 (Incremental_inputs_entry_writer): Edit comment.
10696 (Sized_incremental_binary::do_find_incremental_inputs_section):
10697 Add *strtab_shndx parameter, fill it.
10698 (Sized_incremental_binary::do_check_inputs): New method.
10699 (Incremental_checker::can_incrementally_link_output_file): Use
10700 Sized_incremental_binary::check_inputs.
10701 (Incremental_inputs::report_command_line): Save command line in
10702 command_line_.
10703 * incremental.h:
10704 (Incremental_binary::find_incremental_inputs_section): New
10705 method.
10706 (Incremental_binary::do_find_incremental_inputs_section): Add
10707 strtab_shndx parameter.
10708 (Incremental_binary::do_check_inputs): New pure virtual method.
10709 (Sized_incremental_binary::do_check_inputs): Declare.
10710 (Incremental_checker::Incremental_checker): Add incremental_inputs
10711 parameter, use it to initialize incremental_inputs_.
10712 (Incremental_checker::incremental_inputs_): New field.
10713 (Incremental_checker::command_line): New method.
10714 (Incremental_checker::inputs): New method.
10715 (Incremental_checker::command_line_): New field.
10716
c549a694
ILT
107172009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10718
10719 * incremental.cc: Include <cstdarg> and "target-select.h".
10720 (vexplain_no_incremental): New function.
10721 (explain_no_incremental): New function.
10722 (Incremental_binary::error): New method.
10723 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10724 method.
10725 (make_sized_incremental_binary): New function.
10726 (open_incremental_binary): New function.
10727 (can_incrementally_link_file): Add checks if output is ELF and has
10728 inputs section.
10729 * incremental.h: Include "elfcpp_file.h" and "output.h".
10730 (Incremental_binary): New class.
10731 (Sized_incremental_binary): New class.
10732 (open_incremental_binary): Declare.
10733 * object.cc (is_elf_object): Use
10734 elfcpp::Elf_recognizer::is_elf_file.
10735 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10736 * output.h (Output_file::filesize): New method.
10737
fd3c5f0b
ILT
107382009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10739
10740 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10741 New function.
10742 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10743 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10744 function.
10745 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10746 function.
10747 (Arm_relocate_functions::movw_abs_nc): New function.
10748 (Arm_relocate_functions::movt_abs): New function.
10749 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10750 (Arm_relocate_functions::thm_movt_abs): New function.
10751 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10752 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10753 (Scan::global): Likewise.
10754 (Relocate::relocate): Likewise.
10755 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10756
7f5309a5
ILT
107572009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10758
10759 * arm.cc (Arm_relocate_functions::got_prel) New function.
10760 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10761 (Relocate::relocate): Likewise.
10762 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10763
364c7fa5
ILT
107642009-10-06 Ian Lance Taylor <iant@google.com>
10765
10766 * options.h (class General_options): Define
10767 split_stack_adjust_size parameter.
10768 * object.h (class Object): Add uses_split_stack_ and
10769 has_no_split_stack_ fields. Add uses_split_stack and
10770 has_no_split_stack accessor functions. Declare
10771 handle_split_stack_section.
10772 (class Reloc_symbol_changes): Define.
10773 (class Sized_relobj): Define Function_offsets. Declare
10774 split_stack_adjust, split_stack_adjust_reltype, and
10775 find_functions.
10776 * object.cc (Object::handle_split_stack_section): New function.
10777 (Sized_relobj::do_layout): Call handle_split_stack_section.
10778 * dynobj.cc (Sized_dynobj::do_layout): Call
10779 handle_split_stack_section.
10780 * reloc.cc (Sized_relobj::relocate_sections): Call
10781 split_stack_adjust for executable sections in split_stack
10782 objects. Pass reloc_map to relocate_section.
10783 (Sized_relobj::split_stack_adjust): New function.
10784 (Sized_relobj::split_stack_adjust_reltype): New function.
10785 (Sized_relobj::find_functions): New function.
10786 * target-reloc.h: Include "object.h".
10787 (relocate_section): Add reloc_symbol_changes parameter. Change
10788 all callers.
10789 * target.h (class Target): Add calls_non_split method. Declare
10790 do_calls_non_split virtual method. Declare match_view and
10791 set_view_to_nop.
10792 * target.cc: Include "elfcpp.h".
10793 (Target::do_calls_non_split): New function.
10794 (Target::match_view): New function.
10795 (Target::set_view_to_nop): New function.
10796 * gold.cc (queue_middle_tasks): Give an error if mixing
10797 split-stack and non-split-stack objects with -r.
10798 * i386.cc (Target_i386::relocate_section): Add
10799 reloc_symbol_changes parameter.
10800 (Target_i386::do_calls_non_split): New function.
10801 * x86_64.cc (Target_x86_64::relocate_section): Add
10802 reloc_symbol_changes parameter.
10803 (Target_x86_64::do_calls_non_split): New function.
10804 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10805 parameter.
10806 * powerpc.cc (Target_powerpc::relocate_section): Add
10807 reloc_symbol_changes parameter.
10808 * sparc.cc (Target_sparc::relocate_section): Add
10809 reloc_symbol_changes parameter.
10810 * configure.ac: Call AM_CONDITIONAL for the default target.
10811 * configure: Rebuild.
10812 * testsuite/Makefile.am (TEST_AS): New variable.
10813 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10814 (check_DATA): Add split_i386 and split_x86_64 files.
10815 (SPLIT_DEFSYMS): Define.
10816 (split_i386_[1234n].o): New targets.
10817 (split_i386_[124]): New targets.
10818 (split_i386_[1234r].stdout): New targets.
10819 (split_x86_64_[1234n].o): New targets.
10820 (split_x86_64_[124]): New targets.
10821 (split_x86_64_[1234r].stdout): New targets.
10822 (MOSTLYCLEANFILES): Add new executables.
10823 * testsuite/split_i386.sh: New file.
10824 * testsuite/split_x86_64.sh: New file.
10825 * testsuite/split_i386_1.s: New file.
10826 * testsuite/split_i386_2.s: New file.
10827 * testsuite/split_i386_3.s: New file.
10828 * testsuite/split_i386_4.s: New file.
10829 * testsuite/split_i386_n.s: New file.
10830 * testsuite/split_x86_64_1.s: New file.
10831 * testsuite/split_x86_64_2.s: New file.
10832 * testsuite/split_x86_64_3.s: New file.
10833 * testsuite/split_x86_64_4.s: New file.
10834 * testsuite/split_x86_64_n.s: New file.
10835 * testsuite/testfile.cc (Target_test): Update relocation_section
10836 function.
10837 * testsuite/Makefile.in: Rebuild.
10838
e8a9fcda
ILT
108392009-10-06 Ian Lance Taylor <iant@google.com>
10840
10841 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
10842 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
10843 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
10844 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
10845 the address on ldo_addrs_.
10846 (Target_i386::Relocate::fix_up_ldo): New function.
10847
e99daf92
ILT
108482009-10-06 Rafael Espindola <espindola@google.com>
10849
10850 * plugin.cc (add_input_library): New.
10851 (Plugin::load): Add add_input_library to tv.
10852 (Plugin_manager::add_input_file): Add the is_lib argument.
10853 (add_input_file): Update call to Plugin_manager::add_input_file.
10854 (add_input_library): New.
10855 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
10856
966d4097
DK
108572009-09-30 Doug Kwan <dougkwan@google.com>
10858
10859 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
10860 symbol and call Symbol::may_need_copy_reloc to determine if
10861 a copy reloc is needed.
10862 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
10863 nocopyreloc is given in command line.
10864 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
10865 given in command line.
10866 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
10867 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
10868 of the removed Target_i386::may_need_copy_reloc.
10869 * options.h (copyreloc): New option with default value false.
10870 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10871 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
10872 instead of the removed Target_powerpc::may_need_copy_reloc.
10873 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
10874 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
10875 instead of the removed Target_sparc::may_need_copy_reloc.
10876 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
10877 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
10878 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
10879 instead of the removed Target_x86_64::may_need_copy_reloc.
10880
029ba973
ILT
108812009-09-30 Ian Lance Taylor <iant@google.com>
10882
10883 * object.h (class Object): Remove target_ field, and target,
10884 sized_target, and set_target methods.
10885 (Object::sized_target): Remove.
10886 (class Sized_relobj): Update declarations. Remove sized_target.
10887 * object.cc (Sized_relobj::setup): Remove target parameter.
10888 Change all callers.
10889 (Input_objects::add_object): Don't do anything with the target.
10890 (make_elf_sized_object): Add punconfigured parameter. Change all
10891 callers. Set or test parameter target.
10892 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
10893 Change all callers.
10894 * parameters.cc (Parameters::set_target): Change parameter type to
10895 be non-const.
10896 (Parameters::default_target): Remove.
10897 (set_parameters_target): Change parameter type to be non-const.
10898 (parameters_force_valid_target): New function.
10899 (parameters_clear_target): New function.
10900 * parameters.h (class Parameters): Update declarations. Remove
10901 default_target method. Add sized_target and clear_target
10902 methods. Change target_ to be non-const.
10903 (set_parameters_target): Update declaration.
10904 (parameters_force_valid_target): Declare.
10905 (parameters_clear_target): Declare.
10906 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
10907 as NULL if we aren't searching.
10908 (Add_symbols::run): Don't check for compatible target.
10909 * fileread.cc (Input_file::open_binary): Call
10910 parameters_force_valid_target.
10911 * gold.cc (queue_middle_tasks): Likewise.
10912 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
10913 set_target on object.
10914 * dynobj.h (class Sized_dynobj): Update declarations.
10915 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
10916 make_elf_object returns NULL.
10917 (Archive::include_member): Don't check whether object target is
10918 compatible.
10919 * output.cc (Output_section::add_input_section): Get target from
10920 parameters.
10921 (Output_section::relax_input_section): Likewise.
10922 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
10923 parameters.
10924 (Sized_relobj::do_scan_relocs): Likewise.
10925 (Sized_relobj::relocate_sections): Likewise.
10926 * resolve.cc (Symbol_table::resolve): Likewise.
10927 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
10928 parameter. Change all callers.
10929 (Symbol_table::add_from_object): Get target from parameters.
10930 (Symbol_table::add_from_relobj): Don't check object target.
10931 (Symbol_table::add_from_dynobj): Likewise.
10932 (Symbol_table::define_special_symbol): Get target from
10933 parameters.
10934 * symtab.h (class Symbol_table): Update declaration.
10935 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
10936 parameter. Change all callers. Clear parameter target.
10937 (Binary_test): Test target here.
10938 * testsuite/object_unittest.cc (gold_testsuite): Remove
10939 target_test_pointer parameter. Change all callers.
10940 (Object_test): Test target here.
10941
a6a22b83
ILT
109422009-09-26 Ian Lance Taylor <iant@google.com>
10943
10944 * testsuite/initpri1.c: Don't try to use constructor priorities if
10945 compiling with gcc before 4.3.
10946
6a8f49fe
ILT
109472009-09-22 Mikolaj Zalewski <mikolajz@google.com>
10948
10949 * testsuite/retain_symbols_file_test.sh (check_present): Change
10950 output file name to retain_symbols_file_test.stdout.
10951 (check_absent): Likewise.
10952
8c604651
CS
109532009-09-18 Craig Silverstein <csilvers@google.com>
10954
10955 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
10956 * options.cc: Include <cerrno> and <fstream>.
10957 (General_options::finalize): Parse -retain-symbols-file tag.
10958 * options.h: New flag.
10959 (General_options): New method should_retain_symbol, new
10960 variable symbols_to_retain.
10961 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
10962 should_retain_symbol map.
10963 * testsuite/Makefile.am (retain_symbols_file_test): New test.
10964 * testsuite/Makefile.in: Regenerate.
10965 * testsuite/retain_symbols_file_test.sh: New file.
10966
ca58b19f
NC
109672009-09-18 Nick Clifton <nickc@redhat.com>
10968
10969 * po/es.po: Updated Spanish translation.
10970
20e6d0d6
DK
109712009-09-17 Doug Kwan <dougkwan@google.com>
10972
10973 * debug.h (DEBUG_RELAXATION): New constant.
10974 (DEBUG_ALL): Add DEBUG_RELAXATION.
10975 (debug_string_to_enum): Add relaxation debug option.
10976 * layout.cc
10977 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
10978 Layout::Relaxation_debug_check::read_sections,
10979 Layout::Relaxation_debug_check::read_sections): New method definitions.
10980 (Layout::Layout): Initialize data members
10981 record_output_section_data_from_scrips_,
10982 script_output_section_data_list_ and relaxation_debug_check_.
10983 (Layout::save_segments, Layout::restore_segments,
10984 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10985 Layout::relaxation_loop_body): New method definitions.
10986 (Layout::finalize): Support relaxation. Move section layout code to
10987 Layout::relaxation_loop_body.
10988 (Layout::set_asection_address_from_script): Move code for orphan
10989 section placement out.
10990 (Layout::place_orphan_sections_in_script): New method definition.
10991 * layout.h (Output_segment_headers, Output_file_header):
10992 New forward class declarations.
10993 (Layout::~Layout): Define.
10994 (Layout::new_output_section_data_from_script): New method definition.
10995 (Layout::place_orphan_sections_in_script): New method declaration.
10996 (Layout::Segment_states): New type declaration.
10997 (Layout::save_segments, Layout::restore_segments,
10998 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
10999 Layout::relaxation_loop_body): New method declarations.
11000 (Layout::Output_section_data_list): New type declaration.
11001 (Layout::Relaxation_debug_check): New class definition.
11002 (Layout::record_output_section_data_from_script_,
11003 Layout::script_output_section_data_list_, Layout::segment_states_,
11004 Layout::relaxation_debug_check_): New data members.
11005 * output.cc: (Output_section_headers::do_size): New method definition.
11006 (Output_section_headers::Output_section_headers): Move size
11007 computation to Output_section_headers::do_size.
11008 (Output_segment_headers::do_size): New method definition.
e1df38aa 11009 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11010 Output_file_header::do_size and call it.
11011 (Output_file_header::do_size): New method definition.
11012 (Output_data_group::Output_data_group): Adjust call to
11013 Output_section_data.
11014 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11015 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11016 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11017 RELAXED_INPUT_SECTION_CODE.
11018 (Output_section::Output_section): Initialize data member checkpoint_.
11019 (Output_section::~Output_section): Delete checkpoint object pointed
11020 by checkpoint_.
11021 (Output_section::add_input_section): Always add an Input_section if
11022 relaxing.
11023 (Output_section::add_merge_input_section): Add assert.
11024 (Output_section::relax_input_section): New method definition.
11025 (Output_section::set_final_data_size): Set load address to zero for
11026 an unallocated section.
11027 (Output_section::do_address_and_file_offset_have_reset_values):
11028 New method definition.
11029 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11030 Handle relaxed input section.
11031 (Output_section::sort_attached_input_sections): Checkpoint input
11032 section list lazily.
11033 (Output_section::get_input_sections): Change type of input_sections to
11034 list of Simple_input_section pointers. Checkpoint input section list
11035 lazily. Also handle relaxed input sections.
11036 (Output_section::add_input_section_for_script): Take a reference to
11037 a Simple_input_section object instead of Relobj pointer and section
11038 index as parameter. Handle relaxed input sections.
11039 (Output_section::save_states, Output_section::restore_states): New
11040 method definitions.
11041 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11042 (Output_data::is_data_size_fixed): New method definition.
11043 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11044 if it is fixed.
11045 (Output_data::address_and_file_offset_have_reset_values): New method
11046 definition.
11047 (Output_data::do_address_and_file_offset_have_reset_values): New method
11048 definition.
11049 (Output_data::set_data_size): Check that data size is not fixed.
11050 (Output_data::fix_data_size): New method definition.
11051 (Output_data::is_data_size_fixed_): New data member.
11052 (Output_section_headers::set_final_data_size): New method definition.
11053 (Output_section_headers::do_size): New method declaration.
11054 (Output_segment_headers::set_final_data_size): New method definition.
11055 (Output_segment_headers::do_size): New method declaration.
11056 (Output_file_header::set_final_data_size)::New method definition.
11057 (Output_file_header::do_size)::New method declaration.
11058 (Output_section_data::Output_section_data): Add new parameter
11059 is_data_size_fixed and use it to fix data size.
11060 (Output_data_const::Output_data_const): Adjust call to base class
11061 constructor and fix data size.
11062 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11063 base class constructor and fix data size.
11064 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11065 base class constructor and fix data size.
11066 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11067 class constructor and fix data size.
11068 (Output_data_group::set_final_data_size): New method definition.
11069 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11070 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11071 class constructor and fix data size.
11072 (Output_relaxed_input_section): New class definition.
11073 (Output_section::Simple_input_section): New class definition.
11074 (Output_section::get_input_sections): Adjust parameter list.
11075 (Output_section::add_input_section_for_script): Same.
11076 (Output_section::save_states, Output_section::restore_states,
11077 Output_section::do_address_and_file_offset_have_reset_values,
11078 (Output_section::Input_section::Input_section): Handle
11079 RELAXED_INPUT_SECTION_CODE. Add new overload for
11080 Output_relaxed_input_section.
11081 (Output_section::Input_section::is_input_section,
11082 Output_section::Input_section::set_output_section): Handle relaxed
11083 input section.
11084 (Output_section::Input_section::is_relaxed_input_section,
11085 Output_section::Input_section::output_section_data,
11086 Output_section::Input_section::relaxed_input_section): New method
11087 definitions.
11088 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11089 value.
11090 (Output_section::Input_section::u1_): Update comments.
11091 (Output_section::Input_section::u2_): Add new union member poris.
11092 (Output_section::Checkpoint_output_section): New classs definition.
11093 (Output_section::relax_input_section): New method declaration.
11094 (Output_section::checkpoint_): New data member.
11095 (Output_segment): Update comments.
11096 (Output_segment::Output_segment): Un-privatize copy constructor.
11097 (Output_segment::operator=): Un-privatize.
11098 * script-sections.cc (Output_section_element::Input_section_list):
11099 Change element type to Output_section::Simple_input_section.
11100 (Output_section_element_dot_assignment::set_section_addresses):
11101 Register output section data for relaxation clean up.
11102 (Output_data_exression::Output_data_expression): Adjust call to base
11103 constructor to fix data size.
11104 (Output_section_element_data::set_section_addresses): Register
11105 Output_data_expression object for relaxation clean up.
11106 (struct Input_section_info): Replace Relobj pointer and section index
11107 pair with Output_section::Simple_input_section and Convert struct to a
11108 class.
11109 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11110 Input_section_info data member to use accessors.
20e6d0d6
DK
11111 (Output_section_element_input::set_section_addresses): Use layout
11112 parameter. Adjust code to use Output_section::Simple_input_section
11113 and Input_secction_info classes. Register filler for relaxation
11114 clean up.
11115 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11116 and section index pair with Output_section::Simple_input_section
11117 class. Adjust code accordingly.
11118 (Phdrs_element::release_segment): New method definition.
11119 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11120 segment list.
11121 (Script_sections::release_segments): New method definition.
11122 * gold/script-sections.h (Script_sections::release_segments): New
11123 method declaration.
11124 * gold/target.h (Target::may_relax, Target::relax,
11125 Target::do_may_relax, Target::do_relax): New method definitions.
11126
5e445df6
ILT
111272009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11128
11129 * arm.cc (has_signed_unsigned_overflow): New function.
11130 (Arm_relocate_functions::abs8): New function.
11131 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11132 (Target_arm::Scan::global): Likewise.
11133 (Target_arm::relocate::relocate): Likewise.
11134 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11135 Likewise.
11136
8c604651 111372009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
11138
11139 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11140 * testsuite/Makefile.in: Regenerate.
11141
1e9cc1c2
NC
111422009-09-11 Nick Clifton <nickc@redhat.com>
11143
11144 * po/gold.pot: Updated by the Translation project.
11145
6a89f575
CC
111462009-09-08 Cary Coutant <ccoutant@google.com>
11147
11148 * output.cc (Output_file::open): Add execute permission to empty file.
11149 * testsuite/Makefile.am (permission_test): New test.
11150 * testsuite/Makefile.in: Regenerate.
11151
fdcac5af
ILT
111522009-09-02 Ian Lance Taylor <iant@google.com>
11153
11154 * output.cc (Output_file::resize): Call map_no_anonymous rather
11155 than map.
11156
44453f85
ILT
111572009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11158
11159 * gold.cc: Include "incremental.h".
11160 (queue_initial_tasks): Call Incremental_checker methods.
11161 * incremental.cc: Include "output.h".
11162 (Incremental_checker::can_incrementally_link_output_file): New
11163 method.
11164 * incremental.h (Incremental_checker): New class.
11165
11166 * output.cc (Output_file::open_for_modification): New method.
11167 (Output_file::map_anonymous): Changed return type to bool. Record
11168 map in base_ field.
11169 (Output_file::map_no_anonymous): New method, broken out of map.
11170 (Output_file::map): Use map_no_anonymous and map_anonymous.
11171 * output.h (class Output_file): Update declarations.
11172
293c1386
CC
111732009-08-24 Cary Coutant <ccoutant@google.com>
11174
11175 * options.h (Command_line::Pre_options): New class.
11176 (Command_line::pre_options): New member.
11177 * options.cc (gold::options::ready_to_register): New variable.
11178 (One_option::register_option): Do nothing if not registering options.
11179 Assert if same short option registered twice.
11180 (General_options::General_options): Turn off option registration when
11181 done constructing.
11182 (Command_line::Pre_options::Pre_options): New constructor.
11183
f773f3d2
CC
111842009-08-24 Cary Coutant <ccoutant@google.com>
11185
06a73cfe
CC
11186 * options.h (General_options::no_keep_memory): Remove incorrect
11187 short option.
f773f3d2 11188
a15af8e2
RW
111892009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11190
11191 * Makefile.am (am__skiplex, am__skipyacc): New.
11192 * Makefile.in: Regenerate.
11193
c462b41b
RW
111942009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11195
14ec8efd
RW
11196 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11197 (INCLUDES): ... this.
11198 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11199 (AM_CPPFLAGS): Renamed from ...
11200 (INCLUDE): ... this.
11201 * Makefile.in, testsuite/Makefile.in: Regenerate.
11202
81ecdfbb
RW
11203 * Makefile.in: Regenerate.
11204 * aclocal.m4: Likewise.
11205 * config.in: Likewise.
11206 * configure: Likewise.
11207 * testsuite/Makefile.in: Likewise.
11208
c462b41b
RW
11209 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11210 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11211 * Makefile.in: Regenerate.
11212 * testsuite/Makefile.in: Regenerate.
11213
2da73f13
CC
112142009-08-19 Cary Coutant <ccoutant@google.com>
11215
11216 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11217 symbols in shared libraries overridden by hidden or internal symbols
11218 in the main program.
11219
2db70501
CD
112202009-08-19 Chris Demetriou <cgd@google.com>
11221
11222 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11223 checking source file names in error messages.
11224
f733487b
DK
112252009-08-18 Doug Kwan <dougkwan@google.com>
11226
11227 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11228 an elcpp::Ehdr as parameter. Adjust call to set_target.
11229 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11230 an elfcpp::Ehdr as parameter.
11231 * object.cc (Object::set_target): Remove the version that looks up
11232 a target and sets it.
11233 (Sized_relobj::setup): Take a Target object instead of
11234 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11235 (make_elf_sized_object): Find target and ask target to
11236 make an ELF object.
11237 * object.h: (Object::set_target): Remove the version that looks up
11238 a target and sets it.
11239 (Sized_relobj::setup): Take a Target object instead of
11240 an elfcpp:Ehdr as parameter.
11241 * target.cc: Include dynobj.h.
11242 (Target::do_make_elf_object_implementation): New.
2e702c99 11243 (Target::do_make_elf_object): New.
f733487b
DK
11244 * target.h (Target::make_elf_object): New template declaration.
11245 (Target::do_make_elf_object): New method declarations.
11246 (Target::do_make_elf_object_implementation): New template declaration.
11247
cc70f101
ILT
112482009-08-14 Ian Lance Taylor <iant@google.com>
11249
11250 * gold.h (FUNCTION_NAME): Define.
11251 (gold_unreachable): Use FUNCTION_NAME.
11252
ef5e0cb1
ST
112532009-08-12 Sriraman Tallam <tmsriram@google.com>
11254
11255 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11256 symbol in the --keep-unique list is not found.
11257
48c187ce
ST
112582009-08-12 Sriraman Tallam <tmsriram@google.com>
11259
11260 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11261 been maked as --keep-unique.
11262 (Icf::unfold_section): New function.
11263 * icf.h (Icf::unfold_section): New function.
11264 * options.h (General_options::keep_unique): New option.
11265 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11266 * testsuite/Makefile.in: Regenerate.
11267 * testsuite/icf_keep_unique_test.sh: New file.
11268 * testsuite/icf_keep_unique_test.cc: New file.
11269
645afe0c
CC
112702009-08-12 Cary Coutant <ccoutant@google.com>
11271
11272 PR 10471
11273 * resolve.cc (Symbol_table::resolve): Check for references from
11274 dynamic objects to hidden and internal symbols.
11275 * testsuite/Makefile.am (hidden_test.sh): New test.
11276 * testsuite/Makefile.in: Regenerate.
11277 * testsuite/hidden_test.sh: New script.
11278 * testsuite/hidden_test_1.c: New test source.
11279 * testsuite/hidden_test_main.c: New test source.
11280
11af873f
DK
112812009-08-11 Doug Kwan <dougkwan@google.com>
11282
11283 * arm.cc: Update comments.
11284 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11285 segment to locate the .ARM.exidx section if present.
11286
b9f7d72d
DK
112872009-08-09 Doug Kwan <dougkwan@google.com>
11288
11289 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11290 patch.
11291
ddd3c53c
ST
112922009-08-07 Sriraman Tallam <tmsriram@google.com>
11293 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11294 compiler warnings.
11295
27721062
ST
112962009-08-06 Sriraman Tallam <tmsriram@google.com>
11297
11298 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11299 valid tls_segment only for non-debug-section relocations.
11300 * testsuite/Makefile.am: Add gc_tls_test.
11301 * testsuite/Makefile.in: Regenerate.
11302 * testsuite/gc_tls_test.cc: New file.
11303 * testsuite/gc_tls_test.sh: New file.
11304
ef15dade 113052009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 11306
ef15dade
ST
11307 * icf.cc: New file.
11308 * icf.h: New file.
11309 * Makefile.am (CCFILES): Add icf.cc.
11310 (HFILES): Add icf.h
11311 * Makefile.in: Regenerate.
11312 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11313 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11314 section, symbol and addend information for the relocs.
11315 * gold.cc (queue_middle_tasks): Call identical code folding.
11316 * gold.h: Add defines for multimap.
11317 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11318 to the call of finalize_local_symbols.
11319 * main.cc (main): Create object of class Icf.
11320 * object.cc (Sized_relobj::do_layout): Allow this function to be
11321 called twice during icf.
11322 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11323 to sections marked as identical by icf.
11324 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11325 when available.
11326 (Sized_relobj::do_section_entsize): New function.
11327 * object.h (Object::section_entsize): New function.
11328 (Object::do_section_entsize): New pure virtual function.
11329 (Relobj::finalize_local_symbols): Add new parameter.
11330 (Relobj::do_section_entsize): New function.
11331 * options.h (General_options::icf): New option.
11332 (General_options::icf_iterations): New option.
11333 (General_options::print_icf_sections): New option.
11334 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11335 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11336 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11337 icf.
11338 * symtab.cc (Symbol_table::is_section_folded): New function.
11339 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11340 to sections marked as identical by icf.
11341 * symtab.h (Symbol_table::set_icf): New function.
11342 (Symbol_table::icf): New function.
11343 (Symbol_table::is_section_folded): New function.
11344 (Symbol_table::icf_): New data member.
11345 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11346 * testsuite/Makefile.am: Add commands to build icf_test.
11347 * testsuite/Makefile.in: Regenerate.
11348 * testsuite/icf_test.sh: New file.
11349 * testsuite/icf_test.cc: New file.
11350
c3b65ac4
CD
113512009-07-24 Chris Demetriou <cgd@google.com>
11352
11353 * layout.cc (is_compressible_debug_section): Fix incorrect
11354 comment about compressed section names.
11355
1caf2c51
ILT
113562009-07-20 Ian Lance Taylor <ian@airs.com>
11357
11358 PR 10419
11359 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11360
1ef4d87f
ILT
113612009-07-16 Ian Lance Taylor <iant@google.com>
11362
11363 PR 10400
11364 * layout.h: #include <map>.
11365 (class Kept_section): Change from struct to class. Add accessors
11366 and setters. Add section size to Comdat_group mapping. Change
11367 Comdat_group to std::map. Add is_comdat_ field. Add
11368 linkonce_size field in union.
11369 (class Layout): Update declaration of find_or_add_kept_section.
11370 Don't declare find_kept_object.
11371 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11372 parameter. Add object, shndx, is_comdat, and is_group_name
11373 parameters. Change all callers. Adjust for new Kept_section.
11374 (Layout::find_kept_object): Remove.
11375 * object.cc (Sized_relobj::include_section_group): Update use of
11376 Kept_section. Rename secnum to shndx. Only record
11377 Kept_comdat_section if sections are the same size.
11378 (Sized_relobj::include_linkonce_section): Update use of
11379 Kept_section. Only record Kept_comdat_section if sections are the
11380 same size. Set size of linkonce section.
11381 (Sized_relobj::map_to_kept_section): Update call to
11382 get_kept_comdat_section.
11383 * object.h (class Sized_relobj): Rename fields in
11384 Kept_comdat_section to drop trailing underscores; change object
11385 field to Relobj*. Change Kept_comdat_section_table to store
11386 struct rather than pointer.
11387 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11388 Add kept_object and kept_shndx parameters. Change all callers.
11389 (Sized_relobj::get_kept_comdat_section): Change return type to
11390 bool. Add kept_object and kept_shndx parameters. Change all
11391 callers.
11392 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11393 Layout::find_or_add_kept_section.
11394
37c3b7b0
ILT
113952009-07-09 Ian Lance Taylor <iant@google.com>
11396
11397 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11398 Reserve space in the hash table.
11399
98fa85cb
ILT
114002009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11401
11402 * fileread.cc (File_read::get_mtime): New method.
11403 * fileread.h (Timespec): New structure.
11404 (File_read::get_mtime): New method.
11405 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11406 Renamed from timestamp_nsec.
11407 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11408 Elf_Xword.
e1df38aa 11409 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 11410 timestamp_nsec.
e1df38aa 11411 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
11412 (Incremental_inputs::report_obejct): Save mtime; style fix.
11413 (Incremental_inputs::report_script): Save mtime; style fix.
11414 (Incremental_inputs::finalize_inputs): Style fix.
11415 (Incremental_inputs::finalize): Style fix.
11416 (Incremental_inputs::create_input_section_data): Store inputs
11417 mtime.
11418 * incremental.h (Incremental_inputs::report_script): Add mtime
11419 argument.
11420 (Incremental_inputs::Input_info::Input_info): Intialize only one
11421 union member.
11422 (Incremental_inputs::Input_info::archive): Move to nameless
11423 union.
11424 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11425 (Incremental_inputs::Input_info::script): Move to nameless union.
11426 (Incremental_inputs::mtime): New field.
11427 * script.cc (read_input_script): Pass file mtime to
11428 Incremental_input.
11429 * script.h (Script_info::inputs): Style fix.
11430
c9d70757
ILT
114312009-07-01 Ian Lance Taylor <ian@airs.com>
11432
11433 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11434 instead of 32.
11435
9c547ec3
ILT
114362009-06-24 Ian Lance Taylor <iant@google.com>
11437
11438 PR 10156
11439 * layout.cc (Layout::choose_output_section): If we find an
11440 existing section, update the flags.
11441 (Layout::create_notes): New function, broken out of
11442 Layout::finalize.
11443 (Layout::finalize): Don't create note sections.
11444 (Layout::create_note): Don't crash if linker script discards
11445 section.
11446 (Layout::create_gold_note): Likewise.
11447 (Layout::create_build_id): Likewise. Don't set
11448 after_input_sections on the section.
11449 (Layout::create_executable_stack_info): Remove target parameter.
11450 Change caller.
11451 * layout.h (class Layout): Declare create_notes. Update
11452 declaration of create_executable_stack_info.
11453 * gold.cc (queue_middle_tasks): Call create_notes.
11454 * output.cc (Output_section::update_flags_for_input_section): Move
11455 here from output.h. If SHF_ALLOC flag is newly set, mark address
11456 invalid.
11457 * output.h (Output_data::mark_address_invalid): New function.
11458 (class Output_section): Only declare, not define,
11459 update_flags_for_input_section. Remove set_flags.
11460
55458500
ILT
114612009-06-24 Ian Lance Taylor <iant@google.com>
11462
11463 * script-sections.cc (Output_section_definition::
11464 set_section_addresses): Rename shadowing local load_address to
11465 laddr.
11466
1307d6cd
ILT
114672009-06-24 Ian Lance Taylor <iant@google.com>
11468
11469 PR 10244
11470 * reloc.cc (relocate_sections): Skip empty relocation sections.
11471
ec3f783e
ILT
114722009-06-23 Ian Lance Taylor <iant@google.com>
11473
11474 PR 10156
11475 * layout.cc (Layout::create_note): Use choose_output_section
11476 rather than make_output_section.
11477
459c9f1c
ILT
114782009-06-23 Ian Lance Taylor <iant@google.com>
11479
11480 PR 10237
11481 * options.cc (General_options::parse_V): Set printed_version_.
11482 (General_options::General_options): Initialize printed_version_.
11483 * options.h (class General_options): Add printed_version_ field.
11484 * gold.cc (queue_initial_tasks): If there are no input files,
11485 don't give a fatal error if we printed the version information.
11486 (queue_middle_tasks): If using -r with a shared object, give a
11487 fatal error rather than an ordinary error.
11488
1518dc8f
ILT
114892009-06-23 Ian Lance Taylor <iant@google.com>
11490
11491 PR 10219
11492 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11493 (Layout::make_output_section): Set have_stabstr_section_ if we see
11494 a .stab*str section.
11495 (Layout::finalize): Call link_stabs_sections.
11496 (Layout::link_stabs_sections): New file.
11497 * layout.h (class Layout): Add have_stabstr_section_ field.
11498 Declare link_stabs_sections.
11499
3d857b98
DK
115002009-06-23 Doug Kwan <dougkwan@google.com>
11501
11502 * Makefile.am (libgold_a_LIBADD): New.
11503 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 11504 * Makefile.in: Regenerate.
3d857b98
DK
11505 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11506 * configure: Regenerate.
11507 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11508 * fileread.cc: Include sys/state.h
11509 * gold.h: Declare memmem and strndup if found missing.
11510 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11511
0639a6f6
ILT
115122009-06-23 Ian Lance Taylor <iant@google.com>
11513
11514 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11515 * configure: Rebuild.
11516
8d63875c
ILT
115172009-06-23 Ian Lance Taylor <iant@google.com>
11518
11519 PR 10147
11520 * object.cc (Object::section_contents): Don't try to get a view if
11521 the section has length zero.
11522 (Object::handle_gnu_warning_section): If the section is empty, use
11523 the name of the section as the warning.
11524
f7c8a183
ILT
115252009-06-23 Ian Lance Taylor <iant@google.com>
11526
11527 PR 10133
11528 * stringpool.h (class Stringpool_template): Add optimize_ field.
11529 (Stringpool_template::set_optimize): New function.
11530 * stringpool.cc (Stringpool_template::Stringpool_template):
11531 Initialize optimize_ field.
11532 (Stringpool_template::set_string_offsets): Test local optimize
11533 fild rather than parameter.
11534 * layout.cc (Layout::Layout): Call set_optimize on the section
11535 name stringpool.
11536
e6a307ba
ILT
115372009-06-22 Ian Lance Taylor <iant@google.com>
11538
11539 PR 10030
11540 * yyscript.y: Parse TARGET.
11541 * script.cc (script_set_target): New function.
11542 * script-c.h (script_set_target): Declare.
11543 * options.cc (General_options::string_to_object_format): Rename
11544 from string_to_object_format in anonymous namespace. Change
11545 callers.
11546 * options.h (class General_options): Declare
11547 string_to_object_format.
11548
3ee173de
ILT
115492009-06-22 Ian Lance Taylor <iant@google.com>
11550
11551 * script-sections.cc (Script_sections::create_segments): Don't put
11552 program headers in a PT_LOAD segment if -n or -N.
11553
115542009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
11555
11556 PR 10141
11557 * options.h (class General_options): Add -z lazy and -z now. Sort
11558 -z options into alphabetical order.
11559 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11560
cd6739a1 115612009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
11562
11563 * layout.cc (Layout::make_output_section): Call
11564 Target::new_output_section.
11565 (Layout::attach_allocated_section_to_segment): Put large section
11566 sections in a separate load segment with the large segment flag
11567 set.
11568 (Layout::segment_precedes): Sort large data segments after other
11569 load segments.
11570 (align_file_offset): New static function.
11571 (Layout::set_segment_offsets): Use align_file_offset.
11572 * output.h (class Output_section): Add is_small_section_ and
11573 is_large_section_ fields.
11574 (Output_section::is_small_section): New function.
11575 (Output_section::set_is_small_section): New function.
11576 (Output_section::is_large_section): New function.
11577 (Output_section::set_is_large_section): New function.
11578 (Output_section::is_large_data_section): New function.
11579 (class Output_segment): Add is_large_data_segment_ field.
11580 (Output_segment::is_large_data_segment): New function.
11581 (Output_segment::set_is_large_data_segment): New function.
11582 * output.cc (Output_section::Output_section): Initialize new
11583 fields.
11584 (Output_segment::Output_segment): Likewise.
11585 (Output_segment::add_output_section): Add assertion that large
11586 data sections always go in large data segments. Force small data
11587 sections to the end of the list of data sections. Force small BSS
11588 sections to the start of the list of BSS sections. For large BSS
11589 sections to the end of the list of BSS sections.
11590 * symtab.h (class Symbol): Declare is_common_shndx.
11591 (Symbol::is_defined): Check Symbol::is_common_shndx.
11592 (Symbol::is_common): Likewise.
11593 (class Symbol_table): Define enum Commons_section_type. Update
11594 declarations. Add small_commons_ and large_commons_ fields.
11595 * symtab.cc (Symbol::is_common_shndx): New function.
11596 (Symbol_table::Symbol_table): Initialize new fields.
11597 (Symbol_table::add_from_object): Put small and large common
11598 symbols in the right list.
11599 (Symbol_table::sized_finalized_symbol): Check
11600 Symbol::is_common_shndx.
11601 (Symbol_table::sized_write_globals): Likewise.
11602 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11603 common symbol lists. Don't call do_allocate_commons_list if the
11604 list is empty.
11605 (Symbol_table::do_allocate_commons_list): Remove is_tls
11606 parameter. Add comons_section_type parameter. Change all
11607 callers. Handle small and large common symbols.
11608 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11609 Symbol::is_common_shndx.
11610 * resolve.cc (symbol_to_bits): Likewise.
11611 * target.h (Target::small_common_shndx): New function.
11612 (Target::small_common_section_flags): New function.
11613 (Target::large_common_shndx): New function.
11614 (Target::large_common_section_flags): New function.
11615 (Target::new_output_section): New function.
11616 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11617 small_common_section_flags, and large_common_section_flags
11618 fields.
11619 (Target::do_new_output_section): New virtual function.
11620 * arm.cc (Target_arm::arm_info): Initialize new fields.
11621 * i386.cc (Target_i386::i386_info): Likewise.
11622 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11623 Likewise.
11624 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11625 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11626 (Target_x86_64::do_new_output_section): New function.
11627 * configure.ac: Define conditional MCMODEL_MEDIUM.
11628 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11629 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11630 (large_LDFLAGS): Define.
11631 * testsuite/large.c: New file.
11632 * testsuite/testfile.cc (Target_test::test_target_info):
11633 Initialize new fields.
11634 * configure, testsuite/Makefile.in: Rebuild.
11635
bb04269c
DK
116362009-06-05 Doug Kwan <dougkwan@google.com>
11637
11638 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11639 * Makefile.in: Regenerate.
bb04269c
DK
11640 * i386.cc (class Target_i386): Define new virtual method to
11641 override do_is_local_label_name in parent.
11642 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11643 local symbols if --discard-locals or -X is given.
11644 * options.h (class General_options): Declare new options
11645 '--discard-locals' and '-X' for discarding locals.
11646 * target.h (class Target): Define new methods is_local_label_name.
11647 Declare new virtual method do_is_local_label_name.
11648 * target.cc: New file.
11649 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11650 (check_SCRIPTS): Add discard_locals_test.sh.
11651 (check_DATA): Add discard_local_tests.syms.
11652 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11653 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11654 * testsuite/Makefile.in: Regenerate.
11655 * testsuite/discard_locals_test.c: New file.
11656 * testsuite/discard_locals_test.sh: Same.
11657
805bb01c
DK
116582009-06-05 Doug Kwan <dougkwan@google.com>
11659
11660 * object.cc (Sized_relobj::Sized_relobj): Initialize
11661 discarded_eh_frame_shndx_ to -1U.
11662 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11663 section.
11664 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11665 a discarded .eh_frame section.
11666 (Sized_relobj::do_finalize_local_symbols): Ditto.
11667 * object.h (class Sized_relobj): Declare new member
11668 discarded_eh_frame_shndx_.
11669 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11670 (local_labels_test.o, local_labels_test): New rules.
11671 * testsuite/Makefile.in: Regenerate.
11672
1dcd334d
DK
116732009-06-04 Doug Kwan <dougkwan@google.com>
11674
11675 * layout.cc (Layout::section_name_mapping): Add mapping for
11676 special ARM sections.
11677
96d49306
DK
116782009-06-03 Doug Kwan <dougkwan@google.com>
11679
11680 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11681 (utils::has_overflow): Same.
11682
dff16297
ILT
116832009-06-03 Ian Lance Taylor <iant@google.com>
11684
11685 * layout.cc (Layout::section_name_mapping): New array, replacing
11686 Layout::linkonce_mapping.
11687 (Layout::section_name_mapping_count): New variable, replacing
11688 Layout::linkonce_mapping_count.
11689 (Layout::linkonce_output_name): Remove.
11690 (Layout::output_section_name): Rewrite.
11691 * layout.h (class Layout): Rename Linkonce_mapping to
11692 Section_name_mapping, linkonce_mapping to section_name_mapping,
11693 linkonce_mapping_count to section_name_mapping_count. Don't
11694 declare linkonce_output_name.
11695
c121c671
DK
116962009-06-03 Doug Kwan <dougkwan@google.com>
11697
11698 * gold/arm.cc (namespace utils): New.
11699 (Target_arm::reloc_is_non_pic): Define new method.
11700 (class Arm_relocate_functions): New.
11701 (Target_arm::Relocate::relocate): Handle relocation types used by
11702 Android.
11703
07800fab
ILT
117042009-06-03 Ian Lance Taylor <iant@google.com>
11705
11706 * arm.cc (Target_arm::scan::global): Use || instead of |.
11707
c121c671
DK
117082009-06-02 Doug Kwan <dougkwan@google.com>
11709
11710 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11711 issued_non_pic_error_.
11712 (class Target_arm::Scan): Declare new method check_non_pic.
11713 Define new method symbol_needs_plt_entry.
11714 Declare new data member issued_non_pic_error_.
11715 (class Target_arm::Relocate): Declare new method
11716 should_apply_static_reloc.
11717 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11718 (Target_arm::Scan::check_non_pic): Define new method.
11719 (Target_arm::Scan::local): Handle a small subset of reloc types used
11720 by Android.
11721 (Target_arm::Scan::local): Same.
11722 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11723
b19b0c6d
ILT
117242009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11725
11726 * incremental.cc (Incremental_inputs::report_command_line): Filter
11727 out --incremental-* options.
11728
94cdfcff
DK
117292009-05-29 Doug Kwan <dougkwan@google.com>
11730
11731 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11732 template class.
11733 (class Target_arm): Update comment.
11734 (Target_arm::Target_arm): Initialize new data members GOT_,
11735 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11736 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11737 and Target_arm::rel_dyn_section.
11738 Declare new_enum Target_arm::Got_type.
11739 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11740 and DYNBSS_.
11741 Update commments for member do_dynsym_value.
11742 (Target_arm::got_size, Target_arm::plt_section,
11743 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11744 new methods inside class defintion.
11745 (Target_arm::got_section): Define new method.
11746 (Target_arm::rel_dyn_section): Same.
11747 (Output_data_plt_arm): New template class.
11748 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11749 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11750 (Output_data_plt_arm::add_entry): Same.
11751 (Output_data_plt_arm::first_plt_entry): Define new
11752 static data member for PLT instruction template.
11753 (Output_data_plt_arm::plt_entry): Same.
11754 (Output_data_plt_arm::do_write): Define new method.
11755 (Target_arm::make_plt_entry): Same.
11756 (Target_arm::do_finalize_sections): Same.
11757 (Target_arm::do_dynsym_value): Same.
11758
4a657b0d
DK
117592009-05-28 Doug Kwan <dougkwan@google.com>
11760
11761 * Makefile.am (TARGETSOURCES): Add arm.cc.
11762 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11763 * Makefile.in: Regenerate.
11764 * arm.cc: New file.
11765 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11766
e7ae8c36
DK
117672009-05-26 Doug Kwan <dougkwan@google.com>
11768
11769 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11770 (General_options::check_excluded_libs): Strip off directories in
11771 archive name before matching like GNU ld does.
11772 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11773 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11774 (exclude_libs_test_LDFLAGS): Add linker option
11775 -Wl,--exclude-libs,libexclude_libs_test_3
11776 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11777 an explicit archive without using -l.
11778 (alt/libexclude_libs_test_3.a): New make rule.
11779 * testsuite/Makefile.in: Regenerate.
11780 * testsuite/exclude_libs_test.c : Declare lib3_default().
11781 (main): Call it.
11782 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11783 * exclude_libs_test_3.c: New file.
11784
f12e7348
NC
117852009-05-26 Nick Clifton <nickc@redhat.com>
11786
11787 * po/id.po: New Indonesian translation.
11788 * po/gold.pot: Updated template file.
11789
4daadc0d
ST
117902009-05-22 Sriraman Tallam <tmsriram@google.com>
11791
e1df38aa 11792 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11793 gc_comdat_test files. Add -Wl,--gc-sections to build
11794 gc_comdat_test.
11795 * testsuite/Makefile.in: Regenerate.
11796 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11797
531813ad
ST
117982009-05-21 Sriraman Tallam <tmsriram@google.com>
11799
11800 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11801 kept comdat section was garbage collected.
11802 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11803 * testsuite/Makefile.in: Regenerate.
11804 * testsuite/gc_comdat_test.sh: New file.
11805 * testsuite/gc_comdat_test_1.cc: New file.
11806 * testsuite/gc_comdat_test_2.cc: New file.
11807
65514900
CC
118082009-05-19 Doug Kwan <dougkwan@google.com>
11809
11810 * archive.cc (Archive::Archive): Move constructor from archive.h
11811 to here. Initialize no_export_.
11812 (Archive::get_elf_object_for_member): Set no_export flag of object.
11813 * archive.h (Archive::Archive): Move constructor body to
11814 archive.cc.
11815 (Archive::no_export): New method.
11816 (Archive::no_export_): New field.
11817 * object.h (Object::Object): Initialize no_export_ to false.
11818 (Object::no_export, Object::set_no_export): New methods.
11819 (Object::no_export_): New field.
11820 * options.cc (General_options::parse_exclude_libs): New method.
11821 (General_options::check_excluded_libs) Same.
11822 * options.h (exclude_libs): New option.
11823 (General_options::check_excluded_libs): New method declaration.
11824 (General_options::excluded_libs_): New field.
11825 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
11826 default or protected visibility if an object has no-export flag set.
11827 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
11828 (check_SCRIPTS): Add exclude_libs_test.sh.
11829 (check_DATA): Add exclude_libs_test.syms.
11830 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
11831 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
11832 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
11833 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
11834 (exclude_libs_test.syms, libexclude_libs_test_1.a,
11835 libexclude_libs_test_2.a): New rules.
11836 * testsuite/Makefile.in: Regenerate.
11837 * testsuite/exclude_libs_test.c: New file.
11838 * testsuite/exclude_libs_test.sh: Ditto.
11839 * testsuite/exclude_libs_test_1.c: Ditto.
11840 * testsuite/exclude_libs_test_2.c: Ditto.
11841
1b77ea50
ILT
118422009-05-15 Ian Lance Taylor <iant@google.com>
11843
11844 * configure.ac: Check for declarations for cases where libiberty.h
11845 checks HAVE_DECL_xxx.
11846 * configure, config.in: Rebuild.
11847
072fe7ce
ILT
118482009-05-15 Mikolaj Zalewski <mikolajz@google.com>
11849
11850 * gold.h (Incremental_argument_list): Remove (invalid) forward
11851 declaration.
11852 * incremental.cc (Incremental_inputs::report_achive): New method.
11853 (Incremental_inputs::report_object): New method.
11854 (Incremental_inputs::report_script): New method.
11855 (Incremental_inputs::finalize_inputs): New method.
11856 (Incremental_inputs::finalize): Call finalize_inputs().
11857 (Incremental_inputs::sized_create_incremental_inputs_section_data):
11858 Create inputs entries.
11859 * incremental.h (Incremental_input_type): New enum.
11860 (Incremental_inputs::Incremental_input): Initialize new fields.
11861 (Incremental_inputs::report_inputs): New method.
11862 (Incremental_inputs::report_achive): New method.
11863 (Incremental_inputs::report_object): New method.
11864 (Incremental_inputs::report_script): New method.
11865 (Incremental_inputs::finalize_inputs): New method.
11866 (Incremental_inputs::Input_info): New struct.
11867 (Incremental_inputs::Input_info_map): New typedef.
11868 (Incremental_inputs::lock_): New field.
11869 (Incremental_inputs::Inputs_): New field.
11870 (Incremental_inputs::Inputs_map): New field.
11871 * main.cc (main): Call Incremental_input::report_inputs.
11872 * options.h (Input_argument_list): Typedef moved from
11873 Input_arguments.
11874 (Input_file_group::Files): Remove, use ::Input_argument_list.
11875 (Input_file_group::Input_argument_list): Remove, use
11876 ::Input_argument_list.
11877 * plugin.cc (Plugin_manager::add_input_file): Add error in
11878 incremental build.
11879 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
11880 functions.
11881 * script.cc (read_input_script): Call
11882 Incremental_input::report_script.
11883 * script.h (Script_info): New class.
11884
b0481b0b
ILT
118852009-04-27 Ian Lance Taylor <iant@google.com>
11886
11887 * x86_64.cc (do_adjust_output_section): Set entsize to
11888 plt_entry_size.
11889
b22a5a41 118902009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
11891
11892 * output.cc (Output_file::close): After short writes, continue
11893 writing from the correct offset in the buffer being written.
11894
40fde488
CD
118952009-04-23 Chris Demetriou <cgd@google.com>
11896
11897 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
11898 * configure: Regenerate.
11899 * config.in: Regenerate.
11900 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
11901 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
11902
3ce2c28e
ILT
119032009-04-21 Mikolaj Zalewski <mikolajz@google.com>
11904
11905 * incremental.cc (Incremental_inputs_header_data): Renamed from
11906 Incremental_input_header_data.
11907 (Incremental_inputs_header_data::data_size): New field.
11908 (Incremental_inputs_header_data::put_input_file_count): Renamed
11909 from input_file_count.
11910 (Incremental_inputs_header_data::put_command_line_offset): Renamed
11911 from command_line_offset.
11912 (Incremental_inputs_header_data::put_reserved): Renamed from
11913 put_reserved.
11914 (Incremental_inputs_entry_data): Renamed from
11915 Incremental_input_entry_data.
11916 (Incremental_inputs_entry_data::data_size): New field.
11917 (Incremental_inputs::report_command_line): New method.
11918 (Incremental_inputs::finalize): New method.
11919 (Incremental_inputs::create_incremental_inputs_data): New method.
11920 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
11921 * incremental.h: New file.
11922 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 11923 (Layout::finalize): Create incremental inputs section in
3ce2c28e 11924 incremental builds.
703d02da 11925 (Layout::create_incremental_info_sections): New method.
3ce2c28e 11926 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
11927 (Layout::create_incremental_info_sections): New method.
11928 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
11929 * main.cc (main): Notify Incremental_input of the command line.
11930
e55bde5e
ILT
119312009-04-01 Ian Lance Taylor <iant@google.com>
11932 Mikolaj Zalewski <mikolajz@google.com>
11933
11934 * gold.h (reserve_unordered_map): Define, three versions, one for
11935 each version of Unordered_map.
11936 * layout.cc (Layout::Layout): Remove options parameter. Add
11937 number_of_input_files parameter. Don't initialize options_.
11938 Initialize number_of_input_files_ and resized_signatures_. Move
11939 sections_are_attached_.
11940 (Layout::layout_group): Reserve space for group_signatures_.
11941 (Layout::find_or_add_kept_section): Change name parameter to be a
11942 reference. Resize signatures_ map when it gets large enough.
11943 (Layout::layout_eh_frame): Use parameters->options() instead of
11944 this->options_.
11945 (Layout::make_output_section): Likewise.
11946 (Layout::attach_allocated_section_to_segment): Likewise.
11947 (Layout::finalize, Layout::create_executable_stack): Likewise.
11948 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
11949 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
11950 * layout.h (class Layout): Update declarations. Remove options_
11951 field. Add number_of_input_files_ and resized_signatures_
11952 fields. Move sections_are_attached_ field.
11953 * main.cc (main): Pass number of input files to Layout
11954 constructor. Don't pass options.
11955
154b857c
ILT
119562009-03-30 Ian Lance Taylor <iant@google.com>
11957
11958 * ffsll.c (ffsll): Correct implementation.
11959
2f35ab9b
ILT
119602009-03-27 Ian Lance Taylor <iant@google.com>
11961
fd03461a
ILT
11962 * ffsll.c: New file.
11963 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
11964 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
11965 * ftruncate.c (ftruncate): Declare before definition.
11966 * mremap.c (mremap): Likewise.
11967 * pread.c (pread): Likewise.
11968 * configure, Makefile.in, config.in: Rebuild.
11969
2f35ab9b
ILT
11970 * mremap.c: New file.
11971 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
11972 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
11973 (mremap): Declare if HAVE_MREMAP is not defined.
11974 * configure, Makefile.in, config.in: Rebuild.
11975
33aea2fd
CC
119762009-03-27 Cary Coutant <ccoutant@google.com>
11977
11978 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
11979 position independent.
11980 * sparc.cc (Target_sparc::check_non_pic): Likewise.
11981 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
11982
6d479619
CC
119832009-03-24 Cary Coutant <ccoutant@google.com>
11984
11985 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
11986 an executable.
11987 (needs_dynamic_reloc): Likewise.
11988
afc06bb8
ILT
119892009-03-24 Ian Lance Taylor <iant@google.com>
11990
11991 * yyscript.y (file_cmd): Recognize EXTERN.
11992 (extern_name_list, extern_name_list_body): New nonterminals.
11993 * script.cc (script_add_extern): Define.
11994 * script-c.h (script_add_extern): Declare.
11995
f6060a4d
ILT
119962009-03-24 Rafael Avila de Espindola <espindola@google.com>
11997
11998 * object.cc (is_elf_object): Define.
11999 * object.h (is_elf_object): Declare.
12000 * archive.cc (Archive::get_elf_object_for_member): Call
12001 is_elf_object.
33aea2fd 12002 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12003
26736d8e
ILT
120042009-03-24 Elliott Hughes <enh@google.com>
12005
12006 * output.cc (Output_file::map_anonymous): Define.
12007 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12008 try an anonymous one. Report the size if the mmap fails.
12009 * output.h (class Output_file): Declare map_anonymous.
12010
22fd9730
ILT
120112009-03-24 Ian Lance Taylor <iant@google.com>
12012
12013 * target-select.cc (instantiate_target): Don't acquire the lock if
12014 the instantiated_target_ field has already been set.
12015
cb010894
ILT
120162009-03-23 Ian Lance Taylor <iant@google.com>
12017
7f055c20
ILT
12018 * gold-threads.h (class Initialize_lock): Define.
12019 * gold-threads.cc (class Initialize_lock_once): Define.
12020 (initialize_lock_control): New static variable.
12021 (initialize_lock_pointer): New static variable.
12022 (initialize_lock_once): New static function.
12023 (Initialize_lock::Initialize_lock): Define.
12024 (Initialize_lock::initialize): Define.
12025 * target-select.h: Include "gold-threads.h".
12026 (class Target_selector): Add lock_ and initialize_lock_ fields.
12027 Don't define instantiate_target, just declare it.
12028 * target-select.cc (Target_selector::Target_selector): Initialize
12029 new fields.
12030 (Target_selector::instantiate_target): Define.
12031 * descriptors.h: Include "gold-threads.h".
12032 (class Descriptors): Add initialize_lock_ field.
12033 * descriptors.cc (Descriptors::Descriptors): Initialize new
12034 field.
12035 (Descriptors::open): Use initialize_lock_ field
12036 * errors.h (class Errors): Add initialize_lock_ field.
12037 * errors.cc (Errors::Errors): Initialize new field.
12038 (Errors::initialize_lock): Use initialize_lock_ field.
12039 * powerpc.cc (class Target_selector_powerpc): Remove
12040 instantiated_target_ field. In do_recognize call
12041 instantiate_target rather than do_instantiate_target. In
12042 do_instantiate_target just allocate a new target.
12043 * sparc.cc (class Target_selector_sparc): Likewise.
12044
36959681
ILT
12045 * freebsd.h: New file.
12046 * i386.cc: Include "freebsd.h".
12047 (Target_i386): Derive from Target_freebsd rather than
12048 Sized_target.
12049 (Target_selector_i386): Derive from Target_selector_freebsd rather
12050 than Target_selector.
12051 * x86_64.cc: Include "freebsd.h".
12052 (Target_x86_64): Derive from Target_freebsd rather than
12053 Sized_target.
12054 (Target_selector_x86_64): Derive from Target_selector_freebsd
12055 rather than Target_selector.
12056 * target.h (class Target): Add adjust_elf_header and
12057 do_adjust_elf_header.
12058 * output.cc (Output_file_header:: do_sized_write): Call target
12059 adjust_elf_header routine.
12060 * configure.tgt: Set targ_osabi.
12061 * configure.ac: Define GOLD_DEFAULT_OSABI.
12062 * parameters.cc (Parameters::default_target): Pass
12063 GOLD_DEFAULT_OSABI to select_target.
12064 * target-select.h (class Target_selector): Make instantiate_target
12065 protected rather than private.
12066 * Makefile.am (HFILES): Add freebsd.h.
12067 * configure, Makefile.in, config.in: Rebuild.
12068
cb010894
ILT
12069 * merge.cc (do_add_input_section): Correct pend value. Change
12070 message about last entry not being null terminated from error to
12071 warning.
12072
0e879927
ILT
120732009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12074
12075 * incremental.cc: New file.
12076 * Makefile.am (CCFILES): Add incremental.cc.
12077 * Makefile.in: Rebuild.
12078
41105937
PP
120792009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12080
12081 * layout.cc (Layout::output_section_name): Preserve names
12082 of '.note.' sections.
e1df38aa 12083
60439920
ILT
120842009-03-19 Ian Lance Taylor <iant@google.com>
12085
12086 * descriptors.cc (Descriptors::open): Check that the options are
12087 valid before using them.
12088
0d371ad3
ILT
120892009-03-18 Ian Lance Taylor <iant@google.com>
12090
12091 * script-sections.h: Include <list>.
12092 (class Script_sections): Change Sections_elements from std::vector
12093 to std::list. Typedef public Elements_iterator. Add
12094 orphan_section_placement_, data_segment_align_start_, and
12095 saw_data_segment_align_ fields. Remove data_segment_align_index_
12096 field.
12097 * script-sections.cc (class Orphan_section_placement): New class.
12098 (class Sections_element): Add virtual functions is_relro and
12099 orphan_section_init. Remove virtual function place_orphan_here.
12100 (class Output_section_definition): Add is_relro and
12101 orphan_section_init. Remove place_orphan_here.
12102 (class Orphan_output_section): Likewise.
12103 (Script_sections::Script_sections): Update for field changes.
12104 (Script_sections::data_segment_align): Set saw_data_segment_align_
12105 and data_segment_align_start_, not data_segment_align_index.
12106 (Script_sections::data_segment_relro_end): Check
12107 saw_data_segment_align_. Use data_segment_align_start_ rather
12108 than data_segment_align_index_.
12109 (Script_sections::place_orphan): Rewrite to use
12110 Orphan_section_placement.
12111
9201d894
ILT
121122009-03-17 Ian Lance Taylor <iant@google.com>
12113
9c5b8369
ILT
12114 * archive.cc (Archive::add_symbols): Check for a version attached
12115 to the symbol name in the archive map.
12116 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12117 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12118 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12119 (ver_test_11.a): New target.
12120 * testsuite/Makefile.in: Rebuild.
12121
9201d894
ILT
12122 * configure.ac: Check for chsize and posix_fallocate. Replace
12123 ftruncate.
12124 * ftruncate.c: New file, from gnulib.
12125 * output.cc (posix_fallocate): Define dummy version if not
12126 HAVE_POSIX_FALLOCATE.
12127 (Output_file::map): Call posix_fallocate rather than lseek and
12128 write.
12129 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12130 * configure, Makefile.in, config.in: Rebuild.
12131
ef4ab7a8 121322009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 12133
ef4ab7a8
PP
12134 * layout.h (Layout::create_note): Add section_name parameter.
12135 * layout.cc (Layout::create_note): Likewise.
12136 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 12137
8c500701
ILT
121382009-03-17 Ian Lance Taylor <iant@google.com>
12139
e85b18e1
ILT
12140 * descriptors.cc: Include "options.h".
12141 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12142 (Descriptors::open): Always use O_CLOEXEC when opening a new
12143 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12144 then set FD_CLOEXEC.
12145
9efe6174
ILT
12146 * sparc.cc (class Target_sparc): Add has_got_section.
12147 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12148 make sure we have a GOT section.
12149
12150 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12151 (Target_sparc::Scan::local): Likewise.
12152 (Target_sparc::Scan::global): Likewise.
12153 (Target_sparc::Relocate::relocate): Likewise.
12154 (Target_sparc::Relocate::relocate_tls): Likewise.
12155
8c500701
ILT
12156 * symtab.cc (Symbol_table::define_default_version): New function,
12157 broken out of add_from_object.
12158 (Symbol_table::add_from_object): Call define_default_version.
12159 (Symbol_table::define_special_symbol): Add resolve_oldsym
12160 parameter. Change all callers. If the version for a symbol comes
12161 from a version script, resolve it with the symbol with the same
12162 name with no version. Also add the symbol without a version if
12163 appropriate.
12164 (do_define_in_output_data): If resolving with oldsym, don't delete
12165 sym.
12166 (do_define_in_output_segment): Likewise.
12167 (do_define_as_constant): Likewise.
12168 * symtab.h (class Symbol_table): Update declarations.
12169
f1ed28fb
ILT
121702009-03-13 Ian Lance Taylor <iant@google.com>
12171
15f8229b
ILT
12172 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12173 (Read_symbols::requeue): New function.
12174 (Read_symbols::do_read_symbols): If make_elf_object fails because
12175 the target type is not configured, and the file was searched for,
12176 issue a warning and retry with the next directory.
12177 (Add_symbols::run): If the file has an incompatible format, and
12178 it was searched for, requeue the Read_symbols task. On error,
12179 release the object.
12180 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12181 dirindex parameter to constructor. Change all callers. Declare
12182 incompatible_warning and requeue.
12183 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12184 input_argument_ and input_group_ fields. Add them to
12185 constructor. Change all callers.
12186 (class Read_script): Add dirindex_ field. Add it to constructor.
12187 Change all callers.
12188 * archive.cc (Archive::setup): Remove input_objects parameter.
12189 Change all callers.
12190 (Archive::get_file_and_offset): Likewise.
12191 (Archive::read_all_symbols): Likewise.
12192 (Archive::read_symbols): Likewise.
12193 (Archive::get_elf_object_for_member): Remove input_objects
12194 parameter. Add punconfigured parameter. Change all callers.
12195 (Archive::add_symbols): Change return type to bool. Check return
12196 value of include_member.
12197 (Archive::include_all_members): Likewise.
12198 (Archive::include_member): Change return type to bool. Return
12199 false if first included object has incompatible target. Set
12200 included_member_ field.
12201 (Add_archive_symbols::run): If add_symbols returns false, requeue
12202 Read_symbols task.
12203 * archive.h (class Archive): Add included_member_ field.
12204 Initialize it in constructor. Add input_file and searched_for
12205 methods. Update declarations.
12206 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12207 input_argument_ fields. Add them to constructor. Change all
12208 callers.
12209 * script.cc: Include "target-select.h".
12210 (class Parser_closure): Add skip_on_incompatible_target_ and
12211 found_incompatible_target_ fields. Add
12212 skip_on_incompatible_target parameter to constructor. Change all
12213 callers. Add methods skip_on_incompatible_target,
12214 clear_skip_on_incompatible_target, found_incompatible_target, and
12215 set_found_incompatible_target.
12216 (read_input_script): Add dirindex parameter. Change all callers.
12217 If parser finds an incompatible target, requeue Read_symbols
12218 task.
12219 (script_set_symbol): Clear skip_on_incompatible_target in
12220 closure.
12221 (script_add_assertion, script_parse_option): Likewise.
12222 (script_start_sections, script_add_phdr): Likewise.
12223 (script_check_output_format): New function.
12224 * script.h (read_input_script): Update declaration.
12225 * script-c.h (script_check_output_format): Declare.
12226 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12227 (ignore_cmd): Remove OUTPUT_FORMAT.
12228 * fileread.cc (Input_file::Input_file): Add explicit this.
12229 (Input_file::will_search_for): New function.
12230 (Input_file::open): Add pindex parameter. Change all callers.
12231 * fileread.h (class Input_file): Add input_file_argument method.
12232 Declare will_search_for. Update declarations.
12233 * object.cc (make_elf_object): Add punconfigured parameter.
12234 Change all callers.
12235 * object.h (class Object): Make input_file public. Add
12236 searched_for method.
12237 (make_elf_object): Update declaration.
12238 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12239 restart search.
12240 * dirsearch.h (class Dirsearch): Update declaration.
12241 * options.h (class General_options): Add --warn-search-mismatch.
12242 * parameters.cc (Parameters::is_compatible_target): New function.
12243 * parameters.h (class Parameters): Declare is_compatible_target.
12244 * workqueue.cc (Workqueue::add_blocker): New function.
12245 * workqueue.h (class Workqueue): Declare add_blocker.
12246
f1ed28fb
ILT
12247 * fileread.cc (Input_file::open): Remove options parameter.
12248 Change all callers.
12249 (Input_file::open_binary): Likewise.
12250 * script.cc (read_input_script): Likewise.
12251 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12252 options parameter from constructor. Change all callers.
12253 (class Read_script): Likewise.
12254 * fileread.h (class Input_file): Update declarations.
12255 * script.h (read_input_script): Update declaration.
12256
34dd024a
NC
122572009-03-10 Nick Clifton <nickc@redhat.com>
12258
12259 * po/es.po: New Spanish translation.
12260
6d71b17c
CC
122612009-03-06 Cary Coutant <ccoutant@google.com>
12262
12263 * options.cc (parse_short_option): Keep dash_z from registering itself.
12264
031cdbed
ILT
122652009-03-03 Ian Lance Taylor <iant@google.com>
12266
12267 PR 9918
12268 * target-reloc.h (relocate_section): Pass output_section to
12269 relocate.
12270 * i386.cc (Target_i386::should_apply_static_reloc): Add
12271 output_section parameter. Change all callers.
12272 (Target_i386::Relocate::relocate): Add output_section parameter.
12273 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12274 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12275 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12276 * testsuite/two_file_shared.sh: New script.
12277 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12278 (check_DATA): Add two_file_shared.dbg.
12279 (two_file_shared.dbg): New target.
12280 * testsuite/Makefile.in: Rebuild.
12281
15d5fa16
ILT
122822009-03-01 Ian Lance Taylor <iant@google.com>
12283
12284 * configure.ac: Check for byteswap.h.
12285 * configure: Rebuild.
12286 * config.in: Rebuild.
12287
8a4c0b0d
ILT
122882009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12289
12290 * layout.cc (Layout::find_or_add_kept_section): New function.
12291 (Layout::add_comdat): Removed.
12292 * layout.h (struct Kept_section): Move out of class Layout.
12293 Remove trailing underscores from field names. Add group_sections
12294 field. Rename group_ field to is_group. Change all uses.
12295 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12296 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12297 comdat_groups_ field.
12298 (Sized_relobj::include_section_group): Use
12299 find_or_add_kept_section and Kept_section::group_sections.
12300 (Sized_relobj::include_linkonce_section): Likewise.
12301 * object.cc (class Sized_relobj): Don't define Comdat_group or
12302 Comdat_group_table. Remove find_comdat_group and
12303 add_comdat_group. Remove comdat_groups_ field.
12304 * plugin.cc (include_comdat_group): Use
12305 Layout::find_or_add_kept_section.
12306
b4ecf66b
ILT
123072009-02-28 Ian Lance Taylor <iant@google.com>
12308
14359ca0
ILT
12309 * README: --gc-sections and map files are now supported. Document
12310 some build requirements.
12311
b4ecf66b
ILT
12312 PR 6992
12313 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12314 relocatable link set the value of the section symbol to zero.
12315 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12316 relocatable link don't include the section address in the local
12317 symbol value.
12318
0602e05a
ILT
123192009-02-27 Ian Lance Taylor <iant@google.com>
12320
fd9d194f
ILT
12321 PR 6811
12322 * options.h (class Search_directory): Add is_system_directory.
12323 (class General_options): Declare is_in_system_directory.
12324 * options.cc (get_relative_sysroot): Make static.
12325 (get_default_sysroot): Make static.
12326 (General_optoins::is_in_system_directory): New function.
12327 * fileread.cc (Input_file::is_in_system_directory): New function.
12328 * fileread.h (class Input_file): Declare is_in_system_directory.
12329 * object.h (class Object): Add is_in_system_directory.
12330 (class Input_objects): Remove system_library_directory_ field.
12331 * object.cc (Input_objects::add_object): Don't set
12332 system_library_directory_.
12333 (input_objects::found_in_system_library_directory): Remove.
12334 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12335 parameter. Change all callers.
12336 (Symbol_table::sized_write_globals): Likewise.
12337 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12338 Call Object::is_in_system_directory.
12339 * symtab.h (class Symbol_table): Update declarations.
12340
61edd21f
ILT
12341 PR 5990
12342 * descriptors.h (Open_descriptor): Add is_on_stack field.
12343 * descriptors.cc (Descriptors::open): If the descriptor is on the
12344 top of the stack, remove it. Initialize is_on_stack field.
12345 (Descriptors::release): Only add pod to stack if it is not on the
12346 stack already.
12347 (Descriptors::close_some_descriptor): Clear stack_next and
12348 is_on_stack fields.
12349
e29e076a
ILT
12350 PR 7091
12351 * output.cc (Output_section::find_starting_output_address): Rename
12352 from starting_output_address; add PADDR parameter; change return
12353 type.
12354 * output.h (class Output_section): Declare
12355 find_starting_output_address instead of starting_output_address.
12356 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12357 section symbol for which we can't find a merge section.
12358
0602e05a
ILT
12359 PR 9836
12360 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12361 hidden or internal, force the symbol to be local.
12362 * resolve.cc (Symbol::override_visibility): Define.
12363 (Symbol::override_base): Use override_visibility.
12364 (Symbol_table::resolve): Likewise.
12365 (Symbol::override_base_with_special): Likewise.
12366 (Symbol_table::override_with_special): If the visibility is hidden
12367 or internal, force the symbol to be local.
12368 * symtab.h (class Symbol): Add set_visibility and
12369 override_visibility.
12370 * testsuite/ver_test_1.sh: New file.
12371 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12372 (check_DATA): Add ver_test_1.syms.
12373 (ver_test_1.syms): New target.
12374 * testsuite/Makefile.in: Rebuild.
12375
401a9a73
CC
123762009-02-25 Cary Coutant <ccoutant@google.com>
12377
12378 * layout.cc (Layout::choose_output_section): Don't rename sections
12379 when using a linker script that has a SECTIONS clause.
12380 * Makefile.in: Regenerate.
12381
12382 * testsuite/Makefile.am (script_test_5.sh): New test case.
12383 * testsuite/Makefile.in: Regenerate.
12384 * testsuite/script_test_5.cc: New file.
12385 * testsuite/script_test_5.sh: New file.
12386 * testsuite/script_test_5.t: New file.
12387
f488e4b0
CC
123882009-02-13 Rafael Avila de Espindola <espindola@google.com>
12389
12390 * archive.cc (Archive::include_member): Update calls to add_symbols.
12391 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12392 the Layout argument.
12393 * dynobj.h (do_add_symbols): Add the Layout argument.
12394 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12395 Layout argument.
12396 * object.h (Object::add_symbols): Add the Layout argument.
12397 (Object::do_add_symbols): Add the Layout argument.
12398 (Sized_relobj::do_add_symbols): Add the Layout argument.
12399 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12400 Unify the two versions.
12401 (Add_plugin_symbols): Remove.
12402 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12403 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12404 (Add_plugin_symbols): Remove.
12405 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12406 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12407 (Add_symbols::run): Make it work with Pulginobj.
12408
89dd1680
ILT
124092009-02-06 Ian Lance Taylor <iant@google.com>
12410
12411 * object.cc (Sized_relobj::do_layout): Make info message start
12412 with lower case letter.
12413
266d0a74
ILT
124142009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12415
602b464e
ILT
12416 * binary.cc: Fix file comment.
12417
266d0a74
ILT
12418 * options.h (enum Incremental_disposition): Define.
12419 (class General_options): Add new options: --incremental,
12420 --incremental_changed, --incremental_unchanged,
12421 --incremental_unknown. Add incremental_disposition_ and
12422 implicit_incremental_ fields.
12423 (General_options::incremental_disposition): New function.
12424 (class Position_dependent_options): Add incremental_disposition
12425 option.
12426 (Position_dependent_options::copy_from_options): Set incremental
12427 dispositions.
12428 * options.cc (General_options::parse_incremental_changed): New
12429 function.
2e702c99
RM
12430 (General_options::parse_incremental_unchanged): New function.
12431 (General_options::parse_incremental_unknown): New function.
12432 (General_options::General_options): Initialize new fields
266d0a74 12433 incremental_disposition_ and implicit_incremental_.
2e702c99 12434 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
12435 without --incremental.
12436
f073bbf7
CD
124372009-02-06 Chris Demetriou <cgd@google.com>
12438
12439 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12440 pointer and to report location as the file name associated with
12441 the symbol.
12442 (gold_undefined_symbol_at_location): New function to replace the
12443 old gold_undefined_symbol functionality.
12444 * target-reloc.h (relocate_section): Update to use
12445 gold_undefined_symbol_at_location.
12446 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12447 Call gold_undefined_symbol function rather than gold_error.
12448 * errors.h (Errors::undefined_symbol): Take location as a
12449 string, rather than calculating it from a relocation.
12450 * errors.cc (Errors::fatal): Print "fatal error:" before the
12451 formatted message.
12452 (Errors::error, Errors::error_at_location): Print "error: "
12453 before the formatted message.
12454 (Errors::undefined_symbol): Take location as a string, rather
12455 than calculating it from a relocation.
12456 (gold_undefined_symbol_at_location): New function akin to
12457 old gold_undefined_symbol, calculates location from relocation.
12458 (gold_undefined_symbol): Change to take only a Symbol pointer
12459 and to report location as the file name associated with the symbol.
12460 * testsuite/debug_msg.sh: Update for changed error messages.
12461 * testsuite/undef_symbol.sh: Likewise.
12462
8e94a90c
ILT
124632009-02-04 Duncan Sands <baldrick@free.fr>
12464
12465 PR 9812
12466 * reduced_debug_output.h
12467 (Output_reduced_debug_abbrev_section::failed): Use format for
12468 gold_warning.
12469 (Output_reduced_debug_info_section::faild): Likewise.
12470
88a0e15b
ILT
124712009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12472
12473 * script.cc (Lazy_demangler): New class.
2e702c99 12474 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
12475 symbol only once.
12476
5efc7cd2
CC
124772009-01-29 Cary Coutant <ccoutant@google.com>
12478
12479 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12480 to __tls_get_addr.
12481 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12482
e0ebcf42
ILT
124832009-01-28 Ian Lance Taylor <iant@google.com>
12484
5efc7cd2 12485 * version.cc (version_string): Bump to 1.9.
75fe7426 12486
e0ebcf42
ILT
12487 * gold.h: Include <cstring> and <stdint.h>.
12488 * version.cc: Include <cstdio>.
12489 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12490 warning.
12491 * reduced_debug_output.cc (insert_into_vector): Rename from
12492 Insert_into_vector; change all callers. Use Swap_unaligned to
12493 avoid aliasing issue; remove union since it is unnecessary.
12494
8e2813be 124952009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
12496
12497 * Makefile.am (CCFILES): Add gc.cc.
12498 (HFILES): Add gc.h.
12499 * Makefile.in: Regenerate.
12500 * gold.cc (Gc_runner): New class.
12501 (queue_initial_tasks): Call garbage collection related tasks
12502 when corresponding options are invoked.
12503 (queue_middle_gc_tasks): New function.
12504 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12505 processed early before laying out sections during garbage collection.
12506 * gold.h (queue_middle_gc_tasks): New function.
12507 (is_prefix_of): Move from "layout.cc".
12508 * i386.cc (Target_i386::gc_process_relocs): New function.
12509 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12510 * main.cc (main): Create object of class "Garbage_collection".
12511 * object.cc (Relobj::copy_symbols_data): New function.
12512 (Relobj::is_section_name_included): New function.
e1df38aa
NC
12513 (Sized_relobj::do_layout): Allow this function to be called twice
12514 during garbage collection and defer layout of section during the
6d03d481
ST
12515 first call.
12516 * object.h (Relobj::get_symbols_data): New function.
12517 (Relobj::is_section_name_included): New function.
12518 (Relobj::copy_symbols_data): New function.
12519 (Relobj::set_symbols_data): New function.
12520 (Relobj::get_relocs_data): New function.
12521 (Relobj::set_relocs_data): New function.
12522 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12523 (Relobj::gc_process_relocs): New function.
12524 (Relobj::do_gc_process_relocs): New pure virtual function.
12525 (Relobj::sd_): New data member.
12526 (Sized_relobj::is_output_section_offset_invalid): New function.
12527 (Sized_relobj::do_gc_process_relocs): New function.
12528 * options.h (General_options::gc_sections): Modify to not be a no-op.
12529 (General_options::print_gc_sections): New option.
12530 * plugin.cc (Plugin_finish::run): Remove function call to
12531 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12532 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12533 * reloc.cc (Read_relocs::run): Add task to process relocs and
12534 determine unreferenced sections when doing garbage collection.
12535 (Gc_process_relocs): New class.
12536 (Sized_relobj::do_gc_process_relocs): New function.
12537 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12538 sections that are garbage collected.
12539 * reloc.h (Gc_process_relocs): New class.
12540 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12541 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12542 symbols whose corresponding sections are garbage collected.
12543 (Symbol_table::Symbol_table): Add new parameter for the garbage
12544 collection object.
12545 (Symbol_table::gc_mark_undef_symbols): New function.
12546 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12547 (Symbol_table::gc_mark_dyn_syms): New function.
12548 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12549 as garbage.
12550 (Symbol_table::add_from_object): Likewise.
12551 (Symbol_table::add_from_relobj): When building shared objects, do not
12552 treat externally visible symbols as garbage.
12553 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12554 table information for static and relocatable links.
12555 * symtab.h (Symbol_table::set_gc): New function.
12556 (Symbol_table::gc): New function.
12557 (Symbol_table::gc_mark_undef_symbols): New function.
12558 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12559 (Symbol_table::gc_mark_dyn_syms): New function.
12560 (Symbol_table::gc_): New data member.
e1df38aa 12561 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
12562 function.
12563 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12564 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12565
3b293544
CF
125662009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12567
12568 * options.h (General_options::gc_sections): Define as a no-op for now.
12569 (General_options::no_keep_memory): Ditto.
12570 (General_options::Bshareable): Define.
12571 * options.cc (General_options::finalize): Honor -Bshareable.
12572
83d22aa8
AS
125732009-01-20 Andreas Schwab <schwab@suse.de>
12574
12575 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12576 read the value in the contents, since we don't use it. Use the
12577 template endianness when writing.
12578 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12579
cd536b21
AS
125802009-01-19 Andreas Schwab <schwab@suse.de>
12581
12582 * configure.tgt (powerpc64-*): Fix targ_obj.
12583
99e9a495
ILT
125842009-01-15 Ian Lance Taylor <iant@google.com>
12585
12586 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12587 local symbols when stripping all symbols.
12588
bbbfea06
CC
125892009-01-14 Cary Coutant <ccoutant@google.com>
12590
99e9a495 12591 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 12592
0f7c0701
CC
125932009-01-14 Cary Coutant <ccoutant@google.com>
12594
12595 * archive.cc (Archive::get_elf_object_for_member): Remove call
12596 to File_read::claim_for_plugin.
12597 * descriptors.cc (Descriptors::open): Remove reference to
12598 is_claimed.
12599 (Descriptors::claim_for_plugin): Remove.
12600 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12601 (Descriptors::is_claimed): Remove.
12602 (claim_descriptor_for_plugin): Remove.
12603 * fileread.cc (File_read::claim_for_plugin): Remove.
12604 * fileread.h (File_read::claim_for_plugin): Remove.
12605 (File_read::descriptor): Reopen descriptor if necessary.
12606 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12607 (Plugin_manager::all_symbols_read): Add task parameter. Change
12608 all callers.
12609 (Plugin_manager::get_input_file): New function.
12610 (Plugin_manager::release_input_file): New function.
12611 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12612 corresponding data member.
12613 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12614 and pass to base constructor. Change all callers.
12615 (get_input_file, release_input_file): New functions.
12616 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12617 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12618 (Plugin_manager::all_symbols_read): Add task parameter.
12619 (Plugin_manager::get_input_file): New function.
12620 (Plugin_manager::release_input_file): New function.
12621 (Plugin_manager::task_): New data member.
12622 (Pluginobj::Pluginobj): Add filesize parameter.
12623 (Pluginobj::filename): New function.
12624 (Pluginobj::descriptor): New function.
12625 (Pluginobj::filesize): New function.
12626 (Pluginobj::filesize_): New data member.
12627 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12628 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12629 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12630
12631 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12632 with archive libraries.
12633 * testsuite/Makefile.in: Regenerate.
12634 * testsuite/plugin_test.c (struct sym_info): New type.
12635 (get_input_file, release_input_file): New static variables.
12636 (onload): Capture new transfer vector entries.
12637 (claim_file_hook): Stop reading at end of file according to filesize.
12638 Factor out parsing of readelf output into separate function.
12639 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12640 APIs and get the source file name from the symbol table. Convert
12641 source file name to corresponding object file name. Print info
12642 message when adding new input files.
12643 (parse_readelf_line): New function.
12644 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12645 * testsuite/plugin_test_2.sh: Likewise.
12646 * testsuite/plugin_test_3.sh: Likewise.
12647 * testsuite/plugin_test_4.sh: New test case.
12648
62a6d109
ILT
126492009-01-07 Ian Lance Taylor <iant@google.com>
12650
12651 * version.cc (version_string): Bump to 1.8.
12652
483620e8
CC
126532008-12-23 Cary Coutant <ccoutant@google.com>
12654
12655 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12656 * plugin.cc (Plugin_manager::finish): Rename as
12657 layout_deferred_objects. Move cleanup to separate function.
12658 (Plugin_manager::cleanup): New function.
12659 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12660 separately.
12661 * plugin.h (Plugin_manager::finish): Rename as
12662 layout_deferred_objects.
12663 (Plugin_manager::cleanup): New function.
12664 (Plugin_manager::cleanup_done): New field.
12665
d66a9eb3
CC
126662008-12-23 Cary Coutant <ccoutant@google.com>
12667
12668 * plugin.cc (is_visible_from_outside): New function.
12669 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12670 so we don't return "IR only" status for exported symbols or -r links.
12671
12672 * testsuite/Makefile.am (plugin_test_3): New test case.
12673 * testsuite/Makefile.in: Regenerate.
12674 * testsuite/plugin_test_3.sh: New file.
12675
5995b570
CC
126762008-12-22 Cary Coutant <ccoutant@google.com>
12677
12678 * object.cc (Sized_relobj::layout_section): New function.
12679 (Sized_relobj::do_layout): Defer layout of input sections until after
12680 plugin has provided replacement files.
12681 (Sized_relobj::do_layout_deferred_sections): New function.
12682 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12683 (Relobj::layout_deferred_sections): New function.
12684 (Relobj::do_layout_deferred_sections): New function.
12685 (Sized_relobj::do_layout_deferred_sections): New function.
12686 (Sized_relobj::layout_section): New function.
12687 (Sized_relobj::Deferred_layout): New structure.
12688 (Sized_relobj::deferred_layout_): New field.
12689 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12690 Change all callers. Layout deferred sections.
12691 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12692 references.
12693 (Plugin_hook::run): Move code from do_plugin_hook inline.
12694 (Plugin_hook::do_plugin_hook): Remove.
12695 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12696 (Plugin_manager::finish): Renamed, was cleanup.
12697 (Plugin_manager::should_defer_layout): New function.
12698 (Plugin_manager::add_deferred_layout_object): New function.
12699 (Plugin_manager::Deferred_layout_list): New type.
12700 (Plugin_manager::deferred_layout_objects_): New field.
12701 (Plugin_hook::do_plugin_hook): Remove.
12702
ee769c88
ILT
127032008-12-17 Ian Lance Taylor <iant@google.com>
12704
12705 * options.h (class General_options): Add --no case for
12706 --export-dynamic.
12707
abc8dcba
CC
127082008-12-16 Cary Coutant <ccoutant@google.com>
12709
12710 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12711 vector.
12712 (Plugin_manager::claim_file): Create plugin object even if
12713 plugin did not call the add_symbols callback.
12714 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12715 asking for more symbols than were added.
12716 * testsuite/Makefile.am (plugin_test_1): Add test case with
12717 no global symbols.
12718 (empty.syms): New target.
12719 * testsuite/Makefile.in: Regenerate.
12720 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12721 message. Don't call add_symbols if no globals.
12722 (all_symbols_read_hook): Don't provide replacement for empty
12723 claimed file.
12724
b0074644
ILT
127252008-12-12 Ian Lance Taylor <iant@google.com>
12726
68943102
ILT
12727 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12728 r_type == 0 for a local symbol with r_sym == 0.
12729 (scan_relocatable_relocs): Pass r_sym to
12730 local_non_section_strategy.
12731 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12732 r_sym parameter.
12733
b0074644
ILT
12734 * configure.ac: Update test for TLS descriptors: they are
12735 supported as of glibc 2.9.
12736 * configure: Rebuild.
12737
c2508178
ILT
127382008-12-11 Ian Lance Taylor <iant@google.com>
12739
12740 PR 7091
12741 * target-reloc.h (Default_scan_relocatable_relocs): For each
12742 function, map r_type == 0 to RELOC_DISCARD.
12743
2756a258
CC
127442008-12-10 Cary Coutant <ccoutant@google.com>
12745
12746 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12747 object to override a kept COMDAT group from a plugin object.
12748
bb6f53d3
ILT
127492008-12-09 Ian Lance Taylor <iant@google.com>
12750
fbc558e1
ILT
12751 PR 7088
12752 * yyscript.y (file_cmd): Handle INPUT.
12753
bb6f53d3
ILT
12754 * testsuite/initpri1.c: Change all declarations to be full
12755 prototypes by adding void, to avoid compiler warnings.
12756
4674ecfc
CC
127572008-12-05 Rafael Avila de Espindola <espindola@google.com>
12758
12759 * options.cc (General_options::parse_plugin_opt): New.
12760 (General_options::add_plugin): The argument now is just the filename.
12761 (General_options::add_plugin_option): New.
12762 * options.h (plugin_opt): New.
12763 (add_plugin): Change argument name.
12764 (add_plugin_option): New.
12765 * plugin.cc (Plugin::load): Don't parse the plugin option.
12766 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12767 (Plugin::add_option): New.
12768 (Plugin::args_): Change type.
12769 (Plugin::filename_): New.
12770 (Plugin_manager::add_plugin_option): New.
12771 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12772 * testsuite/Makefile.in: Regenerate.
12773
fd06b4aa
CC
127742008-12-05 Cary Coutant <ccoutant@google.com>
12775
12776 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12777 Handle --strip-lto-sections option.
12778 * options.h (strip_lto_sections): New option.
12779
6c52134c
CC
127802008-12-01 Cary Coutant <ccoutant@google.com>
12781
12782 * plugin.cc (ld_plugin_message): Change format parameter to const.
12783 Fix mismatch between new[] and delete.
12784
a45248e0
CC
127852008-11-14 Cary Coutant <ccoutant@google.com>
12786
12787 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12788 instead of -1U.
12789
c82fbeee
CS
127902008-11-05 Craig Silverstein <csilvers@google.com>
12791
12792 * options.cc (General_options::parse_dynamic_list): New function.
12793 * options.h (General_options): New flags dynamic_list,
12794 dynamic_list_data, dynamic_list_cpp_new, and
12795 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12796 (General_options::in_dynamic_list): New function.
12797 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12798 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12799 (Lex::can_continue_name): Likewise.
12800 (yylex): Likewise.
12801 (read_script_file): New parameter script_options.
12802 (read_dynamic_list): New function.
12803 (Script_options::define_dynamic_list): New function.
12804 (dynamic_list_keyword_parsecodes): New variable.
12805 (dynamic_list_keywords): New variable.
12806 * script.h (Script_options::define_dynamic_list): New function
12807 prototype.
12808 (read_dynamic_list): New function prototype.
12809 * symtab.cc (strprefix): New macro.
12810 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12811 dynamic_list_data, dynamic_list_cpp_new, and
12812 dynamic_list_cpp_typeinfo.
12813 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12814 (dynamic_list_expr): New rule.
12815 (dynamic_list_nodes): Likewise.
12816 (dynamic_list_node): Likewise.
12817 * testsuite/Makefile.am (dynamic_list): New test.
12818 * testsuite/Makefile.in: Regenerated.
12819 * testsuite/dynamic_list.t: New file.
12820 * testsuite/dynamic_list.sh: New file.
12821
e0bb29a5
CS
128222008-11-05 Craig Silverstein <csilvers@google.com>
12823
12824 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
12825 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
12826 (t11_last): Likewise.
12827 * testsuite/ver_test_6.c (main): Likewise.
12828
4e1e25e0
CC
128292008-10-07 Cary Coutant <ccoutant@google.com>
12830
12831 * options.c (General_options::finalize): Add check for -static and
12832 -shared.
12833 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
12834 is not empty.
12835
92f03fcb
CC
128362008-10-02 Cary Coutant <ccoutant@google.com>
12837
12838 * plugin.cc (make_sized_plugin_object): Fix conditional
12839 compilation to work when not all targets are enabled.
12840
fbd8a257
CC
128412008-09-29 Cary Coutant <ccoutant@google.com>
12842
12843 * archive.cc (Archive::get_file_and_offset): Use filename instead
12844 of name to get library path.
12845 (Archive::include_member): Unlock external member of a thin archive.
12846
12847 * testsuite/Makefile.am (TEST_AR): New variable.
12848 (thin_archive_test_1): New test.
12849 (thin_archive_test_2): New test.
81636b3f
CC
12850 * testsuite/Makefile.in: Regenerate.
12851 * testsuite/thin_archive_main.cc: New file.
12852 * testsuite/thin_archive_test_1.cc: New file.
12853 * testsuite/thin_archive_test_2.cc: New file.
12854 * testsuite/thin_archive_test_3.cc: New file.
12855 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 12856
eff45813
CC
128572008-09-29 Cary Coutant <ccoutant@google.com>
12858
12859 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
12860 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
12861 instead of -1U.
12862 (Sized_relobj::do_finalize_local_symbols): Likewise.
12863 (Sized_relobj::map_to_kept_section): Likewise.
12864 * object.h (Sized_relobj::invalid_address): New constant.
12865 (Sized_relobj::do_output_section_offset): Check for invalid_address
12866 and return -1ULL.
12867 * output.cc (Output_reloc::local_section_offset): Use constant
12868 invalid_address instead of -1U.
12869 (Output_reloc::get_address): Likewise.
12870 (Output_section::output_address): Change -1U to -1ULL.
12871 * output.h (Output_reloc::invalid_address): New constant.
12872 * reloc.cc (Sized_relobj::write_sections): Use constant
12873 invalid_address instead of -1U.
12874 (Sized_relobj::relocate_sections): Likewise.
12875 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
12876 values for merge sections.
12877 * target-reloc.h (relocate_for_relocatable): Use constant
12878 invalid_address instead of -1U.
12879
89fc3421
CC
128802008-09-19 Cary Coutant <ccoutant@google.com>
12881
12882 Add plugin functionality for link-time optimization (LTO).
12883 * configure.ac (plugins): Add --enable-plugins option.
12884 * configure: Regenerate.
12885 * config.in: Regenerate.
12886 * Makefile.am (LIBDL): New variable.
12887 (CCFILES): Add plugin.cc.
12888 (HFILES): Add plugin.h.
12889 (ldadd_var): Add LIBDL.
12890 * Makefile.in: Regenerate.
12891
12892 * archive.cc: Include "plugin.h".
12893 (Archive::setup): Don't preread archive symbols when using a plugin.
12894 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
12895 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
12896 files.
12897 (Archive::include_member): Add symbols from plugin objects.
12898 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
12899 * descriptors.cc (Descriptors::open): Check for file descriptors
12900 abandoned by plugins.
12901 (Descriptors::claim_for_plugin): New function.
12902 * descriptors.h (Descriptors::claim_for_plugin): New function.
12903 (Open_descriptor::is_claimed): New field.
12904 (claim_descriptor_for_plugin): New function.
12905 * fileread.cc (File_read::claim_for_plugin): New function.
12906 * fileread.h (File_read::claim_for_plugin): New function.
12907 (File_read::descriptor): New function.
12908 * gold.cc: Include "plugin.h".
12909 (queue_initial_tasks): Add task to call plugin hooks for generating
12910 new object files.
12911 * main.cc: Include "plugin.h".
12912 (main): Load plugin libraries.
12913 * object.h (Pluginobj): Declare.
12914 (Object::pluginobj): New function.
12915 (Object::do_pluginobj): New function.
12916 (Object::set_target): New function.
12917 * options.cc: Include "plugin.h".
12918 (General_options::parse_plugin): New function.
12919 (General_options::General_options): Initialize plugins_ field.
12920 (General_options::add_plugin): New function.
12921 * options.h (Plugin_manager): Declare.
12922 (General_options): Add --plugin option.
12923 (General_options::has_plugins): New function.
12924 (General_options::plugins): New function.
12925 (General_options::add_plugin): New function.
12926 (General_options::plugins_): New field.
12927 * plugin.cc: New file.
12928 * plugin.h: New file.
12929 * readsyms.cc: Include "plugin.h".
12930 (Read_symbols::do_read_symbols): Check for archive before checking
12931 for ELF file. Call plugin hooks to claim files.
12932 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
12933 from a real object file; force override when processing replacement
12934 files.
12935 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
12936 (Symbol::init_base_object): Likewise.
12937 (Symbol::init_base_output_data): Likewise.
12938 (Symbol::init_base_output_segment): Likewise.
12939 (Symbol::init_base_constant): Likewise.
12940 (Symbol::init_base_undefined): Likewise.
12941 (Symbol::output_section): Assert that object is not a plugin.
12942 (Symbol_table::add_from_pluginobj): New function.
12943 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
12944 undefined.
12945 (Symbol_table::sized_write_globals): Likewise.
12946 (Symbol_table::add_from_pluginobj): Instantiate template.
12947 * symtab.h (Sized_pluginobj): Declare.
12948 (Symbol::in_real_elf): New function.
12949 (Symbol::set_in_real_elf): New function.
12950 (Symbol::in_real_elf_): New field.
12951 (Symbol_table::add_from_pluginobj): New function.
12952
12953 * testsuite/Makefile.am (AM_CFLAGS): New variable.
12954 (LIBDL): New variable.
12955 (LDADD): Add LIBDL.
12956 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
12957 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
12958 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
12959 (MOSTLYCLEANFILES): Likewise.
12960 * testsuite/Makefile.in: Regenerate.
12961 * testsuite/plugin_test.c: New file.
12962 * testsuite/plugin_test_1.sh: New file.
12963 * testsuite/plugin_test_2.sh: New file.
12964
de31bda5
ILT
129652008-09-16 Ian Lance Taylor <iant@google.com>
12966
9c2d0ef9
ILT
12967 * target-reloc.h (relocate_section): Check whether a symbol is
12968 defined by the ABI before reporting an undefined symbol error.
12969 * target.h (Target::is_defined_by_abi): Make parameter const.
12970 (Target::do_is_defined_by_abi): Likewise.
12971 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
12972 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
12973 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
12974 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
12975 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
12976 * testsuite/Makefile.in: Rebuild.
12977
de31bda5
ILT
12978 * fileread.cc (make_view): Add casts to avoid warning.
12979
9fa33bee
AO
129802008-09-16 Alexandre Oliva <aoliva@redhat.com>
12981
12982 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
12983 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12984
183fd0e3
AO
129852008-09-16 Alexandre Oliva <aoliva@redhat.com>
12986
12987 * options.h (General_options::output_is_executable): New.
12988 (General_options::output_is_pie): New.
12989 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
12990 for shared libraries.
12991 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
12992
7be8330a
CD
129932008-09-11 Chris Demetriou <cgd@google.com>
12994
12995 * options.h (origin): New -z option.
12996 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
12997 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
12998 in DT_FLAGS_1.
12999
a9caad02
CC
130002008-09-05 Cary Coutant <ccoutant@google.com>
13001
13002 * fileread.cc (File_read::make_view): Add check for attempt to map
13003 beyond end of file.
13004
ae6dce4d
CC
130052008-09-05 Cary Coutant <ccoutant@google.com>
13006
13007 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13008 explicit instantiations.
13009
d7ab2a47
KVH
130102008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13011
13012 PR gold/6858
13013 * options.cc (General_options::finalize): Allow undefined symbols
13014 in shlibs if linking -shared.
13015
13016 PR gold/6859
13017 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13018 symbols as not needing a dynsym entry.
13019
1e52a9c1
CS
130202008-08-20 Craig Silverstein <csilvers@google.com>
13021
13022 * fileread.cc (File_read::open): Do not lock the file unless it
13023 was successfully opened.
13024
d85c80a3
CC
130252008-08-14 Cary Coutant <ccoutant@google.com>
13026
13027 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13028 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13029 * testsuite/tls_test.cc (struct int128): 128-bit struct
13030 for testing TLS relocs with non-zero addend.
13031 (v12): New TLS variable.
13032 (t12): New test.
13033 (t_last): Add check for v12.
13034 * testsuite/tls_test.h (t12): New function.
13035 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13036
2d924fd9
ILT
130372008-08-13 Ian Lance Taylor <iant@google.com>
13038
13039 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13040 set tls_segment_ or relro_segment_.
13041 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13042 when appropriate.
13043 * output.h (Output_section::clear_is_relro): New function.
13044 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13045 sections specially even when output_data_ is empty.
13046 (Output_segment::maximum_alignment): When first section is relro,
13047 only force alignment for PT_LOAD segments.
13048 * script.cc (script_data_segment_align): New function.
13049 (script_data_segment_relro_end): New function.
13050 * script-c.h (script_data_segment_align): Declare.
13051 (script_data_segment_relro_end): Declare.
13052 * script-sections.h (class Script_sections): Declare
13053 data_segment_align and data_segment_relro_end. Add fields
13054 segment_align_index_ and saw_relro_end_.
13055 * script-sections.cc (class Sections_element): Add set_is_relro
13056 virtual function. Add new bool* parameter to place_orphan_here.
13057 Add get_output_section virtual function.
13058 (class Output_section_definition): Add set_is_relro. Add new
13059 bool* parameter to place_orphan_here. Add get_output_section.
13060 Add is_relro_ field.
13061 (Output_section_definition::Output_section_definition): Initialize
13062 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13063 and is_relro_ fields.
13064 (Output_section_definition::place_orphan_here): Add is_relro
13065 parameter.
13066 (Output_section_definition::set_section_addresses): Set relro for
13067 output section.
13068 (Output_section_definition::alternate_constraint): Likewise.
13069 (class Orphan_output_section): Add new bool* parameter to
13070 place_orphan_here. Add get_output_section.
13071 (Orphan_output_section::place_orphan_here): Add is_relro
13072 parameter.
13073 (Script_sections::Script_sections): Initialize
13074 data_segment_align_index_ and saw_relro_end_.
13075 (Script_sections::data_segment_align): New function.
13076 (Script_sections::data_segment_relro_end): New function.
13077 (Script_sections::place_orphan): Set or clear is_relro.
13078 (Script_sections::set_section_addresses): Force alignment of first
13079 TLS section.
13080 * yyscript.y (exp): Call script_data_segment_align and
13081 script_data_segment_relro_end.
13082 * testsuite/relro_script_test.t: New file.
13083 * testsuite/relro_test.cc (using_script): Declare.
13084 (t1, t2): Test using_script.
13085 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13086 (relro_script_test_SOURCES): Define.
13087 (relro_script_test_DEPENDENCIES): Define.
13088 (relro_script_test_LDFLAGS): Define.
13089 (relro_script_test_LDADD): Define.
13090 (relro_script_test.so): New target.
13091 * testsuite/Makefile.in: Rebuild.
13092
f827c9a9
CC
130932008-08-06 Cary Coutant <ccoutant@google.com>
13094
13095 * archive.cc (Archive::total_archives, Archive::total_members)
13096 (Archive::total_members_loaded): New variables.
13097 (Archive::setup): Add parameter. Add option to preread
13098 archive symbols.
13099 (Archive::read_armap): Add counter.
13100 (Archive::get_file_and_offset): New function.
13101 (Archive::get_elf_object_for_member): New function.
13102 (Archive::read_all_symbols): New function.
13103 (Archive::read_symbols): New function.
13104 (Archive::add_symbols): Add counters.
13105 (Archive::include_all_members): Use armap to find members if it's
13106 already built.
13107 (Archive::include_member): Skip reading symbols if already read.
13108 Factored code into Archive::get_file_and_offset and
13109 Archive::get_elf_object_for_member. Changed call to
13110 Mapfile::report_include_archive_member.
13111 (Archive::print_stats): New function.
13112 * archive.h: Declare Object and Read_symbols_data classes.
13113 (Archive::Archive): Add initializers for new members.
13114 (Archive::setup): Add parameter.
13115 (Archive::print_stats): New function.
13116 (Archive::total_archives, Archive::total_members)
13117 (Archive::total_members_loaded): New variables.
13118 (Archive::get_file_and_offset): New function.
13119 (Archive::get_elf_object_for_member): New function.
13120 (Archive::read_all_symbols): New function.
13121 (Archive::read_symbols): New function.
13122 (Archive::Archive_member): New class.
13123 (Archive::members_): New member.
13124 (Archive::num_members_): New member.
13125 * main.cc: Include archive.h.
13126 (main): Call Archive::print_stats.
13127 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13128 archive parameter; member_name is now the fully-decorated name.
13129 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13130 * options.h: (General_options): Add --preread-archive-symbols option.
13131 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13132 Archive::setup.
13133
de4c45bd
ILT
131342008-08-04 Ian Lance Taylor <iant@google.com>
13135
13136 * symtab.h (Symbol::use_plt_offset): New function.
13137 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13138 * powerpc.cc (Relocate::relocate): Likewise.
13139 * sparc.cc (Relocate::relocate): Likewise.
13140 * x86_64.cc (Relocate::relocate): Likewise.
13141 * testsuite/weak_plt.sh: New test.
13142 * testsuite/weak_plt_main.cc: New test.
13143 * testsuite/weak_plt_shared.cc: New test.
13144 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13145 (check_PROGRAMS): Add weak_plt.
13146 (check_DATA): Add weak_plt_shared.so.
13147 (weak_plt_main_pic.o, weak_plt): New targets.
13148 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13149 * testsuite/Makefile.in: Rebuild.
13150
13151 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13152 gcctestdir/ld.
13153 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13154 * testsuite/Makefile.in: Rebuild.
13155
323ee3f4
AM
131562008-08-04 Alan Modra <amodra@bigpond.net.au>
13157
13158 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13159 * Makefile.in: Regenerate.
13160 * po/POTFILES.in: Regenerate.
13161
7c07ecec
ILT
131622008-07-29 Ian Lance Taylor <iant@google.com>
13163
13164 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13165 symbols before other symbols.
13166 * testsuite/script_test_2.cc (test_addr): Declare.
13167 (test_addr_alias): Declare.
13168 (main): Check that test_addr and test_addr_alias have the right
cd536b21 13169 values.
7c07ecec
ILT
13170 * testsuite/script_test_2.t: Define test_addr_alias and
13171 test_addr.
13172
5778530e
ILT
131732008-07-24 Ian Lance Taylor <iant@google.com>
13174
2a00e4fb
ILT
13175 PR 5990
13176 * descriptors.cc: New file.
13177 * descriptors.h: New file.
13178 * gold-threads.h (class Hold_optional_lock): New class.
13179 * fileread.cc: Include "descriptors.h".
13180 (File_read::~File_read): Release descriptor rather than closing
13181 it.
13182 (File_read::open) [file]: Call open_descriptor rather than open.
13183 Set is_descriptor_opened_.
13184 (File_read::open) [memory]: Assert that descriptor is not open.
13185 (File_read::reopen_descriptor): New function.
13186 (File_read::release): Release descriptor.
13187 (File_read::do_read): Make non-const. Reopen descriptor.
13188 (File_read::read): Make non-const.
13189 (File_read::make_view): Reopen descriptor.
13190 (File_read::do_readv): Likewise.
13191 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13192 Update declarations.
13193 * layout.cc: Include "descriptors.h".
13194 (Layout::create_build_id): Use open_descriptor rather than open.
13195 * output.cc: Include "descriptors.h".
13196 (Output_file::open): Use open_descriptor rather than open.
13197 * archive.cc (Archive::const_iterator): Change Archive to be
13198 non-const.
13199 (Archive::begin, Archive::end): Make non-const.
13200 (Archive::count_members): Likewise.
13201 * archive.h (class Archive): Update declarations.
13202 * object.h (Object::read): Make non-const.
13203 * Makefile.am (CCFILES): Add descriptors.cc.
13204 (HFILES): Add descriptors.h.
13205 * Makefile.in: Rebuild.
13206
801647d1
ILT
13207 PR 6716
13208 * gold.h: Always include <clocale>. Add Solaris workarounds
13209 following code in binutils/sysdep.h.
13210
5edd166e
ILT
13211 PR 6048
13212 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13213 this->eh_frame_hdr_ is NULL before using it.
13214
c89ad728
ILT
13215 * dynobj.cc (Versions::Versions): Update comment.
13216
aa86f06b
ILT
13217 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13218 the base version name.
13219
5778530e
ILT
13220 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13221 array size plus one.
13222 (Stringpool_template::set_string_offsets): Subtract one from key
13223 before using it as an array index.
13224 (Stringpool_template::get_offset_with_length): Likewise.
13225 (Stringpool_template::write_to_buffer): Likewise.
13226 * stringpool.h (Stringpool_template::get_offset_from_key):
13227 Likewise.
13228
057ead22
ILT
132292008-07-23 Ian Lance Taylor <iant@google.com>
13230
7f649c59
ILT
13231 PR 6658
13232 * object.h (Merged_symbol_value::value): Do our best to handle a
13233 negative addend.
13234
057ead22
ILT
13235 PR 6647
13236 * script.cc (Version_script_info::get_versions): Don't add empty
13237 version tag to return value.
13238 (Version_script_info::get_symbol_version_helper): Change return
13239 type to bool. Add pversion parameter. Change all callers.
13240 (script_register_vers_node): Don't require a non-NULL tag.
13241 * script.h (class Version_script_info): Update declarations.
13242 (Version_script_info::get_symbol_version): Change return type to
13243 bool. Add version parameter. Change all callers.
13244 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13245 handling. Handle an empty version from a version script.
13246 (Symbol_table::define_special_symbol): Likewise.
13247 * testsuite/ver_test_10.script: New file.
13248 * testsuite/ver_test_10.sh: New file.
13249 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13250 (check_DATA): Add ver_test_10.syms.
13251 (ver_test_10.syms, ver_test_10.so): New target.
13252 * testsuite/Makefile.in: Rebuild.
13253
58e54ac2
CD
132542008-07-23 Simon Baldwin <simonb@google.com>
13255
13256 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13257 to zero for undefined symbols from dynamic libraries.
13258
95d14cd3
ILT
132592008-07-23 Ian Lance Taylor <iant@google.com>
13260
13261 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13262 Change all callers.
13263 * symtab.h (class Symbol_table): Update declaration.
13264 * testsuite/ver_test_9.cc: New file.
13265 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13266 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13267 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13268 (ver_test_9.so, ver_test_9.o): New targets.
13269 * testsuite/Makefile.in: Rebuild.
13270
92de84a6
ILT
132712008-07-22 Ian Lance Taylor <iant@google.com>
13272
34810851
ILT
13273 * options.h (class General_options): Define --check-sections.
13274 * layout.cc (Layout::set_segment_offsets): Handle
13275 --check-sections.
13276
af6156ef
ILT
13277 * options.h (class General_options): Define -n/--nmagic and
13278 -N/--omagic.
13279 * options.cc (General_options::finalize): For -n/--nmagic or
13280 -N/--omagic, set -static.
13281 * layout.cc (Layout::attach_allocated_section_to_segment): If
13282 -N/--omagic, don't put read-only and read-write sections in
13283 different segments.
13284 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13285 finding a read-only segment.
13286 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13287 don't set the minimum segment alignment to the common page size,
13288 and don't set the file offset to the address modulo the page size.
13289 * script-sections.cc (Script_sections::create_segments): If
13290 -n/--omagic, don't put read-only and read-write sections in
13291 different segments.
13292
92de84a6
ILT
13293 * cref.cc: New file.
13294 * cref.h: New file.
13295 * options.h (class General_options): Add --print-symbol-counts.
13296 * main.cc (main): Issue defined symbol report if requested.
13297 * archive.cc (Archive::interpret_header): Make into a const member
13298 function.
13299 (Archive::add_symbols): Call Input_objects::archive_start and
13300 archive_stop.
13301 (Archive::const_iterator): Define new class.
13302 (Archive::begin, Archive::end): New functions.
13303 (Archive::include_all_members): Rewrite to use iterator.
13304 (Archive::count_members): New function.
13305 * archive.h (class Archive): Update declarations.
13306 (Archive::filename): New function.
13307 * object.cc: Include "cref.h".
13308 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13309 (Sized_relobj::do_get_global_symbol_counts): New function.
13310 (Input_objects::add_object): Add object to cross-referencer.
13311 (Input_objects::archive_start): New function.
13312 (Input_objects::archive_stop): New function.
13313 (Input_objects::print_symbol_counts): New function.
13314 * object.h: Declare Cref and Archive.
13315 (Object::get_global_symbol_counts): New function.
13316 (Object::do_get_global_symbol_counts): New pure virtual function.
13317 (class Sized_relobj): Add defined_count_ field. Update
13318 declarations.
13319 (class Input_objects): Add cref_ field. Update constructor.
13320 Update declarations.
13321 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13322 defined_count_.
13323 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13324 symbol counts.
13325 (Sized_dynobj::do_get_global_symbol_counts): New function.
13326 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13327 defined_count_. Update declarations. Define Symbols typedef.
13328 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13329 parameter. Change all callers.
13330 (Symbol_table::add_from_dynobj): Add sympointers and defined
13331 parameters. Change all callers.
13332 * symtab.h (class Symbol_table): Update declarations.
13333 * Makefile.am (CCFILES): Add cref.cc.
13334 (HFILES): Add cref.h.
13335 * Makefile.in: Rebuild.
13336
3f7c5e1d
CD
133372008-07-22 Simon Baldwin <simonb@google.com>
13338
13339 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13340 to zero when writing undefined symbols.
13341
e0b64032
ILT
133422008-07-22 Ian Lance Taylor <iant@google.com>
13343
13344 * output.cc (Output_section::add_input_section): Don't try to
13345 merge empty merge sections.
13346
096b02cf
CS
133472008-07-21 Craig Silverstein <csilvers@google.com>
13348
13349 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13350 Include symbol version in error message.
cd536b21 13351
1d1f116d
CD
133522008-07-20 Chris Demetriou <cgd@google.com>
13353
cd536b21 13354 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
13355 (RANDOM_SEED_CFLAGS): New substituted variable.
13356 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13357 * configure: Rebuild.
13358 * Makefile.in: Likewise.
13359 * testsuite/Makefile.in: Likewise.
13360
a18f591e
ILT
133612008-07-18 Ian Lance Taylor <iant@google.com>
13362
13363 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13364 where we see NAME/NULL and NAME/VERSION as separate symbols.
13365 * testsuite/ver_test_main.cc (main): Call t4.
13366 (t4, t4_2a): Define.
13367 * testsuite/ver_test_2.cc (t4_2): Define.
13368 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13369 * testsuite/ver_test_4.cc (t4_2a): Define.
13370 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13371 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13372
c6e3f6ed
ILT
133732008-07-17 Ian Lance Taylor <iant@google.com>
13374
13375 * dynobj.cc (Versions::add_def): If we give an error about a
13376 missing version, go ahead and create the version anyhow.
13377
ef9beddf
ILT
133782008-07-10 Ian Lance Taylor <iant@google.com>
13379
13380 Handle output sections with more than 0x7fffffff bytes.
13381 * object.h (class Relobj): Change map_to_output_ to
13382 output_sections_, and just keep a section pointer. Change all
13383 uses. Move comdat group support to Sized_relobj.
13384 (Relobj::is_section_specially_mapped): Remove.
13385 (Relobj::output_section): Remove poff parameter. Change all
13386 callers.
13387 (Relobj::output_section_offset): New function.
13388 (Relobj::set_section_offset): Rewrite.
13389 (Relobj::map_to_output): Remove.
13390 (Relobj::output_sections): New function.
13391 (Relobj::do_output_section_offset): New pure virtual function.
13392 (Relobj::do_set_section_offset): Likewise.
13393 (class Sized_relobj): Add section_offsets_ field. Add comdat
13394 group support from Relobj. Update declarations.
13395 (Sized_relobj::get_output_section_offset): New function.
13396 (Sized_relobj::do_output_section_offset): New function.
13397 (Sized_relobj::do_set_section_offset): New function.
13398 * object.cc (Relobj::output_section_address): Remove.
13399 (Sized_relobj::Sized_relobj): Initialize new fields.
13400 (Sized_relobj::include_section_group): Cast find_kept_object to
13401 Sized_relobj.
13402 (Sized_relobj::include_linkonce_section): Likewise.
13403 (Sized_relobj::do_layout): Use separate arrays for output section
13404 and output offset.
13405 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13406 output_sections.
13407 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13408 output_sections and section_offsets.
13409 (Sized_relobj::write_local_symbols): Likewise.
13410 (map_to_kept_section): Compute output address directly.
13411 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13412 output_sections and section_offsets.
13413 (Sized_relobj::write_sections): Likewise.
13414 (Sized_relobj::relocate_sections): Likewise.
13415 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13416 * output.h (class Output_reloc): Update declarations. Change
13417 u2_.relobj to Sized_relobj*.
13418 (class Output_data_reloc): Change add functions to use
13419 Sized_relobj*.
13420 * output.cc (Output_reloc::Output_reloc): Change relobj to
13421 Sized_relobj*.
13422 (Output_reloc::local_section_offset): Change return type to
13423 Elf_Addr. Use get_output_section_offset.
13424 (Output_reloc::get_address): Likewise.
13425 (Output_section::is_input_address_mapped): Don't call
13426 is_section_specially_mapped.
13427 (Output_section::output_offset): Likewise.
13428 (Output_section::output_address): Likewise.
13429 (Output_section::starting_output_address): Likewise.
13430 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13431 parameter to Sized_relobj*.
13432 (Copy_relocs::need_copy_reloc): Likewise.
13433 (Copy_relocs::save): Likewise.
13434 * copy-relocs.h (class Copy_relocs): Update declarations.
13435 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13436 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13437 * target-reloc.h (relocate_for_relocatable): Change
13438 offset_in_output_section type to Elf_Addr. Change code that uses
13439 it as well.
13440 * layout.cc (Layout::layout): Always set *off.
13441 * mapfile.cc (Mapfile::print_input_section): Use
13442 output_section_offset.
13443 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13444 Sized_relobj*.
13445 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13446 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13447 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13448
5cb66f97
ILT
134492008-07-03 Ian Lance Taylor <iant@google.com>
13450
13451 * layout.cc (Layout::include_section): Do not discard unrecognized
13452 SHT_STRTAB sections.
13453
afe47622
CS
134542008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13455
13456 * script.cc (Lex::can_continue_name): Make '?' allowable in
13457 version-script names.
13458 * testsuite/version_script.map: Change glob pattern to use '?'
13459
5adf9721
ILT
134602008-06-30 Manish Singh <yosh@gimp.org>
13461
13462 PR 6585
13463 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13464 Correct typo.
13465
e6fde208
ILT
134662008-06-30 Ian Lance Taylor <iant@google.com>
13467
13468 PR 6660
13469 PR 6682
13470 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13471 versions]: Don't try to read the value in the contents, since we
13472 don't use it. Use the template endianness when writing.
13473
3f2e6a2d
CC
134742008-06-25 Cary Coutant <ccoutant@google.com>
13475
13476 * fileread.cc (File_read::make_view): Assert on zero-length view.
13477 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13478 symbol table when there are no symbols to read.
13479
c43d3a48
CS
134802008-06-23 Craig Silverstein <csilvers@google.com>
13481
13482 * version.cc (version_string): Bump to 1.7
13483
5f494ea0
CS
134842008-06-18 Craig Silverstein <csilvers@google.com>
13485
13486 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13487 constant 0xFFFF to type Valtype.
13488 (Powerpc_relocate_functions::rel16_ha): Likewise.
13489
c42e122e
ILT
134902008-06-17 Ian Lance Taylor <iant@google.com>
13491
f34787f8
ILT
13492 * output.h (Output_section::Input_section): Initialize p2align_ to
13493 zero for Output_section_data constructors.
13494 (Output_section::Input_section::addralign): If not an input
13495 section, return the alignment of the Output_section_data.
13496 * testsuite/copy_test.cc: New file.
13497 * testsuite/copy_test_1.cc: New file.
13498 * testsuite/copy_test_2.cc: New file.
13499 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13500 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13501 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13502 (copy_test_1_pic.o, copy_test_1.so): New targets.
13503 (copy_test_2_pic.o, copy_test_2.so): New targets.
13504 * testsuite/Makefile.in: Rebuild.
13505
c42e122e
ILT
13506 * script-sections.cc (Script_sections::place_orphan): Initialize
13507 local variable exact.
13508
ce3ac18a
DE
135092008-06-13 David Edelsohn <edelsohn@gnu.org>
13510
13511 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13512
42cacb20
DE
135132008-06-12 David Edelsohn <edelsohn@gnu.org>
13514 David S. Miller <davem@davemloft.net>
13515
13516 * powerpc.cc: New file.
13517 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13518 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13519 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13520 * Makefile.in: Rebuild.
13521
7b308235
ILT
135222008-06-09 Ian Lance Taylor <iant@google.com>
13523
13524 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13525 <exception>.
13526 (throwing, orig_terminate): New static variables.
13527 (terminate_handler): New static function.
13528 (t2): Set terminate handler.
13529
f0b886e3
ILT
135302008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13531
13532 PR 6584
cd536b21 13533 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
13534 alignment.
13535
3e90f135
CC
135362008-05-30 Cary Coutant <ccoutant@google.com>
13537
13538 * archive.cc (Archive::include_all_members) Correct to step
13539 over symbol table and extended name table in thin archives.
13540
e09ad04a
ILT
135412008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13542
13543 PR 6407
13544 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13545 calculation.
13546
62b01cb5
ILT
135472008-05-28 Caleb Howe <cshowe@google.com>
13548
13549 * reduced_debug_output.cc: New file.
13550 * reduced_debug_output.h: New file.
92de84a6 13551 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
13552 * options.cc (General_options::finalize): Add strip_debug_non_line
13553 to the strip heirarchy.
13554 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13555 fields.
13556 * layout.cc: Include "reduced_debug_output.h".
13557 (Layout::Layout): Initialize new fields.
13558 (line_only_debug_sections): New static array.
13559 (is_lines_only_debug_sections): New static inline function.
13560 (Layout::include_section): Handle --strip-debug-non-line.
13561 (Layout::make_output_section): If --strip-debug-non-line, build
13562 new output sections for .debug_abbrev and .debug_info.
13563 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13564 gold. Warn about possible overflow.
13565 (read_signed_LEB_128): Likewise.
13566 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13567 (read_signed_LEB_128): Declare.
13568 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13569 (HFILES): Add reduced_debug_output.h.
13570 * Makefile.in: Rebuild.
13571
7d9e3d98
ILT
135722008-05-21 Ian Lance Taylor <iant@google.com>
13573
13574 * mapfile.cc: New file.
13575 * mapfile.h: New file.
13576 * options.h (class General_options): Add -M/--print-map and -Map.
13577 * options.cc (General_options::finalize): Make -M equivalent to
13578 -Map -.
13579 * main.cc: Include <cstdio> and "mapfile.h".
13580 (main): Open mapfile if requested.
13581 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13582 constructor. Change caller.
13583 (queue_initial_tasks): Add mapfile parameter. Change caller.
13584 (queue_middle_tasks): Likewise.
13585 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13586 declarations.
13587 * archive.cc: Include "mapfile.h".
13588 (Archive::add_symbols): Add mapfile parameter. Change all
13589 callers. Pass mapfile, symbol, and reason to include_member.
13590 (Archive::include_all_members): Add mapfile parameter. Change all
13591 callers.
13592 (Archive::include_member): Add mapfile, sym, and why parameters.
13593 Change all callers. Report inclusion to map file.
13594 * archive.h: Include "fileread.h".
13595 (class Archive): Update declarations.
13596 (Archive::file): New const method.
13597 (class Add_archive_symbols): Add mapfile_ field. Update
13598 constructor. Change all callers.
13599 * readsyms.h (class Read_symbols): Likewise.
13600 (class Finish_group): Likewise.
13601 (class Read_script): Likewise.
13602 * common.cc: Include "mapfile.h".
13603 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13604 all callers.
13605 (Symbol_table::do_allocate_commons): Likewise.
13606 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13607 symbol allocation to mapfile.
13608 * common.h (class Allocate_commons_task): Add mapfile_ field.
13609 Update constructor. Change all callers.
13610 * symtab.h (class Symbol_table): Update declarations.
13611 * layout.cc: Include "mapfile.h".
13612 (Layout_task_runner::run): Print information to mapfile.
13613 (Layout::create_gold_note): Change Output_data_fixed_space to
13614 Output_data_zero_fill.
13615 (Layout::create_build_id): Likewise.
13616 (Layout::print_to_mapfile): New function.
13617 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13618 constructor. Change caller.
13619 (class Layout): Declare print_to_mapfile.
13620 * output.cc (Output_section::Input_section::print_to_mapfile): New
13621 function.
13622 (Output_section::add_input_section): If producing a map, always
13623 add to input_sections_ list.
13624 (Output_section::do_print_to_mapfile): New function.
13625 (Output_segment::print_sections_to_mapfile): New function.
13626 (Output_segment::print_section_list_to_mapfile): New function.
13627 * output.h: Include "mapfile.h".
13628 (Output_data::print_to_mapfile): New function.
13629 (Output_data::do_print_to_mapfile): New virtual function.
13630 (Output_segment_headers::do_print_to_mapfile): New function.
13631 (Output_file_header::do_print_to_mapfile): New function.
13632 (Output_data_const::do_print_to_mapfile): New function.
13633 (class Output_data_const_buffer): Add map_name_ field. Update
13634 constructor. Change all callers. Add do_print_to_mapfile
13635 function.
13636 (class Output_data_fixed_space): Likewise.
13637 (class Output_data_space): Likewise.
13638 (class Output_data_zero_fill): New class.
13639 (Output_data_strtab::do_print_to_mapfile): New function.
13640 (Output_data_reloc_base::do_print_to_mapfile): New function.
13641 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13642 (Output_data_group::do_print_to_mapfile): New function.
13643 (Output_data_got::do_print_to_mapfile): New function.
13644 (Output_data_dynamic::do_print_to_mapfile): New function.
13645 (Output_symtab_xindex::do_print_to_mapfile): New function.
13646 (class Output_section): Declare do_print_to_mapflie. Declare
13647 print_to_mapfile in Input_section.
13648 (class Output_segment): Declare new functions.
13649 * object.h (Sized_relobj::symbol_count): New function.
13650 * script-sections.cc
13651 (Output_section_element_dot_assignment::set_section_addresses):
13652 Change Output_data_fixed_space to Output_data_zero_fill.
13653 (Output_data_expression::do_print_to_mapfile): New function.
13654 * script.cc (read_input_script): Add mapfile parameter. Change
13655 all callers.
13656 * script.h (read_input_script): Update declaration.
13657 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13658 (Eh_frame::do_print_to_mapfile): New function.
13659 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13660 (Output_merge_string::do_print_to_mapfile): New function.
13661 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13662 function.
13663 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13664 function.
13665 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13666 function.
13667 * Makefile.am (CCFILES): Add mapfile.cc.
13668 (HFILES): Add mapfile.h.
13669 * Makefile.in: Rebuild.
13670
9f1d377b
ILT
136712008-05-19 Ian Lance Taylor <iant@google.com>
13672
13673 * options.h (class General_options): Add -z relro.
13674 * layout.cc (Layout::Layout): Initialize relro_segment_.
13675 (Layout::add_output_section_data): Return the output section.
13676 (Layout::make_output_section): Rcognize relro sections and mark
13677 them appropriately.
13678 (Layout::attach_allocated_section_to_segment): Put relro sections
13679 in a PT_GNU_RELRO segment.
13680 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13681 section as relro.
13682 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13683 PT_TLS segments.
13684 (Layout::linkonce_mapping): Map d.rel.ro.local to
13685 .data.rel.ro.local.
13686 (Layout::output_section_name): Us .data.rel.ro.local for any
13687 section which begins with that.
13688 * layout.h (class Layout): Update add_output_section_data
13689 declaration. Add relro_segment_ field.
13690 * output.cc (Output_section::Output_section): Initialize is_relro_
13691 and is_relro_local_ fields.
13692 (Output_segment::add_output_section): Group relro sections.
13693 (Output_segment::is_first_section_relro): New function.
13694 (Output_segment::maximum_alignment): If there is a relro section,
13695 align the segment to the common page size.
13696 (Output_segment::set_section_addresses): Track whether we are
13697 looking at relro sections. If the last section is a relro
13698 section, align to the common page size.
13699 (Output_segment::set_section_list_addresses): Add in_relro
13700 parameter. Change all callers. Align to the page size when
13701 moving from relro to non-relro section.
13702 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13703 segment.
13704 * output.h (class Output_section): Add is_relro_ and
13705 is_relro_local_ fields.
13706 (Output_section::is_relro): New function.
13707 (Output_section::set_is_relro): New function.
13708 (Output_section::is_relro_local): New function.
13709 (Output_section::set_is_relro_local): New function.
13710 (class Output_segment): Update declarations.
13711 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13712 * sparc.cc (Target_sparc::got_section): Likewise.
13713 * x86_64.cc (Target_x86_64::got_section): Likewise.
13714 * testsuite/relro_test_main.cc: New file.
13715 * testsuite/relro_test.cc: New file.
13716 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13717 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13718 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13719 (relro_test.so, relro_test_pic.o): New targets.
13720 * testsuite/Makefile.in: Rebuild.
13721
a984ee1d
ILT
137222008-05-16 Ian Lance Taylor <iant@google.com>
13723
01676dcd
ILT
13724 * output.cc (Output_segment::add_output_section): Remove front
13725 parameter.
13726 * output.h (class Output_segment): Remove
13727 add_initial_output_section and overloaded add_output_section.
13728 Update declaration of remaining add_output_section.
13729 * layout.cc (Layout::create_interp): Call add_output_section
13730 rather than add_initial_output_section.
13731 (Layout::finish_dynamic_section): Likewise.
13732
497897f9
ILT
13733 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13734 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13735 know the dynamic type.
13736 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13737 field. Initialize it in constructor.
13738 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13739 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13740 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13741 reloc.
13742
a984ee1d
ILT
13743 * output.cc (Output_reloc::get_address): Change return type to
13744 Elf_Addr.
13745 * output.h (class Output_reloc): Update get_address declaration.
13746 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13747 for section addresses.
13748
55ba0940
ILT
137492008-05-09 Ian Lance Taylor <iant@google.com>
13750
13751 PR 6493
13752 * gold.cc (gold_nomem): Use return value of write.
13753
75517b77
ILT
137542008-05-08 Ian Lance Taylor <iant@google.com>
13755
13756 * symtab.c (Symbol::init_base_output_data): Add version
13757 parameter. Change all callers.
13758 (Symbol::init_base_output_segment): Likewise.
13759 (Symbol::init_base_constant): Likewise.
13760 (Symbol::init_base_undefined): Likewise.
13761 (Sized_symbol::init_output_data): Likewise.
13762 (Sized_symbol::init_output_segment): Likewise.
13763 (Sized_symbol::init_constant): Likewise.
13764 (Sized_symbol::init_undefined): Likewise.
13765 (Symbol_table::do_define_in_output_data): If the new symbol has a
13766 version, mark it as the default.
13767 (Symbol_table::do_define_in_output_segment): Likewise.
13768 (Symbol_table::do_define_as_constant): Likewise.
13769 * symtab.h (class Symbol): Update declarations.
13770 (class Sized_symbol): Likewise.
13771 * resolve.cc (Symbol::override_version): New function.
c42e122e 13772 (Symbol::override_base): Call override_version.
75517b77
ILT
13773 (Symbol::override_base_with_special): Likewise.
13774 * testsuite/ver_script_8.script: New file.
13775 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13776 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13777 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13778 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13779
f1f70eae
ILT
137802008-05-06 Ian Lance Taylor <iant@google.com>
13781
f3e9c5c5
ILT
13782 PR 6049
13783 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13784 functions.
13785 (class General_options): Remove existing --undefined, and add
13786 --no-undefined instead. Add new --undefined as synonym for -u.
13787 * archive.cc (Archive::add_symbols): Check whether symbol was
13788 named with -u.
13789 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13790 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13791 all uses. Add IS_UNDEFINED. Update declarations to split
13792 different versions of init_base. Declare init_base_undefined.
13793 (Symbol::is_defined): Handle IS_UNDEFINED.
13794 (Symbol::is_undefined): Likewise.
13795 (Symbol::is_weak_undefined): Call is_undefined.
13796 (Symbol::is_absolute): Handle IS_CONSTANT.
13797 (class Sized_symbol): Update declarations to split different
13798 versions of init. Declare init_undefined.
13799 (class Symbol_table): Declare new functions.
13800 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13801 Change all callers.
13802 (Symbol::init_base_output_data): Likewise.
13803 (Symbol::init_base_output_segment): Likewise.
13804 (Symbol::init_base_constant): Likewise.
13805 (Symbol::init_base_undefined): New function.
13806 (Sized_symbol::init_object): Rename from init. Change all
13807 callers.
13808 (Sized_symbol::init_output_data): Likewise.
13809 (Sized_symbol::init_output_segment): Likewise.
13810 (Sized_symbol::init_constant): Likewise.
13811 (Sized_symbol::init_undefined): New function.
13812 (Symbol_table::add_undefined_symbols_from_command_line): New
13813 function.
13814 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13815 function.
13816 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13817 (Symbol::output_section): Likewise.
13818 (Symbol::set_output_section): Likewise.
13819 (Symbol_table::sized_finalize_symbol): Likewise.
13820 (Symbol_table::sized_write_globals): Likewise.
13821 * resolve.cc (Symbol_table::should_override): Likewise.
13822 (Symbol::override_base_with_special): Likewise.
13823
8bdcdf2c
ILT
13824 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
13825 symbol, change it to have default visibility.
13826 * testsuite/protected_1.cc: New file.
13827 * testsuite/protected_2.cc: New file.
13828 * testsuite/protected_3.cc: New file.
13829 * testsuite/protected_main_1.cc: New file.
13830 * testsuite/protected_main_2.cc: New file.
13831 * testsuite/protected_main_3.cc: New file.
13832 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
13833 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
13834 (protected_1_LDFLAGS, protected_1_LDADD): Define.
13835 (protected_1.so): New target.
13836 (protected_1_pic.o, protected_2_pic.o): New targets.
13837 (protected_3_pic.o): New target.
13838 (check_PROGRAMS): Add protected_2.
13839 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
13840 (protected_2_LDFLAGS, protected_2_LDADD): Define.
13841 * testsuite/Makefile.in: Rebuild.
13842
2b706932
ILT
13843 * options.h (DEFINE_var): Add set_user_set_##varname__.
13844 (DEFINE_bool_alias): New macro.
13845 (class General_options): Define -Bstatic using DEFINE_bool_alias
13846 rather than DEFINE_special. Add --undefined as an alias for -z
13847 defs.
13848 * options.cc (General_options::parse_Bstatic): Remove.
13849
d82a5bcc
ILT
13850 * options.h (class General_options): Add --fatal-warnings.
13851 * main.cc (main): Implement --fatal-warnings.
13852 * errors.h (Errors::warning_count): New function.
13853
f1f70eae
ILT
13854 * options.h (class General_options): Add -Bsymbolic-functions.
13855 * symtab.h (Symbol::is_preemptible): Check for
13856 -Bsymbolic-functions.
13857
8825ac63
ILT
138582008-05-05 Ian Lance Taylor <iant@google.com>
13859
d98bc257
ILT
13860 * options.h (DEFINE_bool): For DASH_Z, create the negative option
13861 as noVARNAME rather than no-VARNAME.
13862 (class General_options): Add option -z combreloc.
13863 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
13864 get_address.
13865 (Output_reloc::sort_before) [SHT_REL]: New function.
13866 (Output_reloc::sort_before) [SHT_RELA]: New function.
13867 (class Output_data_reloc_base): Add sort_relocs_ field. Define
13868 Sort_relocs_comparison.
13869 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
13870 parameter. Change all callers.
13871 (Output_data_reloc::Output_data_reloc) [both versions]: Add
13872 sort_relocs parameter. Change all callers.
13873 * output.cc (Output_reloc::get_address): New function, broken out
13874 of write_rel.
13875 (Output_reloc::write_rel): Call it.
13876 (Output_reloc::compare): New function.
13877 (Output_data_reloc_base::do_write): Optionally sort relocs.
13878
60b2b4e7
ILT
13879 * configure.ac: If targ_extra_obj is set, link it in.
13880 * configure.tgt: Initialize all variables.
13881 (x86_64*): Set targ_extra_obj and targ_extra_size.
13882 * configure: Rebuild.
13883
8825ac63
ILT
13884 * object.cc (Sized_relobj::include_section_group): Adjust section
13885 indexes read from group data. Build vector to pass to
13886 layout_group.
13887 * layout.cc (Layout::layout_group): Add flags and shndxes
13888 parameters. Remove contents parameter. Change caller. Update
13889 explicit instantiations.
13890 * layout.h (class Layout): Update layout_group declaration.
13891 * output.cc (Output_data_group::Output_data_group): Add flags and
13892 input_shndxes parameters. Remove contents parameter. Change
13893 caller.
13894 (Output_data_group::do_write): Change input_sections_ to
13895 input_shndxes_.
13896 * output.h (class Output_data_group): Update constructor
13897 declaration. Rename input_sections_ to input_shndxes_.
13898 * testsuite/many_sections_test.cc: Add template.
13899
e94cf127
CC
139002008-04-30 Cary Coutant <ccoutant@google.com>
13901
4418b2d5
CC
13902 * target-reloc.h (relocate_section): Fix dead-pointer bug.
13903
e94cf127
CC
13904 * layout.cc (Layout::include_section): Refactored check for debug
13905 info section.
13906 (Layout::add_comdat): Add new parameters. Change type
13907 of signature parameter. Add object and shndx to signatures table.
13908 (Layout::find_kept_object): New function.
13909 * layout.h: Include <cstring>.
13910 (Layout::is_debug_info_section): New function.
13911 (Layout::add_comdat): Add new parameters.
13912 (Layout::find_kept_object): New function.
13913 (Layout::Kept_section): New struct.
13914 (Layout::Signatures): Change type of map range.
13915 * object.cc (Relobj::output_section_address): New function.
13916 (Sized_relobj::include_section_group): Add new parameters. Change
13917 calls to Layout::add_comdat. Change to build table of kept comdat
13918 groups and table mapping discarded sections to kept sections.
13919 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
13920 (Sized_relobj::do_layout): Change calls to include_section_group and
13921 include_linkonce_section.
13922 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
13923 value to zero when section is discarded.
13924 (Sized_relobj::map_to_kept_section): New function.
13925 * object.h (Relobj::output_section_address): New function.
13926 (Relobj::Comdat_group): New type.
13927 (Relobj::find_comdat_group): New function.
13928 (Relobj::Comdat_group_table): New type.
13929 (Relobj::Kept_comdat_section): New type.
13930 (Relobj::Kept_comdat_section_table): New type.
13931 (Relobj::add_comdat_group): New function.
13932 (Relobj::set_kept_comdat_section): New function.
13933 (Relobj::get_kept_comdat_section): New function.
13934 (Relobj::comdat_groups_): New field.
13935 (Relobj::kept_comdat_sections_): New field.
13936 (Symbol_value::input_value): Update comment.
13937 (Sized_relobj::map_to_kept_section) New function.
13938 (Sized_relobj::include_linkonce_section): Add new parameter.
13939 * target-reloc.h (Comdat_behavior): New type.
13940 (get_comdat_behavior): New function.
13941 (relocate_section): Add code to map a discarded section to the
13942 corresponding kept section when applying a relocation.
13943
e4e5049b
CS
139442008-04-30 Craig Silverstein <csilvers@google.com>
13945
13946 * dwarf_reader.cc (next_generation_count): New static var.
13947 (Addr2line_cache_entry): New struct.
13948 (addr2line_cache): New static var.
13949 (Dwarf_line_info::one_addr2line): Added caching.
13950 (Dwarf_line_info::clear_addr2line_cache): New function.
13951 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
13952 cache-size parameter.
13953 (Dwarf_line_info::one_addr2line_cache): New function.
13954 * symtab.cc (Symbol_table::detect_odr_violations): Pass
13955 new cache-size argument to one_addr2line(), and clear cache.
13956
d09e9154
CC
139572008-04-28 Cary Coutant <ccoutant@google.com>
13958
13959 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
13960 R_386_PC8 relocations.
13961
7ef73768
ILT
139622008-04-23 Ian Lance Taylor <iant@google.com>
13963
55438702
ILT
13964 * object.cc (Sized_relobj::include_section_group): Check for
13965 invalid section group.
13966
c165fb93
ILT
13967 * object.cc (make_elf_object): Correct test for 64-bit ELF file
13968 header size.
13969
7ef73768
ILT
13970 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
13971 than read for file header.
13972 * archive.cc (Archive::include_member): Likewise.
13973
6194aaab
L
139742008-04-23 Paolo Bonzini <bonzini@gnu.org>
13975
13976 * aclocal.m4: Regenerate.
13977 * configure: Regenerate.
13978
d491d34e
ILT
139792008-04-19 Ian Lance Taylor <iant@google.com>
13980
5ea2bac6
ILT
13981 * version.cc (version_string): Bump to 1.6.
13982
7bc3e21a
ILT
13983 * testsuite/Makefile.am (many_sections_r_test): New target.
13984 (many_sections_r_test_SOURCES): Remove.
13985 (many_sections_r_test_DEPENDENCIES): Remove.
13986 (many_sections_r_test_LDFLAGS): Remove.
13987 (many_sections_r_test_LDADD): Remove.
13988
7fcd3aa9
ILT
13989 * object.cc (Sized_relobj::do_add_symbols): Always pass
13990 local_symbol_count_ to add_from_relobj.
13991
4c94d6ae
ILT
13992 * testsuite/Makefile.am (many_sections_check.h): Only check one in
13993 every thousand variables.
13994 * testsuite/Makefile.in: Rebuild.
13995
d491d34e
ILT
13996 * object.cc (Xindex::initialize_symtab_xindex): New function.
13997 (Xindex::read_symtab_xindex): New function.
13998 (Xindex::sym_xindex_to_shndx): New function.
13999 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14000 available.
14001 (Sized_relobj::do_initialize_xindex): New function.
14002 (Sized_relobj::do_read_symbols): Adjust section links.
14003 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14004 parameter. Change all callers.
14005 (Sized_relobj::include_section_group): Adjust section links and
14006 symbol section indexes.
14007 (Sized_relobj::do_layout): Adjust section links.
14008 (Sized_relobj::do_count_local_symbols): Adjust section links and
14009 symbol section indexes.
14010 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14011 ordinary and special symbols.
14012 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14013 dynsym_xindex parameters. Change all callers. Adjust section
14014 links. Use SHN_XINDEX when needed.
14015 (Sized_relobj::get_symbol_location_info): Adjust section links.
14016 Don't get fooled by special symbols.
14017 * object.h (class Xindex): Define.
14018 (class Object): Add xindex_ parameter. Declare virtual functoin
14019 do_initialize_xindex.
14020 (Object::adjust_sym_shndx): New function.
14021 (Object::set_xindex): New protected function.
14022 (class Symbol_value): Add is_ordinary_shndx_ field.
14023 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14024 (Symbol_value::value): Assert ordinary section.
14025 (Symbol_value::initialize_input_to_output_map): Likewise.
14026 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14027 Change all callers.
14028 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14029 all callers.
14030 (class Sized_relobj): Update declarations.
14031 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14032 parameter. Change all callers.
14033 (Sized_relobj::adjust_shndx): New function.
14034 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14035 field.
14036 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14037 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14038 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14039 (Sized_dynobj::read_dynsym_section): Adjust section links.
14040 (Sized_dynobj::read_dynamic): Likewise.
14041 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14042 section links.
14043 (Sized_dynobj::do_initialize_xindex): New function.
14044 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14045 do_initialize_xindex.
14046 (Sized_dynobj::adjust_shndx): New function.
14047 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14048 dynsym_xindex_ fields.
14049 (Layout::finalize): Add a call to set_section_indexes before
14050 creating the symtab sections.
14051 (Layout::set_section_indexes): Don't do anything if the section
14052 already has a section index.
14053 (Layout::create_symtab_sections): Add shnum parameter. Change
14054 caller. Create .symtab_shndx section if needed.
14055 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14056 caller.
14057 (Layout::allocated_output_section_count): New function.
14058 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14059 needed.
14060 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14061 fields. Update declarations.
14062 (Layout::symtab_xindex): New function.
14063 (Layout::dynsym_xindex): New function.
14064 (class Write_symbols_task): Add layout_ field.
14065 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14066 Change caller.
14067 * output.cc (Output_section_headers::Output_section_headers): Add
14068 shstrtab_section parameter. Change all callers.
14069 (Output_section_headers::do_sized_write): Store overflow values
14070 for section count and section string table section index in
14071 section header zero.
14072 (Output_file_header::do_sized_write): Check for overflow of
14073 section count and section string table section index.
14074 (Output_symtab_xindex::do_write): New function.
14075 (Output_symtab_xindex::endian_do_write): New function.
14076 * output.h (class Output_section_headers): Add shstrtab_section_.
14077 Update declarations.
14078 (class Output_symtab_xindex): Define.
14079 (Output_section::has_out_shndx): New function.
14080 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14081 field.
14082 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14083 Change all callers.
14084 (Sized_symbol::init): Likewise.
14085 (Symbol::output_section): Check for ordinary symbol.
14086 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14087 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14088 callers.
14089 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14090 Change all callers. Simplify handling of symbols from sections
14091 not included in the link.
14092 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14093 distinction.
14094 (Weak_alias_sorter::operator()): Assert that symbols are
14095 ordinary.
14096 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14097 distinction.
14098 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14099 parameters. Change all callers.
14100 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14101 symbol distinction. Use SHN_XINDEX when needed.
14102 (Symbol_table::write_section_symbol): Add symtab_xindex
14103 parameter. Change all callers.
14104 (Symbol_table::sized_write_section_symbol): Likewise. Use
14105 SHN_XINDEX when needed.
14106 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14107 declarations.
14108 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14109 (Symbol::is_defined): Check is_ordinary.
14110 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14111 (Symbol::is_absolute, Symbol::is_common): Likewise.
14112 (class Sized_symbol): Update declarations.
14113 (class Symbol_table): Update declarations.
14114 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14115 parameters. Change all callers.
14116 (Sized_symbol::override): Likewise.
14117 (Symbol_table::override): Likewise.
14118 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14119 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14120 is_ordinary, and orig_st_shndx parameters. Change all callers.
14121 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14122 to be in an ordinary section.
14123 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14124 object and is_ordinary parameters. Change all callers.
14125 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14126 Change all callers. Don't add undefined or non-ordinary symbols
14127 to reloc_map_.
14128 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14129 Change all callers.
14130 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14131 declarations.
14132 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14133 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14134 (Sized_relobj::relocate_sections): Likewise.
14135 * target-reloc.h (scan_relocs): Adjust section symbol index.
14136 (scan_relocatable_relocs): Likewise.
14137 * i386.cc (Scan::local): Check for ordinary symbols.
14138 * sparc.cc (Scan::local): Likewise.
14139 * x86_64.cc (Scan::local): Likewise.
14140 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14141 to symbol_section_and_value.
14142 * testsuite/many_sections_test.cc: New file.
14143 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14144 (check_PROGRAMS): Add many_sections_test.
14145 (many_sections_test_SOURCES): Define.
14146 (many_sections_test_DEPENDENCIES): Define.
14147 (many_sections_test_LDFLAGS): Define.
14148 (BUILT_SOURCES): Add many_sections_define.h.
14149 (many_sections_define.h): New target.
14150 (BUILT_SOURCES): Add many_sections_check.h.
14151 (many_sections_check.h): New target.
14152 (check_PROGRAMS): Add many_sections_r_test.
14153 (many_sections_r_test_SOURCES): Define.
14154 (many_sections_r_test_DEPENDENCIES): Define.
14155 (many_sections_r_test_LDFLAGS): Define.
14156 (many_sections_r_test_LDADD): Define.
14157 (many_sections_r_test.o): New target.
14158 * testsuite/Makefile.in: Rebuild.
14159
c5818ff1
CC
141602008-04-17 Cary Coutant <ccoutant@google.com>
14161
14162 * errors.cc (Errors::info): New function.
14163 (gold_info): New function.
14164 * errors.h (Errors::info): New function.
14165 * gold.h (gold_info): New function.
14166 * object.cc (Input_objects::add_object): Print trace output.
14167 * options.cc (options::parse_set): New function.
14168 (General_options::parse_wrap): Deleted.
14169 (General_options::General_options): Deleted initializer.
14170 * options.h (options::String_set): New typedef.
14171 (options::parse_set): New function.
14172 (DEFINE_set): New macro.
14173 (General_options::wrap): Changed to use DEFINE_set. Changed
14174 callers of any_wrap_symbols and is_wrap_symbol.
14175 (General_options::trace, General_options::trace_symbol):
14176 New options.
14177 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14178 (General_options::wrap_symbols_): Deleted.
14179 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14180
b5be4a7c
DM
141812008-04-17 David S. Miller <davem@davemloft.net>
14182
14183 * options.cc (General_options::parse_V): New function.
14184 * options.h: Add entries for -V and -Qy.
14185
155a0dd7
ILT
141862008-04-17 Ian Lance Taylor <iant@google.com>
14187
14188 * common.cc (Symbol_table::allocate_commons): Remove options
14189 parameter. Change caller.
14190 (Symbol_table::do_allocate_commons): Remove options parameter.
14191 Change caller. Just call do_allocate_commons_list twice.
14192 (Symbol_table::do_allocate_commons_list): New function, broken out
14193 of do_allocate_commons.
14194 * common.h (class Allocate_commons_task): Remove options_ field.
14195 Update constructor.
14196 * symtab.cc (Symbol_table::Symbol_table): Initialize
14197 tls_commons_.
14198 (Symbol_table::add_from_object): Put TLS common symbols on
14199 tls_commons_ list.
14200 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14201 which are IN_OUTPUT_DATA.
14202 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14203 allocate_commons and do_allocate_commons declarations. Declare
14204 do_allocate_commons_list.
14205 * gold.cc (queue_middle_tasks): Update creation of
14206 Allocate_commons_task to not pass options.
14207 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14208 (TLS_TEST_C_FLAGS): New variable.
14209 (tls_test_c_pic.o): New target.
14210 (tls_test_shared.so): Link in tls_test_c_pic.o.
14211 (tls_test_c_pic_ie.o): New target.
14212 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14213 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14214 (tls_test_c.o): New target.
14215 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14216 (tls_pic_test_LDADD): Likewise.
14217 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14218 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14219 (tls_test_c_gnu2.o): New target.
14220 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14221 tls_test_c_gnu2.o.
14222 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14223 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14224 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14225 * testsuite/tls_test.cc: Include "config.h".
14226 (t_last): Call t11_last.
14227 * testsuite/tls_test.h (t11, t11_last): Declare.
14228 * testsuite/tls_test_c.c: New file.
14229 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14230 * configure.ac: Check for OpenMP support.
14231 * configure, config.in, Makefile.in: Rebuild.
14232 * testsuite/Makefile.in: Rebuild.
14233
edfbb029
CC
142342008-04-16 Cary Coutant <ccoutant@google.com>
14235
14236 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14237 (Target_i386::tls_base_symbol_defined_): New field.
14238 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14239 (Target_i386::Scan::global): Likewise.
14240 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14241 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14242 (Target_x86_64::tls_base_symbol_defined_): New field.
14243 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14244 (Target_x86_64::Scan::global): Likewise.
14245
f3c69fca
CC
142462008-04-16 Cary Coutant <ccoutant@google.com>
14247
14248 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14249 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14250 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14251 building shared libraries.
14252 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14253 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14254 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14255 * testsuite/Makefile.in: Rebuild.
14256 * testsuite/weak_undef.h: New file.
14257 * testsuite/weak_undef_file1.cc: Add extra test cases.
14258 * testsuite/weak_undef_file2.cc: Likewise.
14259 * testsuite/weak_undef_test.cc: Likewise.
14260
7c414435
DM
142612008-04-16 David S. Miller <davem@davemloft.net>
14262
32b769e1
DM
14263 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14264 Add issued_non_pic_error_ field. Declare check_non_pic.
14265 (Target_sparc::Scan::check_non_pic): New function.
14266 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14267 (Target_sparc::Scan::global): Likewise.
14268
11936fb1
DM
14269 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14270 * configure: Rebuild.
14271
7c414435
DM
14272 * options.h (DEFINE_enable): New macro.
14273 (new_dtags): New enable option.
14274 (initfirst, interpose, loadfltr, nodefaultlib,
14275 nodelete, nodlopen, nodump): New -z options.
14276 * layout.cc (Layout:finish_dynamic_section): If new
14277 dtags enabled, emit DT_RUNPATH. Also, emit a
14278 DT_FLAGS_1 containing any specified -z flags.
14279
85c7bf8b
ILT
142802008-04-16 Ian Lance Taylor <iant@google.com>
14281
12c0daef
ILT
14282 * copy-relocs.cc: New file.
14283 * copy-relocs.h: New file.
14284 * reloc.cc: Remove Copy_relocs code.
14285 * reloc.h: Likewise.
14286 * reloc-types.h (struct Reloc_types) [both versions]: Add
14287 get_reloc_addend_noerror.
14288 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14289 variants of add_global which take an addend which must be zero.
14290 * i386.cc: Include "copy-relocs.h".
14291 (class Target_i386): Change type of copy_relocs_ to variable,
14292 update initializer.
14293 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14294 Change all callers.
14295 (Target_i386::do_finalize_sections): Change handling of
14296 copy_relocs_.
14297 * sparc.cc: Include "copy-relocs.h".
14298 (class Target_sparc): Change type of copy_relocs_ to variable,
14299 update initializer.
14300 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14301 Change all callers.
14302 (Target_sparc::do_finalize_sections): Change handling of
14303 copy_relocs_.
14304 * x86_64.cc: Include "copy-relocs.h".
14305 (class Target_x86_64): Change type of copy_relocs_ to variable,
14306 update initializer.
14307 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14308 class. Change all callers.
14309 (Target_x86_64::do_finalize_sections): Change handling of
14310 copy_relocs_.
14311 * Makefile.am (CCFILES): Add copy-relocs.cc.
14312 (HFILES): Add copy-relocs.h.
14313
4f4995b6
ILT
14314 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14315
85c7bf8b
ILT
14316 * testsuite/script_test_4.sh: Permit leading zeroes.
14317
4f2a9edd
ILT
143182008-04-15 Ian Lance Taylor <iant@google.com>
14319
e6188289
ILT
14320 * script-sections.cc (Script_sections::create_segments): Use
14321 header_size_adjustment even when there is enough room for the
14322 headers.
14323 * testsuite/script_test_4.sh: New file.
14324 * testsuite/script_test_4.t: New file.
14325 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14326 (check_DATA): Add script_test_4.stdout.
14327 (MOSTLYCLEANFILES): Likewise.
14328 (script_test_4): New target.
14329 (script_test_4.stdout): New target.
14330 * testsuite/Makefile.in: Rebuild.
14331
4f2a9edd
ILT
14332 * sparc.cc: Add definitions for Output_data_plt_sparc class
14333 constants.
14334
f5314dd5
DM
143352008-04-14 David S. Miller <davem@davemloft.net>
14336
14337 * sparc.cc: New file.
14338 * Makefile.am (TARGETSOURCES): Add sparc.cc
14339 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14340 * configure.tgt: Document targ_extra_size and
14341 targ_extra_big_endian. Add entries for sparc-* and
14342 sparc64-*.
14343 * configure.ac: Handle targ_extra_size and
14344 targ_extra_big_endian.
14345 * Makefile.in: Rebuild.
14346 * configure: Likewise.
14347 * po/POTFILES.in: Likewise.
14348 * po/gold.pot: Likewise.
14349
154e0e9a
ILT
143502008-04-14 Ian Lance Taylor <iant@google.com>
14351
14352 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14353 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14354 in the name/type/flags to section mapping. Don't call
14355 allocate_output_section.
14356 (Layout::choose_output_section): Change parameter from adjust_name
14357 to is_input_section. Don't permit input sections after sections
14358 are attached to segments. Don't call allocate_output_section.
14359 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14360 not write_enable_output_section.
14361 (Layout::make_output_section): Don't push to
14362 unattached_section_list_ nor call attach_to_segment. Call
14363 attach_section_to_segment if sections are attached.
14364 (Layout::attach_sections_to_segments): New function.
14365 (Layout::attach_section_to_segment): New function.
14366 (Layout::attach_allocated_section_to_segment): Rename from
14367 attach_to_segment. Remove flags parameter.
14368 (Layout::allocate_output_section): Remove function.
14369 (Layout::write_enable_output_section): Remove function.
14370 * layout.h (class Layout): Update for above changes. Add new
14371 field sections_are_attached_.
14372 * output.h (Output_section::update_flags_for_input_section): New
14373 function.
14374 * output.cc (Output_section::add_input_section): Call
14375 update_flags_for_input_section.
14376 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14377
009a67a2
CC
143782008-04-11 Cary Coutant <ccoutant@google.com>
14379
14380 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14381 thought unnecessary.
14382 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14383
759b1a24
ILT
143842008-04-11 Ian Lance Taylor <iant@google.com>
14385
14386 * output.h (class Output_section_data): Remove inline definition
14387 of set_addralign.
14388 * output.cc (Output_section_data::set_addralign): New function.
14389
c2b45e22
CC
143902008-04-11 Cary Coutant <ccoutant@google.com>
14391
14392 Add support for TLS descriptors for i386 and x86_64.
14393 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14394 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14395 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14396 GOT_TYPE_TLS_DESC.
14397 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14398 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14399 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14400 relocations.
14401 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14402 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14403 Fix problem with initial-exec relocations.
14404 (Target_i386::Relocate::relocate_tls): Likewise.
14405 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14406 relaxation.
14407 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14408 support for section-plus-offset dynamic table entries.
14409 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14410 (Output_data_dynamic::Dynamic_entry): Add support for
14411 section-plus-offset dynamic table entries.
14412 (Output_data_dynamic::Classification): Likewise.
14413 (Output_data_dynamic::classification_): Renamed offset_.
14414 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14415 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14416 (Target_x86_64::make_plt_section): New function.
14417 (Target_x86_64::reserve_tlsdesc_entries): New function.
14418 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14419 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14420 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14421 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14422 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14423 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14424 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14425 add extra PLT entry for TLS descriptors.
14426 (Output_data_plt_x86_64::got_): New field.
14427 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14428 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14429 fields.
14430 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14431 descriptors.
14432 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14433 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14434 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14435 R_386_TLS_DESC_CALL relocations.
14436 (Target_x86_64::Scan::global): Likewise.
14437 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14438 for TLS descriptors.
14439 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14440 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14441 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14442 GD-to-IE relaxation.
14443 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14444 and TLS_DESCRIPTORS.
14445 * Makefile.in: Rebuild.
14446 * configure: Rebuild.
14447 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14448 (tls_test_shared2.so): New target.
14449 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14450 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14451 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14452 (tls_shared_gd_to_ie_test_LDADD): New variable.
14453 (tls_shared_gnu2_gd_to_ie_test): New target.
14454 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14455 New targets.
14456 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14457 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14458 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14459 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14460 (tls_shared_gnu2_test): New target.
14461 (tls_test_gnu2_shared.so): New target.
14462 (tls_shared_gnu2_test_SOURCES): New variable.
14463 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14464 (tls_shared_gnu2_test_LDFLAGS): New variable.
14465 (tls_shared_gnu2_test_LDADD): New variable.
14466 * testsuite/Makefile.in: Rebuild.
14467 * testsuite/Makefile.
14468
83bfb6b7
ILT
144692008-04-11 Ian Lance Taylor <iant@google.com>
14470
14471 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14472 justsyms.t.
14473 * testsuite/Makefile.in: Rebuild.
14474
14475 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14476 long.
14477 * testsuite/script_test_2.cc (main): Adjust test.
14478
706e1f5e
ILT
144792008-04-11 David S. Miller <davem@davemloft.net>
14480 Ian Lance Taylor <iant@google.com>
14481
14482 * options.h (General_options): Add entries for '-Y' and
14483 '-relax'.
14484 * options.cc (General_options:finalize): If -Y was used, add those
14485 entries to the library path instead of the default "/lib" and
14486 "/usr/lib".
14487
7c98e6bb
DM
144882008-04-11 David S. Miller <davem@davemloft.net>
14489
14490 * testsuite/justsyms.t: Start at 0x100.
14491 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
14492 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14493 long.
14494 * testsuite/script_test_2.cc: Adjust string and section length
14495 checks.
7c98e6bb 14496
99a37bfd
ILT
144972008-04-09 Ian Lance Taylor <iant@google.com>
14498
2cefc357
ILT
14499 PR gold/5996
14500 * script-sections.cc (Sections_element::allocate_to_segment): Add
14501 orphan parameter.
14502 (Output_section_definition::allocate_to_segment): Likewise.
14503 (Orphan_output_section::allocate_to_segment): Likewise.
14504 (Script_sections::attach_sections_using_phdrs_clause): Don't
14505 propagate non-PT_LOAD segments to orphan sections.
14506 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14507 readelf rather than objdump.
14508 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14509 .interp section and PT_INTERP segment are the same size.
14510 * testsuite/Makefile.in: Rebuild.
14511
99a37bfd
ILT
14512 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14513 aliases for symbols defined in the same object.
14514 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14515 (weak_alias_test_SOURCES): New variable.
14516 (weak_alias_test_DEPENDENCIES): New variable.
14517 (weak_alias_test_LDFLAGS): New variable.
14518 (weak_alias_test_LDADD): New variable.
14519 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14520 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14521 (weak_alias_test_3.o): New target.
14522 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14523 * testsuite/weak_alias_test_main.cc: New file.
14524 * testsuite/weak_alias_test_1.cc: New file.
14525 * testsuite/weak_alias_test_2.cc: New file.
14526 * testsuite/weak_alias_test_3.cc: New file.
14527
780e49c5
ILT
145282008-04-08 Ian Lance Taylor <iant@google.com>
14529
cdb0b8f5
ILT
14530 * options.h (class General_options): Add --noinhibit-exec option.
14531 * main.cc (main): Check --noinhibit-exec.
14532
0864d551
ILT
14533 * options.h (class General_options): Define --wrap as a special
14534 option. Add wrap_symbols_ field.
14535 (General_options::any_wrap_symbols): New function.
14536 (General_options::is_wrap_symbol): New function.
14537 * options.cc (General_options::parse_wrap): New function.
14538 (General_options::General_options): Initialize wrap_symbols_.
14539 * symtab.cc (Symbol_table::wrap_symbol): New function.
14540 (Symbol_table::add_from_object): Handle --wrap.
14541 * symtab.h (class Symbol_table): Declare wrap_symbol.
14542 * target.h (Target::wrap_char): New function.
14543 (Target::Target_info): Add wrap_char field.
14544 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14545 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14546 * testsuite/testfile.cc (Target_test::test_target_info):
14547 Likewise.
14548
789aa6de
ILT
14549 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14550 there is one.
14551
2c38906f
ILT
14552 * layout.h (class Layout): Add added_eh_frame_data_ field.
14553 * layout.cc (Layout::Layout): Initialize new field.
14554 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14555 output section until we find a section we merged successfully.
14556 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14557 that the size be non-zero.
14558
780e49c5
ILT
14559 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14560 qualifier.
14561
7fcd0256
ILT
145622008-04-08 Craig Silverstein <csilvers@google.com>
14563
14564 * configure.ac: Export new conditional variable HAVE_ZLIB.
14565 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14566 on HAVE_ZLIB.
14567 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14568 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14569
6835af53
ILT
145702008-04-07 Ian Lance Taylor <iant@google.com>
14571
e24f324c
ILT
14572 * version.cc (version_string): Set to "1.5".
14573
a036edd8
ILT
14574 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14575 Add issued_non_pic_error_ field. Declare check_non_pic.
14576 (Target_x86_64::Scan::check_non_pic): New function.
14577 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14578 (Target_x86_64::Scan::global): Likewise.
14579
624f8810
ILT
14580 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14581 addend parameter. Change caller. Handle merge sections.
14582 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14583 Address to Addend. Don't add in the result of
14584 local_section_offset, pass down the addend and use the returned
14585 value.
14586 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14587 Update declarations of local_section_offset and symbol_value.
14588 * testsuite/two_file_test_1.cc (t18): New function.
14589 * testsuite/two_file_test_2.cc (f18): New function.
14590 * testsuite/two_file_test_main.cc (main): Call t18.
14591 * testsuite/two_file_test.h (t18, f18): Declare.
14592
6835af53
ILT
14593 * configure.ac: Don't test for objdump, c++filt, or readelf.
14594 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14595 conditionals.
14596 (TEST_READELF): New variable.
14597 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14598 (check_PROGRAMS): Add two_file_strip_test.
14599 (two_file_strip_test): New target.
14600 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14601 (two_file_same_shared_strip_test_SOURCES): New variable.
14602 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14603 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14604 (two_file_same_shared_strip_test_LDADD): New variable.
14605 (two_file_shared_strip.so): New target.
14606 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14607 (ver_test_5.syms, ver_test_7.syms): Likewise.
14608 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14609 (strip_test_3.stdout): Use TEST_OBJDUMP.
14610 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14611
86925eef
CC
146122008-04-04 Cary Coutant <ccoutant@google.com>
14613
14614 * symtab.h (Symbol::is_weak_undefined): New function.
14615 (Symbol::is_strong_undefined): New function.
14616 (Symbol::is_absolute): New function.
14617 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14618 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14619 absolute symbols.
14620 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14621 (weak_undef_test): New target.
14622 * testsuite/Makefile.in: Rebuild.
14623 * testsuite/weak_undef_file1.cc: New file.
14624 * testsuite/weak_undef_file2.cc: New file.
14625 * testsuite/weak_undef_test.cc: New file.
14626
126f3ece
ILT
146272008-04-03 Craig Silverstein <csilvers@google.com>
14628
14629 * compressed_output.h (class Output_compressed_section): Use
14630 unsigned buffer.
14631 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14632 add zlib header.
14633 (zlib_compressed_suffix): Removed.
14634 (Output_compressed_section::set_final_data_size): Use unsigned
14635 buffers.
14636 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14637 Fix linker invocation.
14638 (flagstest_o_specialfile_and_compress_debug_sections):
14639 Likewise.
14640 * testsuite/Makefile.in: Regenerated.
14641
deae2a14
DM
146422008-04-02 David S. Miller <davem@davemloft.net>
14643
14644 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14645 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14646
70752818
ILT
146472008-04-02 Craig Silverstein <csilvers@google.com>
14648
14649 * TODO: New file.
14650
39d0cb0e
ILT
146512008-04-02 Ian Lance Taylor <iant@google.com>
14652
14653 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14654 parameters. Update for new key type to views_. Change all
14655 callers.
14656 (File_read::read): Adjust for byteshift in returned view.
14657 (File_read::add_view): New function, broken out of
14658 find_and_make_view.
14659 (File_read::make_view): New function, broken out of
14660 find_and_make_view.
14661 (File_read::find_or_make_view): Add offset and aligned
14662 parameters. Rewrite accordingly. Change all callers.
14663 (File_read::get_view): Add offset and aligned parameters. Adjust
14664 for byteshift in return value.
14665 (File_read::get_lasting_view): Likewise.
14666 * fileread.h (class File_read): Update declarations.
14667 (class File_read::View): Add byteshift_ field. Add byteshift to
14668 constructor. Add byteshift method.
14669 * archive.h (Archive::clear_uncached_views): New function.
14670 (Archive::get_view): Add aligned parameter. Change all callers.
14671 * object.h (Object::get_view): Add aligned parameter. Change all
14672 callers.
14673 (Object::get_lasting_view): Likewise.
14674
14675 * fileread.cc (File_read::release): Don't call clear_views if
14676 there are multiple objects.
14677 * fileread.h (File_read::clear_uncached_views): New function.
14678 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14679 on the archive.
14680
a1207466
CC
146812008-03-31 Cary Coutant <ccoutant@google.com>
14682
14683 Add thin archive support.
14684 * archive.cc (Archive::armagt): New const.
14685 (Archive::setup): Remove task parameter and calls to unlock.
14686 (Archive::unlock_nested_archives): New function.
14687 (Archive::read_header): Add nested_off parameter. Change
14688 all callers.
14689 (Archive::interpret_header): Likewise.
14690 (Archive::include_all_members): Change to handle thin
14691 archives.
14692 (Archive::include_member): Likewise.
14693 * archive.h (Archive::Archive): Add new parameters and
14694 initializers.
14695 (Archive::armagt): New const.
14696 (Archive::setup): Remove task parameter.
14697 (Archive::unlock_nested_archives): New function.
14698 (Archive::read_header): Add nested_off parameter.
14699 (Archive::interpret_header): Likewise.
14700 (Archive::Nested_archive_table): New typedef.
14701 (Archive::is_thin_archive_): New field.
14702 (Archive::nested_archives_): New field.
14703 (Archive::options_): New field.
14704 (Archive::dirpath_): New field.
14705 (Archive::task_): New field.
14706 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14707 for thin archives. Pass additional parameters to
14708 Archive::Archive. Unlock the archive file after calling
14709 Archive::setup.
cd536b21 14710
479f6503
ILT
147112008-03-29 Ian Lance Taylor <iant@google.com>
14712
686c8caf
ILT
14713 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14714 version symbol to be local.
14715 * testsuite/ver_test_4.sh: New file.
14716 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14717 (check_DATA): Add ver_test_4.syms.
14718 (ver_test_4.syms): New target.
14719 * testsuite/Makefile.in: Rebuild.
14720
ab794b6b
ILT
14721 * output.cc
14722 (Output_section::Input_section_sort_entry::has_priority): New
14723 function.
14724 (Output_section::Input_section_sort_entry::match_file_name): New
14725 function.
14726 (Output_section::Input_section_sort_entry::match_section_name):
14727 Remove.
14728 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14729 Remove.
14730 (Output_section::Input_section_sort_entry::match_section_file):
14731 Remove.
14732 (Output_section::Input_section_sort_compare::operator()): Rewrite
14733 using new Input_section_sort_entry functions. Sort crtbegin and
14734 crtend first. Sort sections with no priority before sections with
14735 a priority.
14736 * testsuite/initpri1.c (d3): Check j != 4.
14737 (cd5): New constructor/destructor function.
14738 (main): Check j != 2.
14739
479f6503
ILT
14740 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14741 new symbol when resolving, don't call set_is_default.
14742 * testsuite/ver_test_7.cc: New file.
14743 * testsuite/ver_test_7.sh: New file.
14744 * testsuite/Makefile.am (ver_test_7.so): New target.
14745 (ver_test_7.o): New target.
14746 (check_SCRIPTS): Add ver_test_7.sh.
14747 (check_DATA): Add ver_test_7.syms.
14748 (ver_test_7.syms): New target.
14749
2fd32231
ILT
147502008-03-28 Ian Lance Taylor <iant@google.com>
14751
14752 * layout.cc (Layout::layout): If we see an input section with a
14753 name that needs sorting, set the must_sort flag for the output
14754 section.
14755 (Layout::make_output_section): If the name of the output section
14756 indicates that it might require sorting, set the may_sort flag.
14757 * output.h (Output_section::may_sort_attached_input_sections): New
14758 function.
14759 (Output_section::set_may_sort_attached_input_sections): New
14760 function.
14761 (Output_section::must_sort_attached_input_sections): New
14762 function.
14763 (Output_section::set_must_sort_attached_input_sections): New
14764 function.
14765 (class Output_section): Declare Input_section_sort_entry. Define
14766 Input_section_sort_compare. Declare
14767 sort_attached_input_sections. Add new fields:
14768 may_sort_attached_input_sections_,
14769 must_sort_attached_input_sections_,
14770 attached_input_sections_are_sorted_.
14771 * output.cc (Output_section::Output_section): Initialize new
14772 fields.
14773 (Output_section::add_input_section): Add an entry to
14774 input_sections_ if may_sort or must_sort are true.
14775 (Output_section::set_final_data_size): Call
14776 sort_attached_input_sections if necessary.
14777 (Output_section::Input_section_sort_entry): Define new class.
14778 (Output_section::Input_section_sort_compare::operator()): New
14779 function.
14780 (Output_section::sort_attached_input_sections): New function.
14781 * configure.ac: Check whether the compiler supports constructor
14782 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14783 * testsuite/initpri1.c: New file.
14784 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14785 CONSTRUCTOR_PRIORITY.
14786 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14787 (initpri1_LDFLAGS): New variable.
14788 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14789
18e6b24e
ILT
147902008-03-27 Ian Lance Taylor <iant@google.com>
14791
49bdd526
ILT
14792 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14793 * testsuite/common_test_1.c: New file.
14794 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14795 (common_test_1_SOURCES): New variable.
14796 (common_test_1_DEPENDENCIES): New variable.
14797 (common_test_1_LDFLAGS): New variable.
14798
18e6b24e
ILT
14799 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14800 and commons_ correctly when NAME/VERSION does not override
14801 NAME/NULL.
14802 * testsuite/ver_test_6.c: New file.
14803 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14804 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14805 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14806
04bf7072
ILT
148072008-03-26 Ian Lance Taylor <iant@google.com>
14808
5871526f
ILT
14809 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14810 of an undefined symbol from a version script.
14811 * testsuite/Makefile.am (ver_test_5.so): New target.
14812 (ver_test_5.o): New target.
14813 (check_SCRIPTS): Add ver_test_5.sh.
14814 (check_DATA): Add ver_test_5.syms.
14815 (ver_test_5.syms): New target.
14816 * testsuite/ver_test_5.cc: New file.
14817 * testsuite/ver_test_5.script: New file.
14818 * testsuite/ver_test_5.sh: New file.
14819 * Makefile.in, testsuite/Makefile.in: Rebuild.
14820
04bf7072
ILT
14821 PR gold/5986
14822 Fix problems building gold with gcc 4.3.0.
14823 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
14824 (gold_error_at_location, gold_warning_at_location): Use it.
14825 * configure.ac: Check whether we can compile and use a template
14826 function with a printf attribute.
14827 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
14828 when jumping over bytes.
14829 * object.cc: Instantiate Object::read_section_data.
14830 * debug.h: Include <cstring>
14831 * dwarf_reader.cc: Include <algorithm>
14832 * main.cc: Include <cstring>.
14833 * options.cc: Include <cstring>.
14834 * output.cc: Include <cstring>.
14835 * script.cc: Include <cstring>.
14836 * script.h: Include <string>.
14837 * symtab.cc: Include <cstring> and <algorithm>.
14838 * target-select.cc: Include <cstring>.
14839 * version.cc: Include <string>.
14840 * testsuite/testmain.cc: Include <cstdlib>.
14841 * configure, config.in: Rebuild.
14842
874c5b28
ILT
148432008-03-25 Ian Lance Taylor <iant@google.com>
14844
819d6c3a
ILT
14845 * options.cc: Include "../bfd/bfdver.h".
14846 (options::help): Print bug reporting address.
14847
f4b2c6f5
ILT
14848 * version.cc (print_version): Adjust output for current value of
14849 BFD_VERSION_STRING.
14850
14851 * NEWS: New file.
14852
e96caa79
ILT
14853 * options.cc (options::help): Print list of supported targets.
14854 * target-select.h: Include <vector>.
14855 (class Target_selector): Make machine_, size_, and is_big_endian_
14856 fields const. Add bfd_name_ and instantiated_target_ fields.
14857 (Target_selector::Target_selector): Add bfd_name parameter.
14858 (Target_selector::recognize): Make non-virtual, call
14859 do_recognize.
14860 (Target_selector::recognize_by_name): Make non-virtual, call
14861 do_recognize_by_name.
14862 (Target_selector::supported_names): New function.
14863 (Target_selector::bfd_name): New function.
14864 (Target_selector::do_instantiate_target): New pure virtual
14865 function.
14866 (Target_selector::do_recognize): New virtual function.
14867 (Target_selector::do_recognize_by_name): New virtual function.
14868 (Target_selector::instantiate_target): New private function.
14869 (supported_target_names): Declare.
14870 * target-select.cc (Target_selector::Target_selector): Update for
14871 new parameter and fields.
14872 (select_target_by_name): Check that the name matches before
14873 calling recognize_by_name.
14874 (supported_target_names): New function.
14875 * i386.cc (class Target_selector_i386): Update Target_selector
14876 constructor call. Remove recognize and recognize_by_name. Add
14877 do_instantiate_target.
14878 * x86_64.cc (class Target_selector_x86_64): Likewise.
14879 * testsuite/testfile.cc (class Target_selector_test): Update for
14880 changes to Target_selector.
14881
874c5b28
ILT
14882 * README: Rewrite, with some notes on unsupported features.
14883
0a65a3a7
CC
148842008-03-24 Cary Coutant <ccoutant@google.com>
14885
14886 * i386.cc (Target_i386::Got_type): New enum declaration.
14887 (Target_i386::Scan::local): Updated callers of Output_data_got
14888 member functions.
14889 (Target_i386::Scan::global): Likewise.
14890 (Target_i386::Relocate::relocate): Likewise.
14891 (Target_i386::Relocate::relocate_tls): Likewise.
14892 * object.h (Got_offset_list): New class.
14893 (Sized_relobj::local_has_got_offset): Added got_type parameter.
14894 (Sized_relobj::local_got_offset): Likewise.
14895 (Sized_relobj::set_local_got_offset): Likewise.
14896 (Sized_relobj::local_has_tls_got_offset): Removed.
14897 (Sized_relobj::local_tls_got_offset): Removed.
14898 (Sized_relobj::set_local_tls_got_offset): Removed.
14899 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
14900 * output.cc (Output_data_got::add_global): Added got_type parameter.
14901 (Output_data_got::add_global_with_rel): Likewise.
14902 (Output_data_got::add_global_with_rela): Likewise.
14903 (Output_data_got::add_global_pair_with_rel): New function.
14904 (Output_data_got::add_global_pair_with_rela): New function.
14905 (Output_data_got::add_local): Added got_type parameter.
14906 (Output_data_got::add_local_with_rel): Likewise.
14907 (Output_data_got::add_local_with_rela): Likewise.
14908 (Output_data_got::add_local_pair_with_rel): New function.
14909 (Output_data_got::add_local_pair_with_rela): New function.
14910 (Output_data_got::add_global_tls): Removed.
14911 (Output_data_got::add_global_tls_with_rel): Removed.
14912 (Output_data_got::add_global_tls_with_rela): Removed.
14913 (Output_data_got::add_local_tls): Removed.
14914 (Output_data_got::add_local_tls_with_rel): Removed.
14915 (Output_data_got::add_local_tls_with_rela): Removed.
14916 * output.h (Output_data_got::add_global): Added got_type parameter.
14917 (Output_data_got::add_global_with_rel): Likewise.
14918 (Output_data_got::add_global_with_rela): Likewise.
14919 (Output_data_got::add_global_pair_with_rel): New function.
14920 (Output_data_got::add_global_pair_with_rela): New function.
14921 (Output_data_got::add_local): Added got_type parameter.
14922 (Output_data_got::add_local_with_rel): Likewise.
14923 (Output_data_got::add_local_with_rela): Likewise.
14924 (Output_data_got::add_local_pair_with_rel): New function.
14925 (Output_data_got::add_local_pair_with_rela): New function.
14926 (Output_data_got::add_global_tls): Removed.
14927 (Output_data_got::add_global_tls_with_rel): Removed.
14928 (Output_data_got::add_global_tls_with_rela): Removed.
14929 (Output_data_got::add_local_tls): Removed.
14930 (Output_data_got::add_local_tls_with_rel): Removed.
14931 (Output_data_got::add_local_tls_with_rela): Removed.
14932 * resolve.cc (Symbol::override_base_with_special): Removed
14933 reference to has_got_offset_ field.
14934 * symtab.cc (Symbol::init_fields): Replaced initialization
14935 of got_offset_ with got_offsets_. Removed initialization
14936 of has_got_offset_
53fcba31 14937 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
14938 (Symbol::got_offset): Likewise.
14939 (Symbol::set_got_offset): Likewise.
14940 (Symbol::has_tls_got_offset): Removed.
14941 (Symbol::tls_got_offset): Removed.
14942 (Symbol::set_tls_got_offset): Removed.
14943 (Symbol::got_offset_): Removed.
14944 (Symbol::tls_mod_got_offset_): Removed.
14945 (Symbol::tls_pair_got_offset_): Removed.
14946 (Symbol::got_offsets_): New field.
14947 (Symbol::has_got_offset): Removed.
14948 (Symbol::has_tls_mod_got_offset): Removed.
14949 (Symbol::has_tls_pair_got_offset): Removed.
14950 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
14951 (Target_x86_64::Scan::local): Updated callers of Output_data_got
14952 member functions.
14953 (Target_x86_64::Scan::global): Likewise.
14954 (Target_x86_64::Relocate::relocate): Likewise.
14955 (Target_x86_64::Relocate::relocate_tls): Likewise.
14956
bd52eafb
BE
149572008-03-25 Ben Elliston <bje@au.ibm.com>
14958
14959 * yyscript.y: Fix spelling error in comment.
14960
8b105e34
ILT
149612008-03-24 Ian Lance Taylor <iant@google.com>
14962
8ed814a9
ILT
14963 * options.h (class General_options): Define build_id option.
14964 * layout.h (class Layout): Declare write_build_id, create_note,
14965 create_build_id. Add build_id_note_ member.
14966 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
14967 "libiberty.h", "md5.h", "sha1.h".
14968 (Layout::Layout): Initialize eh_frame_data_,
14969 eh_frame_hdr_section_, and build_id_note_.
14970 (Layout::finalize): Call create_build_id.
14971 (Layout::create_note): New function, broken out of
14972 Layout::create_gold_note.
14973 (Layout::create_gold_note): Call create_note.
14974 (Layout::create_build_id): New function.
14975 (Layout::write_build_id): New function.
14976 (Close_task_runner::run): Call write_build_id.
14977
8b105e34
ILT
14978 * x86_64.cc: Correct license to GPLv3.
14979
086a1841
ILT
149802008-03-23 Ian Lance Taylor <iant@google.com>
14981
14982 * options.cc: Include "demangle.h".
14983 (parse_optional_string): New function.
14984 (parse_long_option): Handle takes_optional_argument.
14985 (parse_short_option): Update dash_z initializer. Handle
14986 takes_optional_argument.
14987 (General_options::General_options): Initialize do_demangle_.
14988 (General_options::finalize): Set do_demangle_. Handle demangling
14989 style.
14990 * options.h (parse_optional_string): Declare.
14991 (struct One_option): Add optional_arg field. Update constructor.
14992 Update call constructor calls. Add takes_optional_argument
14993 function.
14994 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
14995 (DEFINE_optional_string): Define.
14996 (General_options::demangle): Change from DEFINE_bool to
14997 DEFINE_optional_string.
14998 (General_options::no_demangle): New function.
14999 (General_options::do_demangle): New function.
15000 (General_options::set_do_demangle): New function.
15001 (General_options::execstack_status_): Move definition to end of
15002 class definition.
15003 (General_options::static_): Likewise.
15004 (General_options::do_demangle_): New field.
15005 * object.cc (big_endian>::get_symbol_location_info): Call
15006 Options::do_demangle, not Options::demangle.
15007 * symtab.cc (demangle): Likewise.
15008
cbb93e63
ILT
150092008-03-22 Ian Lance Taylor <iant@google.com>
15010
15011 * gold.h: Include <cstddef> and <sys/types.h>
15012 * options.h: Include <cstring>.
15013
ec531623
ILT
150142008-03-21 Ian Lance Taylor <iant@google.com>
15015
15016 * Added source code to GNU binutils.
752937aa 15017\f
0c6e6c39 15018Copyright (C) 2008-2013 Free Software Foundation, Inc.
752937aa
NC
15019
15020Copying and distribution of this file, with or without modification,
15021are permitted in any medium without royalty provided the copyright
15022notice and this notice are preserved.
15023
15024Local Variables:
15025mode: change-log
15026left-margin: 8
15027fill-column: 74
15028version-control: never
15029End:
This page took 0.976896 seconds and 4 git commands to generate.