gold/
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
679e4abf
RM
12013-10-11 Roland McGrath <mcgrathr@google.com>
2
1496b446
RM
3 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
4 * testsuite/Makefile.in: Regenerate.
5
cc84c10b
RM
6 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
7 Remove const from declaration.
8 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
9 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
10 * output.h (Output_file_header): Remove const from member target_
11 and corresponding constructor argument.
12 * output.cc (Output_file_header::Output_file_header): Update prototype.
13 (Output_file_header::do_sized_write): Use this->target_ in place
14 of parameters()->target().
15
52f66a2c
RM
16 * testsuite/undef_symbol.cc (Foo::get_a): New method.
17
2b64b551
RM
18 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
19 * configure: Regenerate.
20 * Makefile.in: Regenerate.
21 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
22 * testsuite/merge_string_literals_2.c: Likewise.
23 * testsuite/Makefile.am
24 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
25 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
26 literal -fmerge-constants.
27 * testsuite/Makefile.in: Regenerate.
28
43819297
RM
29 * i386.cc (Target_i386): Remove unused member dynbss_.
30 * arm.cc (Target_arm): Likewise.
31 * powerpc.cc (Target_powerpc): Likewise.
32 * sparc.cc (Target_sparc): Likewise.
33 * tilegx.cc (Target_tilegx): Likewise.
34 * x86_64.cc (Target_x86_64): Likewise.
35 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
36 type_signature_, type_offset_.
37 * plugin.h (Plugin_hook): Remove unused member layout_.
38 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
39 mapfile_.
40 (Read_member): Remove unused members input_objects_, symtab_,
41 mapfile_, layout_.
42 (Check_library): Remove unused member symtab_.
43 * archive.h (Lib_group): Remove unused member lib_.
44 * archive.cc (Lib_group::Lib_group): Update initializer.
45 * incremental.h (Incremental_binary): Remove unused member target_.
46 (Incremental_script_entry): Removed unused member script_.
47 * layout.h (Write_symbols_task): Remove unused member input_objects_.
48 * icf.h (Icf): Remove unused member num_tracked_relocs.
49
39d9ead7
RM
50 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
51 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
52 its only use.
53 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
54
679e4abf
RM
55 * archive.h: Use struct rather than class for forward declaration
56 of Read_symbols_data.
57
54de2ea6
CC
582013-10-07 Cary Coutant <ccoutant@google.com>
59
60 PR gold/16010
61 * testsuite/Makefile.am (icf_test): Fix dependencies.
62 (icf_safe_test): Likewise.
63 (icf_safe_so_test): Likewise.
64 (large_symbol_alignment): Add empty _LDADD rule.
65 * testsuite/Makefile.in: Regenerate.
66
b14016f0
L
672013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
68
69 PR gold/15927
70 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
71 relocation for R_X86_64_32 on x32.
72
eb426534
RM
732013-08-27 Roland McGrath <mcgrathr@google.com>
74
75 * output.cc (Output_segment::set_section_addresses): Take new
76 Target* argument. If target->isolate_execinstr() and the segment
77 is executable and starts at a target->abi_pagesize() boundary,
78 pad its end out to a target->abi_pagesize() boundary with code fill.
79 * output.h (Output_segment::set_section_addresses): Update decl.
80 * layout.h (Layout::check_output_data_for_reset_values): Take new
81 argument RELAX_OUTPUTS.
82 (Layout): New member relax_output_list_.
83 (Layout::add_relax_output): New method.
84 * layout.cc (Layout::Layout): Update constructor.
85 (Layout::reset_relax_output): New method.
86 (Layout::clean_up_after_relaxation): Call it.
87 (Layout::prepare_for_relaxation): Update caller.
88 (Layout::set_segment_offsets): Update callers of set_section_addresses.
89 Call reset_relax_output before re-processing segments for
90 isolate_execinstr case.
91 (Layout::write_data): Handle relax_output_list_.
92 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
93 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
94
9aff4b7a
NC
952013-08-23 Yuri Chornoivan <yurchor@ukr.net>
96
97 PR binutils/15834
98 * object.h: Fix typos.
99
93f8221c
RM
1002013-08-16 Roland McGrath <mcgrathr@google.com>
101
102 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
103 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
104
e44c3715
CC
1052013-08-07 Cary Coutant <ccoutant@google.com>
106
107 Revert support for v2 DWP files:
108
109 2013-03-01 Cary Coutant <ccoutant@google.com>
110
111 Add dwp support for v2 DWARF package file format.
112 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
113 tu_length parameter. Adjust all callers.
114 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
115 * dwp.cc: Include dwarf.h.
116 (Section_bounds): New struct type.
117 (Unit_set): New struct type.
118 (Dwo_file::Dwo_file): Initialize new data member.
119 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
120 Combine and rename to...
121 (Dwo_file::read_unit_index): ...this.
122 (Dwo_file::sized_read_compunit_index)
123 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
124 (Dwo_file::sized_read_unit_index): ...this.
125 (Dwo_file::copy_section): Remove section_name, is_str_offsets
126 parameters; add section_id parameter.
127 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
128 (Dwo_file::add_unit_set): ...this.
129 (Dwo_file::shndx_map_): Remove.
130 (Dwo_file::sect_offsets_): New data member.
131 (Dwp_output_file::Dwp_output_file): Initialize new data members.
132 (Dwp_output_file::add_section): Rename to...
133 (Dwp_output_file::add_contribution): ...this.
134 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
135 (Dwp_output_file::add_tu_set): Likewise.
136 (Dwp_output_file::Contribution): New type.
137 (Dwp_output_file::Section::contributions): New data member.
138 (Dwp_output_file::Cu_or_tu_set): Remove.
139 (Dwp_output_file::Section::Section): New ctor.
140 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
141 (Dwp_output_file::Dwp_index::Section_table): New type.
142 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
143 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
144 parameter.
145 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
146 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
147 (Dwp_output_file::Dwp_index::section_table): New member function.
148 (Dwp_output_file::Dwp_index::section_table_end): New member function.
149 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
150 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
151 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
152 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
153 (Dwp_output_file::Dwp_index::section_table_): New data member.
154 (Dwp_output_file::Dwp_index::section_mask_): New data member.
155 (Dwp_output_file::add_output_section): New member function.
156 (Dwp_output_file::write_new_section): New member function.
157 (Dwp_output_file::write_contributions): New member function.
158 (Dwp_output_file::section_id_map_): New data member.
159 (class Dwo_id_info_reader): Remove.
160 (class Unit_reader): New class.
161 (get_dwarf_section_name): New function.
162 (Dwo_file::read_executable): Adjust initializations of class data.
163 (Dwo_file::read): Add support for v2 package file format.
164 (Dwo_file::read_unit_index): Likewise.
165 (Dwo_file::sized_read_unit_index): Likewise.
166 (Dwo_file::copy_section): Likewise.
167 (Dwo_file::add_unit_set): Likewise.
168 (Dwp_output_file::add_output_section): Likewise.
169 (Dwp_output_file::add_contribution): Likewise.
170 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
171 for empty slot.
172 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
173 file format.
174 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
175 slot.
176 (Dwp_output_file::initialize): Remove unused function.
177 (Dwp_output_file::finalize): Add support for v2 package file format.
178 (Dwp_output_file::write_index): Likewise.
179 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
180 function prototype.
181
c6905c28
CC
1822013-07-31 Cary Coutant <ccoutant@google.com>
183
184 * object.cc (Sized_relobj::do_output_section_address): New function.
185 (Sized_relobj): Instantiate explicitly.
186 * object.h (Object::output_section_address): New function.
187 (Object::do_output_section_address): New function.
188 (Sized_relobj::do_output_section_address): New function.
189 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
190
1912013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 192 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
193
194 * parameters.cc (Parameters::entry): Return target-specific entry
195 symbol name.
196 * target.h (Target::entry_symbol_name): New function.
197 (Target_info::entry_symbol_name): New data member.
198
199 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
200 * i386.cc (Target_i386::i386_info): Likewise.
201 (Target_i386_nacl::i386_nacl_info): Likewise.
202 * sparc.cc (Target_sparc::sparc_info): Likewise.
203 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
204 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
205 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
206 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
207
234d4ab8
SA
2082013-07-22 Sterling Augustine <saugustine@google.com>
209
210 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
211 Convert parameter shndx to local variable. Add parameters symtab
212 and symtab_size. Scan over section names. Find relocation
213 section corresponding to current section. Create and initialize
214 reloc_mapper_ and reloc_type_.
215 (Dwarf_pubnames_table::read_header): Add assertion. Change
216 unit_length to off_t. Initialize member unit_length_. Fill in field
217 cu_offset_.
218 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
219 Initialize new fields unit_length_ and cu_offset_.
220 (Dwarf_pubnames_table::read_section): Update prototype.
221 (Dwarf_pubnames_table::cu_offset): New member function.
222 (Dwarf_pubnames_table::subsection_size): Likewise.
223 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
224 New fields.
225 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
226 member functions public.
227 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
228 Update comment. Rework logic. Move repeated parts to...
229 (Gdb_index_info_reader::read_pubtable): ...here. New function.
230 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
231 pubtypes_table_, and stmt_list_offset.
232 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
233 Gdb_index::find_pubtype_offset,
234 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
235 (Gdb_index::pubnames_read): Update prototype and rework logic.
236 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
237 Forward declare.
238 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
239 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
240 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
241 Gdb_index::map_pubtable_to_dies):
242 Declare functions.
243 (Gdb_index::pubnames_read): Update declaration.
244 (Gdb_index::Pubname_offset_map): New type.
245 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
246 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
247 Gdb_index::stmt_list_offset): Declare.
248 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
249 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
250 Gdb_index::pubtypes_offset_): Remove.
251
a3ed37d8
RM
2522013-07-19 Roland McGrath <mcgrathr@google.com>
253
254 * options.h (General_options): Add -Trodata-segment option.
255 * parameters.cc (Parameters::check_rodata_segment): New function.
256 (Parameters::set_target_once): Call it.
257 * parameters.h (Parameters): Declare it (private member function).
258 * layout.cc (load_seg_unusable_for_headers): New function, broken
259 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
260 then validate rodata segment rather than text segment.
261 (relaxation_loop_body): Call that.
262 (is_text_segment): New function. Don't admit a non-executable
263 segment if TARGET->isolate_execinstr().
264 (set_segment_offsets): Call it. Honor -Trodata-segment option.
265
eb5b4ded
CC
2662013-07-15 Shawn Landden <shawnlandden@gmail.com>
267
268 PR gold/15070
269 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
270 * nacl.h (Sniff_file::View::View): Request aligned view.
271
4d5effb9
CC
2722013-07-11 Cary Coutant <ccoutant@google.com>
273
274 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
275 correct BRLT entry size.
276
ba8ca3e7
AM
2772013-07-03 Alan Modra <amodra@gmail.com>
278
279 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
280 comment.
281
267257d2
CC
2822013-07-01 Cary Coutant <ccoutant@google.com>
283
284 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
285 reloc_type_.
286 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
287 (Dwarf_ranges_table::lookup_reloc): New function.
288 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
289 reloc_type_.
290 (Dwarf_ranges_table::lookup_reloc): New function.
291 (Dwarf_ranges_table::reloc_type_): New data member.
292
06f30c9d
CC
2932013-06-27 Jing Yu <jingyu@google.com>
294
295 PR gold/15662
296 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
297 function.
298 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
299 (Target_powerpc::do_relax): Call the above.
300
a2d7bf59
AM
3012013-06-27 Cary Coutant <ccoutant@google.com>
302
303 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
304 on garbage collected .opd section.
305
3062013-06-27 Alan Modra <amodra@gmail.com>
307
308 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
309 is non-zero.
310 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
311 (Target_powerpc::do_function_location): Likewise for loc->shndx.
312
32364e50
CC
3132013-06-14 Cary Coutant <ccoutant@google.com>
314
315 * resolve.cc (Symbol::override_base): Don't override st_type
316 from plugin placeholder symbols.
317 (Symbol_table::resolve): Likewise.
318 (Symbol_table::should_override): Don't complain about TLS mismatch
319 if the TO symbol is a plugin placeholder.
320 * testsuite/Makefile.am (plugin_test_tls): New test.
321 * testsuite/Makefile.in: Regenerate.
322 * testsuite/plugin_test_tls.sh: New test script.
323 * testsuite/two_file_test_2_tls.cc: New test source.
324 * testsuite/two_file_test_tls.cc: New test source.
325
7fb47cc9
CC
3262013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
327
328 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
329 the maximum segment alignment is larger than the page size.
330 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
331 correctly aligns the symbols with large alignemnt.
332 * testsuite/Makefile.in: Regenerate.
333 * testsuite/large_symbol_alignment.cc: New file.
334
6934001a
CC
3352013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
336 Sriraman Tallam <tmsriram@google.com>
337
338 * options.h (sort_section): New option.
339 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
340 Rename from Input_section_sort_section_name_special_ordering_compare.
341 (Input_section_sort_section_name_compare): New struct.
342 * output.cc (Output_section::Input_section_sort_section_name_compare::
343 operator()): New function.
344 (Output_section::sort_attached_input_sections): Use new sort function
345 for .text if --sort-section=name is specified.
346 * layout.cc (Layout::make_output_section):
347 Add sorting by name when --sort-section=name is specified.
348 * testsuite/Makefile.am (text_section_grouping): Test option
349 --sort-section=name.
350 * testsuite/Makefile.in: Regenerate.
351 * testsuite/section_sorting_name.cc: New file.
352 * testsuite/section_sorting_name.sh: New file.
353
93acabad
CC
3542013-05-21 Cary Coutant <ccoutant@google.com>
355
356 * symtab.h (Symbol::is_cxx_vtable): New function.
357 * target-reloc.h (relocate_section): Check for vtable symbol.
358 * testsuite/Makefile.am (missing_key_func.sh): New test case.
359 * testsuite/Makefile.in: Regenerate.
360 * testsuite/missing_key_func.cc: New test source.
361 * testsuite/missing_key_func.sh: New test script.
362
60e8b3fc
CC
3632013-05-21 Cary Coutant <ccoutant@google.com>
364
2b64b551
RM
365 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
366 type of enclosing symbol.
367 (Relocate_info::location): Check symbol type when describing symbol.
368 * object.h (Symbol_location_info): Remove unused line_number;
369 add enclosing_symbol_type.
370 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 371
9df9de2c
CC
3722013-05-13 Cary Coutant <ccoutant@google.com>
373
2b64b551
RM
374 * configure.ac: Export DEFAULT_TARGET.
375 * configure: Regenerate.
376 * Makefile.in: Regenerate.
377 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
378 * testsuite/Makefile.in: Regenerate.
379 * testsuite/debug_msg.sh: Delete duplicate tests.
380 Don't check undef_int error message match for powerpc where the
381 source file and line number aren't available.
9df9de2c 382
bbc5ae17
RM
3832013-05-10 Roland McGrath <mcgrathr@google.com>
384
385 * options.h (General_options): Add --rosegment-gap option.
386 * options.cc (finalize): --rosegment-gap implies --rosegment.
387 * layout.cc (set_segment_offsets): Let user option override
388 target->rosegment_gap().
389
0c6e6c39
RM
3902013-05-10 Roland McGrath <mcgrathr@google.com>
391
392 * options.h (General_options): Remove leading space from help
393 messages for -nostdlib and --rosegment.
394
cde7cb01
MR
3952013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
396
397 PR ld/15365
398 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
399
f31ae5b8
AM
4002013-05-03 Alan Modra <amodra@gmail.com>
401
402 * merge.cc (Output_merge_string::do_add_input_section): Correct
403 scan for number of strings. Rename vars to avoid shadowing.
404 Include missing terminator in input_size_.
405
d3a7cd45
L
4062013-05-01 H.J. Lu <hongjiu.lu@intel.com>
407
408 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
409 Restore empty string handling.
410
6ad3daba
CC
4112013-05-01 Cary Coutant <ccoutant@google.com>
412
413 * stringpool.cc (Stringpool_template::new_key_offset): Fix
414 uninitialized warning.
415
e31908b6
CC
4162013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
417
418 * output.cc (Output_section::add_merge_input_section): Allow
419 to merge sections if the alignment is more than character size.
420 * merge.h (Output_merge_string::Output_merge_string): Remove
421 assert.
422 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
423 only not-null strings. Check the alignment of strings.
424 * stringpool.h
425 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
426 alignment as the argument.
427 (Stringpool_template<Stringpool_char>::addralign_): New class member.
428 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
429 Align non-zero length strings according to the addralign_.
430 (Stringpool_template<Stringpool_char>::set_string_offsets):
431 Updating offsets according to the given alignment.
432 * testsuite/Makefile.am (text_section_grouping): Test if string
433 literals are getting merged.
434 * testsuite/Makefile.in: Regenerate.
435 * testsuite/merge_string_literals_1.c: New file.
436 * testsuite/merge_string_literals_2.c: Ditto.
437 * testsuite/merge_string_literals.sh: Ditto.
438
0e804863
ILT
4392013-04-26 Ian Lance Taylor <iant@google.com>
440
441 * target-reloc.h (relocate_section): If the reloc offset is out of
442 range, pass VIEW as NULL to relocate.relocate.
443 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
444 * i386.cc (Target_i386::Relocate::relocate): Likewise.
445 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
446 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
447 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
448 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
449
e7c5ea40
CC
4502013-04-26 Geoff Pike <gpike@chromium.org>
451
452 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
453 * layout.cc (Hash_task): New class.
454 (Layout::queue_build_id_tasks): New function.
455 (Layout::write_build_id): Handle single-thread portion of build ID
456 computation. (In some cases, all of it is single-threaded.) Replace
457 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
458 functionality in fewer lines of code.
459 * layout.h (Layout::queue_build_id_tasks): New function declaration.
460 * options.h (General_options): make "--build-id" default to tree
461 rather than sha1. Add two new options related to --build-id=tree:
462 --build-id-chunk-size-for-treehash and
463 --build-id-min-file-size-for-treehash.
464 * Makefile.am: add testing of --build-id=tree and related new options
465 (these tests will be invoked by "make check").
466 * Makefile.in: Regenerate.
467
49926cd0
AM
4682013-04-25 Alan Modra <amodra@gmail.com>
469
470 * configure.tgt: Add powerpcle and powerpc64le.
471
a4034750
AM
4722013-04-22 Alan Modra <amodra@gmail.com>
473
474 PR gold/15355
475 * layout.cc (Layout::segment_precedes): Allow more than one
476 segment with the same type and flags.
477
e79c84aa
CC
4782013-04-15 Cary Coutant <ccoutant@google.com>
479
480 * layout.cc (Layout::set_relocatable_section_offsets): Don't
481 allocate space in file for BSS sections.
482
2199fbe7
CC
4832013-04-15 Cary Coutant <ccoutant@google.com>
484
485 * script-sections.cc (Orphan_output_section): Reset address
486 to zero after each orphaned section for relocatable links.
487
502e8a84
CC
4882013-04-15 Cary Coutant <ccoutant@google.com>
489
a4034750
AM
490 * symtab.cc (Symbol_table::sized_write_globals): Subtract
491 section starting address for relocatable link.
492 * testsuite/Makefile.am (script_test_11): New test.
493 * testsuite/Makefile.in: Regenerate.
494 * testsuite/script_test_11.c: New source file.
495 * testsuite/script_test_11.t: New linker script.
502e8a84 496
0cfdc767
AM
4972013-04-13 Alan Modra <amodra@gmail.com>
498
499 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
500 owner when sections are not adjacent and exceed group size.
501 (Target_powerpc::group_sections): Handle corner case.
502 (Target_powerpc::Branch_info::make_stub): Handle case where
503 stub table doesn't exist due to branches in non-exec sections.
504 (Target_powerpc::Relocate::relocate): Likewise.
505
6830ee24
AM
5062013-04-11 Alan Modra <amodra@gmail.com>
507
508 PR gold/15354
509 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
510 .branch_lt to match bfd ld. Adjust comments throughout file.
511
54a3d865
ILT
5122013-04-04 Ian Lance Taylor <iant@google.com>
513
514 GCC PR c++/56840
515 * object.cc (do_layout_deferred_sections): Handle .eh_frame
516 sections before checking whether they are included in the link.
517
9993ba11
ST
5182013-03-29 Sriraman Tallam <tmsriram@google.com>
519
520 * archive.cc (Archive::get_elf_object_for_member): Create the elf
521 object before calling the plugin claim_file handler. Pass the elf
522 object of the archive to the plugin. Delete the elf object if the
523 plugin claims the file.
524
ebacd51e
AM
5252013-03-21 Alan Modra <amodra@gmail.com>
526
527 * layout.cc (Layout::set_segment_offsets): Accept writable .text
528 segment when omagic.
529
117be58f
AM
5302013-03-21 Alan Modra <amodra@gmail.com>
531
532 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
533 comparison warning.
534 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
535 uninitialized" warning.
536
32e2b61d
AM
5372013-03-20 Alan Modra <amodra@gmail.com>
538
539 * symtab.h (Symbol::clear_version): New function.
540 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
541 is_needed by weak references. Clear version for symbols defined
542 in as-needed objects that are not needed.
543
b3ccdeb5
AM
5442013-03-15 Alan Modra <amodra@gmail.com>
545
546 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
547 static and public. Add report_err param. Return false for data refs.
548 (Target_powerpc::rela_dyn_section): New overloaded function.
549 (Target_powerpc::plt_, iplt_): Elucidate.
550 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
551 (Output_data_plt_powerpc::do_write): Don't write .iplt.
552 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
553 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
554 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
555 push_branch and make_plt_entry for ifunc syms when
556 reloc_needs_plt_for_ifunc.
557 (Target_powerpc::Relocate::relocate): Don't use plt entry value
558 for ifunc unless reloc_needs_plt_for_ifunc.
559
ad3d8a2f
AM
5602013-03-15 Alan Modra <amodra@gmail.com>
561
562 * gc.h (gc_process_relocs): Don't look through function descriptors.
563 * icf.cc (get_section_contents): Do so here instead.
564
4d9aa155
AM
5652013-03-13 Alan Modra <amodra@gmail.com>
566
567 * powerpc.cc (is_branch_reloc): Forward declare.
568 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
569 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
570 false for 64-bit, true for 32-bit non-branch relocs.
571 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
572 * testsuite/Makefile.am (icf_test): Use linker map file instead of
573 nm output.
574 (icf_safe_test): Generate linker map file as well as nm output.
575 (icf_safe_so_test): Likewise.
576 * testsuite/Makefile.in: Regenerate.
577 * testsuite/icf_test.sh: Parse linker map file to determine
578 section folding.
579 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
580 * testsuite/icf_safe_so_test.sh: Likewise.
581 (X86_32_or_ARM_specific_safe_fold): Merge into..
582 (arch_specific_safe_fold): ..this.
583 (X86_64_specific_safe_fold): Delete unused function.
584
57420c20
AM
5852013-03-12 Alan Modra <amodra@gmail.com>
586
587 * gc.h (gc_process_relocs): Look through function descriptors
588 to determine shndx, symvalue and addend used by ICF. Tidy
589 variable duplication.
590
dc3714f3
AM
5912013-03-11 Alan Modra <amodra@gmail.com>
592
593 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
594 * layout.cc (Layout_task_runner::run): ..to here.
595 * symtab.h (struct Symbol_location): Extract from..
596 (class Symbol_table): ..here.
597 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
598 * target.h (class Target): Add function_location and
599 do_function_location functions.
600 (class Sized_target): Add do_function_location.
601 * object.h (class Sized_relobj_file): Move find_shdr..
602 (class Object): ..to here.
603 * object.cc: Likewise. Update to suit. Instantiate.
604 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
605 * powerpc.cc (class Powerpc_dynobj): New.
606 (Target_powerpc::do_function_location): New function.
607 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
608 (Powerpc_dynobj::do_read_symbols): New function.
609 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
610
956b03bb
ILT
6112013-03-08 Ian Lance Taylor <iant@google.com>
612
613 * options.cc (General_options::string_to_object_format): Accept
614 "default".
615
4bead2d5
AM
6162013-03-08 Alan Modra <amodra@gmail.com>
617
618 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
619 pointer to Post_fde.
620 (struct Post_fde): Move definition to here..
621 * ehframe.cc (struct Post_fde): ..from here.
622 (Cie::write): Don't alloc Post_fde.
623 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
624
02e60bf7
AM
6252013-03-07 Alan Modra <amodra@gmail.com>
626
627 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
628 relocation referencing .LC0.
629 * testsuite/discard_locals_test.sh: Remove FIXMEs.
630
8343f03a
AM
6312013-03-07 Alan Modra <amodra@gmail.com>
632
633 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
634 always_inline. Add assembly for powerpc to avoid GOT.
635
3366d57c
AM
6362013-03-07 Alan Modra <amodra@gmail.com>
637
638 * testsuite/script_test_10.sh: Don't test .bss section
639 header number.
640
6c77229c
AM
6412013-03-06 Alan Modra <amodra@gmail.com>
642
643 * powerpc.cc (class Powerpc_relobj): Move some member functions.
644 (Target_powerpc::symval_for_branch): Add symtab param. Update
645 all callers. Handle folded sections.
646 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
647 to Powerpc_relobj.
648 (Global_symbol_visitor_opd::operator()): Likewise.
649
a39e4af6
AM
6502013-03-04 Alan Modra <amodra@gmail.com>
651
652 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
653 * testsuite/Makefile.in: Regenerate.
654
d5834edb
CC
6552013-03-01 Cary Coutant <ccoutant@google.com>
656
657 Add dwp support for v2 DWARF package file format.
658 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
659 tu_length parameter. Adjust all callers.
660 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
661 * dwp.cc: Include dwarf.h.
662 (Section_bounds): New struct type.
663 (Unit_set): New struct type.
664 (Dwo_file::Dwo_file): Initialize new data member.
665 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
666 Combine and rename to...
667 (Dwo_file::read_unit_index): ...this.
668 (Dwo_file::sized_read_compunit_index)
669 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
670 (Dwo_file::sized_read_unit_index): ...this.
671 (Dwo_file::copy_section): Remove section_name, is_str_offsets
672 parameters; add section_id parameter.
673 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
674 (Dwo_file::add_unit_set): ...this.
675 (Dwo_file::shndx_map_): Remove.
676 (Dwo_file::sect_offsets_): New data member.
677 (Dwp_output_file::Dwp_output_file): Initialize new data members.
678 (Dwp_output_file::add_section): Rename to...
679 (Dwp_output_file::add_contribution): ...this.
680 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
681 (Dwp_output_file::add_tu_set): Likewise.
682 (Dwp_output_file::Contribution): New type.
683 (Dwp_output_file::Section::contributions): New data member.
684 (Dwp_output_file::Cu_or_tu_set): Remove.
685 (Dwp_output_file::Section::Section): New ctor.
686 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
687 (Dwp_output_file::Dwp_index::Section_table): New type.
688 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
689 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
690 parameter.
691 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
692 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
693 (Dwp_output_file::Dwp_index::section_table): New member function.
694 (Dwp_output_file::Dwp_index::section_table_end): New member function.
695 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
696 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
697 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
698 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
699 (Dwp_output_file::Dwp_index::section_table_): New data member.
700 (Dwp_output_file::Dwp_index::section_mask_): New data member.
701 (Dwp_output_file::add_output_section): New member function.
702 (Dwp_output_file::write_new_section): New member function.
703 (Dwp_output_file::write_contributions): New member function.
704 (Dwp_output_file::section_id_map_): New data member.
705 (class Dwo_id_info_reader): Remove.
706 (class Unit_reader): New class.
707 (get_dwarf_section_name): New function.
708 (Dwo_file::read_executable): Adjust initializations of class data.
709 (Dwo_file::read): Add support for v2 package file format.
710 (Dwo_file::read_unit_index): Likewise.
711 (Dwo_file::sized_read_unit_index): Likewise.
712 (Dwo_file::copy_section): Likewise.
713 (Dwo_file::add_unit_set): Likewise.
714 (Dwp_output_file::add_output_section): Likewise.
715 (Dwp_output_file::add_contribution): Likewise.
716 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
717 for empty slot.
718 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
719 file format.
720 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
721 slot.
722 (Dwp_output_file::initialize): Remove unused function.
723 (Dwp_output_file::finalize): Add support for v2 package file format.
724 (Dwp_output_file::write_index): Likewise.
725 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
726 function prototype.
727
a68a081d
CC
7282013-03-01 Cary Coutant <ccoutant@google.com>
729
730 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
731 function into class definition in header file.
732 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
733 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
734 New function.
735 (Dwarf_info_reader::check_buffer): Move here from .cc file.
736
9d5781f8
AM
7372013-02-28 Alan Modra <amodra@gmail.com>
738
739 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
740 * target.cc (Target::do_plt_fde_location): New function.
741 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
742 accessor function, and constructor param.
743 (struct Post_fde, Post_fdes): Declare.
744 (Cie::write): Add post_fdes param.
745 * ehframe.cc (Fde::write): Use plt_fde_location.
746 (struct Post_fde): Define.
747 (Cie::write): Stash FDEs added post merge mapping.
748 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
749 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
750 (Eh_frame::do_sized_write): Arrange to write post map FDES after
751 other FDEs.
752 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
753 (Target_powerpc::has_glink): New function.
754 (Target_powerpc::do_relax): Add eh_frame info for stubs.
755 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
756 glink_eh_frame_fde_32, default_fde): New data.
757 (Stub_table::eh_frame_added_): New var.
758 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
759 Make const.
760 (Stub_table::add_eh_frame): New function.
761 (Output_data_glink::add_eh_frame): New function.
762 (Target_powerpc::make_glink_section): Call add_eh_frame.
763
214383dd
ILT
7642013-02-15 Ian Lance Taylor <iant@google.com>
765
766 * options.h (DEFINE_uint64_alias): Define.
767 (class General_options): Add -Ttext-segment as an alias for
768 -Ttext.
769
91c2b899
AM
7702013-02-15 Alan Modra <amodra@gmail.com>
771
772 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
773 (Stub_table::do_write): ..here, two places.
774 (Stub_table::plt_call_size): Use it here too.
775
20e2a8aa
ILT
7762013-02-11 Ian Lance Taylor <iant@google.com>
777
778 * descriptors.cc (Descriptors::close_all): New function.
779 * descriptors.h (class Descriptors): Declare close_all.
780 (close_all_descriptors): New inline function.
781 * plugin.cc: Include "descriptors.h".
782 (Plugin_manager::cleanup): Call close_all_descriptors.
783
8952bc69
AM
7842013-02-06 Alan Modra <amodra@gmail.com>
785
786 * README: Update coding style link.
787
29bd8b6b
CC
7882013-01-28 Cary Coutant <ccoutant@google.com>
789
a4034750
AM
790 * dwp.cc (File_list): New typedef.
791 (Dwo_name_info_reader): New class.
792 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
793 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
794 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
795 (Dwo_file::read_executable): New function.
796 (Dwo_file::read): Move common setup code to ...
797 (Dwo_file::make_object): ... here.
798 (dwp_options): Add --exec/-e.
799 (usage): Likewise.
800 (main): Likewise.
29bd8b6b 801
c6ac678d
ST
8022013-01-24 Sriraman Tallam <tmsriram@google.com>
803
804 * layout.cc (Layout::layout): Check for option text_reorder.
805 (Layout::make_output_section): Ditto.
806 * options.h (text_reorder): New option.
807 * output.cc (Input_section_sort_compare): Remove special ordering
808 of section names.
809 (Output_section::
810 Input_section_sort_section_name_special_ordering_compare::
811 operator()): New function.
812 (Output_section::sort_attached_input_sections): Use new sort function
813 for .text.
814 * output.h (Input_section_sort_section_name_special_ordering_compare):
815 New struct.
816 * testsuite/Makefile.am (text_section_grouping): Test option
817 --no-text-reorder
818 * testsuite/Makefile.in: Regenerate.
819 * testsuite/text_section_grouping.sh: Check order of functions without
820 default text reordering.
821
50701cc1
MF
8222013-01-18 Mike Frysinger <vapier@gentoo.org>
823
824 * options.h (General_options): Change default to true for new_dtags.
825
b1b00fcc
MF
8262013-01-18 Mike Frysinger <vapier@gentoo.org>
827
828 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
829 when enable_new_dtags is false. Only add DT_RUNPATH when
830 enable_new_dtags is true.
831
ec5b8187
AM
8322013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
833
834 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
835 used in declaration and definition consistent.
836 (Target_powerpc::symval_for_branch): Ditto.
837
a880d4c4
ST
8382013-01-16 Sriraman Tallam <tmsriram@google.com>
839
840 * testsuite/plugin_final_layout.cc: Fix comment.
841
7c381248
ST
8422013-01-16 Sriraman Tallam <tmsriram@google.com>
843
844 * layout.cc (Layout::layout): Do not do default sorting for
845 text sections when section ordering is specified.
846 (make_output_section): Ditto.
847 * testsuite/plugin_final_layout.cc: Name the function sections
848 to catch reordering issues.
849
e2458743
AM
8502013-01-15 Alan Modra <amodra@gmail.com>
851
852 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
853 plt-thread-safe.
854
431ed302
AM
8552013-01-15 Alan Modra <amodra@gmail.com>
856
857 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
858 * testsuite/Makefile.in: Regenerate.
859
0ec6429b
AM
8602013-01-14 Alan Modra <amodra@gmail.com>
861
862 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
863 * testsuite/Makefile.in: Regenerate.
864
0bf402d5
ILT
8652013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
866
36af3926 867 PR bfd/14430
0bf402d5
ILT
868 Fix mingw gold build with plugins enabled
869 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
870 * configure.ac: Export DLOPEN_LIBS and add headers check.
871 * plugin.cc: Handle non-dlfcn case.
872 * Makefile.in: Regenerate.
873 * config.in: Regenerate.
874 * configure: Regenerate.
875 * testsuite/Makefile.in: Regenerate.
876
9e9143bc
ST
8772013-01-09 Sriraman Tallam <tmsriram@google.com>
878
879 * output.h (sort_attached_input_sections): Change to be public.
880 * script-sections.cc
881 (Output_section_definition::set_section_addresses): Sort
882 attached input sections according to section order before linker
883 script assigns section addresses.
884 (Orphan_output_section::set_section_addresses): Sort
885 attached input sections according to section order before linker
886 script assigns section addresses.
887 * Makefile.am (final_layout.sh): Use a simple linker script to
888 check if section ordering still works.
889 * Makefile.in: Regenerate.
890
679af368
ILT
8912013-01-09 Ben Cheng <bccheng@google.com>
892
893 * arm.cc (Target_arm::attributes_accept_div): New function.
894 (Target_arm::attributes_forbid_div): New function.
895 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
896 attribute using the same new functions as what bfd/elf32_arm.c
897 does.
898
3136a00e
CC
8992013-01-07 Cary Coutant <ccoutant@google.com>
900
901 PR gold/14993
902 * output.cc (Output_section::add_input_section): For incremental
903 updates, don't track input sections that are allocated from patch
904 space.
905
f2a6224b
L
9062013-01-07 H.J. Lu <hongjiu.lu@intel.com>
907 Ian Lance Taylor <iant@google.com>
908
909 PR gold/14897
910 * configure.ac (--enable-ld): Removed.
911 (install_as_default): Set to yes only for --enable-gold=default
912 or --disable-ld.
913 * configure: Regenerated.
914
4f46f626
L
9152013-01-07 H.J. Lu <hongjiu.lu@intel.com>
916
917 * options.h (General_options): Add -fuse-ld= for GCC linker
918 option compatibility.
919
26e4ef59
CC
9202013-01-04 Cary Coutant <ccoutant@google.com>
921
922 * configure.ac: Fix typo restoring CXXFLAGS.
923 * configure: Regenerate.
924
3d587466
CC
9252013-01-04 Cary Coutant <ccoutant@google.com>
926
4f46f626
L
927 * testsuite/Makefile.am (CXXLINK_S): New macro.
928 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
929 * testsuite/Makefile.in: Regenerate.
3d587466 930
44db6695
L
9312013-01-02 H.J. Lu <hongjiu.lu@intel.com>
932
933 * version.cc (print_version): Update copyright year to 2013.
934
edcac0c1
ILT
9352012-12-20 Ian Lance Taylor <iant@google.com>
936
937 * layout.cc (Layout::special_ordering_of_input_section): New
938 function.
939 (Layout::layout): If input section requires special ordering, must
940 sort input sections.
941 (Layout::make_output_section): May sort .text input sections.
942 (Layout::is_section_name_prefix_grouped): Remove.
943 * layout.h (class Layout): Declare
944 special_ordering_of_input_section. Don't declare
945 is_section_name_prefix_grouped.
946 * output.cc (Output_section::add_input_section): Revert last
947 change.
948 (Output_section::Input_section_sort::match_file_name): Don't crash
949 if called on output section data.
950 (Output_section::Input_section_sort_compare): Sort based on
951 special ordering.
952 (Output_section::Input_section_sort_section_order_index_compare):
953 Revert last patch.
954 (Output_section::sort_attached_input_sections): Likewise.
955
28f2a4ac
ST
9562012-12-18 Sriraman Tallam <tmsriram@google.com>
957
edcac0c1 958 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
959 * layout.h (Layout::is_section_name_prefix_grouped): New function.
960 * output.cc (Output_section::add_input_section): Check if section
961 name contains special prefix. Keep input sections to sort such
962 sections.
963 (Output_section::Input_section_sort_section_order_index_compare
964 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
965 (Output_section::sort_attached_input_sections): Add condition to
966 Input_section_entry constructor call.
28f2a4ac
ST
967 * testsuite/Makefile.am (text_section_grouping): New test.
968 * testsuite/Makefile.in: Regenerate.
969 * testsuite/text_section_grouping.cc: New file.
970 * testsuite/text_section_grouping.sh: New file.
971
5bf135a7
NC
9722012-12-17 Nick Clifton <nickc@redhat.com>
973
974 * Makefile.am: Add copyright notice.
975 * NEWS: Likewise.
976 * README: Likewise.
977 * configure.ac: Likewise.
978 * ftruncate.c: Likewise.
979 * Makefile.in: Regenerate.
980
59965708
CC
9812012-12-14 Cary Coutant <ccoutant@google.com>
982
a4034750
AM
983 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
984 --no-as-needed flag.
985 (exception_separate_shared_12_test): Likewise.
986 (incremental_copy_test): Likewise.
987 * testsuite/Makefile.in: Regenerate.
59965708 988
2a77e2ab
CC
9892012-12-14 Cary Coutant <ccoutant@google.com>
990
991 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
992 (Dwp_output_file::Dwp_index::enter_set): Add assert.
993
e3deeb9c
AM
9942012-12-12 Alan Modra <amodra@gmail.com>
995
996 * powerpc.cc (class Track_tls): New.
997 (class Relocate, class Scan): Inherit Track_tls.
998 (Target_powerpc::Scan::local, global): Track tls optimization
999 and avoid creating plt entry for __tls_get_addr if all uses
1000 are optimized away.
1001 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1002
d8f5a274
AM
10032012-12-12 Alan Modra <amodra@gmail.com>
1004
1005 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1006 Replace no_toc_optimize with toc_optimize.
1007 * output.h (Output_section::input_sections): Provide non-const variant.
1008 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1009 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1010 accessors.
1011 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1012 (class Sort_toc_sections): New.
1013 (Target_powerpc::do_finalize_sections): Sort toc sections.
1014 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1015
4c8a1de1
RM
10162012-12-10 Roland McGrath <mcgrathr@google.com>
1017
1018 * testsuite/binary_unittest.cc (read_all): New function.
1019 (Sized_binary_test): Use it instead of ::read.
1020 * fileread.cc (do_read): Don't assume pread always reads the whole
1021 amount in a single call.
1022
edc27beb
AM
10232012-12-10 Alan Modra <amodra@gmail.com>
1024
1025 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1026 Set EM_PPC64 or EM_PPC here.
1027 (Target_selector_powerpc::do_recognize): Delete.
1028
906b9150
AM
10292012-12-10 Alan Modra <amodra@gmail.com>
1030
1031 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1032 stub_table_.
1033 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1034
418c15ae
RM
10352012-12-07 Roland McGrath <mcgrathr@google.com>
1036
1037 * testsuite/binary_unittest.cc (Sized_binary_test):
1038 Use open_descriptor rather than ::open.
1039
decdd3bc
AM
10402012-12-07 Alan Modra <amodra@gmail.com>
1041
1042 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1043 typedef and invalid_address constant.
1044 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1045 instantiate constants.
1046
db399005
ILT
10472012-12-06 Roland McGrath <mcgrathr@google.com>
1048
1049 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1050 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1051 * aclocal.m4: Regenerate.
1052 * configure: Regenerate.
1053 * Makefile.in: Regenerate.
1054 * testsuite/Makefile.in: Regenerate.
1055
aba6bc71
AM
10562012-12-07 Alan Modra <amodra@gmail.com>
1057
1058 * options.h (General_options): Add no_toc_optimize.
1059 * powerpc.cc (ok_lo_toc_insn): New function.
1060 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1061
9e69ed50
AM
10622012-12-06 Alan Modra <amodra@gmail.com>
1063
1064 * options.h (General_options): Add plt_align, plt_static_chain,
1065 plt_thread_safe. Update stub_group_size help text.
1066 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1067 for new plt_thread_safe_ var.
1068 (use_plt_offset): Correct comments.
1069 (Target_powerpc::do_relax): Look for thread creation symbols to
1070 determine default plt_thread_safe value. Clear plt call stubs
1071 as well as branch stubs each iteration.
1072 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1073 insn constants.
1074 (l, hi, ha, write_insn): Move earlier.
1075 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1076 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1077 plt stubs too.
1078 (Stub_table::update_size): Adjust.
1079 (Stub_table::prev_size, set_prev_size): Delete.
1080 (Stub_table::stub_align): Let --plt-align affect result.
1081 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1082 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1083 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1084 (Stub_table::do_write): Support more stub variants.
1085
f43ba157
AM
10862012-12-04 Alan Modra <amodra@gmail.com>
1087
1088 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
1089 (Target_powerpc::do_define_standard_symbols): New function.
1090
34171bc5
AM
10912012-12-03 Alan Modra <amodra@gmail.com>
1092
1093 * output.h: Formatting, whitespace.
1094
dc9589e9 10952012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
1096
1097 * layout.h (Layout::get_executable_sections): Declare.
1098 * layout.cc (Layout::get_executable_sections): New function.
1099 * arm.cc (Target_arm::group_sections): Use it.
1100 (Arm_output_section::group_sections): Delete now redundant test.
1101 * output.cc (Output_reloc::Output_reloc): Add is_relative.
1102 param to handle relative relocs.
1103 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
1104 (Output_data_reloc::add_absolute): Adjust.
1105 (Output_data_reloc::add_relative): New function.
1106 (Output_data::reset_data_size): New function.
1107 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
1108 (Output_section::set_addralign): New function.
1109 (Output_section::checkpoint_set_addralign): New function.
1110 (Output_section::clear_section_offsets_need_adjustment): New function.
1111 (Output_section::input_sections): Make public.
1112 * powerpc.cc (class Output_data_brlt_powerpc): New.
1113 (class Stub_table, class Stub_control): New.
1114 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
1115 stub_table_, set_stub_table, stub_table): New vectors and accessor
1116 functions.
1117 (Target_powerpc::do_may_relax, do_relax, push_branch,
1118 new_stub_table, stub_tables, brlt_section, group_sections,
1119 add_branch_lookup_table, find_branch_lookup_table,
1120 write_branch_lookup_table, make_brlt_section): New functions.
1121 (Target_powerpc::struct Sort_sections, class Branch_info): New.
1122 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
1123 branch_info_): New vars.
1124 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
1125 make call stubs here.
1126 (Output_data_glink): Remove all call stub handling from this class.
1127 (Target_powerpc::Scan::local, global): Save interesting branch
1128 relocs and relocs for ifunc. Adjust calls to plt entry functions.
1129 (Target_powerpc::do_finalize_sections): Only make reg save/restore
1130 functions on final link.
1131 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
1132 Handle long branch destinations too.
1133 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
1134 do_plt_address_for_local): Adjust lookup of plt call stubs.
1135
627b30b7
AM
11362012-11-30 Alan Modra <amodra@gmail.com>
1137
1138 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
1139 relocs against protected symbols when building 32-bit shared libs.
1140
40b469d7
AM
11412012-11-30 Alan Modra <amodra@gmail.com>
1142
1143 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
1144 param. Call got_section() to make .got. Update all callers
1145 and their callers and so on.
1146
bb66a627
AM
11472012-11-30 Alan Modra <amodra@gmail.com>
1148
1149 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
1150 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
1151 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
1152 value if it already exists.
1153
d2cf1c6c
L
11542012-11-19 H.J. Lu <hongjiu.lu@intel.com>
1155
1156 PR gold/14858
1157 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
1158
edccdf7c
RM
11592012-11-14 Roland McGrath <mcgrathr@google.com>
1160
1161 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
1162 than bfc instruction for data sandboxing.
1163
6febeb74
AM
11642012-11-08 Alan Modra <amodra@gmail.com>
1165
1166 * po/POTFILES.in: Regenerate.
1167
0a6f1bf2
AM
11682012-11-05 Alan Modra <amodra@gmail.com>
1169
1170 * configure.ac: Apply 2012-09-10 change to config.in here.
1171 * configure: Regenerate.
1172
26a4e9cb
AM
11732012-11-05 Alan Modra <amodra@gmail.com>
1174
1175 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
1176 (struct Opd_ent): Use "Address" rather than "Offset".
1177 (Output_data_got_powerpc::got_base_offset): Return Valtype.
1178 (Target_powerpc::got_section): Make public.
1179 (Target_powerpc::scan_relocs): Move code setting symbols..
1180 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
1181 Create _SDA_BASE_ only when referenced.
1182
cc928013
RM
11832012-11-02 Roland McGrath <mcgrathr@google.com>
1184
1185 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
1186 from last change.
1187
50ed5eb1
RM
11882012-11-01 Roland McGrath <mcgrathr@google.com>
1189
62fe925a
RM
1190 * target.h (Sized_target::relocate_relocs): Use Elf_Off
1191 for offset_in_output_section parameter.
1192 (Sized_target::relocate_special_relocatable): Likewise.
1193 * arm.cc (Target_arm::relocate_relocs): Likewise.
1194 (Target_arm::relocate_special_relocatable): Likewise.
1195 * i386.cc (Target_i386::relocate_relocs): Likewise.
1196 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
1197 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
1198 * target-reloc.h (relocate_relocs): Likewise.
1199 * testsuite/testfile.cc (Target_test): Likewise.
1200 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
1201 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
1202
1203 * system.h: Move inclusion of <clocale> to after <libintl.h> in
1204 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
1205
1206 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
1207 parameter, which is unused in the [!F_SETFD] case.
1208
50ed5eb1
RM
1209 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
1210 SYMNDX to off_t before comparing it to this->data_size().
1211 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
1212 * incremental.cc (Output_section_incremental_inputs::do_write):
1213 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
1214
2cadc0bf
RM
1215 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
1216
3bfcb652
NC
12172012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
1218
1219 * gold.cc (Target_arm::do_adjust_elf_header): Add the
1220 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
1221 in EABI_VER5.
1222
c1a8d56e
CC
12232012-10-29 Cary Coutant <ccoutant@google.com>
1224
1225 * dwp.cc (usage): Add file and exit status parameters;
1226 add --help and --version options.
1227 (print_version): New function.
1228 (main): Add --help and --version options.
1229
b2490a7b
L
12302012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1231
1232 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
1233 final_layout_sequence.txt.
1234 * testsuite/Makefile.in: Regenerated.
1235
aa543512
L
12362012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1237
1238 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
1239 COMPILE generated by automake.
1240 (LINK1): Likewise.
1241 (CXXCOMPILE1): Likewise.
1242 (CXXLINK1): Likewise.
1243 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
1244 (LINK): Likewise.
1245 (CXXCOMPILE): Likewise.
1246 (CXXLINK): Likewise.
1247 * testsuite/Makefile.in: Regenerated.
1248
d361fafb
L
12492012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1250
1251 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
1252 on bad fwrite return.
1253
598c7410
L
12542012-10-25 H.J. Lu <hongjiu.lu@intel.com>
1255
1256 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
1257 on val.
1258
35c813e2
CC
12592012-10-23 Cary Coutant <ccoutant@google.com>
1260
1261 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
1262 * testsuite/Makefile.in: Regenerate.
1263 * testsuite/dwp_test.h: New source file.
1264 * testsuite/dwp_test_1.cc: New source file.
1265 * testsuite/dwp_test_1.s: New source file.
1266 * testsuite/dwp_test_1.sh: New source file.
1267 * testsuite/dwp_test_1b.cc: New source file.
1268 * testsuite/dwp_test_1b.s: New source file.
1269 * testsuite/dwp_test_2.cc: New source file.
1270 * testsuite/dwp_test_2.s: New source file.
1271 * testsuite/dwp_test_2.sh: New source file.
1272 * testsuite/dwp_test_main.cc: New source file.
1273 * testsuite/dwp_test_main.s: New source file.
1274
77429909
CC
12752012-10-23 Cary Coutant <ccoutant@google.com>
1276
1277 * dwp.h: New header file.
1278 * dwp.cc: New source file.
1279 * gold.h: Move shared declarations to system.h.
1280 * system.h: New header file.
1281 * Makefile.am: Add dwp.
1282 * Makefile.in: Regenerate.
1283
ed5d6712
CC
12842012-10-23 Cary Coutant <ccoutant@google.com>
1285
1286 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
1287 Dwarf_info_reader::read_from_pointer.
1288 (Dwarf_pubnames_table::read_header): Likewise.
1289 (Dwarf_pubnames_table::next_name): Likewise.
1290 (Dwarf_die::read_attributes): Likewise.
1291 (Dwarf_die::skip_attributes): Likewise.
1292 (Dwarf_info_reader::read_from_pointer): New function template.
1293 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
1294 (Dwarf_pubnames_table): Likewise.
1295 (Dwarf_info_reader::read_from_pointer): New function template.
1296 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
1297 Dwarf_pubnames_table ctor.
1298
8787852d
CC
12992012-10-23 Cary Coutant <ccoutant@google.com>
1300
1301 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
1302 abbrev_shndx.
1303 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
1304 abbrev_shndx_.
1305 (Dwarf_info_reader::set_abbrev_shndx): New method.
1306 (Dwarf_info_reader::abbrev_shndx_): New data member.
1307
9fc236f3
CC
13082012-10-23 Cary Coutant <ccoutant@google.com>
1309
1310 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
1311 from object, not parameters.
1312 (Dwarf_info_reader::parse): Likewise.
1313 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
1314 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
1315 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
1316 methods.
1317
effe8365
CC
13182012-10-23 Cary Coutant <ccoutant@google.com>
1319
1320 * fileread.cc (Input_file::Input_file): New constructor.
1321 * fileread.h (class Input_file): Add new constructor.
1322
1698990d
AM
13232012-10-18 Alan Modra <amodra@gmail.com>
1324
1325 PR gold/14727
1326 * object.cc (Relobj::is_section_name_included): Also match
1327 .sdata personality section.
1328
168a4726
AM
13292012-10-18 Alan Modra <amodra@gmail.com>
1330
1331 * target-reloc.h (class Default_comdat_behavior): New, package up..
1332 (get_comdat_behaviour): ..this.
1333 (relocate_section): Add Relocate_comdat_behavior template arg,
1334 adjust code to suit.
1335 * arm.cc (Target_arm::relocate_section): Adjust to suit.
1336 (Target_arm::scan_reloc_section): Likewise.
1337 * i386.cc (Target_i386::relocate_section): Likewise.
1338 * sparc.cc (Target_sparc::relocate_section): Likewise.
1339 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
1340 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
1341 * powerpc.cc (class Relocate_comdat_behavior): New.
1342 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
1343 gold::relocate_section with new template arg.
1344
acc276d8
AM
13452012-10-18 Alan Modra <amodra@gmail.com>
1346
1347 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
1348 dynamic relocs for GOT_TPREL got entries, without symbol if
1349 resolving locally.
1350 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
1351 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
1352 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
1353
e10f9870
AM
13542012-10-17 Alan Modra <amodra@gmail.com>
1355
1356 PR gold/14726
1357 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
1358
ae034989
ST
13592012-10-16 Sriraman Tallam <tmsriram@google.com>
1360
1361 * layout.cc (Layout::include_section): Keep sections marked
1362 SHF_EXCLUDE when doing relocatable links.
1363
f3a0ed29
AM
13642012-10-16 Alan Modra <amodra@gmail.com>
1365
1366 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
1367 (Target_powerpc::do_finalize_sections): Call it.
1368 (Output_data_save_res): New class and supporting functions.
1369 (Target_powerpc::symval_for_branch): Only look up .opd entry for
1370 normal symbols defined in object files.
1371
c6de8ed4
AM
13722012-10-12 Alan Modra <amodra@gmail.com>
1373
1374 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
1375 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
1376 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
1377 section if scan_opd_relocs not yet called.
1378 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
1379
03e25981
AM
13802012-10-12 Alan Modra <amodra@gmail.com>
1381
1382 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1383 add_local_ifunc_entry): Revert last change.
1384 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
1385
c9824451
AM
13862012-10-05 Alan Modra <amodra@gmail.com>
1387
1388 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
1389 do_plt_address_for_global): New functions.
1390 (Output_data_got_powerpc::do_write): Don't segfault when linking
1391 statically.
1392 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
1393 add_local_ifunc_entry): Return true on adding entry..
1394 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
1395 glink->add_entry call. Remove unused symtab param. Adjust calls.
1396 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
1397 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
1398 set up symbols here.
1399 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
1400 syms here. Do so even when no .iplt. Don't segfault when linking
1401 statically.
1402 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
1403 new variants without reloc param.
1404 (Glink_sym_ent::Glink_sym_ent): Likewise.
1405 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
1406 reloc when refs will resolve to plt call stub.
1407 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
1408 R_PPC_PLTREL24 to resolve locally.
1409 (Target_powerpc::Scan::global): Correct ifunc handling.
1410 (Target_powerpc::Relocate::relocate): Correct local sym glink
1411 lookup. Don't destroy "value" when we have a plt call stub,
1412 and when checking plt call validity.
1413 (Target_powerpc::do_dynsym_value): Simplify.
1414
19fec8c1
AM
14152012-10-05 Alan Modra <amodra@gmail.com>
1416
1417 * i386.cc (Output_data_plt_i386::address_for_global,
1418 address_for_local): Add plt offset to returned value. Adjust uses.
1419 * sparc.cc (Output_data_plt_sparc::address_for_global,
1420 address_for_local): Likewise.
1421 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
1422 address_for_local): Likewise.
1423 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
1424 address_for_local): Likewise.
1425 * target.h (Target::plt_address_for_global, plt_address_for_local):
1426 Update comment.
1427 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
1428 (Output_data_got::Got_entry::write): Nor here.
1429 * output.h: Comment fix.
1430
e867b647
WL
14312012-10-02 Jiong Wang <jiwang@tilera.com>
1432
1433 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
1434 global_offset_table_ value for larget got.
1435 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
1436
e5d5f5ed
AM
14372012-09-29 Alan Modra <amodra@gmail.com>
1438
1439 * powerpc.cc (Target_powerpc::iplt_): New output section.
1440 (Target_powerpc::iplt_section, make_iplt_section,
1441 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
1442 (Target_powerpc::make_plt_entry): Handle ifunc syms.
1443 Target_powerpc::plt_entry_count): Count iplt entries too.
1444 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
1445 reloc section in constructor. New params.
1446 (Target_powerpc::make_plt_section): Create reloc section here instead.
1447 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
1448 functions.
1449 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
1450 (Output_data_glink::add_entry, find_entry): New functions to
1451 deal with local syms.
1452 (Glink_sym_ent): Add support for local syms.
1453 (Output_data_glink::do_write): Handle ifunc plt entries.
1454 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1455 (Target_powerpc::Scan::local, global): Handle ifunc syms.
1456 (Target_powerpc::Relocate::relocate): Likewise.
1457 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
1458
ec4dbad3
AM
14592012-09-25 Alan Modra <amodra@gmail.com>
1460
1461 * object.h (Sized_relobj_file::adjust_local_symbol,
1462 do_adjust_local_symbol): New functions.
1463 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
1464 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
1465 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
1466 and irregular opd entry spacing.
1467 (Powerpc_relobj::do_read_relocs): Add opd size checks.
1468 (Global_symbol_visitor_opd): New functor.
1469 (Target_powerpc::do_finalize_sections): Omit global symbols defined
1470 on deleted opd entries.
1471
5c0b3823
WL
14722012-09-15 Jiong Wang <jiwang@tilera.com>
1473
1474 * tilegx.cc: New file.
1475 * Makefile.am (TARGETSOURCES): Add tilegx.cc
1476 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
1477 * configure.tgt: Add entries for tilegx*.
1478 * configure.ac: Likewise.
1479 * Makefile.in: Rebuild.
1480 * configure: Likewise.
1481 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
1482 tilegx.
1483
bfdfa4cd
AM
14842012-09-13 Alan Modra <amodra@gmail.com>
1485
1486 * target-reloc.h (scan_relocs): Call scan.local for relocs
1487 against symbols in discarded sections. Pass is_discarded
1488 param.
1489 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
1490 Add is_discarded param.
1491 * powerpc (Target_powerpc::Scan::local): Likewise. Use
1492 is_discarded to flag opd entry as discarded. Don't emit dyn
1493 relocs on such entries.
1494 (Target_powerpc::Scan::global): Similarly detect and handle
1495 such opd entries.
1496 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
1497 opd_ent_. Update all uses.
1498 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
1499 (Target_powerpc::relocate_section): Zero out discarded opd
1500 entry relocs.
1501
d77a0555
ILT
15022012-09-12 Ian Lance Taylor <iant@google.com>
1503
1504 PR gold/14570
1505 * output.cc: Rename Output_data_got template parameter from size
1506 to got_size for all functions. Compile all variants of
1507 Output_data_got.
1508 (Output_data_got::Got_entry::write): Correct use of size for
1509 symbol value. Use local_is_tls rather than casting to
1510 Sized_relobj_file.
1511 * object.h (class Object): Add local_is_tls and do_local_is_tls.
1512 (class Sized_relobj_file): Add do_local_is_tls.
1513 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
1514
815a1205
AM
15152012-09-11 Alan Modra <amodra@gmail.com>
1516
1517 PR gold/14566
1518 * layout.cc (Layout::set_segment_offsets): When using
1519 common-page-size alignment, ensure we are on a new max-page-size
1520 page.
1521 * output.cc (Output_segment::set_section_addresses): Use
1522 abi_pagesize, not common_pagesize for relro boundary.
1523 (Output_segment::set_offset): Likewise.
1524
bd73a62d
AM
15252012-09-11 Alan Modra <amodra@gmail.com>
1526
1527 * output.h (Output_data_got::add_global_tls, add_local_tls,
1528 add_local_tls_pair): New functions.
1529 (Output_data_got::add_local_pair_with_rel): Remove second
1530 reloc param. Expand comment.
1531 (Output_data_got::Got_entry): Rename use_plt_offset_ to
1532 use_plt_or_tls_offset_, similarly for constructor param.
1533 (Output_data_got::Got_entry::write): Add got_index param.
1534 * output.cc (Output_data_got::add_global_tls, add_local_tls,
1535 add_local_tls_pair): New functions.
1536 (Output_data_got::Got_entry::write): Handle tls symbols
1537 with use_plt_or_tls_offset_ set specially.
1538 (Output_data_got::add_local_pair_with_rel): Only one reloc.
1539 (Output_data_got::do_write): Replace iterator with index, pass
1540 index to entry write function.
1541 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
1542 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
1543 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
1544 call.
1545 * i386.cc (Target_i386::Scan::local): Likewise.
1546 * sparc.cc (Target_sparc::Scan::local): Likewise.
1547 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
1548 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
1549 do_tls_offset_for_global): New functions.
1550 (Target_powerpc::Scan::local): Correct TLS relocations and got
1551 entry values.
1552 (Target_powerpc::Scan::global): Don't emit unnecessary
1553 dynamic relocations on TLS GOT entries.
1554
00716ab1
AM
15552012-09-10 Matthias Klose <doko@ubuntu.com>
1556
1557 * config.in: Disable sanity check for kfreebsd.
1558
c891b3f9
SA
15592012-09-10 Sterling Augustine <saugustine@google.com>
1560
1561 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
1562 (Gdb_index::pubtypes_read): New parameter.
1563 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
1564 to calls.
1565 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
1566 pubtypes_object_.
1567
e81fea4d
AM
15682012-09-09 Alan Modra <amodra@gmail.com>
1569
1570 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
1571 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
1572 * gc.h (gc_process_relocs): Call target gc_add_reference.
1573 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
1574 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
1575 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
1576 unnecessary cast.
1577 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
1578 to cater for when we don't need code offset. Update use.
1579 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
1580 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
1581 set_opd_valid): New functions.
1582 (Target_powerpc::do_gc_add_reference): New function.
1583 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
1584 stashed refs.
1585 (Target_powerpc::do_gc_mark_symbol): New function.
1586
d2d60eef
CC
15872012-09-06 Cary Coutant <ccoutant@google.com>
1588
1589 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
1590 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
1591 (Dwarf_die::skip_attributes): Likewise.
1592 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
1593 * testsuite/gdb_index_test.cc (inline_func_1): New function.
1594 (main): Call it.
1595 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
1596
32ed4573
L
15972012-09-05 H.J. Lu <hongjiu.lu@intel.com>
1598
1599 * testsuite/script_test_3.t: Add .got.plt output section
1600 statement.
1601 * testsuite/script_test_4.t: Likewise.
1602
f4baf0d4
AM
16032012-09-05 Alan Modra <amodra@gmail.com>
1604
1605 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
1606 update all uses and lose "enum" when using type.
1607
864a1b56
AM
16082012-09-05 Alan Modra <amodra@gmail.com>
1609
1610 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
1611 * configure: Regenerate.
1612 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
1613 (plugin_final_layout.stdout): Likewise.
1614 (memory_test): Set page sizes to 0x1000.
1615 * testsuite/Makefile.in: Regenerate.
1616 * testsuite/discard_locals_test.sh: Add FIXME comment.
1617 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
1618 * testsuite/pr14265.t: Add .got output section statement.
1619 * testsuite/script_test_2.t: Likewise.
1620 * testsuite/script_test_3.t: Likewise.
1621 * testsuite/script_test_4.t: Likewise.
1622 * testsuite/script_test_5.t: Likewise.
1623 * testsuite/script_test_6.t: Likewise.
1624 * testsuite/script_test_7.t: Likewise.
1625 * testsuite/script_test_9.t: Likewise.
1626
3ea0a085
AM
16272012-09-05 Alan Modra <amodra@gmail.com>
1628
1629 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
1630 (Powerpc_relocate_functions::Status): New typedef.
1631 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1632 (Target_powerpc::Scan::local): Handle REL64.
1633 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
1634 for REL32 and REL64.
1635 (Target_powerpc::symval_for_branch): New function, extracted from..
1636 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
1637 checks. Report overflow errors.
1638
7404fe1b
AM
16392012-09-05 Alan Modra <amodra@gmail.com>
1640
1641 * object.h (Sized_relobj_file::emit_relocs): Delete.
1642 (Sized_relobj_file::emit_relocs_reltype): Delete.
1643 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
1644 relocate_relocs for --emit-relocs.
1645 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
1646 * output.h: Update comment.
1647 (Output_segment::first_section): New function.
1648 (Output_segment::first_section_load_address): Use first_section.
1649 * output.cc (Output_segment::first_section): New function extracted..
1650 (Output_segment::first_section_load_address): ..from here. Delete.
1651 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
1652 * target.h (Sized_target::relocate_for_relocatable): Likewise.
1653 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
1654 adjust call to target.h function.
1655 * i386.cc (Target_i386): Likewise.
1656 * sparc.cc (Target_sparc): Likewise.
1657 * x86_64.cc (Target_x86_64): Likewise.
1658 * powerpc.cc (Target_powerpc): Likewise.
1659 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
1660 first tls section has section symbol for optimised local dynamic
1661 output relocs.
1662 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
1663 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
1664 optimised tls code.
1665 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
1666 Rename to relocate_relocs. Update error message.
1667
957564c9
AS
16682012-09-04 Andreas Schwab <schwab@linux-m68k.org>
1669
1670 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
1671 --just-symbols.
1672
dd93cd0a
AM
16732012-08-31 Alan Modra <amodra@gmail.com>
1674
1675 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
1676 (Powerpc_relobj::toc_base_offset): New stub function.
1677 (Target_powerpc): Add tp_offset, dtp_offset. Rename
1678 got_mod_index_offset to tlsld_got_offset. Update all refs.
1679 (Target_powerpc::Relocate::enum skip_tls): New.
1680 (Target_powerpc::call_tls_get_addr_): New var.
1681 (Target_powerpc::is_branch_reloc): Move to file scope.
1682 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
1683 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
1684 New functions.
1685 (Target_powerpc::enum Got_type): Delete old values, add new ones.
1686 (powerpc_info): Correct common_pagesize for ppc64.
1687 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
1688 (Powerpc_relocate_functions): Add overflow check enums and functions.
1689 Add non-shift version of rela, rela_ua. Delete all rel public
1690 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
1691 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
1692 addr16_ha3, addr14 functions.
1693 (Output_data_got_powerpc::add_constant_pair): New function.
1694 (Output_data_got_powerpc::got_base_offset): Likewise.
1695 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
1696 (instruction constants): Sort, add some more.
1697 (Output_data_glink::do_write): Add and use Address typedef. Use
1698 object->toc_base_offset() stub for 64-bit.
1699 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
1700 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
1701 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
1702 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
1703 Always treat .opd relocs as against locally defined symbol.
1704 Correct condition for RELATIVE relocs.
1705 (Target_powerpc::do_finalize_sections): Test for NULL sections.
1706 (Target_powerpc::Relocate::relocate): Use plt call stub as value
1707 for 32-bit syms with a plt entry. Correct ppc64 toc base
1708 calculations. Handle TLS relocs, and more. Add overflow
1709 checking and adjust for Powerpc_relocate_functions changes.
1710 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
1711 Reinstate --emit-relocs code with FIXME.
1712
a1373b60
AM
17132012-08-30 Alan Modra <amodra@gmail.com>
1714
1715 * layout.cc (Layout::set_segment_offsets): Set p_align to
1716 abi_pagesize, not common_pagesize.
1717 (Layout::relaxation_loop_body): Similarly use abi_pagesize
1718 to determine whether file header can go in segment.
1719
703d02da
AM
17202012-08-30 Alan Modra <amodra@gmail.com>
1721
1722 * output.h (Output_reloc::Output_reloc <output section>): Add
1723 is_relative param. Adjust calls.
1724 (Output_reloc::add_output_section_relative): New functions.
1725 * output.cc (Output_reloc::Output_reloc <output section>): Handle
1726 is_relative.
1727 (Output_reloc::symbol_value): Handle SECTION_CODE.
1728
16164a6b
ST
17292012-08-24 Sriraman Tallam <tmsriram@google.com>
1730
1731 * gold.cc (queue_middle_tasks): Call layout again when unique
1732 segments for sections is desired.
1733 * layout.cc (Layout::Layout): Initialize new members.
1734 (Layout::get_output_section_flags): New function.
1735 (Layout::choose_output_section): Call get_output_section_flags.
1736 (Layout::layout): Make output section for mapping to a unique segment.
1737 (Layout::insert_section_segment_map): New function.
1738 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 1739 output sections marked so.
16164a6b
ST
1740 (Layout::segment_precedes): Check for unique segments when sorting.
1741 * layout.h (Layout::Unique_segment_info): New struct.
1742 (Layout::Section_segment_map): New typedef.
1743 (Layout::insert_section_segment_map): New function.
1744 (Layout::get_output_section_flags): New function.
1745 (Layout::is_unique_segment_for_sections_specified): New function.
1746 (Layout::set_unique_segment_for_sections_specified): New function.
1747 (Layout::unique_segment_for_sections_specified_): New member.
1748 (Layout::section_segment_map_): New member.
1749 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
1750 Rename is_gc_pass_one to is_pass_one.
1751 Rename is_gc_pass_two to is_pass_two.
1752 Rename is_gc_or_icf to is_two_pass.
1753 Check for which pass based on whether symbols data is present.
1754 Make it two pass when unique segments for sections is desired.
1755 * output.cc (Output_section::Output_section): Initialize new
1756 members.
1757 * output.h (Output_section::is_unique_segment): New function.
1758 (Output_section::set_is_unique_segment): New function.
1759 (Output_section::is_unique_segment_): New member.
1760 (Output_section::extra_segment_flags): New function.
1761 (Output_section::set_extra_segment_flags): New function.
1762 (Output_section::extra_segment_flags_): New member.
1763 (Output_section::segment_alignment): New function.
1764 (Output_section::set_segment_alignment): New function.
1765 (Output_section::segment_alignment_): New member.
1766 (Output_segment::Output_segment): Initialize is_unique_segment_.
1767 (Output_segment::is_unique_segment): New function.
1768 (Output_segment::set_is_unique_segment): New function.
1769 (Output_segment::is_unique_segment_): New member.
1770 * plugin.cc (allow_unique_segment_for_sections): New function.
1771 (unique_segment_for_sections): New function.
1772 (Plugin::load): Add new functions to transfer vector.
1773 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
1774 * Makefile.in: Regenerate.
1775 * testsuite/plugin_final_layout.sh: Check if unique segment
1776 functionality works.
1777 * testsuite/plugin_section_order.c (onload): Check if new interfaces
1778 are available.
1779 (allow_unique_segment_for_sections): New global.
1780 (unique_segment_for_sections): New global.
1781 (claim_file_hook): Call allow_unique_segment_for_sections.
1782 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 1783
1e2bee4f
CC
17842012-08-22 Cary Coutant <ccoutant@google.com>
1785
1786 * layout.cc (Layout::include_section): Don't assert on GROUP
1787 sections with --emit-relocs.
1788
1d5dfe78
CC
17892012-08-21 Cary Coutant <ccoutant@google.com>
1790
1791 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
1792 if --export-dynamic-symbol names an undef symbol.
1793
c9269dff
AM
17942012-08-18 Alan Modra <amodra@gmail.com>
1795
1796 * powerpc.cc: Formatting and white space.
1797 (Powerpc_relobj): Rename got2_section_ to special_.
1798 Add opd_ent_shndx_ and opd_ent_off_ vectors.
1799 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
1800 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
1801 (Target_powerpc): Add Address typedef and invalid_address. Use
1802 throughout.
1803 (Target_powerpc::is_branch_reloc): New function.
1804 (Powerpc_relocate_functions): Add Address typedef, use throughout.
1805 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
1806 for dst_mask, value and addend.
1807 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
1808 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
1809 (Output_data_glink::do_write): Correct toc base. Don't try to use
1810 uint16_t for 24-bit offset. Use get_output_section_offset and
1811 check return.
1812 (Target_powerpc::Scan::local): Handle more relocs.
1813 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
1814 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
1815 Plug in toc restoring insn after plt calls. Translate branches
1816 to function descriptor symbols to corresponding entry point.
1817 (Target_powerpc::relocate_for_relocatable): Check return from
1818 get_output_section_offset.
1819 * symtab.h: Comment typo.
1820
b1759dce
ILT
18212012-08-14 Ian Lance Taylor <iant@google.com>
1822
1823 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
1824 unsupported_relocal_local to call unsupported_reloc_global.
1825
b9b2ae8b
NC
18262012-08-14 Nick Clifton <nickc@redhat.com>
1827
1828 PR ld/14265
1829 * script-sections.cc (Sections_element::output_section_name): Add
1830 keep return parameter.
1831 (Output_section_element::match_name): Add keep return parameter.
1832 Return the value of the keep_ member.
1833 * script-sections.h (class Output_section): Update
1834 output_section_name prototype.
1835 * layout.cc (Layout::keep_input_section): New public member
1836 function.
1837 (Layout::choose_output_section): Pass keep parameter to
1838 output_section_name.
1839 * layout.h (class Layout): Add keep_input_section.
1840 * object.cc (Sized_relobj_file::do_layout): Check for kept input
1841 sections.
1842 * testsuite/Makefile.am: Add a test.
1843 * testsuite/Makefile.in: Regenerate.
1844 * testsuite/pr14265.c: Source file for the test.
1845 * testsuite/pr14265.t: Linker script for the test.
1846 * testsuite/pr14265.sh: Shell script for the test.
1847
921b5322
AM
18482012-08-14 Alan Modra <amodra@gmail.com>
1849
1850 * target.h (Target::output_section_name): New function.
1851 (Target::do_output_section_name): New function.
1852 * layout.cc (Layout::choose_output_section): Call the above.
1853 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
1854
6ce78956
AM
18552012-08-14 Alan Modra <amodra@gmail.com>
1856
1857 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
1858 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
1859 for replace_constant call.
1860 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
1861 (Output_data_glink::do_print_to_mapfile): New function.
1862 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
1863 (Target_powerpc::Relocate::relocate): Likewise.
1864
d1a8cabd
AM
18652012-08-14 Alan Modra <amodra@gmail.com>
1866
1867 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
1868 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
1869 (Output_data_glink::add_entry,find_entry): Remove shndx param.
1870 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
1871 all references to shndx_. Handle special case for R_PPC_PLTREL24
1872 here.
1873 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
1874 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
1875 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
1876 here.
1877 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
1878 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
1879
d83ce4e3
AM
18802012-08-12 Alan Modra <amodra@gmail.com>
1881
1882 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
1883 (glink insn constants): Use uint32_t.
1884 (Output_data_glink::add_entry): Use insert, not [] operator.
1885
cf43a2fe
AM
18862012-08-11 Alan Modra <amodra@gmail.com>
1887
1888 * object.h (Sized_relobj_file::find_shdr): New function.
1889 (Sized_relobj_file::find_special_sections): New function.
1890 * object.cc (Sized_relobj_file::find_shdr): New function.
1891 (Sized_relobj_file::find_eh_frame): Use find_shdr.
1892 (Sized_relobj_file::find_special_sections): New function, split out..
1893 (Sized_relobj_file::do_read_symbols): ..from here.
1894 * output.h (Output_data_got::replace_constant): New function.
1895 (Output_data_got::num_entries): New function.
1896 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
1897 (Output_data_got::got_offset): Protected rather than private.
1898 (Output_data_got::replace_got_entry): New function.
1899 * output.cc (Output_data_got::replace_got_entry): New function.
1900 * powerpc.cc (class Powerpc_relobj): New.
1901 (class Powerpc_relocate_functions): Delete all psymval variants or
1902 convert to value,addend type. Delete pcrela, pcrela_unaligned.
1903 Implement _ha functions using corresponding _hi function.
1904 (Powerpc_relobj::find_special_sections): New function.
1905 (Target_powerpc::do_make_elf_object): New function.
1906 (class Output_data_got_powerpc): New.
1907 (class Output_data_glink): New.
1908 (class Powerpc_scan_relocatable_reloc): New.
1909 Many more changes througout file.
1910
3c892704
NC
19112012-08-09 Nick Clifton <nickc@redhat.com>
1912
1913 * po/vi.po: Updated Vietnamese translation.
1914
82435b3b
ILT
19152012-08-07 Ian Lance Taylor <iant@google.com>
1916
1917 * layout.cc (Layout::add_target_dynamic_tags): If
1918 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
1919 plt_rel.
1920
a6dc81d2
NC
19212012-07-30 Nick Clifton <nickc@redhat.com>
1922
1923 * po/gold.pot: Updated template.
1924 * po/es.po: Updated Spanish translation.
1925
f1415016
CC
19262012-07-18 Cary Coutant <ccoutant@google.com>
1927
1928 PR gold/14344
1929 * configure.ac: Add check for -gpubnames support.
1930 * configure: Regenerate.
1931 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
1932 support; force -gno-pubnames.
1933 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
1934 support.
1935 (gdb_index_test_4): New test.
1936 * testsuite/Makefile.in: Regenerate.
1937 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
1938 * testsuite/gdb_index_test_2.sh: Likewise.
1939 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
1940 * testsuite/gdb_index_test_4.sh: New script.
1941 * testsuite/gdb_index_test_comm.sh: New script with common code;
1942 don't look for space after colon.
1943
b7fd7c37
ST
19442012-07-16 Sriraman Tallam <tmsriram@google.com>
1945
1946 * gold.cc (queue_middle_tasks): Update function order only after
1947 deferred objects due to plugins are processed.
1948
1f3212db
ILT
19492012-07-11 Ian Lance Taylor <iant@google.com>
1950
1951 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
1952 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
1953 (Target_arm::scan_reloc_for_stub): Likewise.
1954 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
1955 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
1956 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
1957 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
1958 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
1959
81c82a68
ILT
19602012-07-10 Dodji Seketeli <dodji@redhat.com>
1961 Ian Lance Taylor <iant@google.com>
1962
1963 PR gold/14309
1964 * configure.ac: Test whether std::tr1::hash<off_t> works.
1965 * gold.h: Add a specialization for std::tr1::hash<off_t> if
1966 needed.
1967 * output.h (class Output_fill): Add virtual destructor.
1968 * configure, config.in: Rebuild.
1969
eabc84f4
RM
19702012-06-22 Roland McGrath <mcgrathr@google.com>
1971
1972 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
1973
370e30b6
RÁE
19742012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
1975
1976 * plugin.cc (Plugin::load): Handle position independent executables.
1977
fb1b895d
CC
19782012-06-06 Cary Coutant <ccoutant@google.com>
1979
1980 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
1981 add .debug_macro.
1982 (lines_only_debug_sections): Likewise.
1983 (gdb_fast_lookup_sections): New static array.
1984 (is_gdb_debug_section): Rename formal parameter.
1985 (is_lines_only_debug_section): Likewise.
1986 (is_gdb_fast_lookup_section): New function.
1987 (Layout::include_section): Check for ".zdebug_" prefix; pass
1988 section name suffix to is_gdb_debug_section, et al.; check for
1989 fast-lookup sections when building .gdb_index.
1990 * options.h (--strip-debug-gdb): Update GDB version number.
1991
7c0640fa
CC
19922012-06-06 Cary Coutant <ccoutant@google.com>
1993
1994 * configure.ac: Add check for fallocate.
1995 * configure: Regenerate.
1996 * config.in: Regenerate.
1997
1998 * options.h (class General_options): Add --mmap-output-file and
1999 --posix-fallocate options.
2000 * output.cc: (posix_fallocate): Remove; replace with...
2001 (gold_fallocate): New function.
2002 (Output_file::map_no_anonymous): Call gold_fallocate.
2003 (Output_file::map): Check --mmap-output-file option.
2004
2a49eb69
DK
20052012-06-05 Jing Yu <jingyu@google.com>
2006
2007 * gold.h (textdomain): Add do {} to empty while(0).
2008 (bindtextdomain): Likewise.
2009
fad072ac
CC
20102012-06-04 Cary Coutant <ccoutant@google.com>
2011
2012 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2013 has_dynsym_index.
2014
8cc69fb6
ST
20152012-05-25 Sriraman Tallam <tmsriram@google.com>
2016
2017 * symtab.cc (Symbol_table::define_special_symbol):
2018 Initialize *poldsym to prevent uninitialized variable errors.
2019
1be75daa
CC
20202012-05-23 Cary Coutant <ccoutant@google.com>
2021
2022 * layout.cc (Layout::section_name_mapping): Add rules to handle
2023 exact match on .data.rel.ro.local or .data.rel.ro.
2024 (Layout::output_section_name): Check for exact matches.
2025
9b689de0
CC
20262012-05-23 Cary Coutant <ccoutant@google.com>
2027
2028 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2029 more carefully.
2030
b24fdbf5
CC
20312012-05-22 Cary Coutant <ccoutant@google.com>
2032
2033 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2034 object before exporting symbol.
2035
e550e1a2
L
20362012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2037
2038 * testsuite/tls_test.cc: Include "config.h" first.
2039 * testsuite/tls_test_c.c: Likewise.
2040
df7b86aa
NC
20412012-05-17 Daniel Richard G. <skunk@iskunk.org>
2042 Nick Clifton <nickc@redhat.com>
2043
2044 PR 14072
2045 * configure.in: Add check that sysdep.h has been included before
2046 any system header files.
2047 * configure: Regenerate.
2048 * config.in: Regenerate.
2049
1007b503
CC
20502012-05-14 Cary Coutant <ccoutant@google.com>
2051
2052 * layout.cc (Layout::make_output_section): Mark .tdata section
2053 as RELRO.
2054 * testsuite/relro_test.cc: Add a TLS variable.
2055
fd885f3a
L
20562012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2057
2058 PR gold/14091
2059 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2060 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2061 R_X86_64_64.
2062
80f5885c
CC
20632012-05-08 Cary Coutant <ccoutant@google.com>
2064
2065 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2066 (lines_only_debug_sections): Likewise.
2067
2e702c99
RM
20682012-05-02 Roland McGrath <mcgrathr@google.com>
2069
2070 * nacl.cc: New file.
2071 * nacl.h: New file.
2072 * Makefile.am (CCFILES, HFILES): Add them.
2073 * Makefile.in: Regenerate.
2074 * i386.cc (Output_data_plt_i386_nacl): New class.
2075 (Output_data_plt_i386_nacl_exec): New class.
2076 (Output_data_plt_i386_nacl_dyn): New class.
2077 (Target_i386_nacl): New class.
2078 (Target_selector_i386_nacl): New class.
2079 (target_selector_i386): Use it instead of Target_selector_i386.
2080 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2081 (Target_x86_64_nacl): New class.
2082 (Target_selector_x86_64_nacl): New class.
2083 (target_selector_x86_64, target_selector_x32): Use it instead of
2084 Target_selector_x86_64.
2085 * arm.cc (Output_data_plt_arm_nacl): New class.
2086 (Target_arm_nacl): New class.
2087 (Target_selector_arm_nacl): New class.
2088 (target_selector_arm, target_selector_armbe): Use it instead of
2089 Target_selector_arm.
2090
2091 * target-select.cc (select_target): Take new Input_file* and off_t
2092 arguments, pass them on to recognize method of selector.
2093 * object.cc (make_elf_sized_object): Update caller.
2094 * parameters.cc (parameters_force_valid_target): Likewise.
2095 * incremental.cc (make_sized_incremental_binary): Likewise.
2096 * target-select.h: Update decl.
2097 (Target_selector::recognize): Take new Input_file* argument,
2098 pass it on to do_recognize.
2099 (Target_selector::do_recognize): Take new Input_file* argument.
2100 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
2101 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
2102 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
2103 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
2104
2105 * target.h (Target::Target_info): New members isolate_execinstr
2106 and rosegment_gap.
2107 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
2108 * arm.cc (Target_arm::arm_info): Update initializer.
2109 * i386.cc (Target_i386::i386_info): Likewise.
2110 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
2111 * sparc.cc (Target_sparc::sparc_info): Likewise.
2112 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2113 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2114 * layout.cc (Layout::attach_allocated_section_to_segment):
2115 Take new const Target* argument. If target->isolate_execinstr(), act
2116 like --rosegment.
2117 (Layout::find_first_load_seg): Take new const Target* argument;
2118 if target->isolate_execinstr(), reject PF_X segments.
2119 (Layout::relaxation_loop_body): Update caller.
2120 (Layout::set_segment_offsets): If target->isolate_execinstr(),
2121 reset file offset to zero when we hit LOAD_SEG, and then do a second
2122 loop over the segments before LOAD_SEG to reassign offsets after
2123 addresses have been determined. Handle target->rosegment_gap().
2124 (Layout::attach_section_to_segment): Take new const Target* argument;
2125 pass it to attach_allocated_section_to_segment.
2126 (Layout::make_output_section): Update caller.
2127 (Layout::attach_sections_to_segments): Take new const Target* argument;
2128 pass it to attach_section_to_segment.
2129 * gold.cc (queue_middle_tasks): Update caller.
2130 * layout.h (Layout): Update method decls with new arguments.
2131
2132 * arm.cc (Target_arm::Target_arm): Take optional argument for the
2133 Target_info pointer to use.
2134 (Target_arm::do_make_data_plt): New virtual method.
2135 (Target_arm::make_data_plt): New method that calls it.
2136 (Target_arm::make_plt_entry): Use it.
2137 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
2138 for the section alignment.
2139 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
2140 method.
2141 (Output_data_plt_arm::first_plt_entry_offset): Call it.
2142 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
2143 method.
2144 (Output_data_plt_arm::get_plt_entry_size): Call it.
2145 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
2146 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
2147 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
2148 method.
2149 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
2150 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
2151 method instead of sizeof(plt_entry).
2152 (Output_data_plt_arm::add_entry): Likewise.
2153 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
2154 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
2155 than static method.
2156 (Target_arm::plt_entry_size): Likewise.
2157 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
2158 Move to ...
2159 (Output_data_plt_arm_standard): ... here, new class.
2160 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
2161 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
2162 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
2163
2164 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2165 Take additional argument for the PLT entry size.
2166 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
2167 Use get_plt_entry_size method rather than plt_entry_size variable.
2168 (Output_data_plt_x86_64::reserve_slot): Likewise.
2169 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
2170 (Output_data_plt_x86_64::add_entry): Likewise.
2171 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
2172 (Output_data_plt_x86_64::address_for_global): Likewise.
2173 (Output_data_plt_x86_64::address_for_local): Likewise.
2174 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2175 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
2176 Make method non-static.
2177 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
2178 method.
2179 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
2180 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
2181 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
2182 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
2183 virtual method.
2184 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
2185 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
2186 virtual method.
2187 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
2188 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
2189 virtual method.
2190 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
2191 (Output_data_plt_x86_64::plt_entry_size)
2192 (Output_data_plt_x86_64::first_plt_entry)
2193 (Output_data_plt_x86_64::plt_entry)
2194 (Output_data_plt_x86_64::tlsdesc_plt_entry)
2195 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
2196 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
2197 (Output_data_plt_x86_64_standard): ... here, new class.
2198 (Target_x86_64::Target_x86_64): Take optional argument for the
2199 Target_info pointer to use.
2200 (Target_x86_64::do_make_data_plt): New virtual method.
2201 (Target_x86_64::make_data_plt): New method to call it.
2202 (Target_x86_64::init_got_plt_for_update): Use that.
2203 Call this->plt_->add_eh_frame method here.
2204 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
2205 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
2206 rather than static method.
2207 (Target_x86_64::plt_entry_size): Likewise.
2208 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
2209 rather than plt_entry_size variable. Move guts of PLT filling to...
2210 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
2211 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
2212 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
2213
2214 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
2215 additional argument for the section alignment.
2216 Don't do add_eh_frame_for_plt here.
2217 (Output_data_plt_i386::first_plt_entry_offset): Make the method
2218 non-static. Use get_plt_entry_size method rather than plt_entry_size
2219 variable.
2220 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
2221 method.
2222 (Output_data_plt_i386::get_plt_entry_size): Call it.
2223 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
2224 (Output_data_plt_i386::add_eh_frame): New method to call it.
2225 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
2226 method.
2227 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
2228 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
2229 method.
2230 (Output_data_plt_i386::fill_plt_entry): New method to call it.
2231 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
2232 method instead of plt_entry_size.
2233 (Output_data_plt_i386::plt_entry_size)
2234 (Output_data_plt_i386::plt_eh_frame_fde_size)
2235 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
2236 (Output_data_plt_i386_standard): ... here, new class.
2237 (Output_data_plt_i386_exec): New class.
2238 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
2239 (Output_data_plt_i386_exec::first_plt_entry): ... here.
2240 (Output_data_plt_i386::exec_plt_entry): Move to ...
2241 (Output_data_plt_i386_exec::plt_entry): ... here.
2242 (Output_data_plt_i386_dyn): New class.
2243 (Output_data_plt_i386::first_plt_entry): Move to ...
2244 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
2245 (Output_data_plt_i386::dyn_plt_entry): Move to ...
2246 (Output_data_plt_i386_dyn::plt_entry): ... here.
2247 (Target_i386::Target_i386): Take optional argument for the Target_info
2248 pointer to use.
2249 (Target_i386::do_make_data_plt): New virtual method.
2250 (Target_i386::make_data_plt): New method to call it.
2251 (Target_i386::make_plt_section): Use that.
2252 Call this->plt_->add_eh_frame method here.
2253 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
2254 rather than plt_entry_size variable.
2255 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
2256 (Output_data_plt_i386::address_for_local): Likewise.
2257 (Output_data_plt_i386::do_write): Likewise.
2258 Move guts of PLT filling to...
2259 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
2260 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
2261 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
2262 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
2263
b9b9f2ee
CC
22642012-05-01 Cary Coutant <ccoutant@google.com>
2265
2266 * dwarf_reader.cc (Dwarf_die::read_attributes)
2267 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
2268 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
2269 * reduced_debug_output.cc
2270 (Output_reduced_debug_info_section::get_die_end): Remove
2271 DW_FORM_GNU_ref_index. Add default case.
2272
57923f48
MW
22732012-04-26 Mark Wielaard <mjw@redhat.com>
2274
2275 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
2276 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
2277 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
2278 DW_AT_high_pc as offset from DW_AT_low_pc.
2279
2280 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
2281 * testsuite/Makefile.in: Regenerate.
2282 * testsuite/gdb_index_test_3.c: New test source file.
2283 * testsuite/gdb_index_test_3.sh: New test source file.
2284
2c54b4f4
ILT
22852012-04-25 Ian Lance Taylor <iant@google.com>
2286
2287 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
2288 pointer.
2289 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
2290 as a class, not a struct.
2291 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
2292 (Target_arm::apply_cortex_a8_workaround): Likewise.
2293 * gc.h: Declare Reloc_types as a struct, not a class.
2294 * object.h: Declare Symbols_data as a struct.
2295 * reloc.h: Declare Read_relocs_data as a struct.
2296 * target.h: Declare Relocate_info as a struct.
2297
a5a5f7a3
DM
22982012-04-24 David S. Miller <davem@davemloft.net>
2299
2300 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
2301 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
2302 and R_SPARC_WPLT30.
2303
f038d496
CC
23042012-04-24 Cary Coutant <ccoutant@google.com>
2305
2306 * incremental-dump.cc (find_input_containing_global): Replace
2307 magic number with symbolic constant.
2308 (dump_incremental_inputs): Update version number.
2309 * incremental.cc (Output_section_incremental_inputs): Update version
2310 number; import symbolic constants from Incremental_inputs_reader.
2311 (Incremental_inputs::create_data_sections): Align relocations
2312 section correctly for 64-bit targets.
2313 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
2314 constants; add padding.
2315 (Output_section_incremental_inputs::write_header): Add assert for
2316 header_size.
2317 (Output_section_incremental_inputs::write_input_files): Add assert
2318 for input_entry_size.
2319 (Output_section_incremental_inputs::write_info_blocks): Add padding;
2320 add assert for object_info_size, input_section_entry_size,
2321 global_sym_entry_size.
2322 * incremental.h (Incremental_inputs_reader): Add symbolic constants
2323 for data structure sizes; use them.
2324 (Incremental_input_entry_reader): Import symbolic constants from
2325 Incremental_inputs_reader; use them.
2326
a4d85145
DM
23272012-04-23 David S. Miller <davem@davemloft.net>
2328
2329 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
2330 and elf_flags_set_.
2331 (Target_sparc::Target_sparc): Initialize new fields.
2332 (Target_sparc::do_make_elf_object): New function.
2333 (Target_sparc::do_adjust_elf_header): New function.
2334
1d509098
CC
23352012-04-23 Cary Coutant <ccoutant@google.com>
2336
2337 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
2338 CU range table of gdb index.
2339
7ebeff7f
DM
23402012-04-20 David S. Miller <davem@davemloft.net>
2341
2342 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
2343 instead of false.
2344
13cf9988
DM
23452012-04-16 David S. Miller <davem@davemloft.net>
2346
2a1079e8
DM
2347 * sparc.cc (Target_sparc::got_address): New function.
2348 (Sparc_relocate_functions::gdop_hix22): New function.
2349 (Sparc_relocate_functions::gdop_lox10): New function.
2350 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
2351 relocs.
2352 (Target_sparc::Scan::local): Likewise if the global symbol is not
2353 preemptible and is not IFUNC.
2354 (Target_sparc::Relocate::relocate): Perform GOTDATA code
2355 transformations for local and non-preemptible non-IFUNC global
2356 symbols.
2357
0bc964fc
DM
2358 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
2359 writing out 64-bit part of ranges.
2360
661d7a80
DM
2361 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
2362 -fpic and -fpie respectively.
2363 * Makefile.in: Regenerate.
2364
8c2bf391
DM
2365 * sparc.cc (class Target_sparc): Add rela_ifunc_.
2366 (Target_sparc::Target_sparc): Initialize new field.
2367 (Target_sparc::do_plt_section_for_global): New function.
2368 (Target_sparc::do_plt_section_for_local): New function.
2369 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
2370 (Target_sparc::make_plt_section): New function, broken out of
2371 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
2372 (Target_sparc::make_plt_entry): Call make_plt_section.
2373 (Target_sparc::make_local_ifunc_plt_entry): New function.
2374 (Target_sparc::rela_ifunc_section): New function.
2375 (Target_sparc::plt_section): Remove const.
2376 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
2377 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
2378 and ifunc_count_ fields.
2379 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
2380 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
2381 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
2382 (Output_data_plt_sparc::rela_ifunc): New function.
2383 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
2384 (Output_data_plt_sparc::has_ifunc_section): New function.
2385 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
2386 (Output_data_plt_sparc::address_for_global): New function.
2387 (Output_data_plt_sparc::address_for_local): New function.
2388 (Output_data_plt_sparc::plt_index_to_offset): New function.
2389 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
2390 and entry_count.
2391 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
2392 entry_count.
2393 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
2394 R_SPARC_JMP_IREL to switch.
2395 (Target_sparc::Scan::check_non_pic): Likewise.
2396 (Target_sparc::Scan::local): Handle IFUNC symbols.
2397 (Target_sparc::Scan::local): Likewise.
2398 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
2399 and plt_address_for_local.
2400 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
2401 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
2402
13cf9988
DM
2403 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
2404 (class Output_data_reloc): Adjust calls to Output_reloc_type.
2405 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
2406 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
2407 global relocs too.
2408 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
2409 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
2410 calls.
2411 * sparc.cc (Target_sparc::Scan::global): Likewise.
2412 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
2413
31821be0
CC
24142012-04-16 Cary Coutant <ccoutant@google.com>
2415
2416 * archive.cc (Library_base::should_include_member): Check for
2417 --export-dynamic-symbol.
2418 * options.h (class General_options): Add --export-dynamic-symbol.
2419 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
2420 --export-dynamic-symbol.
2421 (Symbol_table::gc_mark_undef_symbols): Likewise.
2422 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
2423
2615994e
DM
24242012-04-12 David S. Miller <davem@davemloft.net>
2425
2426 * sparc.cc (Reloc::wdisp10): New relocation method.
2427 (Reloc::h34): Likewise.
2428 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
2429 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
2430 R_SPARC_WDISP10.
2431 (Target_sparc::Scan::local): Likewise.
2432 (Target_sparc::Scan::global): Likewise.
2433 (Target_sparc::Relocate::relocate): Likewise.
2434
6782735d
CC
24352012-04-09 Cary Coutant <ccoutant@google.com>
2436
2437 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
2438 low_pc == 0.
2439
8c7a0b00
ILT
24402012-04-06 Ian Lance Taylor <iant@google.com>
2441
2442 * timer.cc: #include <unistd.h>.
2443
58797674
RM
24442012-04-06 Roland McGrath <mcgrathr@google.com>
2445
2446 * configure.in (AC_CHECK_HEADERS): Add locale.h.
2447 * config.in: Regenerate.
2448 * configure: Regenerate.
2449
44350750
NC
24502012-04-05 Nick Clifton <nickc@redhat.com>
2451
2452 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
2453 (AM_LC_MESSAGES): Add.
2454 * aclocal.m4: Regenerate.
2455 * config.in: Regenerate.
2456 * configure: Regenerate.
2457
c1027032
CC
24582012-03-21 Cary Coutant <ccoutant@google.com>
2459
2460 * Makefile.am: Add gdb-index.cc, gdb-index.h.
2461 * Makefile.in: Regenerate.
2462 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
2463 (Sized_elf_reloc_mapper::symbol_section): New function.
2464 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
2465 (make_elf_reloc_mapper): New function.
2466 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
2467 (Dwarf_abbrev_table::do_read_abbrevs): New function.
2468 (Dwarf_abbrev_table::do_get_abbrev): New function.
2469 (Dwarf_ranges_table::read_ranges_table): New function.
2470 (Dwarf_ranges_table::read_range_list): New function.
2471 (Dwarf_pubnames_table::read_section): New function.
2472 (Dwarf_pubnames_table::read_header): New function.
2473 (Dwarf_pubnames_table::next_name): New function.
2474 (Dwarf_die::Dwarf_die): New function.
2475 (Dwarf_die::read_attributes): New function.
2476 (Dwarf_die::skip_attributes): New function.
2477 (Dwarf_die::set_name): New function.
2478 (Dwarf_die::set_linkage_name): New function.
2479 (Dwarf_die::attribute): New function.
2480 (Dwarf_die::string_attribute): New function.
2481 (Dwarf_die::int_attribute): New function.
2482 (Dwarf_die::uint_attribute): New function.
2483 (Dwarf_die::ref_attribute): New function.
2484 (Dwarf_die::child_offset): New function.
2485 (Dwarf_die::sibling_offset): New function.
2486 (Dwarf_info_reader::check_buffer): New function.
2487 (Dwarf_info_reader::parse): New function.
2488 (Dwarf_info_reader::do_parse): New function.
2489 (Dwarf_info_reader::do_read_string_table): New function.
2490 (Dwarf_info_reader::lookup_reloc): New function.
2491 (Dwarf_info_reader::get_string): New function.
2492 (Dwarf_info_reader::visit_compilation_unit): New function.
2493 (Dwarf_info_reader::visit_type_unit): New function.
2494 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
2495 Sized_elf_reloc_mapper.
2496 (Sized_dwarf_line_info::symbol_section): Remove function.
2497 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
2498 (Sized_dwarf_line_info::read_line_mappings): Remove object
2499 parameter, adjust callers.
2500 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
2501 * dwarf_reader.h: Include <sys/types.h>.
2502 (class Track_relocs): Remove forward declaration.
2503 (class Elf_reloc_mapper): New class.
2504 (class Sized_elf_reloc_mapper): New class.
2505 (class Dwarf_abbrev_table): New class.
2506 (class Dwarf_range_list): New class.
2507 (class Dwarf_ranges_table): New class.
2508 (class Dwarf_pubnames_table): New class.
2509 (class Dwarf_die): New class.
2510 (class Dwarf_info_reader): New class.
2511 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
2512 (Sized_dwarf_line_info::symbol_section): Remove member function.
2513 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
2514 base class.
2515 * gdb-index.cc: New source file.
2516 * gdb-index.h: New source file.
2517 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
2518 and .debug_types sections, call Layout::add_to_gdb_index.
2519 (Sized_relobj_incr::do_section_name): Implement.
2520 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
2521 return type; Implement.
2522 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
2523 return type.
2524 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
2525 parameter list and return type.
2526 (Sized_incr_dynobj::do_section_contents): Likewise.
2527 * layout.cc: Include gdb-index.h.
2528 (Layout::Layout): Initialize gdb_index_data_.
2529 (Layout::init_fixed_output_section): Check for .gdb_index section.
2530 (Layout::add_to_gdb_index): New function. Instantiate.
2531 * layout.h: Add forward declaration for class Gdb_index.
2532 (Layout::add_to_gdb_index): New member function.
2533 (Layout::gdb_index_data_): New data member.
2534 * main.cc: Include gdb-index.h.
2535 (main): Print statistics for gdb index.
2536 * object.cc (Object::section_contents): Move code into
2537 do_section_contents.
2538 (need_decompressed_section): Check for sections needed when building
2539 gdb index.
2540 (build_compressed_section_map): Likewise.
2541 (Sized_relobj_file::do_read_symbols): Need local symbols when building
2542 gdb index.
2543 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
2544 sections; call Layout::add_to_gdb_index.
2545 (Sized_relobj_file::do_decompressed_section_contents): Call
2546 do_section_contents directly.
2547 * object.h (Object::do_section_contents): Adjust parameter list and
2548 return type.
2549 (Object::do_decompressed_section_contents): Call do_section_contents
2550 directly.
2551 (Sized_relobj_file::do_section_contents): Adjust parameter list and
2552 return type.
2553 * options.h (class General_options): Add --gdb-index option.
2554 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
2555 list and return type.
2556 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
2557 * reloc.h (Track_relocs::checkpoint): New function.
2558 (Track_relocs::reset): New function.
2559
2560 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
2561 New test cases.
2562 * testsuite/Makefile.in: Regenerate.
2563 * testsuite/gdb_index_test.cc: New test source file.
2564 * testsuite/gdb_index_test_1.sh: New test source file.
2565 * testsuite/gdb_index_test_2.sh: New test source file.
2566
647f1574
DK
25672012-03-19 Doug Kwan <dougkwan@google.com>
2568
2569 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 2570 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
2571 __exidx_start and __exidx_end. Make symbol table parameter
2572 anonymous as it is not used.
2573 * gold.cc (queue_middle_tasks): Call target hook to define any
2574 target-specific symbols.
2575 * target.h (Target::define_standard_symbols): New method.
2576 (Target::do_define_standard_symbols): Same.
2577 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
2578 * testsuite/Makefile.in: Regenerate.
2579 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
2580 and __exidx_end.
2581 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
2582 relocations are generated for __exidx_start and __exidx_end.
2583
7c6109da
DK
25842012-03-16 Doug Kwan <dougkwan@google.com>
2585
2586 * testsuite/Makefile.am: Disable test initpri3b.
2587 * testsuite/Makefile.in: Regenerate.
2588
7b8957f8
DK
25892012-03-15 Doug Kwan <dougkwan@google.com>
2590
2591 * arm.cc (Target_arm::got_section): Make .got section read-only
2592 if -z now is given.
2593
14dc9ef7
ILT
25942012-03-15 Ian Lance Taylor <iant@google.com>
2595
2596 PR gold/13850
2597 * layout.cc (Layout::make_output_section): Correctly mark
2598 SHT_INIT_ARRAY, et. al., as relro.
2599
fa40b62a
DK
26002012-03-14 Doug Kwan <dougkwan@google.com>
2601
2602 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
2603 dynamic relocations for protected symbols in shared objects.
2604
fd325007
ILT
26052012-03-13 Ian Lance Taylor <iant@google.com>
2606
2607 * resolve.cc (Symbol_table::resolve): When merging common symbols,
2608 keep the larger alignment.
2609
e8dd54e1
CC
26102012-03-12 Cary Coutant <ccoutant@google.com>
2611
2612 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
2613 handling of DW_LNE_define_file.
2614
feb5f3b0
CC
26152012-03-12 Cary Coutant <ccoutant@google.com>
2616
2617 * reduced_debug_output.cc
2618 (Output_reduced_debug_info_section::get_die_end): Add new FORM
2619 codes to switch.
2620
a1fb4256
CC
26212012-02-29 Cary Coutant <ccoutant@google.com>
2622
2623 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
2624
5dd8762a
CC
26252012-02-29 Cary Coutant <ccoutant@google.com>
2626
2627 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
2628 Call Object::decompressed_section_contents.
2629 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
2630 New dtor.
2631 (Sized_dwarf_line_info::buffer_start_): New data member.
2632 * merge.cc (Output_merge_data::do_add_input_section): Call
2633 Object::decompressed_section_contents.
2634 (Output_merge_string::do_add_input_section): Likewise.
2635 * object.cc (need_decompressed_section): New function.
2636 (build_compressed_section_map): Decompress sections needed later.
2637 (Sized_relobj_file::do_decompressed_section_contents): New function.
2638 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2639 * object.h (Object::decompressed_section_contents): New function.
2640 (Object::discard_decompressed_sections): New function.
2641 (Object::do_decompressed_section_contents): New function.
2642 (Object::do_discard_decompressed_sections): New function.
2643 (Compressed_section_info): New type.
2644 (Compressed_section_map): Include decompressed section contents.
2645 (Sized_relobj_file::do_decompressed_section_contents): New function.
2646 (Sized_relobj_file::do_discard_decompressed_sections): New function.
2647
7b5de7ee
CC
26482012-02-16 Cary Coutant <ccoutant@google.com>
2649
2650 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
2651 * testsuite/Makefile.in: Regenerate.
2652
f9fa4a63
CC
26532012-02-14 Cary Coutant <ccoutant@google.com>
2654
2655 * options.cc (General_options::finalize): Disallow -pie and -static.
2656
2c175ebc
DK
26572012-02-03 Doug Kwan <dougkwan@google.com>
2658
2659 * arm.cc (Arm_relocate_functions::abs8,
2660 Arm_relocate_functions::abs16): Use
2661 Bits::has_signed_unsigned_overflow32.
2662 (Arm_relocate_functions::thm_abs8): Correct range of
2663 overflow check.
2664 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
2665 in assertions.
2666
90cff06f
DK
26672012-02-02 Doug Kwan <dougkwan@google.com>
2668
2669 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
2670 position independent outputs, not just shared objects.
2671
63887f3d
L
26722012-01-30 H.J. Lu <hongjiu.lu@intel.com>
2673
2674 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
2675 * configure: Regenerated.
2676
bef2b434
ILT
26772012-01-27 Ian Lance Taylor <iant@google.com>
2678
2679 * reloc.h (Bits): New class with static functions, copied from
2680 namespace utils in arm.cc.
2681 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
2682 instead.
2683
c335b55d
L
26842012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2685
2686 * incremental.cc (write_info_blocks): Correct relocation offset.
2687
41194d9f
L
26882012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2689
2690 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
2691 (Relocate::tls_gd_to_le): Likewise.
2692
1bae613c
L
26932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2694
2695 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
2696
24482ca0
L
26972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
2698
2699 * configure.ac: Check if -mcmodel=medium works.
2700 * configure: Regenerated.
2701
c2c7840a
CC
27022012-01-24 Cary Coutant <ccoutant@google.com>
2703
2704 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
2705 definition and ...
2706 (read_unsigned_LEB_128_x): ... this new function.
2707 (read_signed_LEB_128): Replaced with inline definition and ...
2708 (read_signed_LEB_128_x): ... this new function.
2709 * int_encoding.h (read_unsigned_LEB_128_x): New function.
2710 (read_unsigned_LEB_128): Add inline definition.
2711 (read_signed_LEB_128_x): New function.
2712 (read_signed_LEB_128): Add inline definition.
2713 * testsuite/Makefile.am (leb128_unittest): New unit test.
2714 * testsuite/Makefile.in: Regenerate.
2715 * testsuite/leb128_unittest.cc: New unit test.
2716
833de760 27172012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
2718
2719 PR gold/13617
2720 * i386.cc (Target_i386::do_code_fill): When using a jmp
2721 instruction, pad with nop instructions.
2722 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2723
618d6666
L
27242012-01-22 H.J. Lu <hongjiu.lu@intel.com>
2725
2726 * x86_64.cc (gc_process_relocs): Add typename on types used in
2727 template.
2728 (scan_relocs): Likewise.
2729 (relocate_section): Likewise.
2730 (apply_relocation): Likewise.
2731
3660ff06
L
27322012-01-10 H.J. Lu <hongjiu.lu@intel.com>
2733
2734 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
2735 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
2736 under x32.
2737
fc51264f
L
27382012-01-09 H.J. Lu <hongjiu.lu@intel.com>
2739
2740 * x86_64.cc: Initial support for x32.
2741
dd74ae06
CC
27422012-01-03 Cary Coutant <ccoutant@google.com>
2743
2744 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
2745 Use abstract base class for GOT.
2746 * gold/output.h (class Output_data_got_base): New abstract base class.
2747 (class Output_data_got): Derive from new base class, adjust ctors.
2748 (Output_data_got::reserve_slot): Make virtual; rename to
2749 do_reserve_slot; Adjust callers.
2750 * gold/target.h (Sized_target::init_got_plt_for_update): Return
2751 pointer to abstract base class.
2752 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
2753
83896202
ILT
27542011-12-18 Ian Lance Taylor <iant@google.com>
2755
2756 * object.h (Relobj::local_symbol_value): New function.
2757 (Relobj::local_plt_offset): New function.
2758 (Relobj::local_has_got_offset): New function.
2759 (Relobj::local_got_offset): New function.
2760 (Relobj::set_local_got_offset): New function.
2761 (Relobj::do_local_symbol_value): New pure virtual function.
2762 (Relobj::do_local_plt_offset): Likewise.
2763 (Relobj::do_local_has_got_offset): Likewise.
2764 (Relobj::do_local_got_offset): Likewise.
2765 (Relobj::do_set_local_got_offset): Likewise.
2766 (Sized_relobj::do_local_has_got_offset): Rename from
2767 local_has_got_offset.
2768 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
2769 (Sized_relobj::do_set_local_got_offset): Rename from
2770 set_local_got_offset.
2771 (Sized_relobj_file::do_local_plt_offset): Rename from
2772 local_plt_offset.
2773 (Sized_relobj_file::do_local_symbol_value): New function.
2774 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
2775 local_plt_offset.
2776 * output.cc (Output_data_got::Got_entry::write): Change object to
2777 Relobj. Use local_symbol_value.
2778 (Output_data_got::add_global_with_rel): Change rel_dyn to
2779 Output_data_reloc_generic*. Use add_global_generic.
2780 (Output_data_got::add_global_with_rela): Remove. Change all
2781 callers to use add_global_with_rel.
2782 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
2783 Output_data_reloc_generic*. Use add_global_generic.
2784 (Output_data_got::add_global_pair_with_rela): Remove. Change all
2785 callers to use add_global_pair_with_rel.
2786 (Output_data_got::add_local): Change object to Relobj*.
2787 (Output_data_got::add_local_plt): Likewise.
2788 (Output_data_got::add_local_with_rel): Change object to Relobj*,
2789 change rel_dyn to Output_data_reloc_generic*. Use
2790 add_local_generic.
2791 (Output_data_got::add_local_with_rela): Remove. Change all
2792 callers to use all_local_with_rel.
2793 (Output_data_got::add_local_pair_with_rel): Change object to
2794 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
2795 add_output_section_generic.
2796 (Output_data_got::add_local_pair_with_rela): Remove. Change all
2797 callers to use add_local_pair_with_rel.
2798 (Output_data_got::reserve_local): Change object to Relobj*.
2799 * output.h: (class Output_data_reloc_generic): Add pure virtual
2800 declarations for add_global_generic, add_local_generic,
2801 add_output_section_generic.
2802 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
2803 functions for Output_data_reloc_generic. Update declarations for
2804 changes listed in output.cc.
2805 (class Output_data_got): Change template parameter to got_size.
2806 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
2807 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
2808 function.
2809 (Sized_relobj_incr::do_local_plt_offset): New function.
2810 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
2811 add_global_generic.
2812
76677ad0
CC
28132011-12-17 Cary Coutant <ccoutant@google.com>
2814
2815 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
2816 * resolve.cc (Symbol_table::resolve): Likewise.
2817 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
2818 arrays.
2819 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
2820
8b8dd8d5
ILT
28212011-12-16 Ian Lance Taylor <iant@google.com>
2822
2823 * output.h (Output_data_reloc_generic::add): Only call
2824 add_dynamic_reloc if this is a dynamic reloc section.
2825
d55525b9
L
28262011-12-15 H.J. Lu <hongjiu.lu@intel.com>
2827
2828 PR gold/13505
2829 * target-reloc.h (apply_relocation): Replace <64, false> with
2830 <size, big_endian>.
2831
ff81c7c1
NC
28322011-11-25 Nick Clifton <nickc@redhat.com>
2833
2834 * po/it.po: New Italian translation.
2835
628f39be
SA
28362011-11-17 Sterling Augustine <saugustine@google.com>
2837
2838 * script.cc (script_include_directive): Implement.
2839 (read_script_file): New local variables name and search_path. Update
2840 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
2841 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
2842 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
2843
98ef3ea4
SA
28442011-11-11 Sterling Augustine <saugustine@google.com>
2845
2846 * yyscript.y (section_cmd): Add support for INCLUDE directive.
2847 (file_or_sections_cmd): Likewise.
2848
f4a8b6d7
DK
28492011-11-11 Doug Kwan <dougkwan@google.com>
2850
2851 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
2852 if --just-symbols is given.
2853
29ab395d
DK
28542011-11-10 Doug Kwan <dougkwan@google.com>
2855
2856 PR gold/13362
2857 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
2858 when processing data relocs.
2859 * reloc.h (Relocate_functions::rel_unaligned): New method.
2860 (Relocate_functions::pcrel_unaligned): Ditto.
2861 (Relocate_functions::rel32_unaligned): Ditto.
2862 (Relocate_functions::pcrel32_unaligned): Ditto.
2863
2c339f71
DK
28642011-11-09 Doug Kwan <dougkwan@google.com>
2865
2866 PR gold/13362
2867 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
2868 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
2869 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
2870 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2871 (Relocate_functions::rel_unaligned): New.
2872 (Relocate_functions::rel32_unaligned): New.
2873 * target-reloc.h (relocate_for_relocatable): Add code to handle
2874 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
2875 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
2876 arm_unaligned_reloc_r): New targets.
2877 * testsuite/Makefile.in: Regenerate.
2878 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
2879 linking.
2880
3f3cddf1
ILT
28812011-11-02 Ian Lance Taylor <iant@google.com>
2882
2883 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
2884 NATIVE_LINKER.
2885 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
2886 * options.cc (General_options::finalize): Use library search path
2887 from configure script if specified. If not native and no sysroot,
2888 only search TOOLLIBDIR.
2889 * options.h (Search_directory::Search_directory): Change name to
2890 const std::string&.
2891 (General_options::add_to_library_path_with_sysroot): Change arg to
2892 const std::string&.
2893 * configure, Makefile.in, config.in: Rebuild.
2894
a8e2273b
ILT
28952011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2896
2897 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
2898 we are working around the ARM1176 Erratum.
2899 * options.h (General_options::fix_arm1176): Add option.
2900 * testsuite/Makefile.am: Add testcases, and keep current ones
2901 working.
2902 * testsuite/Makefile.in: Regenerate.
2903 * testsuite/arm_fix_1176.s: New file.
2904 * testsuite/arm_fix_1176.sh: Likewise.
2905
cd6eab1c
ILT
29062011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
2907
2908 * arm.cc (Target_arm::Target_arm): Remove initialisation of
2909 may_use_blx_.
2910 (Target_arm::may_use_blx): Remove method.
2911 (Target_arm::set_may_use_blx): Likewise.
2912 (Target_arm::may_use_v4t_interworking): New method.
2913 (Target_arm::may_use_v5t_interworking): Likewise.
2914 (Target_arm::may_use_blx_): Remove member variable.
2915 (Arm_relocate_functions::arm_branch_common): Check for v5T
2916 interworking.
2917 (Arm_relocate_functions::thumb_branch_common): Likewise.
2918 (Reloc_stub::stub_type_for_reloc): Likewise.
2919 (Target_arm::do_finalize_sections): Correct interworking checks.
2920 * testsuite/Makefile.am: Add new tests.
2921 * testsuite/Makefile.in: Regenerate.
2922 * testsuite/arm_farcall_arm_arm.s: New test.
2923 * testsuite/arm_farcall_arm_arm.sh: Likewise.
2924 * testsuite/arm_farcall_arm_thumb.s: Likewise.
2925 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
2926 * testsuite/arm_farcall_thumb_arm.s: Likewise.
2927 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
2928 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
2929 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
2930
286adcf4
CC
29312011-10-31 Cary Coutant <ccoutant@google.com>
2932
2933 PR gold/13023
2934 * expression.cc (Expression::eval_with_dot): Add
2935 is_section_dot_assignment parameter.
2936 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
2937 absolute and assigning to dot within a section.
2938 * script-sections.cc
2939 (Output_section_element_assignment::set_section_addresses): Pass
2940 dot_section to set_if_absolute.
2941 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
2942 as is_section_dot_assignment flag to eval_with_dot.
2943 (Output_section_element_dot_assignment::set_section_addresses):
2944 Likewise.
2945 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
2946 parameter. Also set value if relative to dot_section; set the
2947 symbol's output_section.
2948 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
2949 parameter. Adjust all callers.
2950 (Expression::eval_maybe_dot): Likewise.
2951 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
2952 Adjust all callers.
2953 * testsuite/script_test_2.t: Test assignment of an absolute value
2954 to dot within an output section element.
2955
9634ed06
CC
29562011-10-31 Cary Coutant <ccoutant@google.com>
2957
2958 * options.h (class General_options): Add --[no-]gnu-unique options.
2959 * symtab.cc (Symbol_table::sized_write_globals): Convert
2960 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
2961
de4101c7
CC
29622011-10-31 Cary Coutant <ccoutant@google.com>
2963
2964 PR gold/13359
2965 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
2966 unnecessary assertion.
2967 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
2968
7257cc92
ST
29692011-10-31 Sriraman Tallam <tmsriram@google.com>
2970
2971 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2972 gc_mark_symbol.
2973 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
2974 gc_mark_symbol.
2975 Change to just keep the section associated with symbol.
2976 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
2977 they are externally visible and --export-dynamic is turned on.
2978 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
2979
bfc34b3f
ILT
29802011-10-19 Ian Lance Taylor <iant@google.com>
2981
2982 PR gold/13163
2983 * script-sections.cc
2984 (Output_section_element_dot_assignment::needs_output_section): New
2985 function.
2986
ea0d8c47
ILT
29872011-10-19 Ian Lance Taylor <iant@google.com>
2988
2989 PR gold/13204
2990 * layout.cc (Layout::segment_precedes): Don't assert failure if a
2991 --section-start option was seen.
2992 * options.h (General_options::any_section_start): New function.
2993
abd242a9
DM
29942011-10-18 David S. Miller <davem@davemloft.net>
2995
2996 PR binutils/13301
2997 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
2998 member to track relocation locations that have moved during TLS
2999 reloc optimizations.
3000 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3001 (Target_sparc::Relocate::relocate): Adjust view down by 4
3002 bytes if it matches reloc_adjust_addr_.
3003 (Target_sparc::Relocate::relocate_tls): Always move the
3004 __tls_get_addr call delay slot instruction forward 4 bytes when
3005 performing relaxation.
3006
bab9090f
CC
30072011-10-18 Cary Coutant <ccoutant@google.com>
3008
3009 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3010 (Output_file::map_no_anonymous): Check for non-zero
3011 return code from posix_fallocate.
3012
f7c5b166
CC
30132011-10-17 Cary Coutant <ccoutant@google.com>
3014
3015 PR gold/13245
3016 * plugin.cc (is_visible_from_outside): Check for symbols
3017 referenced from dynamic objects.
3018 * resolve.cc (Symbol_table::resolve): Don't count references
3019 from dynamic objects as references from real ELF files.
3020 * testsuite/plugin_test_2.sh: Adjust expected result.
3021
b490c0bb
CC
30222011-10-17 Cary Coutant <ccoutant@google.com>
3023
3024 * gold.cc: Include timer.h.
3025 (queue_middle_tasks): Stamp time.
3026 (queue_final_tasks): Likewise.
3027 * main.cc (main): Store timer in parameters. Print timers
3028 for each pass.
3029 * parameters.cc (Parameters::Parameters): Initialize timer_.
3030 (Parameters::set_timer): New function.
3031 (set_parameters_timer): New function.
3032 * parameters.h (Parameters::set_timer): New function.
3033 (Parameters::timer): New function.
3034 (Parameters::timer_): New data member.
3035 (set_parameters_timer): New function.
3036 * timer.cc (Timer::stamp): New function.
3037 (Timer::get_pass_time): New function.
3038 * timer.h (Timer::stamp): New function.
3039 (Timer::get_pass_time): New function.
3040 (Timer::pass_times_): New data member.
3041
f475cf7b
CC
30422011-10-17 Cary Coutant <ccoutant@google.com>
3043
3044 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3045 task for members of lib groups.
3046
cdd7e244
CC
30472011-10-17 Cary Coutant <ccoutant@google.com>
3048
3049 PR gold/13288
4f95c8b4 3050 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3051 (File_read::make_view): Move bounds check (replace with assert)...
3052 (File_read::find_or_make_view): ... to here.
3053
dfb45471
CC
30542011-10-12 Cary Coutant <ccoutant@google.com>
3055
4f95c8b4 3056 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3057 ::read returns less than requested size.
3058
53bbcc1b
CC
30592011-10-10 Cary Coutant <ccoutant@google.com>
3060
4f95c8b4 3061 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3062 Initialize defined_count_.
3063 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3064 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3065 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3066 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3067 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3068 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3069 member.
3070 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3071 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3072 Return zeroes instead of internal error.
3073
397b129b
CC
30742011-10-10 Cary Coutant <ccoutant@google.com>
3075
3076 PR gold/13249
4f95c8b4 3077 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3078 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3079 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3080 (Output_reloc::type_): Adjust size of bit field.
3081 (Output_reloc::use_plt_offset_): New bit field.
3082 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3083 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3084 flag. Adjust all callers.
4f95c8b4 3085 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
3086 creating RELATIVE relocations.
3087
d5698657
NC
30882011-10-10 Nick Clifton <nickc@redhat.com>
3089
3090 * po/es.po: Updated Spanish translation.
3091 * po/fi.po: Updated Finnish translation.
3092
6a59a5c2
DN
30932011-10-03 Diego Novillo <dnovillo@google.com>
3094
3095 * options.cc (parse_uint): Fix dereference of RETVAL.
3096
f0558624
ST
30972011-09-29 Sriraman Tallam <tmsriram@google.com>
3098
3099 * layout.h (section_order_map_): New member.
3100 (get_section_order_map): New member function.
3101 * output.cc (Output_section::add_input_section): Check for patterns
3102 only when --section-ordering-file is specified.
3103 * gold.cc (queue_middle_tasks): Delay updating order of sections till
3104 output_sections have been formed.
3105 * layout.cc (Layout_Layout): Initialize section_order_map_.
3106 * plugin.cc (update_section_order): Store order in order_map. Do not
3107 update the order.
3108 * testsuite/Makefile.am: Add test case for plugin_final_layout.
3109 * testsuite/Makefile.in: Regenerate.
3110 * testsuite/plugin_section_order.c: New file.
3111 * testsuite/plugin_final_layout.cc: New file.
3112 * testsuite/plugin_final_layout.sh: New file.
3113
a7dac153
CC
31142011-09-29 Cary Coutant <ccoutant@google.com>
3115
4f95c8b4 3116 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 3117 Check for NULL.
4f95c8b4 3118 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
3119 symbols during incremental update.
3120 (Symbol_table::add_from_dynobj): Likewise.
3121
eebd87a5
ILT
31222011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3123 Ian Lance Taylor <iant@google.com>
3124
3125 * symtab.cc (Symbol_table::define_special_symbol): Always
3126 canonicalize version string.
3127
403a3331
CC
31282011-09-26 Cary Coutant <ccoutant@google.com>
3129
4f95c8b4
CC
3130 * gold.cc (queue_initial_tasks): Move option checks ...
3131 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
3132 some options; make others fatal.
3133
235061c2
CC
31342011-09-26 Cary Coutant <ccoutant@google.com>
3135
3136 gcc PR lto/47247
3137 * plugin.cc (get_symbols_v2): New function.
3138 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
3139 (is_referenced_from_outside): New function.
3140 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
3141 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
3142 (get_symbols): Pass version parameter.
3143 (get_symbols_v2): New function.
3144 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
3145 parameter.
3146 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
3147 (onload): Add LDPT_GET_SYMBOLS_V2.
3148 (all_symbols_read_hook): Use get_symbols_v2; check for
3149 LDPR_PREVAILING_DEF_IRONLY_EXP.
3150 * testsuite/plugin_test_3.sh: Update expected results.
3151
dc87f620
ILT
31522011-09-23 Simon Baldwin <simonb@google.com>
3153
3154 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
3155 configuration options.
3156 * configure: Regenerate.
3157 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
3158 * Makefile.in: Regenerate.
3159 * testsuite/Makefile.in: Regenerate.
3160
a8279f82
ST
31612011-09-19 Sriraman Tallam <tmsriram@google.com>
3162
3163 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
3164
0c9350c8
CC
31652011-09-19 Cary Coutant <ccoutant@google.com>
3166
3167 * incremental.cc (can_incremental_update): Fix typo in comment.
3168 * incremental.h (can_incremental_update): Likewise.
3169
aa06ae28
CC
31702011-09-18 Cary Coutant <ccoutant@google.com>
3171
3172 * incremental.cc (can_incremental_update): New function.
3173 * incremental.h (can_incremental_update): New function.
3174 * layout.cc (Layout::init_fixed_output_section): Call it.
3175 (Layout::make_output_section): Don't allow patch space in .eh_frame.
3176 * object.cc (Sized_relobj_file::do_layout): Call
3177 can_incremental_update.
3178
ebb300b2
CC
31792011-09-13 Cary Coutant <ccoutant@google.com>
3180
3181 * configure.ac: Check for glibc support for gnu_indirect_function
3182 support with static linking, setting automake conditional
3183 IFUNC_STATIC.
3184 * Makefile.in: Regenerate.
3185 * configure: Regenerate.
3186
3187 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
3188 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
3189 for IFUNC_STATIC.
3190 * testsuite/Makefile.in: Regenerate.
3191
1206d0d5
CC
31922011-09-13 Cary Coutant <ccoutant@google.com>
3193
3194 * incremental.cc (Sized_relobj_incr::do_layout): Call
3195 report_comdat_group for kept comdat sections.
3196 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
3197 * testsuite/Makefile.in: Regenerate.
3198 * testsuite/incr_comdat_test_1.cc: New source file.
3199 * testsuite/incr_comdat_test_2_v1.cc: New source file.
3200 * testsuite/incr_comdat_test_2_v2.cc: New source file.
3201 * testsuite/incr_comdat_test_2_v3.cc: New source file.
3202
40b29874
ILT
32032011-09-13 Ian Lance Taylor <iant@google.com>
3204
3205 * object.cc (Sized_relobj_file::do_layout): Remove unused local
3206 variable external_symbols_offset.
3207
1b045aac
ILT
32082011-09-12 Ian Lance Taylor <iant@google.com>
3209
3210 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
3211 triggered if object has no symbols.
3212
24c6c55a
DM
32132011-09-09 David S. Miller <davem@davemloft.net>
3214
3215 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
3216 (Output_fill_debug_line::do_write): Likewise.
3217
66570254
CC
32182011-08-29 Cary Coutant <ccoutant@google.com>
3219
3220 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
3221 casts to match formatting specs.
3222 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
3223
8ea8cd50
CC
32242011-08-26 Cary Coutant <ccoutant@google.com>
3225
3226 * layout.cc (Free_list::allocate): Provide guarantee of minimum
3227 remaining hole size when allocating.
3228 (Layout::make_output_section): Set fill methods for debug sections.
3229 * layout.h (Free_list::Free_list_node): Move from private to
3230 public.
3231 (Free_list::set_min_hole_size): New function.
3232 (Free_list::begin, Free_list::end): New functions.
3233 (Free_list::min_hole_): New data member.
3234 * output.cc: Include dwarf.h.
3235 (Output_fill_debug_info::do_minimum_hole_size): New function.
3236 (Output_fill_debug_info::do_write): New function.
3237 (Output_fill_debug_line::do_minimum_hole_size): New function.
3238 (Output_fill_debug_line::do_write): New function.
3239 (Output_section::Output_section): Initialize new data member.
3240 (Output_section::set_final_data_size): Ensure patch space is larger
3241 than minimum hole size.
3242 (Output_section::do_write): Fill holes in debug sections.
3243 * output.h (Output_fill): New class.
3244 (Output_fill_debug_info): New class.
3245 (Output_fill_debug_line): New class.
3246 (Output_section::set_free_space_fill): New function.
3247 (Output_section::free_space_fill_): New data member.
3248 * testsuite/Makefile.am (incremental_test_3): Add
3249 --incremental-patch option.
3250 (incremental_test_4): Likewise.
3251 (incremental_test_5): Likewise.
3252 (incremental_test_6): Likewise.
3253 (incremental_copy_test): Likewise.
3254 (incremental_common_test_1): Likewise.
3255 * testsuite/Makefile.in: Regenerate.
3256
7cf80422
NC
32572011-08-26 Nick Clifton <nickc@redhat.com>
3258
3259 * po/es.po: Updated Spanish translation.
3260
c3f7b0e5
CC
32612011-08-01 Cary Coutant <ccoutant@google.com>
3262
3263 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
3264 * gold/testsuite/Makefile.in: Regenerate.
3265 * gold/testsuite/justsyms_exec.c: New source file.
3266 * gold/testsuite/justsyms_lib.c: New source file.
3267
9590bf25
CC
32682011-08-01 Cary Coutant <ccoutant@google.com>
3269
3270 * layout.cc (Layout::set_segment_offsets): Don't realign text
3271 segment if -Ttext was specified.
3272 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
3273 file type.
3274 * object.h (Sized_relobj_file::e_type): New function.
3275 (Sized_relobj_file::e_type_): New data member.
3276 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
3277 base address for ET_EXEC files.
3278 * target.cc (Target::do_make_elf_object_implementation): Allow
3279 ET_EXEC files with --just-symbols option.
3280
dcd8d12e
CC
32812011-07-28 Cary Coutant <ccoutant@google.com>
3282
3283 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
3284 Add thread_number parameter.
3285 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
3286 * workqueue-threads.cc
3287 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
3288 current thread if its thread number is greater than desired thread
3289 count.
3290 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
3291 Add thread_number parameter.
3292 (Workqueue::should_cancel_thread): Likewise.
3293 (Workqueue::find_runnable_or_wait): Pass thread_number to
3294 should_cancel_thread.
3295 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
3296 parameter.
3297
804eb480
ST
32982011-07-22 Sriraman Tallam <tmsriram@google.com>
3299
3300 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
3301 only after checking if it cannot be forced local.
3302 * symtab.h (is_externally_visible): Check if the symbol is not forced
3303 local.
3304
f1ddb600
ILT
33052011-07-15 Ian Lance Taylor <iant@google.com>
3306
3307 * options.h (class General_options): Add --print-output-format.
3308 Move -EL next to -EB, for better --help output.
3309 * target-select.cc: Include <cstdio>, "options.h", and
3310 "parameters.h".
3311 (Target_selector::do_target_bfd_name): New function.
3312 (print_output_format): New function.
3313 * target-select.h (class Target_selector): Update declarations.
3314 (Target_selector::target_bfd_name): New function.
3315 (print_output_format): Declare.
3316 * main.cc: Include "target-select.h".
3317 (main): Handle --print-output-format.
3318 * gold.cc: Include "target-select.h".
3319 (queue_initial_tasks): Handle --print-output-format when there are
3320 no input files.
3321 * parameters.cc (parameters_force_valid_target): Give a better
3322 error message if -EB/-EL does not match target.
3323 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
3324 function.
3325
7d172687
ILT
33262011-07-15 Ian Lance Taylor <iant@google.com>
3327
3328 * i386.cc (class Output_data_plt_i386): Add layout_ field.
3329 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
3330 (Output_data_plt_i386::do_write): Write address of .dynamic
3331 section to first entry in .got.plt section.
3332 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
3333 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3334 Initialize layout_.
3335 (Output_data_plt_x86_64::do_write): Write address of .dynamic
3336 section to first entry in .got.plt section.
3337 * layout.h (Layout::dynamic_section): New function.
3338
e9552f7e
ST
33392011-07-13 Sriraman Tallam <tmsriram@google.com>
3340
3341 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
3342 to claim_file call.
3343 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
3344 input_section_position_, and input_section_glob_.
3345 (read_layout_from_file): Call function section_ordering_specified.
3346 * layout.h (is_section_ordering_specified): New function.
3347 (section_ordering_specified): New function.
3348 (section_ordering_specified_): New boolean member.
3349 * main.cc(main): Call load_plugins after layout object is defined.
3350 * output.cc (Output_section::add_input_section): Use
3351 function section_ordering_specified to check if section ordering is
3352 needed.
3353 * output.cc (Output_section::add_relaxed_input_section): Use
3354 function section_ordering_specified to check if section ordering is
3355 needed.
3356 (Output_section::update_section_layout): New function.
3357 (Output_section::sort_attached_input_sections): Check if input section
3358 must be reordered.
3359 * output.h (Output_section::update_section_layout): New function.
3360 * plugin.cc (get_section_count): New function.
3361 (get_section_type): New function.
3362 (get_section_name): New function.
3363 (get_section_contents): New function.
3364 (update_section_order): New function.
58797674 3365 (allow_section_ordering): New function.
e9552f7e
ST
3366 (Plugin::load): Add the new interfaces to the transfer vector.
3367 (Plugin_manager::load_plugins): New parameter.
3368 (Plugin_manager::all_symbols_read): New parameter.
3369 (Plugin_manager::claim_file): New parameter. Save the elf object for
3370 unclaimed objects.
3371 (Plugin_manager::get_elf_object): New function.
3372 (Plugin_manager::get_view): Change to directly use the bool to check
3373 if get_view is called from claim_file_hook.
3374 * plugin.h (input_objects): New function
3375 (Plugin__manager::load_plugins): New parameter.
3376 (Plugin_manager::claim_file): New parameter.
3377 (Plugin_manager::get_elf_object): New function.
3378 (Plugin_manager::in_claim_file_handler): New function.
3379 (Plugin_manager::in_claim_file_handler_): New member.
3380 (layout): New function.
3381 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
3382 handler with an extra parameter. Make the elf object before calling
3383 claim_file handler.
3384 * testsuite/plugin_test.c (get_section_count): New function pointer.
3385 (get_section_type): New function pointer.
3386 (get_section_name): New function pointer.
3387 (get_section_contents): New function pointer.
3388 (update_section_order): New function pointer.
3389 (allow_section_ordering): New function pointer.
3390 (onload): Check if the new interfaces exist.
3391
9446efde
ILT
33922011-07-13 Ian Lance Taylor <iant@google.com>
3393
3394 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
3395 relro section.
3396 * x86_64.cc (Target_x86_64::got_section): Likewise.
3397 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
3398 (relro_now_test_SOURCES): New variable.
3399 (relro_now_test_DEPENDENCIES): New variable.
3400 (relro_now_test_LDFLAGS): New variable.
3401 (relro_now_test_LDADD): New variable.
3402 (relro_now_test.so): New target.
3403 * testsuite/Makefile.in: Rebuild.
3404
07aa62f2
ILT
34052011-07-12 Ian Lance Taylor <iant@google.com>
3406
3407 PR gold/12980
3408 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
3409 GLOB_DAT relocation rather than a RELATIVE relocation for a
3410 protected symbol when creating a shared library.
3411 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3412 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
3413 * testsuite/protected_main_1.cc (main): Test that protected
3414 function has same address.
3415
e2153196
ILT
34162011-07-11 Ian Lance Taylor <iant@google.com>
3417
3418 PR gold/12979
3419 * options.h (class General_options): Add -Bgroup.
3420 * options.cc (General_options::finalize): If -Bgroup is set,
3421 default to --unresolved-symbols=report-all.
3422 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
3423 * target-reloc.h (issue_undefined_symbol_error): Handle
3424 --unresolved-symbols=report-all.
3425
6daf5215
ILT
34262011-07-08 Ian Lance Taylor <iant@google.com>
3427
3428 PR gold/11985
3429 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
3430 if linker script discards key sections.
3431 (Layout::create_dynamic_symtab): Likewise.
3432 (Layout::assign_local_dynsym_offsets): Likewise.
3433 (Layout::sized_create_version_sections): Likewise.
3434 (Layout::create_interp): Likewise.
3435 (Layout::finish_dynamic_section): Likewise.
3436 (Layout::set_dynamic_symbol_size): Likewise.
3437
beabb2c6
ILT
34382011-07-08 Ian Lance Taylor <iant@google.com>
3439
3440 PR gold/12386
3441 * options.h (class General_options): Add --unresolved-symbols.
3442 * target-reloc.h (issue_undefined_symbol_error): Check
3443 --unresolved-symbols. Add comments.
3444
9c16daf1
ILT
34452011-07-08 Ian Lance Taylor <iant@google.com>
3446
3447 * testsuite/odr_violation2.cc (Ordering::operator()): Make
3448 expression more complex.
3449
191f1a2d
ILT
34502011-07-08 Ian Lance Taylor <iant@google.com>
3451
3452 PR gold/11317
3453 * target-reloc.h (issue_undefined_symbol_error): New inline
3454 function, broken out of relocate_section.
3455 (relocate_section): Call issue_undefined_symbol_error.
3456 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3457 there is no TLS segment if we are about to issue an undefined
3458 symbol error.
3459 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3460
62855347
ILT
34612011-07-08 Ian Lance Taylor <iant@google.com>
3462
3463 PR gold/12279
3464 * resolve.cc (Symbol_table::should_override): Add fromtype
3465 parameter. Change all callers. Give error when linking together
3466 TLS and non-TLS symbol.
3467 (Symbol_table::should_override_with_special): Add fromtype
3468 parameter. Change all callers.
3469 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
3470 there is no TLS segment if we have reported some errors.
3471 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
3472
67181c72
ILT
34732011-07-08 Ian Lance Taylor <iant@google.com>
3474
3475 PR gold/12372
3476 * target.h (Target::plt_address_for_global): New function.
3477 (Target::plt_address_for_local): New function.
3478 (Target::plt_section_for_global): Remove.
3479 (Target::plt_section_for_local): Remove.
3480 (Target::do_plt_address_for_global): New virtual function.
3481 (Target::do_plt_address_for_local): New virtual function.
3482 (Target::do_plt_section_for_global): Remove.
3483 (Target::do_plt_section_for_local): Remove.
3484 (Target::register_global_plt_entry): Add Symbol_table and Layout
3485 parameters.
3486 * output.cc (Output_data_got::Got_entry::write): Use
3487 plt_address_for_global and plt_address_for_local.
3488 * layout.cc (Layout::add_target_dynamic_tags): Use size and
3489 address of output section.
3490 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
3491 got_irelative_, and irelative_count_ fields. Update
3492 declarations.
3493 (Output_data_plt_i386::has_irelative_section): New function.
3494 (Output_data_plt_i386::entry_count): Add irelative_count_.
3495 (Output_data_plt_i386::set_final_data_size): Likewise.
3496 (class Target_i386): Add got_irelative_ and rel_irelative_
3497 fields. Update declarations.
3498 (Target_i386::Target_i386): Initialize new fields.
3499 (Target_i386::do_plt_address_for_global): New function replacing
3500 do_plt_section_for_global.
3501 (Target_i386::do_plt_address_for_local): New function replacing
3502 do_plt_section_for_local.
3503 (Target_i386::got_section): Create got_irelative_.
3504 (Target_i386::rel_irelative_section): New function.
3505 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
3506 fields. Don't define __rel_iplt_{start,end}.
3507 (Output_data_plt_i386::add_entry): Add symtab and layout
3508 parameters. Change all callers. Use different PLT and GOT for
3509 IFUNC symbols.
3510 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
3511 layout parameters. Change all callers. Use different PLT and
3512 GOT.
3513 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
3514 (Output_data_plt_i386::rel_irelative): New function.
3515 (Output_data_plt_i386::address_for_global): New function.
3516 (Output_data_plt_i386::address_for_local): New function.
3517 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
3518 IRELATIVE GOT when changing IFUNC GOT entries.
3519 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
3520 reloc.
3521 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
3522 if we didn't create an IRELATIVE GOT.
3523 (Target_i386::Relocate::relocate): Use plt_address_for_global and
3524 plt_address_for_local.
3525 (Target_i386::do_dynsym_value): Use plt_address_for_global.
3526 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
3527 got_irelative_, and irelative_count_ fields. Update
3528 declarations.
3529 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
3530 Initialize new fields. Remove symtab parameter. Change all
3531 callers.
3532 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
3533 irelative_count_.
3534 (Output_data_plt_x86_64::has_irelative_section): New function.
3535 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
3536 (class Target_x86_64): Add got_irelative_ and rel_irelative_
3537 fields. Update declarations.
3538 (Target_x86_64::Target_x86_64): Initialize new fields.
3539 (Target_x86_64::do_plt_address_for_global): New function replacing
3540 do_plt_section_for_global.
3541 (Target_x86_64::do_plt_address_for_local): New function replacing
3542 do_plt_section_for_local.
3543 (Target_x86_64::got_section): Create got_irelative_.
3544 (Target_x86_64::rela_irelative_section): New function.
3545 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
3546 all callers. Don't create __rel_iplt_{start,end}.
3547 (Output_data_plt_x86_64::add_entry): Add symtab and layout
3548 parameters. Change all callers. Use different PLT and GOT for
3549 IFUNC symbols.
3550 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
3551 layout parameters. Change all callers. Use different PLT and
3552 GOT.
3553 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
3554 parameters. Change all callers. Use different PLT and GOT for
3555 IFUNC symbols.
3556 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
3557 (Output_data_plt_x86_64::rela_irelative): New function.
3558 (Output_data_plt_x86_64::address_for_global): New function.
3559 (Output_data_plt_x86_64::address_for_local): New function.
3560 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3561 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
3562 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
3563 (Target_x86_64::register_global_plt_entry): Add symtab and layout
3564 parameters.
3565 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
3566 reloc.
3567 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
3568 symbols if we didn't create an IRELATIVE GOT.
3569 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
3570 plt_address_for_local.
3571 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
3572 * testsuite/ifuncvar1.c: New test file.
3573 * testsuite/ifuncvar2.c: New test file.
3574 * testsuite/ifuncvar3.c: New test file.
3575 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
3576 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
3577 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
3578 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
3579 * testsuite/Makefile.in: Rebuild.
3580
33c15b45
CC
35812011-07-07 Cary Coutant <ccoutant@google.com>
3582
3583 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
3584 (two_file_test_1_ndebug.o): Likewise.
3585 (two_file_test_1b_ndebug.o): Likewise.
3586 (two_file_test_2_ndebug.o): Likewise.
3587 (two_file_test_main_ndebug.o): Likewise.
3588 (incremental_test_2): Link with no-debug versions.
3589
f48b5fb7
CC
35902011-07-06 Cary Coutant <ccoutant@google.com>
3591
3592 * gold/incremental.cc
3593 (Output_section_incremental_inputs::write_info_blocks): Check for
3594 hidden and internal symbols.
3595
221597a5
CC
35962011-07-06 Cary Coutant <ccoutant@google.com>
3597
3598 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
3599 Check disposition for startup file.
3600 (Incremental_inputs::report_command_line): Ignore
3601 --incremental-startup-unchanged option.
3602 * options.cc (General_options::parse_incremental_startup_unchanged):
3603 New function.
3604 (General_options::General_options): Initialize new data member.
3605 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
3606 (General_options): Add --incremental-startup-unchanged option.
3607 (General_options::incremental_startup_disposition): New function.
3608 (General_options::incremental_startup_disposition_): New data member.
3609
e24719f6
CC
36102011-07-06 Cary Coutant <ccoutant@google.com>
3611
3612 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
3613 input file index to Script_info ctor.
3614 (Sized_incremental_binary::do_file_has_changed): Find the
3615 command-line argument for files named in scripts.
3616 * incremental.h (Script_info::Script_info): New ctor
3617 with input file index.
3618 (Script_info::input_file_index): New function.
3619 (Script_info::input_file_index_): New data member.
3620 (Incremental_binary::get_library): Add const.
3621 (Incremental_binary::get_script_info): Add const.
3622 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
3623 * testsuite/Makefile.am (incremental_test_5): New test case.
3624 (incremental_test_6): New test case.
3625 * testsuite/Makefile.in: Regenerate.
3626
8f7c81e8
CC
36272011-07-06 Cary Coutant <ccoutant@google.com>
3628
3629 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
3630 debug output when command lines differ.
3631
9fbd3822
CC
36322011-07-06 Cary Coutant <ccoutant@google.com>
3633
3634 * incremental.cc (Incremental_inputs::report_command_line): Ignore
3635 --incremental-patch option.
3636 * layout.cc (Free_list::allocate): Extend allocation beyond original
3637 end if enabled.
3638 (Layout::make_output_section): Mark sections that should get
3639 patch space.
3640 * options.cc (parse_percent): New function.
3641 * options.h (parse_percent): New function.
3642 (DEFINE_percent): New macro.
3643 (General_options): Add --incremental-patch option.
3644 * output.cc (Output_section::Output_section): Initialize new data
3645 members.
3646 (Output_section::add_input_section): Print section name when out
3647 of patch space.
3648 (Output_section::add_output_section_data): Likewise.
3649 (Output_section::set_final_data_size): Add patch space when
3650 doing --incremental-full.
3651 (Output_section::do_reset_address_and_file_offset): Remove patch
3652 space.
3653 (Output_segment::set_section_list_addresses): Print debug output
3654 only if --incremental-update.
3655 * output.h (Output_section::set_is_patch_space_allowed): New function.
3656 (Output_section::is_patch_space_allowed_): New data member.
3657 (Output_section::patch_space_): New data member.
3658 * parameters.cc (Parameters::incremental_full): New function.
3659 * parameters.h (Parameters::incremental_full): New function
3660 * testsuite/Makefile.am (incremental_test_2): Add test for
3661 --incremental-patch option.
3662 * testsuite/Makefile.in: Regenerate.
3663 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
3664 (t18): Remove function body.
3665
f6cccc2c
DK
36662011-07-05 Doug Kwan <dougkwan@google.com>
3667
3668 PR gold/12771
3669 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
3670 Arm_Address type for relocation result.
3671 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
3672 overflow check.
3673 (Arm_relocate_functions::abs32): Use unaligned access.
3674 (Arm_relocate_functions::rel32): Ditto.
3675 (Arm_relocate_functions::prel31): Ditto.
3676 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
3677 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
3678 static data relocations.
3679 * testsuite/Makefile.in: Regnerate.
3680 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
3681
28a13fec
ILT
36822011-07-05 Ian Lance Taylor <iant@google.com>
3683
3684 PR gold/12392
3685 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
3686 symbols if necessary.
3687 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3688
24d47b34
ILT
36892011-07-05 Ian Lance Taylor <iant@google.com>
3690
3691 PR gold/12952
3692 * resolve.cc (Symbol::override_base_with_special): Simply override
3693 version with special symbol version, ignoring previous version.
3694
41f9cbbe
ILT
36952011-07-05 Ian Lance Taylor <iant@google.com>
3696
3697 * object.cc (Sized_relobj_file::include_section_group): Add
3698 information to comment about signature location.
3699
886288f1
ILT
37002011-07-02 Ian Lance Taylor <iant@google.com>
3701
3702 PR gold/12957
3703 * options.h (class General_options): Add -f and -F.
3704 * options.cc (General_options::finalize): Fatal error if -f/-F
3705 are used without -shared.
3706 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
3707
ae3a6d4f
ILT
37082011-07-02 Ian Lance Taylor <iant@google.com>
3709
3710 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
3711
21131061
ILT
37122011-07-01 Ian Lance Taylor <iant@google.com>
3713
3714 PR gold/12525
3715 PR gold/12952
3716 * resolve.cc (Symbol::override_base_with_special): Don't override
3717 the version if the overriding symbol has a different name.
3718 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
3719 all callers. If we give an error about an undefined version,
3720 define the base version if necessary.
3721 * dynobj.h (class Versions): Update declaration.
3722 * testsuite/weak_alias_test_5.cc: New file.
3723 * testsuite/weak_alias_test.script: New file.
3724 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
3725 and versioned_alias have the right value, and call t2.
3726 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
3727 weak_alias_test_5.so.
3728 (weak_alias_test_LDADD): Likewise.
3729 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
3730 * testsuite/Makefile.in: Rebuild.
3731
611062c0
ILT
37322011-07-01 Ian Lance Taylor <iant@google.com>
3733
3734 PR gold/12525
3735 * options.h (class General_options): Support -z notext.
3736 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
3737 -Wl,-z,notext.
3738 (two_file_shared_nonpic.so): Likewise.
3739 (two_file_shared_mixed.so): Likewise.
3740 (two_file_shared_mixed_1.so): Likewise.
3741 (weak_undef_lib_nonpic.so): Likewise.
3742 (alt/weak_undef_lib_nonpic.so): Likewise.
3743 (tls_test_shared_nonpic.so): Likewise.
3744 * testsuite/Makefile.in: Rebuild.
3745
328c7c2f
ILT
37462011-07-01 Ian Lance Taylor <iant@google.com>
3747
3748 PR gold/12525
3749 * configure.ac: Test whether static linking works, setting
3750 the automake conditional HAVE_STATIC.
3751 * testsuite/Makefile.am: Disable tests using -static if
3752 HAVE_STATIC is not true.
3753 * configure, testsuite/Makefile.in: Rebuild.
3754
02d7cd44
ILT
37552011-07-01 Ian Lance Taylor <iant@google.com>
3756
3757 PR gold/12525
3758 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
3759 Assert if we see DW_EH_PE_indirect.
3760 * target.h (Target::ehframe_datarel_base): New function.
3761 (Target::do_ehframe_datarel_base): New target function.
3762 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
3763 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
3764 function.
3765
07a60597
ILT
37662011-07-01 Ian Lance Taylor <iant@google.com>
3767
3768 PR gold/12571
3769 * options.h (class General_options): Add
3770 --ld-generated-unwind-info.
3771 * ehframe.cc (Fde::write): Add address parameter. Change all
3772 callers. If associated with PLT, fill in address and size.
3773 (Cie::set_output_offset): Only add merge mapping if there is an
3774 object.
3775 (Cie::write): Add address parameter. Change all callers.
3776 (Eh_frame::add_ehframe_for_plt): New function.
3777 * ehframe.h (class Fde): Update declarations. Move shndx_ and
3778 input_offset_ fields into union u_, with new plt field.
3779 (Fde::Fde): Adjust for new union field.
3780 (Fde::Fde) [Output_data version]: New constructor.
3781 (Fde::add_mapping): Only add merge mapping if there is an object.
3782 (class Cie): Update declarations.
3783 (class Eh_frame): Declare add_ehframe_for_plt.
3784 * layout.cc (Layout::layout_eh_frame): Break out code into
3785 make_eh_frame_section, and call it.
3786 (Layout::make_eh_frame_section): New function.
3787 (Layout::add_eh_frame_for_plt): New function.
3788 * layout.h (class Layout): Update declarations.
3789 * merge.cc (Merge_map::add_mapping): Add assertion.
3790 * i386.cc: Include "dwarf.h".
3791 (class Output_data_plt_i386): Make first_plt_entry,
3792 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
3793 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3794 and plt_eh_frame_fde.
3795 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
3796 boundary. Call add_eh_frame_for_plt if appropriate.
3797 * x86_64.cc: Include "dwarf.h".
3798 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
3799 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
3800 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
3801 and plt_eh_frame_fde.
3802 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
3803 appropriate.
3804
14788a3f
ILT
38052011-06-29 Ian Lance Taylor <iant@google.com>
3806
3807 PR gold/12629
3808 * object.cc (Sized_relobj_file::layout_section): Change shdr
3809 parameter to be const.
3810 (Sized_relobj_file::layout_eh_frame_section): New function, broken
3811 out of do_layout.
3812 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
3813 appropriate. Call layout_eh_frame_section.
3814 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
3815 sections.
3816 * object.h (class Sized_relobj_file): Update declarations.
3817
6c21fce1
ILT
38182011-06-29 Ian Lance Taylor <iant@google.com>
3819
37e41b03 3820 PR gold/12652
6c21fce1
ILT
3821 * script.cc (Token::integer_value): Accept trailing M/m/K/k
3822 modifier.
3823 (Lex::gather_token): Accept trailing M/m/K/k for integers.
3824
4d5e4e62
ILT
38252011-06-29 Ian Lance Taylor <iant@google.com>
3826
3827 PR gold/12675
3828 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
3829 SHT_X86_64_UNWIND.
3830 * layout.cc (Layout::layout_eh_frame): Likewise.
3831
886f533a
ILT
38322011-06-29 Ian Lance Taylor <iant@google.com>
3833
3834 PR gold/12695
3835 * layout.cc (Layout::symtab_section_shndx): New function.
3836 * layout.h (class Layout): Declare symtab_section_shndx.
3837 * output.cc (Output_section::write_header): Call it.
3838
f3ae1b28
ILT
38392011-06-29 Ian Lance Taylor <iant@google.com>
3840
3841 PR gold/12818
3842 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
3843 symbols which are not used in a relocation.
3844
aecf301f
ILT
38452011-06-28 Ian Lance Taylor <iant@google.com>
3846
3847 PR gold/12898
3848 * layout.cc (Layout::segment_precedes): Don't crash if a linker
3849 script create indistinguishable segments.
3850 (Layout::set_segment_offsets): Use stable_sort when sorting
3851 segments. Pass this to Compare_segments constructor.
3852 * layout.h (class Layout): Make segment_precedes non-static.
3853 (class Compare_segments): Change from struct to class. Add
3854 layout_ field. Add constructor.
3855 * script-sections.cc
3856 (Script_sections::attach_sections_using_phdrs_clause): Rename
3857 local orphan to is_orphan. Don't report failure to put empty
3858 section in segment. On attachment failure, report name of
3859 section, and attach to first PT_LOAD segment.
3860
03ef7571
ILT
38612011-06-28 Ian Lance Taylor <iant@google.com>
3862
3863 PR gold/12934
3864 * target-select.cc (Target_selector::Target_selector): Add
3865 emulation parameter. Change all callers.
3866 (select_target_by_bfd_name): Rename from select_target_by_name.
3867 Change all callers.
3868 (select_target_by_emulation): New function.
3869 (supported_emulation_names): New function.
3870 * target-select.h (class Target_selector): Add emulation_ field.
3871 Update declarations.
3872 (Target_selector::recognize_by_bfd_name): Rename from
3873 recognize_by_name. Change all callers.
3874 (Target_selector::supported_bfd_names): Rename from
3875 supported_names. Change all callers.
3876 (Target_selector::recognize_by_emulation): New function.
3877 (Target_selector::supported_emulations): New function.
3878 (Target_selector::emulation): New function.
3879 (Target_selector::do_recognize_by_bfd_name): Rename from
3880 do_recognize_by_name. Change all callers.
3881 (Target_selector::do_supported_bfd_names): Rename from
3882 do_supported_names. Change all callers.
3883 (Target_selector::do_recognize_by_emulation): New function.
3884 (Target_selector::do_supported_emulations): New function.
3885 (select_target_by_bfd_name): Change name in declaration.
3886 (select_target_by_emulation): Declare.
3887 (supported_emulation_names): Declare.
3888 * parameters.cc (parameters_force_valid_target): Try to find
3889 target based on emulation from -m option.
3890 * options.h (class General_options): Change doc string for -m.
3891 * options.cc (help): Print emulations.
3892 (General_options::parse_V): Likewise.
3893 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
3894 Add emulation parameter. Change all callers.
3895
200b2bb9
ILT
38962011-06-28 Ian Lance Taylor <iant@google.com>
3897
3898 * target.h (class Target): Add osabi_ field.
3899 (Target::osabi): New function.
3900 (Target::set_osabi): New function.
3901 (Target::Target): Initialize osabi_.
3902 (Target::do_adjust_elf_header): Make pure virtual.
3903 (Sized_target::do_adjust_elf_header): Declare.
3904 * target.cc (Sized_target::do_adjust_elf_header): New function.
3905 (class Sized_target): Instantiate all versions.
3906 * freebsd.h (class Target_freebsd): Remove.
3907 (Target_selector_freebsd::do_recognize): Call set_osabi on
3908 Target.
3909 (Target_selector_freebsd::do_recognize_by_name): Likewise.
3910 (Target_selector_freebsd::set_osabi): Remove.
3911 * i386.cc (class Target_i386): Inherit from Sized_target rather
3912 than Target_freebsd.
3913 * x86_64.cc (class Target_x86_64): Likewise.
3914
b3ce541e
ILT
39152011-06-28 Ian Lance Taylor <iant@google.com>
3916
3917 * target.h (Target::can_check_for_function_pointers): Rewrite.
3918 Make non-virtual.
3919 (Target::can_icf_inline_merge_sections): Likewise.
3920 (Target::section_may_have_icf_unsafe_poineters): Likewise.
3921 (Target::Target_info): Add can_icf_inline_merge_sections field.
3922 (Target::do_can_check_for_function_pointers): New virtual
3923 function.
3924 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
3925 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
3926 from can_check_for_function_pointers, move in file.
3927 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
3928 section_may_have_icf_unsafe_poineters, move in file.
3929 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
3930 * i386.cc (Target_i386::do_can_check_for_function_pointers):
3931 Rename from can_check_for_function_pointers, move in file.
3932 (Target_i386::can_icf_inline_merge_sections): Remove.
3933 (Target_i386::i386_info): Initialize
3934 can_icf_inline_merge_sections.
3935 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
3936 Initialize can_icf_inline_merge_sections.
3937 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
3938 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
3939 Rename from can_check_for_function_pointers, move in file.
3940 (Target_x86_64::can_icf_inline_merge_sections): Remove.
3941 (Target_x86_64::x86_64_info): Initialize
3942 can_icf_inline_merge_sections.
3943 * testsuite/testfile.cc (Target_test::test_target_info):
3944 Likewise.
3945 * icf.cc (get_section_contents): Correct formatting.
3946
6d1c4efb
ILT
39472011-06-27 Ian Lance Taylor <iant@google.com>
3948
3949 * symtab.cc (Symbol::versioned_name): New function.
3950 (Symbol_table::add_to_final_symtab): Use versioned_name when
3951 appropriate.
3952 (Symbol_table::sized_write_symbol): Likewise.
3953 * symtab.h (class Symbol): Declare versioned_name.
3954 * stringpool.h (class Stringpool_template): Add variant of add
3955 which takes a std::basic_string.
3956 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
3957 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
3958 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
3959 (ver_test_12.o): New target.
3960 * testsuite/Makefile.in: Rebuild.
3961
57eb9b50
DK
39622011-06-27 Doug Kwan <dougkwan@google.com>
3963
3964 * arm.cc (Arm_relocate_functions::thm_jump8,
3965 Arm_relocate_functions::thm_jump11): Use a wider signed
3966 type to compute offset.
3967 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
3968 arm_thm_jump8.
3969 * testsuite/Makefile.in: Regenerate.
3970 * testsuite/arm_branch_in_range.sh: Check test results of
3971 arm_thm_jump11 and arm_thm_jump8.
3972 * testsuite/arm_thm_jump11.s: New test source file.
3973 * testsuite/arm_thm_jump11.t: New linker script.
3974 * testsuite/arm_thm_jump8.s: New test source file.
3975 * testsuite/arm_thm_jump8.t: New linker script.
3976
487b39df
ILT
39772011-06-24 Ian Lance Taylor <iant@google.com>
3978
3979 * layout.cc: Include "object.h".
3980 (ctors_sections_in_init_array): New static variable.
3981 (Layout::is_ctors_in_init_array): New function.
3982 (Layout::layout): Add entry to ctors_sections_in_init_array if
3983 appropriate.
3984 * layout.h (class Layout): Declare is_ctors_in_init_array.
3985 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
3986 is_ctors_reverse_view is set.
3987 (Sized_relobj_file::write_sections): Add layout parameter. Change
3988 all callers. Set is_ctors_reverse_view field of View_size.
3989 (Sized_relobj_file::reverse_words): New function.
3990 * object.h (Sized_relobj_file::View_size): Add
3991 is_ctors_reverse_view field.
3992 (class Sized_relobj_file): Update declarations.
3993 * testsuite/initpri3.c: New test.
3994 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
3995 initpri3b.
3996 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
3997 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
3998 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
3999 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4000 * testsuite/Makefile.in: Rebuild.
4001
472076e4
CC
40022011-06-24 Cary Coutant <ccoutant@google.com>
4003
4004 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4005 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4006 (debug_msg_cdebug.err): New targets.
4007 * testsuite/Makefile.in: Regenerate.
4008 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4009 Fix checks for link with shared library.
4010
a60af0db
DK
40112011-06-24 Doug Kwan <dougkwan@google.com>
4012
4013 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4014 skip empty text sections.
4015 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4016
5393d741
ILT
40172011-06-22 Ian Lance Taylor <iant@google.com>
4018
4019 PR gold/12910
4020 * options.h (class General_options): Add --ctors-in-init-array.
4021 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4022 friends as SHT_PROGBITS for merging sections.
4023 (Layout::layout): Remove special handling of .init_array and
4024 friends. Don't sort if doing relocatable link. Sort for .ctors
4025 and .dtors if ctors_in_init_array.
4026 (Layout::make_output_section): Force correct section types for
4027 .init_array and friends. Don't sort if doing relocatable link,
4028 Don't sort .ctors and .dtors if ctors_in_init_array.
4029 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4030 (Layout::output_section_name): Add relobj parameter. Change all
4031 callers. Handle .ctors. and .dtors. in code rather than table.
4032 Handle .ctors and .dtors if ctors_in_init_array.
4033 (Layout::match_file_name): New function, moved from output.cc.
4034 * layout.h (class Layout): Update declarations.
4035 * output.cc: Include "layout.h".
4036 (Input_section_sort_entry::get_priority): New function.
4037 (Input_section_sort_entry::match_file_name): Just call
4038 Layout::match_file_name.
4039 (Output_section::Input_section_sort_init_fini_compare::operator()):
4040 Handle .ctors and .dtors. Sort by explicit priority rather than
4041 by name.
4042 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4043 * testsuite/initpri2.c: New test.
4044 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4045 (check_PROGRAMS): Add initpri2.
4046 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4047 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4048 * configure, testsuite/Makefile.in: Rebuild.
4049
e1f74f98
ILT
40502011-06-19 Ian Lance Taylor <iant@google.com>
4051
4052 PR gold/12880
4053 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4054 .interp section to a PT_INTERP segment even if we have seen a
4055 --dynamic-linker option. Don't do it if we have seen a PHDRS
4056 clause in a linker script.
4057 (Layout::finalize): Don't create a .interp section if we've
4058 already create a PT_INTERP segment.
4059 (Layout::create_interp): Always call choose_output_section (revert
4060 patch of 2011-06-17). Don't create PT_INTERP segment.
4061 * script-sections.cc
4062 (Script_sections::create_note_and_tls_segments): Add a .interp
4063 section to a PT_INTERP segment even if we have seen a
4064 --dynamic-linker option.
4065
766f91bb
ILT
40662011-06-18 Ian Lance Taylor <iant@google.com>
4067
4068 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4069 merely because a non-PT_LOAD segment has a dynamic reloc.
4070
0d212c3a
ILT
40712011-06-18 Ian Lance Taylor <iant@google.com>
4072
4073 * layout.cc (Layout::finish_dynamic_section): Don't create
4074 DT_FLAGS entry if not needed.
4075
911a5072
ILT
40762011-06-18 Ian Lance Taylor <iant@google.com>
4077
4078 PR gold/12745
4079 * layout.cc (Layout::layout_eh_frame): Correct handling of
4080 writable .eh_frame section.
4081
534b4e5f
ILT
40822011-06-17 Ian Lance Taylor <iant@google.com>
4083
4084 PR gold/12893
4085 * resolve.cc (Symbol_table::resolve): Don't give an error if a
4086 symbol is redefined with the exact same object and value.
4087
10b4f102
ILT
40882011-06-17 Ian Lance Taylor <iant@google.com>
4089
4090 PR gold/12880
4091 * layout.h (class Layout): Add interp_segment_ field.
4092 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
4093 (Layout::attach_allocated_section_to_segment): If making shared
4094 library, put .interp section in PT_INTERP segment.
4095 (Layout::finalize): Also call create_interp if -dynamic-linker
4096 option was used.
4097 (Layout::create_interp): Assert that there is no PT_INTERP
4098 segment. If not using a SECTIONS clause, use make_output_section.
4099 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
4100 * script-sections.cc
4101 (Script_sections::create_note_and_tls_segments): If making shared
4102 library, put .interp section in PT_INTERP segment.
4103
a29b0dad
ILT
41042011-06-17 Ian Lance Taylor <iant@google.com>
4105
e588ea8d
ILT
4106 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
4107 when making a shared library.
4108
41092011-06-17 Ian Lance Taylor <iant@google.com>
4110
4111 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
4112 parameter. Change all callers. Don't issue warning about PC32
4113 against locally defined symbol.
a29b0dad 4114
9d3b0698
ILT
41152011-06-16 Ian Lance Taylor <iant@google.com>
4116
4117 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
4118 occurs in same object.
4119
85b0f90c
AM
41202011-06-14 Alan Modra <amodra@gmail.com>
4121
4122 * po/POTFILES.in: Regenerate.
4123
a94907d9
ILT
41242011-06-09 Ian Lance Taylor <iant@google.com>
4125
4126 * script-sections.cc
4127 (Orphan_output_section::set_section_addresses): For a relocatable
4128 link set address to 0.
4129
4fb3a1c3
CC
41302011-06-09 Cary Coutant <ccoutant@google.com>
4131
4132 PR gold/12804
4133 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
4134 used with --compress-debug-sections.
4135 * gold/object.cc (Sized_relobj_file::do_layout): Report
4136 uncompressed size of compressed input sections.
4137
61220854
CC
41382011-06-08 Cary Coutant <ccoutant@google.com>
4139
4140 PR gold/12804
4141 * testsuite/two_file_test_2_v1.cc: Change initialization of
4142 v2 to keep it in .data.
4143
e6455dfb
CC
41442011-06-07 Cary Coutant <ccoutant@google.com>
4145
4146 * common.cc (Symbol_table::do_allocate_commons_list): Call
4147 gold_fallback.
4148 * errors.cc (Errors::fatal): Adjust call to gold_exit.
4149 (Errors::fallback): New function.
4150 (gold_fallback): New function.
4151 * errors.h (Errors::fallback): New function.
4152 * gold.cc (gold_exit): Change status parameter to enum; adjust
4153 all callers.
4154 (queue_initial_tasks): Call gold_fallback.
4155 * gold.h: Include cstdlib.
4156 (Exit_status): New enum type.
4157 (gold_exit): Change status parameter to enum.
4158 (gold_fallback): New function.
4159 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
4160 (Layout::create_symtab_sections): Likewise.
4161 (Layout::create_shdrs): Likewise.
4162 * main.cc (main): Adjust call to gold_exit.
4163 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
4164 (Output_data_got::add_got_entry_pair): Likewise.
4165 (Output_section::add_input_section): Likewise.
4166 (Output_section::add_output_section_data): Likewise.
4167 (Output_segment::set_section_list_addresses): Likewise.
4168 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
4169
fb0e076f
CC
41702011-06-07 Cary Coutant <ccoutant@google.com>
4171
4172 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
4173 for incremental links.
4174 * output.cc (Output_segment::set_section_list_addresses): Remove
4175 FIXME and test for TLS or BSS.
4176
a5ee4d5d
CC
41772011-06-07 Cary Coutant <ccoutant@google.com>
4178
4179 * testsuite/Makefile.am: Add incremental_copy_test,
4180 incremental_common_test_1.
4181 * testsuite/Makefile.in: Regenerate.
4182 * testsuite/common_test_1_v1.c: New source file.
4183 * testsuite/common_test_1_v2.c: New source file.
4184 * testsuite/copy_test_v1.cc: New source file.
4185
5146f448
CC
41862011-06-07 Cary Coutant <ccoutant@google.com>
4187
4188 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
4189 update, allocate common from bss section's free list.
4190 * incremental-dump.cc (dump_incremental_inputs): Print flag for
4191 linker-defined symbols.
4192 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
4193 Skip GOT and PLT entries that are no longer referenced.
4194 (Output_section_incremental_inputs::write_info_blocks): Mark
4195 linker-defined symbols.
4196 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
4197 * output.cc (Output_section::allocate): New function.
4198 * output.h (Output_section::allocate): New function.
4199 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
4200 linker-defined symbols.
4201 (Symbol::override_base_with_special): Copy is_predefined_ flag.
4202 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
4203 (Symbol::init_base_output_data): Likewise.
4204 (Symbol::init_base_output_segment): Likewise.
4205 (Symbol::init_base_constant): Likewise.
4206 (Sized_symbol::init_output_data): Likewise.
4207 (Sized_symbol::init_output_segment): Likewise.
4208 (Sized_symbol::init_constant): Likewise.
4209 (Symbol_table::do_define_in_output_data): Likewise.
4210 (Symbol_table::do_define_in_output_segment): Likewise.
4211 (Symbol_table::do_define_as_constant): Likewise.
4212 * symtab.h (Symbol::is_predefined): New function.
4213 (Symbol::init_base_output_data): Add is_predefined parameter.
4214 (Symbol::init_base_output_segment): Likewise.
4215 (Symbol::init_base_constant): Likewise.
4216 (Symbol::is_predefined_): New data member.
4217 (Sized_symbol::init_output_data): Add is_predefined parameter.
4218 (Sized_symbol::init_output_segment): Likewise.
4219 (Sized_symbol::init_constant): Likewise.
4220 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
4221
26d3c67d
CC
42222011-06-07 Cary Coutant <ccoutant@google.com>
4223
4224 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
4225 instead of emit_copy_reloc.
4226 (Copy_relocs::emit_copy_reloc): Refactor.
4227 (Copy_relocs::make_copy_reloc): New function.
4228 (Copy_relocs::add_copy_reloc): Remove.
4229 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
4230 section.
4231 (Copy_relocs::make_copy_reloc): New function.
4232 (Copy_relocs::add_copy_reloc): Remove.
4233 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
4234 unchanged input files.
4235 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
4236 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
4237 Reserve BSS space for COPY relocations.
4238 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4239 (Output_section_incremental_inputs::write_info_blocks): Record
4240 whether a symbol is copied from a shared object.
4241 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
4242 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
4243 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
4244 (Incremental_input_entry_reader::get_output_symbol_index): Add
4245 is_copy parameter.
4246 (Incremental_binary::emit_copy_relocs): New function.
4247 (Incremental_binary::do_emit_copy_relocs): New function.
4248 (Sized_incremental_binary::Sized_incremental_binary): Initialize
4249 new data member.
4250 (Sized_incremental_binary::add_copy_reloc): New function.
4251 (Sized_incremental_binary::do_emit_copy_relocs): New function.
4252 (Sized_incremental_binary::Copy_reloc): New struct.
4253 (Sized_incremental_binary::Copy_relocs): New typedef.
4254 (Sized_incremental_binary::copy_relocs_): New data member.
4255 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
4256 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
4257 * target.h (Sized_target::emit_copy_reloc): New function.
4258 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
4259
7cdb37d9
CC
42602011-06-02 Cary Coutant <ccoutant@google.com>
4261
4262 PR gold/12163
4263 * gold/archive.cc (Archive::Archive): Initialize new data member.
4264 (Archive::include_all_members): Return if archive has already been
4265 included.
4266 * gold/archive.h (Archive::include_all_members_): New data member.
4267
cc643b88
NC
42682011-06-02 Nick Clifton <nickc@redhat.com>
4269
4270 * dynobj.h: Fix spelling mistake in comment.
4271 * output.cc: Likewise.
4272
f62a3ca7 42732011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 4274 Asier Llano
f62a3ca7
DK
4275
4276 PR gold/12826
cc643b88 4277 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
4278 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
4279 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
4280 redundant arm_exidx_test.so.
4281 * testsuite/Makefile.in: Regenerate.
4282 (check_SCRIPTS): Add pr12826.sh
4283 (check_DATA): Add pr12826.stdout
4284 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
4285 * testsuite/pr12826.sh: New file.
4286 * testsuite/pr12826_1.s: Ditto.
4287 * testsuite/pr12826_1.s: Ditto.
4288
8dbe1edc
ILT
42892011-05-30 Ian Lance Taylor <iant@google.com>
4290
4291 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
4292 sections.
4293
c49875be
ILT
42942011-05-29 Ian Lance Taylor <iant@google.com>
4295
4296 PR gold/12804
4297 * testsuite/Makefile.am: Use different file name for two_file_test
4298 temporary file for each incremental test.
4299 * testsuite/Makefile.in: Rebuild.
4300
69d53f7a
ILT
43012011-05-29 Ian Lance Taylor <iant@google.com>
4302
4303 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
4304 binary input file is empty.
4305
41d0ab5f
ILT
43062011-05-27 Ian Lance Taylor <iant@google.com>
4307
4308 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4309 (ver_test_9.so): Likewise.
4310 * testsuite/Makefile.in: Rebuild.
4311
89d8a36b
CC
43122011-05-26 Cary Coutant <ccoutant@google.com>
4313
4314 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4315 * incremental.cc (Incremental_inputs::report_input_section): Fix
4316 comment, indentation.
4317 (Incremental_inputs::report_comdat_group): New function.
4318 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4319 of data for incremental input file entry.
4320 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
4321 group count, COMDAT group signatures.
4322 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
4323 an unchanged input file.
4324 * incremental.h (Incremental_object_entry::Incremental_object_entry):
4325 Initialize new data member.
4326 (Incremental_object_entry::add_comdat_group): New function.
4327 (Incremental_object_entry::get_comdat_group_count): New function.
4328 (Incremental_object_entry::get_comdat_signature_key): New function.
4329 (Incremental_object_entry::groups_): New data member.
4330 (Incremental_inputs::report_comdat_group): New function.
4331 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
4332 data for incremental input file entry.
4333 (Incremental_input_entry_reader::get_comdat_group_count): New function.
4334 (Incremental_input_entry_reader::get_input_section): Adjust size of
4335 data for incremental input file entry.
4336 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
4337 (Incremental_input_entry_reader::get_comdat_group_signature): New
4338 function.
4339 * object.cc (Sized_relobj::include_section_group): Report kept
4340 COMDAT groups for incremental links.
4341
1706a06f
ILT
43422011-05-24 David Meyer <pdox@google.com>
4343
4344 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
4345 with name parameter. Add found_name parameter.
4346 * fileread.cc (Input_file::find_file): Adjust code accordingly.
4347 * dirsearch.h (class Dirsearch): Update declaration.
4348
a10ae760
ILT
43492011-05-24 Ian Lance Taylor <iant@google.com>
4350
4351 * archive.cc (Library_base::should_include_member): Pull in object
4352 from archive if it defines the entry symbol.
4353 * parameters.cc (Parameters::entry): New function.
4354 * parameters.h (class Parameters): Declare entry.
4355 * output.h (class Output_file_header): Remove entry_ field.
4356 * output.cc (Output_file_header::Output_file_header): Remove entry
4357 parameter. Change all callers.
4358 (Output_file_header::entry): Use parameters->entry.
4359 * gold.cc (queue_middle_tasks): Likewise.
4360 * plugin.cc (Plugin_hook::run): Likewise.
4361
aa92d6ed
CC
43622011-05-24 Cary Coutant <ccoutant@google.com>
4363
4364 * gold.cc (queue_initial_tasks): Pass incremental base filename
4365 to Output_file::open_base_file; don't print error message.
4366 * incremental-dump.cc (main): Adjust call to
4367 Output_file::open_for_modification.
4368 * incremental-dump.cc (main): Likewise.
4369 * incremental.cc (Incremental_inputs::report_command_line):
4370 Ignore --incremental-base option when comparing command lines.
4371 Ignore parameter when given as separate argument.
4372 * options.h (class General_options): Add --incremental-base.
4373 * output.cc (Output_file::Output_file):
4374 (Output_file::open_base_file): Add base_name and writable parameters;
4375 read base file into new file; print error message here.
4376 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4377 callers.
4378 * output.h (Output_file::open_for_modification): Rename to...
4379 (Output_file::open_base_file): ...this; add base_name and
4380 writable parameters; adjust all callers.
4381 (Output_file::map_no_anonymous): Add writable parameter; adjust all
4382 callers.
4383 * testsuite/Makefile.am (incremental_test_4): Test
4384 --incremental-base.
4385 * testsuite/Makefile.in: Regenerate.
4386
2eedd706
CC
43872011-05-24 Cary Coutant <ccoutant@google.com>
4388
4389 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
4390 incremental_test_4.
4391 * testsuite/Makefile.in: Regenerate.
4392 * testsuite/two_file_test_1_v1.cc: New test source file.
4393 * testsuite/two_file_test_1b_v1.cc: New test source file.
4394 * testsuite/two_file_test_2_v1.cc: New test source file.
4395
0f1c85a6
CC
43962011-05-24 Cary Coutant <ccoutant@google.com>
4397
4398 * dynobj.h (Dynobj::do_dynobj): New function.
4399 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
4400 flag and soname for shared objects.
4401 * incremental.cc (Incremental_inputs::report_object): Make
4402 either Incremental_object_entry or Incremental_dynobj_entry; add
4403 soname to string table.
4404 (Incremental_inputs::report_input_section): Add assertion.
4405 (Output_section_incremental_inputs::set_final_data_size): Adjust
4406 type of input file entry for shared libraries; adjust size of
4407 shared library info entry.
4408 (Output_section_incremental_inputs::write_input_files): Write
4409 as_needed flag for shared libraries.
4410 (Output_section_incremental_inputs::write_info_blocks): Adjust type
4411 of input file entry for shared libraries; write soname.
4412 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
4413 soname from incremental info.
4414 * incremental.h (enum Incremental_input_flags): Add
4415 INCREMENTAL_INPUT_AS_NEEDED.
4416 (Incremental_input_entry::Incremental_input_entry): Initialize new
4417 data member.
4418 (Incremental_input_entry::set_as_needed): New function.
4419 (Incremental_input_entry::as_needed): New function.
4420 (Incremental_input_entry::do_dynobj_entry): New function.
4421 (Incremental_input_entry::as_needed_): New data member.
4422 (Incremental_object_entry::Incremental_object_entry): Don't check
4423 for shared library.
4424 (Incremental_object_entry::do_type): Likewise.
4425 (class Incremental_dynobj_entry): New class.
4426 (Incremental_input_entry_reader::as_needed): New function.
4427 (Incremental_input_entry_reader::get_soname): New function.
4428 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
4429 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
4430 size of shared library info entry.
58797674 4431 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
4432 incremental link when adding DT_NEEDED entries.
4433 * object.h (Object::Object): Initialize new data member.
4434 (Object::dynobj): New function.
4435 (Object::set_as_needed): New function.
4436 (Object::as_needed): New function.
4437 (Object::do_dynobj): New function.
4438 (Object::as_needed_): New data member.
4439
6fa2a40b
CC
44402011-05-24 Cary Coutant <ccoutant@google.com>
4441
4442 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
4443 info; adjust display of GOT entries.
4444 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4445 vector of input objects; remove file_status_.
4446 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
4447 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
4448 got_plt reader; call target hooks to reserve GOT entries.
4449 (Output_section_incremental_inputs::set_final_data_size): Adjust size
4450 of input file info header and GOT info entry.
4451 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
4452 relocation info.
4453 (Got_plt_view_info::got_descriptor): Remove.
4454 (Got_plt_view_info::sym_index): New data member.
4455 (Got_plt_view_info::input_index): New data member.
4456 (Local_got_offset_visitor::visit): Write input file index.
4457 (Global_got_offset_visitor::visit): Write 0 for input file index.
4458 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
4459 with sym_index and input_index.
4460 (Output_section_incremental_inputs::write_got_plt): Adjust size of
4461 incremental info GOT entry; replace got_descriptor with input_index.
4462 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
4463 map from input file index to object.
4464 (Sized_relobj_incr::do_layout): Replace direct data member reference
4465 with accessor function.
4466 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
4467 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
4468 Adjust size of input file info header.
4469 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
4470 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
4471 (Incremental_input_entry_reader::get_input_section): Adjust size of
4472 input file info header.
4473 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
4474 of incremental info GOT entry.
4475 (Incremental_got_plt_reader::get_got_desc): Remove.
4476 (Incremental_got_plt_reader::get_got_symndx): New function.
4477 (Incremental_got_plt_reader::get_got_input_index): New function.
4478 (Sized_incremental_binary::Sized_incremental_binary): Remove
4479 file_status_; add input_objects_.
4480 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
4481 (Sized_incremental_binary::set_file_is_unchanged): Remove.
4482 (Sized_incremental_binary::file_is_unchanged): Remove.
4483 (Sized_incremental_binary::set_input_object): New function.
4484 (Sized_incremental_binary::input_object): New function.
4485 (Sized_incremental_binary::file_status_): Remove.
4486 (Sized_incremental_binary::input_objects_): New data member.
4487 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
4488 references.
4489 (Sized_relobj_incr::invalid_address): Move to base class.
4490 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
4491 class.
4492 (Sized_relobj_incr::do_output_section_offset): Likewise.
4493 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
4494 (Sized_relobj_incr::section_offsets_): Likewise.
4495 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
4496 function.
4497 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
4498 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
4499 with accessor function.
4500 (Sized_relobj_file::do_layout): Likewise.
4501 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
4502 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
4503 (Sized_relobj_file::compute_final_local_value): Replace refs to
4504 section_offsets_ with accessor function.
4505 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
4506 * object.h (Relobj::Relobj): Initialize new data members.
4507 (Relobj::add_dyn_reloc): New function.
4508 (Relobj::first_dyn_reloc): New function.
4509 (Relobj::dyn_reloc_count): New function.
4510 (Relobj::first_dyn_reloc_): New data member.
4511 (Relobj::dyn_reloc_count_): New data member.
4512 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
4513 references.
4514 (Sized_relobj::Address): New typedef.
4515 (Sized_relobj::invalid_address): Move here from child class.
4516 (Sized_relobj::Sized_relobj): Initialize new data members.
4517 (Sized_relobj::sized_relobj): New function.
4518 (Sized_relobj::is_output_section_offset_invalid): Move here from
4519 child class.
4520 (Sized_relobj::get_output_section_offset): Likewise.
4521 (Sized_relobj::local_has_got_offset): Likewise.
4522 (Sized_relobj::local_got_offset): Likewise.
4523 (Sized_relobj::set_local_got_offset): Likewise.
4524 (Sized_relobj::do_for_all_local_got_entries): Likewise.
4525 (Sized_relobj::clear_got_offsets): New function.
4526 (Sized_relobj::section_offsets): Move here from child class.
4527 (Sized_relobj::do_output_section_offset): Likewise.
4528 (Sized_relobj::do_set_section_offset): Likewise.
4529 (Sized_relobj::Local_got_offsets): Likewise.
4530 (Sized_relobj::local_got_offsets_): Likewise.
4531 (Sized_relobj::section_offsets_): Likewise.
4532 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
4533 references.
4534 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
4535 class.
4536 (Sized_relobj_file::sized_relobj): New function
4537 (Sized_relobj_file::local_has_got_offset): Move to base class.
4538 (Sized_relobj_file::local_got_offset): Likewise.
4539 (Sized_relobj_file::set_local_got_offset): Likewise.
4540 (Sized_relobj_file::get_output_section_offset): Likewise.
4541 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
4542 (Sized_relobj_file::do_output_section_offset): Likewise.
4543 (Sized_relobj_file::do_set_section_offset): Likewise.
4544 (Sized_relobj_file::Local_got_offsets): Likewise.
4545 (Sized_relobj_file::local_got_offsets_): Likewise.
4546 (Sized_relobj_file::section_offsets_): Likewise.
4547 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
4548 (all constructors).
4549 (set_needs_dynsym_index): Convert relobj to derived class pointer.
4550 (Output_reloc::get_symbol_index): Likewise.
4551 (Output_reloc::local_section_offset): Likewise.
4552 (Output_reloc::get_address): Likewise.
4553 (Output_reloc::symbol_value): Likewise.
4554 (Output_data_got::reserve_slot): Move to class definition.
4555 (Output_data_got::reserve_local): New function.
4556 (Output_data_got::reserve_slot_for_global): Remove.
4557 (Output_data_got::reserve_global): New function.
4558 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
4559 (all constructors, two instantiations).
4560 (Output_reloc::get_relobj): New function (two instantiations).
4561 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
4562 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
4563 (Output_data_reloc::add_global): Adjust type of relobj.
4564 (Output_data_reloc::add_global_relative): Likewise.
4565 (Output_data_reloc::add_symbolless_global_addend): Likewise.
4566 (Output_data_reloc::add_local): Likewise.
4567 (Output_data_reloc::add_local_relative): Likewise.
4568 (Output_data_reloc::add_symbolless_local_addend): Likewise.
4569 (Output_data_reloc::add_local_section): Likewise.
4570 (Output_data_reloc::add_output_section): Likewise.
4571 (Output_data_reloc::add_absolute): Likewise.
4572 (Output_data_reloc::add_target_specific): Likewise.
4573 (Output_data_got::reserve_slot): Move definition here.
4574 (Output_data_got::reserve_local): New function.
4575 (Output_data_got::reserve_global): New function.
4576 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
4577 section_offsets_ with accessor function.
4578 (Sized_relobj_file::write_sections): Likewise.
4579 (Sized_relobj_file::do_relocate_sections): Likewise.
4580 * target.h (Sized_target::reserve_local_got_entry): New function.
4581 (Sized_target::reserve_global_got_entry): New function.
4582 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
4583 (Target_x86_64::reserve_global_got_entry): New function.
4584 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
4585
4829d394
CC
45862011-05-23 Cary Coutant <ccoutant@google.com>
4587
4588 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
4589 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
4590 bit when checking got_type.
4591 * incremental.cc (Sized_incremental_binary::setup_readers):
4592 Store symbol table and string table locations; initialize bit vector
4593 of file status flags.
4594 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
4595 unchanged files.
4596 (Sized_incremental_binary::do_process_got_plt): New function.
4597 (Sized_incremental_binary::get_symtab_view): Use stored locations.
4598 (Output_section_incremental_inputs::set_final_data_size): Record
4599 file index for each input file.
4600 (Output_section_incremental_inputs::write_got_plt): Store file index
4601 instead of input entry offset for each GOT entry.
4602 * incremental.h
4603 (Incremental_input_entry::Incremental_input_entry): Initialize new
4604 data member.
4605 (Incremental_input_entry::set_offset): Store file index.
4606 (Incremental_input_entry::get_file_index): New function.
4607 (Incremental_input_entry::file_index_): New data member.
4608 (Incremental_binary::process_got_plt): New function.
4609 (Incremental_binary::do_process_got_plt): New function.
4610 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4611 data members.
4612 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
4613 (Sized_incremental_binary::set_file_is_unchanged): New function.
4614 (Sized_incremental_binary::file_is_unchanged): New function.
4615 (Sized_incremental_binary::do_process_got_plt): New function.
4616 (Sized_incremental_binary::file_status_): New data member.
4617 (Sized_incremental_binary::main_symtab_loc_): New data member.
4618 (Sized_incremental_binary::main_strtab_loc_): New data member.
4619 * output.cc (Output_data_got::Got_entry::write): Add case
4620 RESERVED_CODE.
4621 (Output_data_got::add_global): Call add_got_entry.
4622 (Output_data_got::add_global_plt): Likewise.
4623 (Output_data_got::add_global_with_rel): Likewise.
4624 (Output_data_got::add_global_with_rela): Likewise.
4625 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
4626 (Output_data_got::add_global_pair_with_rela): Likewise.
4627 (Output_data_got::add_local): Call add_got_entry.
4628 (Output_data_got::add_local_plt): Likewise.
4629 (Output_data_got::add_local_with_rel): Likewise.
4630 (Output_data_got::add_local_with_rela): Likewise.
4631 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
4632 (Output_data_got::add_local_pair_with_rela): Likewise.
4633 (Output_data_got::reserve_slot): New function.
4634 (Output_data_got::reserve_slot_for_global): New function.
4635 (Output_data_got::add_got_entry): New function.
4636 (Output_data_got::add_got_entry_pair): New function.
4637 (Output_section::add_output_section_data): Edit FIXME.
4638 * output.h
4639 (Output_section_data_build::Output_section_data_build): New
4640 constructor with size parameter.
4641 (Output_data_space::Output_data_space): Likewise.
4642 (Output_data_got::Output_data_got): Initialize new data member; new
4643 constructor with size parameter.
4644 (Output_data_got::add_constant): Call add_got_entry.
4645 (Output_data_got::reserve_slot): New function.
4646 (Output_data_got::reserve_slot_for_global): New function.
4647 (class Output_data_got::Got_entry): Add RESERVED_CODE.
4648 (Output_data_got::add_got_entry): New function.
4649 (Output_data_got::add_got_entry_pair): New function.
4650 (Output_data_got::free_list_): New data member.
4651 * target.h (Sized_target::init_got_plt_for_update): New function.
4652 (Sized_target::register_global_plt_entry): New function.
4653 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4654 Initialize new data member; call init; add constructor with PLT count.
4655 (Output_data_plt_x86_64::init): New function.
4656 (Output_data_plt_x86_64::add_relocation): New function.
4657 (Output_data_plt_x86_64::reserve_slot): New function.
4658 (Output_data_plt_x86_64::free_list_): New data member.
4659 (Target_x86_64::init_got_plt_for_update): New function.
4660 (Target_x86_64::register_global_plt_entry): New function.
4661 (Output_data_plt_x86_64::add_entry): Allocate from free list for
4662 incremental updates.
4663 (Output_data_plt_x86_64::add_relocation): New function.
4664 * testsuite/object_unittest.cc (Object_test): Set default options.
4665
ec69d6da
ILT
46662011-05-16 Ian Lance Taylor <iant@google.com>
4667
4668 * options.h (class General_options): Make -i a synonym for -r.
4669
732e31de
ILT
46702011-05-16 Ian Lance Taylor <iant@google.com>
4671
4672 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
4673
403676b5
CC
46742011-05-10 Cary Coutant <ccoutant@google.com>
4675
4676 * object.cc (Sized_relobj::do_count_local_symbols): Check for
4677 strip_all (-s).
4678
5b7b7d6e
ILT
46792011-05-06 Ian Lance Taylor <iant@google.com>
4680
4681 * layout.cc (Layout::layout): If the output section flags change,
4682 update the ordering.
4683
f0f9babf
CC
46842011-04-25 Cary Coutant <ccoutant@google.com>
4685
4686 * incremental-dump.cc (dump_incremental_inputs): Print local
4687 symbol info for each input file.
4688 * incremental.cc
4689 (Output_section_incremental_inputs::set_final_data_size): Add local
4690 symbol info to input file entries in incremental info.
4691 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4692 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
4693 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
4694 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
4695 implementation.
4696 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
4697 (Sized_incr_relobj::do_relocate): Write the local symbols.
4698 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
4699 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
4700 Adjust size of input file header.
4701 (Incremental_inputs_reader::get_local_symbol_offset): New function.
4702 (Incremental_inputs_reader::get_local_symbol_count): New function.
4703 (Incremental_inputs_reader::get_input_section): Adjust size of input
4704 file header.
4705 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
4706 (Sized_incr_relobj::This): New typedef.
4707 (Sized_incr_relobj::sym_size): New const data member.
4708 (Sized_incr_relobj::Local_symbol): New struct.
4709 (Sized_incr_relobj::do_output_local_symbol_count): New function.
4710 (Sized_incr_relobj::do_local_symbol_offset): New function.
4711 (Sized_incr_relobj::local_symbol_count_): New data member.
4712 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
4713 (Sized_incr_relobj::local_symbol_index_): New data member.
4714 (Sized_incr_relobj::local_symbol_offset_): New data member.
4715 (Sized_incr_relobj::local_dynsym_offset_): New data member.
4716 (Sized_incr_relobj::local_symbols_): New data member.
4717 * object.h (Relobj::output_local_symbol_count): New function.
4718 (Relobj::local_symbol_offset): New function.
4719 (Relobj::do_output_local_symbol_count): New function.
4720 (Relobj::do_local_symbol_offset): New function.
4721 (Sized_relobj::do_output_local_symbol_count): New function.
4722 (Sized_relobj::do_local_symbol_offset): New function.
4723
d0a9ace3
ILT
47242011-04-22 Vladimir Simonov <sv@sw.ru>
4725
4726 * descriptors.cc (set_close_on_exec): New function.
4727 (Descriptors::open): Use set_close_on_exec.
4728 * output.cc (S_ISLNK): Define if not defined.
4729
94a3fc8b
CC
47302011-04-22 Cary Coutant <ccoutant@google.com>
4731
4732 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4733 global symbol map.
4734 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4735 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
4736 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
4737 relocations.
4738 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
4739 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
4740 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
4741 * incremental.h
4742 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
4743 function.
4744 (Incremental_binary::apply_incremental_relocs): New function.
4745 (Incremental_binary::do_apply_incremental_relocs): New function.
4746 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
4747 data member.
4748 (Sized_incremental_binary::add_global_symbol): New function.
4749 (Sized_incremental_binary::global_symbol): New function.
4750 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
4751 (Sized_incremental_binary::symbol_map_): New data member.
4752 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
4753 * target.h (Sized_target::apply_relocation): New function.
4754 * target-reloc.h (apply_relocation): New function.
4755 * x86_64.cc (Target_x86_64::apply_relocation): New function.
4756
c87e4302
DK
47572011-04-22 Doug Kwan <dougkwan@google.com>
4758
4759 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4760 flag of a SHT_ARM_EXIDX section.
2e702c99 4761 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
4762 * testsuite/Makefile.in: Regenerate.
4763 * testsuite/arm_exidx_test.s: New file.
4764 * testsuite/arm_exidx_test.sh: Same.
4765
e7782cf6
CC
47662011-04-20 Cary Coutant <ccoutant@google.com>
4767
4768 PR gold/12689
4769 * archive.h (Incremental_archive_entry::Archive_member):
4770 Initialize arg_serial_ (second constructor).
4771
308ecdc7
ILT
47722011-04-17 Ian Lance Taylor <iant@google.com>
4773
4774 * object.cc (Relocate_info::location): Simplify location string.
4775 * errors.cc (Errors::error_at_location): Don't print program
4776 name.
4777 (Errors::warning_at_location): Likewise.
4778 (Errors::undefined_symbol): Likewise.
4779 * testsuite/debug_msg.sh: Update accordingly.
4780
bec5b579
CC
47812011-04-14 Cary Coutant <ccoutant@google.com>
4782
4783 * gold/layout.cc (Layout::symtab_section_offset): New function.
4784 * gold/layout.h (Layout::symtab_section_offset): New function.
4785 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
4786
88597d34
ILT
47872011-04-12 Ian Lance Taylor <iant@google.com>
4788
4789 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
4790 with MREMAP_MAYMOVE.
4791 * output.h (class Output_file): Add map_is_allocated_ field.
4792 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
4793 not available, provide stubs. If mremap is not available, #define
4794 it to gold_mremap.
4795 (MREMAP_MAYMOVE): Define if not defined.
4796 (Output_file::Output_file): Initialize map_is_allocated_.
4797 (Output_file::resize): Check map_is_allocated_.
4798 (Output_file::map_anonymous): If mmap fails, use malloc.
4799 (Output_file::unmap): Don't do anything for an anonymous map.
4800 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
4801 is not available, provide stubs.
4802 (File_read::View::~View): Use free rather than delete[].
4803 (File_read::make_view): Use malloc rather than new[]. If mmap
4804 fails, use malloc.
4805 (File_read::find_or_make_view): Use malloc rather than new[].
4806 * gold.h: Remove HAVE_REMAP code.
4807 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
4808 exists. Rename mremap to gold_mremap. If mmap is not available
4809 don't do anything.
4810 * configure, config.in: Rebuild.
4811
11e361bc
ILT
48122011-04-11 Ian Lance Taylor <iant@google.com>
4813
4814 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
4815 initialize local variable v.
4816
cdc29364
CC
48172011-04-11 Cary Coutant <ccoutant@google.com>
4818
4819 * archive.cc (Archive::include_member): Adjust call to
4820 report_object.
4821 (Add_archive_symbols::run): Track argument serial numbers.
4822 (Lib_group::include_member): Likewise.
4823 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
4824 * archive.h (Incremental_archive_entry::Archive_member):
4825 Initialize arg_serial_.
4826 (Archive_member::arg_serial_): New data member.
4827 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
4828 (Sized_dynobj::do_add_symbols): Track symbols when doing an
4829 incremental link.
4830 (Sized_dynobj::do_for_all_local_got_entries): New function.
4831 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
4832 function.
4833 * fileread.cc (get_mtime): New function.
4834 * fileread.h (get_mtime): New function.
4835 * gold.cc (queue_initial_tasks): Check for incremental update.
4836 (process_incremental_input): New function.
4837 (queue_middle_tasks): Don't force valid target for incremental
4838 update.
4839 * incremental-dump.cc (find_input_containing_global): Adjust
4840 size of symbol info entry.
4841 (dump_incremental_inputs): Dump argument serial number and
4842 in_system_directory flag; bias shndx by 1; print symbol names
4843 when dumping per-file symbol lists; use new symbol info readers.
4844 * incremental.cc
4845 (Output_section_incremental_inputs:update_data_size): New function.
4846 (Sized_incremental_binary::setup_readers): Setup input readers
4847 for each input file; build maps for files added from libraries
4848 and scripts.
4849 (Sized_incremental_binary::check_input_args): New function.
4850 (Sized_incremental_binary::do_check_inputs): Build map of argument
4851 serial numbers to input arguments.
4852 (Sized_incremental_binary::do_file_has_changed): Rename
4853 do_file_is_unchanged to this; compare file modification times.
4854 (Sized_incremental_binary::do_init_layout): New function.
4855 (Sized_incremental_binary::do_reserve_layout): New function.
4856 (Sized_incremental_binary::do_get_input_reader): Remove.
4857 (Sized_incremental_binary::get_symtab_view): New function.
4858 (Incremental_checker::can_incrementally_link_output_file): Remove.
4859 (Incremental_inputs::report_command_line): Exclude --debug options.
4860 (Incremental_inputs::report_archive_begin): Add parameter; track
4861 argument serial numbers; don't put input file entry for archive
4862 before archive members.
4863 (Incremental_inputs::report_archive_end): Put input file entry
4864 for archive after archive members.
4865 (Incremental_inputs::report_object): Add parameter; track argument
4866 serial numbers and in_system_directory flag.
4867 (Incremental_inputs::report_script): Add parameter; track argument
4868 serial numbers.
4869 (Output_section_incremental_inputs::set_final_data_size): Adjust
4870 size of symbol info entry; check for forwarding symbols.
4871 (Output_section_incremental_inputs::write_input_files): Write
4872 in_system_directory flag and argument serial number.
4873 (Output_section_incremental_inputs::write_info_blocks): Map section
4874 indices between incremental info and original input file; store
4875 input section index for each symbol.
4876 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
4877 change operator() to visit().
4878 (class Global_got_offset_visitor): Likewise.
4879 (class Global_symbol_visitor_got_plt):
4880 (Output_section_incremental_inputs::write_got_plt): Use new visitor
4881 classes.
4882 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
4883 (Sized_incr_relobj::do_read_symbols): New function.
4884 (Sized_incr_relobj::do_layout): New function.
4885 (Sized_incr_relobj::do_layout_deferred_sections): New function.
4886 (Sized_incr_relobj::do_add_symbols): New function.
4887 (Sized_incr_relobj::do_should_include_member): New function.
4888 (Sized_incr_relobj::do_for_all_global_symbols): New function.
4889 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
4890 (Sized_incr_relobj::do_section_size): New function.
4891 (Sized_incr_relobj::do_section_name): New function.
4892 (Sized_incr_relobj::do_section_contents): New function.
4893 (Sized_incr_relobj::do_section_flags): New function.
4894 (Sized_incr_relobj::do_section_entsize): New function.
4895 (Sized_incr_relobj::do_section_address): New function.
4896 (Sized_incr_relobj::do_section_type): New function.
4897 (Sized_incr_relobj::do_section_link): New function.
4898 (Sized_incr_relobj::do_section_info): New function.
4899 (Sized_incr_relobj::do_section_addralign): New function.
4900 (Sized_incr_relobj::do_initialize_xindex): New function.
4901 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
4902 (Sized_incr_relobj::do_read_relocs): New function.
4903 (Sized_incr_relobj::do_gc_process_relocs): New function.
4904 (Sized_incr_relobj::do_scan_relocs): New function.
4905 (Sized_incr_relobj::do_count_local_symbols): New function.
4906 (Sized_incr_relobj::do_finalize_local_symbols): New function.
4907 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
4908 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
4909 (Sized_incr_relobj::do_relocate): New function.
4910 (Sized_incr_relobj::do_set_section_offset): New function.
4911 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
4912 (Sized_incr_dynobj::do_read_symbols): New function.
4913 (Sized_incr_dynobj::do_layout): New function.
4914 (Sized_incr_dynobj::do_add_symbols): New function.
4915 (Sized_incr_dynobj::do_should_include_member): New function.
4916 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
4917 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
4918 (Sized_incr_dynobj::do_section_size): New function.
4919 (Sized_incr_dynobj::do_section_name): New function.
4920 (Sized_incr_dynobj::do_section_contents): New function.
4921 (Sized_incr_dynobj::do_section_flags): New function.
4922 (Sized_incr_dynobj::do_section_entsize): New function.
4923 (Sized_incr_dynobj::do_section_address): New function.
4924 (Sized_incr_dynobj::do_section_type): New function.
4925 (Sized_incr_dynobj::do_section_link): New function.
4926 (Sized_incr_dynobj::do_section_info): New function.
4927 (Sized_incr_dynobj::do_section_addralign): New function.
4928 (Sized_incr_dynobj::do_initialize_xindex): New function.
4929 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
4930 (make_sized_incremental_object): New function.
4931 (Incremental_library::copy_unused_symbols): New function.
4932 (Incremental_library::do_for_all_unused_symbols): New function.
4933 * incremental.h (enum Incremental_input_flags): New type.
4934 (class Incremental_checker): Remove.
4935 (Incremental_input_entry::Incremental_input_entry): Add argument
4936 serial number.
4937 (Incremental_input_entry::arg_serial): New function.
4938 (Incremental_input_entry::set_is_in_system_directory): New function.
4939 (Incremental_input_entry::is_in_system_directory): New function.
4940 (Incremental_input_entry::arg_serial_): New data member.
4941 (Incremental_input_entry::is_in_system_directory_): New data member.
4942 (class Script_info): Move here from script.h.
4943 (Script_info::Script_info): Add filename parameter.
4944 (Script_info::filename): New function.
4945 (Script_info::filename_): New data member.
4946 (Incremental_script_entry::Incremental_script_entry): Add argument
4947 serial number.
4948 (Incremental_object_entry::Incremental_object_entry): Likewise.
4949 (Incremental_object_entry::add_input_section): Build list of input
4950 sections with map to original shndx.
4951 (Incremental_object_entry::get_input_section_index): New function.
4952 (Incremental_object_entry::shndx_): New data member.
4953 (Incremental_object_entry::name_key_): Rename; adjust all refs.
4954 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
4955 (Incremental_archive_entry::Incremental_archive_entry): Add argument
4956 serial number.
4957 (Incremental_inputs::report_archive_begin): Likewise.
4958 (Incremental_inputs::report_object): Likewise.
4959 (Incremental_inputs::report_script): Likewise.
4960 (class Incremental_global_symbol_reader): New class.
4961 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
4962 and store flags and input file type.
4963 (Incremental_input_entry_reader::arg_serial): New function.
4964 (Incremental_input_entry_reader::type): Extract type from flags.
4965 (Incremental_input_entry_reader::is_in_system_directory): New function.
4966 (Incremental_input_entry_reader::get_input_section_count): Call
4967 accessor function for type.
4968 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
4969 function for type; adjust size of global symbol entry.
4970 (Incremental_input_entry_reader::get_global_symbol_count): Call
4971 accessor function for type.
4972 (Incremental_input_entry_reader::get_object_count): Likewise.
4973 (Incremental_input_entry_reader::get_object_offset): Likewise.
4974 (Incremental_input_entry_reader::get_member_count): Likewise.
4975 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
4976 (Incremental_input_entry_reader::get_member_offset): Likewise.
4977 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
4978 (Incremental_input_entry_reader::Global_symbol_info): Remove.
4979 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
4980 (Incremental_input_entry_reader::get_global_symbol_reader): New
4981 function.
4982 (Incremental_input_entry_reader::get_output_symbol_index): New
4983 function.
4984 (Incremental_input_entry_reader::type_): Remove.
4985 (Incremental_input_entry_reader::flags_): New data member.
4986 (Incremental_inputs_reader::input_file_offset): New function.
4987 (Incremental_inputs_reader::input_file_index): New function.
4988 (Incremental_inputs_reader::input_file): Call input_file_offset.
4989 (Incremental_inputs_reader::input_file_at_offset): New function.
4990 (Incremental_relocs_reader::get_r_type): Reformat.
4991 (Incremental_relocs_reader::get_r_shndx): Reformat.
4992 (Incremental_relocs_reader::get_r_offset): Reformat.
4993 (Incremental_relocs_reader::data): New function.
4994 (Incremental_binary::Incremental_binary): Initialize new data members.
4995 (Incremental_binary::check_inputs): Add cmdline parameter.
4996 (Incremental_binary::file_is_unchanged): Remove.
4997 (Input_reader::arg_serial): New function.
4998 (Input_reader::get_unused_symbol_count): New function.
4999 (Input_reader::get_unused_symbol): New function.
5000 (Input_reader::do_arg_serial): New function.
5001 (Input_reader::do_get_unused_symbol_count): New function.
5002 (Input_reader::do_get_unused_symbol): New function.
5003 (Incremental_binary::input_file_count): New function.
5004 (Incremental_binary::get_input_reader): Change signature to use
5005 index instead of filename.
5006 (Incremental_binary::file_has_changed): New function.
5007 (Incremental_binary::get_input_argument): New function.
5008 (Incremental_binary::get_library): New function.
5009 (Incremental_binary::get_script_info): New function.
5010 (Incremental_binary::init_layout): New function.
5011 (Incremental_binary::reserve_layout): New function.
5012 (Incremental_binary::output_file): New function.
5013 (Incremental_binary::do_check_inputs): New function.
5014 (Incremental_binary::do_file_is_unchanged): Remove.
5015 (Incremental_binary::do_file_has_changed): New function.
5016 (Incremental_binary::do_init_layout): New function.
5017 (Incremental_binary::do_reserve_layout): New function.
5018 (Incremental_binary::do_input_file_count): New function.
5019 (Incremental_binary::do_get_input_reader): Change signature.
5020 (Incremental_binary::input_args_map_): New data member.
5021 (Incremental_binary::library_map_): New data member.
5022 (Incremental_binary::script_map_): New data member.
5023 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5024 new data members.
5025 (Sized_incremental_binary::output_section): New function.
5026 (Sized_incremental_binary::inputs_reader): Add const.
5027 (Sized_incremental_binary::symtab_reader): Add const.
5028 (Sized_incremental_binary::relocs_reader): Add const.
5029 (Sized_incremental_binary::got_plt_reader): Add const.
5030 (Sized_incremental_binary::get_symtab_view): New function.
5031 (Sized_incremental_binary::Inputs_reader): New typedef.
5032 (Sized_incremental_binary::Input_entry_reader): New typedef.
5033 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5034 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5035 (Sized_incremental_binary::do_file_has_changed): New function.
5036 (Sized_incremental_binary::do_init_layout): New function.
5037 (Sized_incremental_binary::do_reserve_layout): New function.
5038 (Sized_input_reader::Inputs_reader): Remove.
5039 (Sized_input_reader::Input_entry_reader): Remove.
5040 (Sized_input_reader::do_arg_serial): New function.
5041 (Sized_input_reader::do_get_unused_symbol_count): New function.
5042 (Sized_input_reader::do_get_unused_symbol): New function.
5043 (Sized_incremental_binary::do_input_file_count): New function.
5044 (Sized_incremental_binary::do_get_input_reader): Change signature;
5045 use index instead of filename.
5046 (Sized_incremental_binary::section_map_): New data member.
5047 (Sized_incremental_binary::input_entry_readers_): New data member.
5048 (class Sized_incr_relobj): New class.
5049 (class Sized_incr_dynobj): New class.
5050 (make_sized_incremental_object): New function.
5051 (class Incremental_library): New class.
5052 * layout.cc (Free_list::num_lists): New static data member.
5053 (Free_list::num_nodes): New static data member.
5054 (Free_list::num_removes): New static data member.
5055 (Free_list::num_remove_visits): New static data member.
5056 (Free_list::num_allocates): New static data member.
5057 (Free_list::num_allocate_visits): New static data member.
5058 (Free_list::init): New function.
5059 (Free_list::remove): New function.
5060 (Free_list::allocate): New function.
5061 (Free_list::dump): New function.
5062 (Free_list::print_stats): New function.
5063 (Layout_task_runner::run): Resize output file for incremental updates.
5064 (Layout::Layout): Initialize new data members.
5065 (Layout::set_incremental_base): New function.
5066 (Layout::init_fixed_output_section): New function.
5067 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5068 incremental updates.
5069 (Layout::create_gold_note): Do not create gold note section for
5070 incremental updates.
5071 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5072 for incremental updates.
5073 (Layout::set_section_offsets): For incremental updates, allocate space
5074 from free list.
5075 (Layout::create_symtab_sections): Layout with offsets relative to
5076 start of section; for incremental updates, allocate space from free
5077 list.
5078 (Layout::create_shdrs): For incremental updates, allocate space from
5079 free list.
5080 (Layout::finish_dynamic_section): For incremental updates, do not
5081 check --as-needed (fixed in subsequent patch).
5082 * layout.h (class Free_list): New class.
5083 (Layout::set_incremental_base): New function.
5084 (Layout::incremental_base): New function.
5085 (Layout::init_fixed_output_section): New function.
5086 (Layout::allocate): New function.
5087 (Layout::incremental_base_): New data member.
5088 (Layout::free_list_): New data member.
5089 * main.cc (main): Print Free_list statistics.
5090 * object.cc (Relobj::finalize_incremental_relocs): Add
5091 clear_counts parameter; clear counts only when clear_counts is set.
5092 (Sized_relobj::Sized_relobj): Initialize new base class.
5093 (Sized_relobj::do_layout): Don't report special sections.
5094 (Sized_relobj::do_for_all_local_got_entries): New function.
5095 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
5096 symtab_off to all symbol table offsets.
5097 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
5098 * object.h (class Got_offset_list): Move to top of file.
5099 (Object::Object): Allow case where input_file == NULL.
5100 (Object::~Object): Likewise.
5101 (Object::input_file): Assert that input_file != NULL.
5102 (Object::lock): Allow case where input_file == NULL.
5103 (Object::unlock): Likewise.
5104 (Object::is_locked): Likewise.
5105 (Object::token): Likewise.
5106 (Object::release): Likewise.
5107 (Object::is_incremental): New function.
5108 (Object::get_mtime): New function.
5109 (Object::for_all_local_got_entries): New function.
5110 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
5111 (Object::set_is_in_system_directory): New function.
5112 (Object::is_in_system_directory): New function.
5113 (Object::do_is_incremental): New function.
5114 (Object::do_get_mtime): New function.
5115 (Object::do_for_all_local_got_entries): New function.
5116 (Object::is_in_system_directory_): New data member.
5117 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
5118 (class Sized_relobj_base): New class.
5119 (class Sized_relobj): Derive from Sized_relobj_base.
5120 (class Sized_relobj::Symbols): Redeclare from base class.
5121 (class Sized_relobj::local_got_offset_list): Remove.
5122 (class Sized_relobj::Output_sections): Redeclare from base class.
5123 (class Sized_relobj::do_for_all_local_got_entries): New function.
5124 (class Sized_relobj::write_local_symbols): Add offset parameter.
5125 (class Sized_relobj::local_symbol_offset_): Update comment.
5126 (class Sized_relobj::local_dynsym_offset_): Update comment.
5127 * options.cc (Input_arguments::add_file): Remove const.
5128 * options.h (Input_file_argument::Input_file_argument):
5129 Initialize arg_serial_ (all constructors).
5130 (Input_file_argument::set_arg_serial): New function.
5131 (Input_file_argument::arg_serial): New function.
5132 (Input_file_argument::arg_serial_): New data member.
5133 (Input_arguments::Input_arguments): Initialize file_count_.
5134 (Input_arguments::add_file): Remove const.
5135 (Input_arguments::number_of_input_files): New function.
5136 (Input_arguments::file_count_): New data member.
5137 (Command_line::number_of_input_files): Call
5138 Input_arguments::number_of_input_files.
5139 * output.cc (Output_segment_headers::Output_segment_headers):
5140 Set current size.
5141 (Output_section::Input_section::current_data_size): New function.
5142 (Output_section::Output_section): Initialize new data members.
5143 (Output_section::add_input_section): Don't do merge sections for
5144 an incremental link; allocate space from free list for an
5145 incremental update.
5146 (Output_section::add_output_section_data): Allocate space from
5147 free list for an incremental update.
5148 (Output_section::update_data_size): New function.
5149 (Output_section::set_fixed_layout): New function.
5150 (Output_section::reserve): New function.
5151 (Output_segment::set_section_addresses): Remove const.
5152 (Output_segment::set_section_list_addresses): Remove const; allocate
5153 space from free list for an incremental update.
5154 (Output_segment::set_offset): Adjust size of RELRO segment for an
5155 incremental update.
5156 * output.h (Output_data::current_data_size): Move here from
5157 child classes.
5158 (Output_data::pre_finalize_data_size): New function.
5159 (Output_data::update_data_size): New function.
5160 (Output_section_headers::update_data_size): new function.
5161 (Output_section_data_build::current_data_size): Move to Output_data.
5162 (Output_data_strtab::update_data_size): New function.
5163 (Output_section::current_data_size): Move to Output_data.
5164 (Output_section::set_fixed_layout): New function.
5165 (Output_section::has_fixed_layout): New function.
5166 (Output_section::reserve): New function.
5167 (Output_section::update_data_size): New function.
5168 (Output_section::has_fixed_layout_): New data member.
5169 (Output_section::free_list_): New data member.
5170 (Output_segment::set_section_addresses): Remove const.
5171 (Output_segment::set_section_list_addresses): Remove const.
5172 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
5173 New function.
5174 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
5175 New function.
5176 * readsyms.cc (Read_symbols::do_read_symbols): Add library
5177 parameter when calling Add_symbols constructor; store argument
5178 serial number for members of a lib group.
5179 (Add_symbols::locks): Allow case where token == NULL.
5180 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
5181 (Read_member::~Read_member): New function.
5182 (Read_member::is_runnable): New function.
5183 (Read_member::locks): New function.
5184 (Read_member::run): New function.
5185 (Check_script::~Check_script): New function.
5186 (Check_script::is_runnable): New function.
5187 (Check_script::locks): New function.
5188 (Check_script::run): New function.
5189 (Check_library::~Check_library): New function.
5190 (Check_library::is_runnable): New function.
5191 (Check_library::locks): New function.
5192 (Check_library::run): New function.
5193 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
5194 (Add_symbols::library_): New data member.
5195 (class Read_member): New class.
5196 (class Check_script): New class.
5197 (class Check_library): New class.
5198 * reloc.cc (Read_relocs::is_runnable): Allow case where
5199 token == NULL.
5200 (Read_relocs::locks): Likewise.
5201 (Scan_relocs::locks): Likewise.
5202 (Relocate_task::locks): Likewise.
5203 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
5204 to clear counters.
5205 (Sized_relobj::incremental_relocs_scan): Fix comment.
5206 (Sized_relobj::do_relocate): Pass output file offset to
5207 write_local_symbols.
5208 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
5209 from class declaration.
5210 * script.cc (read_input_script): Allocate Script_info; pass
5211 argument serial number to report_script.
5212 * script.h (class Script_info): Move to incremental.h.
5213 * symtab.cc (Symbol_table::add_from_incrobj): New function.
5214 * symtab.h (Symbol_table::add_from_incrobj): New function.
5215 (Symbol_table::set_file_offset): New function.
5216
b961d0d7
CC
52172011-04-05 Cary Coutant <ccoutant@google.com>
5218
5219 * incremental-dump.cc (dump_incremental_inputs): Change signature
5220 to take a Sized_incremental_binary; change caller. Use readers
5221 in Sized_incremental_binary.
5222 * incremental.cc
5223 (Sized_incremental_binary::find_incremental_inputs_sections):
5224 Rename do_find_incremental_inputs_sections to this.
5225 (Sized_incremental_binary::setup_readers): New function.
5226 (Sized_incremental_binary::do_check_inputs): Check
5227 has_incremental_info_ flag; move setup code to setup_readers;
5228 use input readers.
5229 (Sized_incremental_binary::do_file_is_unchanged): New function.
5230 (Sized_incremental_binary::do_get_input_reader): New function.
5231 * incremental.h (class Incremental_binary): Move to end of file.
5232 (Incremental_binary::file_is_unchanged): New function.
5233 (Incremental_binary::do_file_is_unchanged): New function.
5234 (Incremental_binary::Input_reader): New class.
5235 (Incremental_binary::get_input_reader): New function.
5236 (class Sized_incremental_binary): Move to end of file.
5237 (Sized_incremental_binary::Sized_incremental_binary): Setup the
5238 input section reader classes.
5239 (Sized_incremental_binary::has_incremental_info): New function.
5240 (Sized_incremental_binary::inputs_reader): New function.
5241 (Sized_incremental_binary::symtab_reader): New function.
5242 (Sized_incremental_binary::relocs_reader): New function.
5243 (Sized_incremental_binary::got_plt_reader): New function.
5244 (Sized_incremental_binary::do_file_is_unchanged): New function.
5245 (Sized_incremental_binary::Sized_input_reader): New class.
5246 (Sized_incremental_binary::get_input_reader): New function.
5247 (Sized_incremental_binary::find_incremental_inputs_sections):
5248 Rename do_find_incremental_inputs_sections to this.
5249 (Sized_incremental_binary::setup_readers): New function.
5250 (Sized_incremental_binary::has_incremental_info_): New data member.
5251 (Sized_incremental_binary::inputs_reader_): New data member.
5252 (Sized_incremental_binary::symtab_reader_): New data member.
5253 (Sized_incremental_binary::relocs_reader_): New data member.
5254 (Sized_incremental_binary::got_plt_reader_): New data member.
5255 (Sized_incremental_binary::current_input_file_): New data member.
5256
a869183f
PP
52572011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
5258
5259 PR gold/12640
5260 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
5261 violation.
5262
52632011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
5264
5265 * archive.cc (Archive::include_member): Adjust call to report_object.
5266 (Add_archive_symbols::run): Add script_info to call to
5267 report_archive_begin.
5268 (Lib_group::include_member): Adjust call to report_object.
5269 (Add_lib_group_symbols::run): Adjust call to report_object.
5270 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
5271 blocks. Add object count for script input files.
5272 * incremental.cc (Incremental_inputs::report_archive_begin): Add
5273 script_info parameter; change all callers.
5274 (Incremental_inputs::report_object): Add script_info parameter;
5275 change all callers.
5276 (Incremental_inputs::report_script): Store backpointer to
5277 incremental info entry.
5278 (Output_section_incremental_inputs::set_final_data_size): Record
5279 additional information for scripts.
5280 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5281 * incremental.h (Incremental_script_entry::add_object): New function.
5282 (Incremental_script_entry::get_object_count): New function.
5283 (Incremental_script_entry::get_object): New function.
5284 (Incremental_script_entry::objects_): New data member; adjust
5285 constructor.
5286 (Incremental_inputs::report_archive_begin): Add script_info parameter.
5287 (Incremental_inputs::report_object): Add script_info parameter.
5288 (Incremental_inputs_reader::get_object_count): New function.
5289 (Incremental_inputs_reader::get_object_offset): New function.
5290 * options.cc (Input_arguments::add_file): Return reference to
5291 new input argument.
5292 * options.h (Input_argument::set_script_info): New function.
5293 (Input_argument::script_info): New function.
5294 (Input_argument::script_info_): New data member; adjust all
5295 constructors.
5296 (Input_file_group::add_file): Return reference to new input argument.
5297 (Input_file_lib::add_file): Likewise.
5298 (Input_arguments::add_file): Likewise.
5299 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
5300 * script.cc (Parser_closure::Parser_closure): Add script_info
5301 parameter; adjust all callers.
5302 (Parser_closure::script_info): New function.
5303 (Parser_closure::script_info_): New data member.
5304 (read_input_script): Report scripts earlier to incremental info.
5305 (script_add_file): Set script_info in Input_argument.
5306 (script_add_library): Likewise.
5307 * script.h (Script_options::Script_info): Rewrite class.
5308
a869183f 53092011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
5310
5311 * archive.cc (Library_base::should_include_member): Move
5312 method here from class Archive.
5313 (Archive::Archive): Initialize base class.
5314 (Archive::should_include_member): Move to base class.
5315 (Archive::do_for_all_unused_symbols): New function.
5316 (Add_archive_symbols::run): Remove redundant access to
5317 incremental_inputs.
5318 (Lib_group::Lib_group): Initialize base class.
5319 (Lib_group::do_filename): New function.
5320 (Lib_group::include_member): Pass pointer to Lib_group to
5321 report_object.
5322 (Lib_group::do_for_all_unused_symbols): New function.
5323 (Add_lib_group_symbols::run): Report archive information for
5324 incremental links.
5325 * archive.h (class Library_base): New base class.
5326 (class Archive): Derive from Library_base.
5327 (Archive::filename): Move to base class.
5328 (Archive::set_incremental_info): Likewise.
5329 (Archive::incremental_info): Likewise.
5330 (Archive::Should_include): Likewise.
5331 (Archive::should_include_member): Likewise.
5332 (Archive::Armap_entry): Remove.
5333 (Archive::Unused_symbol_iterator): Remove.
5334 (Archive::unused_symbols_begin): Remove.
5335 (Archive::unused_symbols_end): Remove.
5336 (Archive::do_filename): New function.
5337 (Archive::do_get_mtime): New function.
5338 (Archive::do_for_all_unused_symbols): New function.
5339 (Archive::task_): Move to base class.
5340 (Archive::incremental_info_): Likewise.
5341 (class Lib_group): Derive from Library_base.
5342 (Lib_group::do_filename): New function.
5343 (Lib_group::do_get_mtime): New function.
5344 (Lib_group::do_for_all_unused_symbols): New function.
5345 (Lib_group::task_): Move to base class.
5346 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
5347 function.
5348 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
5349 function.
5350 * incremental.cc (Incremental_inputs::report_archive_begin):
5351 Use Library_base; call library's get_mtime; add incremental inputs
5352 entry before members.
5353 (class Unused_symbol_visitor): New class.
5354 (Incremental_inputs::report_archive_end): Use Library_base; use
5355 visitor class to record unused symbols; don't add incremental inputs
5356 entry after members.
5357 (Incremental_inputs::report_object): Use Library_base.
5358 * incremental.h
5359 (Incremental_archive_entry::Incremental_archive_entry): Remove
5360 unused Archive parameter.
5361 (Incremental_inputs::report_archive_begin): Use Library_base.
5362 (Incremental_inputs::report_archive_end): Likewise.
5363 (Incremental_inputs::report_object): Likewise.
5364 * object.cc (Sized_relobj::do_for_all_global_symbols): New
5365 function.
5366 * object.h (Object::for_all_global_symbols): New function.
5367 (Object::do_for_all_global_symbols): New function.
5368 (Sized_relobj::do_for_all_global_symbols): New function.
5369 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
5370 function.
5371 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
5372 function.
5373
61ab3e40
ILT
53742011-03-27 Ian Lance Taylor <iant@google.com>
5375
5376 * archive.cc (Archive::interpret_header): Return -1 if something
5377 goes wrong. Change callers accordingly.
5378
30e1f9e6
CC
53792011-03-25 Cary Coutant <ccoutant@google.com>
5380
5381 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
5382 * testsuite/Makefile.in: Regenerate.
5383
9370ce59 53842011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
5385
5386 * plugin.cc (get_view): New.
5387 (Plugin::load): Pass get_view to the plugin.
5388 (Plugin_manager::get_view): New.
5389
9312bb0a
ILT
53902011-03-21 Ian Lance Taylor <iant@google.com>
5391
5392 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 5393 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 5394
7e12ba9e
ST
53952011-03-21 Sriraman Tallam <tmsriram@google.com>
5396
5397 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
5398 Change == to -eq.
5399 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
5400 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
5401 Change == to -eq.
5402 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
5403 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
5404
fd7a005d
ILT
54052011-03-14 Ian Lance Taylor <iant@google.com>
5406
5407 * script-sections.cc (Sort_output_sections::script_compare):
5408 Rename from is_before, change return type.
5409 (Sort_output_sections::operator()): Adjust accordingly.
5410
ed16fd1b
ILT
54112011-03-11 Jeffrey Yasskin <jyasskin@google.com>
5412
5413 PR gold/12572
5414 * testsuite/odr_violation2.cc: Add comment to make all error line
5415 numbers double digits.
5416 * testsuite/debug_msg.sh: Adjust expected errors.
5417
71ff8986
ILT
54182011-03-09 Jeffrey Yasskin <jyasskin@google.com>
5419
5420 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
5421 but mark earlier ones as non-canonical
5422 (offset_to_iterator): Update search target and example
5423 (do_addr2line): Return extra lines in a vector*
5424 (format_file_lineno): Extract from do_addr2line
5425 (one_addr2line): Add vector* out-param
5426 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
5427 when a lineno entry appeared last for its instruction
5428 (Dwarf_line_info): Add vector* out-param
5429 * object.cc (Relocate_info): Pass NULL for the vector* out-param
5430 * symtab.cc (Odr_violation_compare): Include the lineno in the
5431 comparison again.
5432 (linenos_from_loc): New. Combine the canonical line for an
5433 address with its other lines.
5434 (True_if_intersect): New. Helper functor to make
5435 std::set_intersection a query.
5436 (detect_odr_violations): Compare sets of lines instead of just
5437 one line for each function. This became less deterministic, but
5438 has fewer false positives.
5439 * symtab.h: Declarations.
5440 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
5441 mix an optimized and non-optimized object in the same binary
5442 (odr_violation2.so): Same.
5443 * testsuite/Makefile.in: Regenerate from Makefile.am.
5444 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
5445 * testsuite/debug_msg.sh: Update line numbers and add
5446 assertions.
5447 * testsuite/odr_violation1.cc: Use OdrDerived, in a
5448 non-optimized context.
5449 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
5450 isn't inlined, and use OdrDerived in an optimized context.
5451 * testsuite/odr_header1.h: Defines OdrDerived, where
5452 optimization will change the
5453 first-instruction-in-the-destructor's file and line number.
5454 * testsuite/odr_header2.h: Defines OdrBase.
5455
a19fefdc
ILT
54562011-03-09 Ian Lance Taylor <iant@google.com>
5457
5458 * fileread.cc (File_read::clear_views): Don't delete the whole
5459 file view.
5460
ecb351e9
ILT
54612011-03-08 Ian Lance Taylor <iant@google.com>
5462
5463 PR gold/12525
5464 * fileread.cc: #include <climits>.
5465 (GOLD_IOV_MAX): Define.
5466 (File_read::read_multiple): Limit number of entries by iov_max.
5467 * fileread.h (class File_read): Always set max_readv_entries to
5468 128.
5469
b821d13c
ILT
54702011-03-07 Ian Lance Taylor <iant@google.com>
5471
5472 PR gold/12525
5473 * options.h (class General_options): Add -dy and -dn.
5474
89243142
CC
54752011-03-02 Cary Coutant <ccoutant@google.com>
5476
5477 * testsuite/script_test_9.t: Add TLS segment.
5478
d0773f31
ILT
54792011-03-02 Simon Baldwin <simonb@google.com>
5480
5481 * configure.ac: Add check for gnu_indirect_function support in
5482 the toolchain building binutils.
5483 * configure: Rebuild.
5484
9370ce59 54852011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
5486
5487 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
5488 plugin only symbols.
5489 (Symbol_table::sized_finalize_symbol) Mark symbol only present
5490 in plugin files as not needed in the symbol table.
5491
4cf7a849
ST
54922011-02-11 Sriraman Tallam <tmsriram@google.com>
5493
5494 * output.cc (Output_section::add_input_section): Delay fill
5495 generation for section ordering.
5496
b578bd7d
ILT
54972011-02-09 Ian Lance Taylor <iant@google.com>
5498
5499 PR gold/12316
5500 * object.h (class Sized_relobj): Remove clear_local_symbols.
5501 * reloc.cc (Sized_relobj::do_relocate): Don't call
5502 clear_local_symbols.
5503
9370ce59 55042011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
5505
5506 * plugin.cc (is_visible_from_outside): Return true for symbols
5507 in the -u option.
5508
55382fb7
ILT
55092011-02-04 Jeffrey Yasskin <jyasskin@google.com>
5510
5511 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
5512 filename.
5513
4e271fff
ST
55142011-02-02 Sriraman Tallam <tmsriram@google.com>
5515
5516 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 5517 to std::string.
4e271fff 5518 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 5519 section_name to be std::string.
4e271fff
ST
5520 (is_function_ctor_or_dtor): Change type of parameter to std::string.
5521
d433c3ac
ILT
55222011-01-25 Ian Lance Taylor <iant@google.com>
5523
5524 * script.cc (script_add_extern): Rewrite to use
5525 add_symbol_reference.
5526
880473a6
DK
55272011-01-25 Doug Kwan <dougkwan@google.com>
5528
d433c3ac 5529 * icf.cc (get_section_contents): Always lock section's object.
880473a6 5530
f30f86fa
ILT
55312011-01-24 Ian Lance Taylor <iant@google.com>
5532
5533 * options.h (class General_options): Accept
5534 --no-detect-odr-violations.
5535
8e51a0b9
ILT
55362011-01-24 Ian Lance Taylor <iant@google.com>
5537
5538 * version.cc (version_string): Bump to 1.11.
5539
0f3b89d8
ILT
55402011-01-24 Ian Lance Taylor <iant@google.com>
5541
5542 * plugin.cc (class Plugin_rescan): Define new class.
5543 (Plugin_manager::claim_file): Set any_claimed_.
5544 (Plugin_manager::save_archive): New function.
5545 (Plugin_manager::save_input_group): New function.
5546 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
5547 necessary.
5548 (Plugin_manager::new_undefined_symbol): New function.
5549 (Plugin_manager::rescan): New function.
5550 (Plugin_manager::rescannable_defines): New function.
5551 (Plugin_manager::add_input_file): Set any_added_.
5552 * plugin.h (class Plugin_manager): define new fields rescannable_,
5553 undefined_symbols_, any_claimed_, and any_added_. Declare
5554 Plugin_rescan as friend. Declare new functions.
5555 (Plugin_manager::Rescannable): Define type.
5556 (Plugin_manager::Rescannable_list): Define type.
5557 (Plugin_manager::Undefined_symbol_list): Define type.
5558 (Plugin_manager::Plugin_manager): Initialize new fields.
5559 * archive.cc (Archive::defines_symbol): New function.
5560 (Add_archive_symbols::run): Pass archive to plugins if any.
5561 * archive.h (class Archive): Declare defines_symbol.
5562 * readsyms.cc (Input_group::~Input_group): New function.
5563 (Finish_group::run): Pass input_group to plugins if any.
5564 * readsyms.h (class Input_group): Declare destructor.
5565 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
5566 any.
5567
3bb951e5
ILT
55682011-01-10 Ian Lance Taylor <iant@google.com>
5569
5570 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
5571 section as relro.
5572 (Layout::set_segment_offsets): Reset increase_relro before calling
5573 set_section_addresses a second time.
5574
0aa45fac
CC
55752011-01-04 Cary Coutant <ccoutant@google.com>
5576
5577 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
5578 sections before NOBITS sections.
5579
0db46eb4
L
55802011-01-01 H.J. Lu <hongjiu.lu@intel.com>
5581
5582 * version.cc (print_version): Update copyright to 2011.
5583
829c9745
CC
55842010-12-23 Cary Coutant <ccoutant@google.com>
5585
5586 * output.h (Output_data_reloc::add_output_section): Pass OD instead
5587 of OS to this->add. Add OD parameter to second form of the function.
5588
7500420b
ILT
55892010-12-20 Ian Lance Taylor <iant@google.com>
5590
5591 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
5592 second of two consecutive entries with same offset.
5593
f8e9a930
RW
55942010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5595
5596 * testsuite/Makefile.am (ifuncmain2static_LDADD)
5597 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
5598 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
5599 to avoid unneeded links against $(LDADD).
5600 * testsuite/Makefile.in: Regenerate.
5601
2fbb4320
ILT
56022010-12-15 Ian Lance Taylor <iant@google.com>
5603
5604 PR gold/12324
5605 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
5606 for R_X86_64_32 and R_X86_64_PC32.
5607 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
5608 ver_matching_def_pic.o.
5609 (ver_matching_def_pic.o): New target.
5610
fedb228d
RW
56112010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5612
5613 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
5614 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
5615 Move definition before File_read::View member definitions.
5616 (File_read::View::~View): Initialize and hold lock before
5617 updating current_mapped_bytes.
5618
9b547ce6
RW
56192010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5620
5621 * dwarf_reader.cc: Remove outdated comment.
5622 * gold-threads.cc: Fix typo in error message.
5623 * archive.cc: Fix typos in comments.
5624 * archive.h: Likewise.
5625 * arm-reloc-property.cc: Likewise.
5626 * arm-reloc-property.h: Likewise.
5627 * arm-reloc.def: Likewise.
5628 * arm.cc: Likewise.
5629 * attributes.h: Likewise.
5630 * cref.cc: Likewise.
5631 * ehframe.cc: Likewise.
5632 * fileread.h: Likewise.
5633 * gold.h: Likewise.
5634 * i386.cc: Likewise.
5635 * icf.cc: Likewise.
5636 * incremental.h: Likewise.
5637 * int_encoding.cc: Likewise.
5638 * layout.h: Likewise.
5639 * main.cc: Likewise.
5640 * merge.h: Likewise.
5641 * object.cc: Likewise.
5642 * object.h: Likewise.
5643 * options.cc: Likewise.
5644 * readsyms.cc: Likewise.
5645 * reduced_debug_output.cc: Likewise.
5646 * reloc.cc: Likewise.
5647 * script-sections.cc: Likewise.
5648 * sparc.cc: Likewise.
5649 * symtab.h: Likewise.
5650 * target-reloc.h: Likewise.
5651 * target.cc: Likewise.
5652 * target.h: Likewise.
5653 * timer.cc: Likewise.
5654 * timer.h: Likewise.
5655 * x86_64.cc: Likewise.
5656
83e17bd5
CC
56572010-12-09 Cary Coutant <ccoutant@google.com>
5658
5659 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
5660 stack.
5661 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
5662 parameter; change all callers.
5663 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
5664 * options.h (warn_execstack): New option.
5665
017257f8
DK
56662010-12-07 Doug Kwan <dougkwan@google.com>
5667
5668 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
5669 like function call relocations.
5670
c20cbc06
ILT
56712010-12-07 Ian Lance Taylor <iant@google.com>
5672
5673 * archive.cc (Archive::get_elf_object_for_member): Permit
5674 punconfigured to be NULL.
5675 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
5676 (Archive::include_member): Pass NULL to get_elf_object_for_member
5677 if we searched for the archive and this is the first included
5678 object.
5679
4dbfafcc
ILT
56802010-12-01 Ian Lance Taylor <iant@google.com>
5681
5682 * dwarf_reader.h (class Sized_dwarf_line_info): Add
5683 track_relocs_type_ field.
5684 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5685 Set track_relocs_type_.
5686 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
5687 contents when using RELA relocs.
5688 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
5689 reloc_map_.
5690 * reloc.cc (Track_relocs::next_addend): New function.
5691 * reloc.h (class Track_relocs): Declare next_addend.
5692
e5e19edd
ILT
56932010-12-01 Ian Lance Taylor <iant@google.com>
5694
5695 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
5696 virtual destructor.
5697
9a5ce24c
ILT
56982010-12-01 Ian Lance Taylor <iant@google.com>
5699
5700 * README: Update compilers known to work and fail.
5701
c7791212
NC
57022010-11-23 Matthias Klose <doko@ubuntu.com>
5703
5704 * configure.in: For --enable-gold, handle value `default' instead of
5705 `both*'. Always install ld as ld.bfd, install as ld if gold is
5706 not the default.
5707 * configure: Regenerate.
5708
0ad220c9
DK
57092010-11-18 Doug Kwan <dougkwan@google.com>
5710
5711 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
5712 and right_alignment to be zero. Store result alignment only if it is
5713 greater than existing alignment.
5714
ab8056e0
CC
57152010-11-16 Cary Coutant <ccoutant@google.com>
5716
5717 PR gold/12220
5718 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5719 Check for ".zdebug_line".
5720
fd064a5b
CC
57212010-11-16 Doug Kwan <dougkwan@google.com>
5722 Cary Coutant <ccoutant@google.com>
5723
5724 * output.h (Output_segment::set_section_addresses): Pass increase_relro
5725 by reference; adjust all callers.
5726 * output.cc (Output_segment::set_section_addresses): Adjust references
5727 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
5728 list is empty.
5729 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
5730 end at page boundary.
5731
6fc6ea19
CC
57322010-11-16 Cary Coutant <ccoutant@google.com>
5733
5734 PR gold/12220
5735 * layout.cc (Layout::choose_output_section): Transform names of
5736 compressed sections even when using a script with a SECTIONS clause.
5737 (Layout::output_section_name): Remove code to transform
5738 compressed debug section names.
5739 * output.cc (Output_section::add_input_section): Use uncompressed
5740 section size when tracking input sections.
5741
95a2c8d6
RS
57422010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
5743
5744 * symtab.h (Symbol::NON_PIC_REF): Remove.
5745 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
5746 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
5747 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
5748 (Symbol::use_plt_offset): Take a flags argument and pass it
5749 directly to needs_dynamic_reloc. Restrict check for undefined
5750 weak symbols to function calls.
5751 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
5752 (Target_arm::Scan::global): Use it.
5753 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
5754 (Target_arm::Relocate::relocate): Likewise.
5755 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
5756 parameter with an r_type parameter. Use get_reference_flags
5757 to get the flags.
5758 (Target_arm::Relocate::relocate): Update accordingly.
5759 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
5760 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
5761 (Target_i386::Scan::global): Likewise.
5762 (Target_i386::Relocate::relocate): Likewise.
5763 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
5764 parameter with an r_type parameter. Use get_reference_flags
5765 to get the flags.
5766 (Target_i386::Relocate::relocate): Update accordingly.
5767 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
5768 (Target_powerpc::Scan::global): Use it.
5769 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
5770 (Target_powerpc::Relocate::relocate): Likewise.
5771 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
5772 (Target_sparc::Scan::global): Use it.
5773 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
5774 (Target_sparc::Relocate::relocate): Likewise.
5775 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
5776 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
5777 (Target_x86_64::Scan::global): Likewise.
5778 (Target_x86_64::Relocate::relocate): Likewise.
5779
f625ae50
DK
57802010-11-08 Doug Kwan <dougkwan@google.com>
5781 Cary Coutant <ccoutant@google.com>
5782
5783 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
5784 (Arm_exidx_merge_section::section_contents_): New data member.
5785 (Arm_input_section::Arm_input_section): Initialize original_contents_.
5786 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 5787 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
5788 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
5789 in parameters instead of calling Object::section_contents without
5790 locking.
5791 (Arm_output_section::group_section): New parameter TASK. Pass it
5792 to callees that need locking objects.
5793 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
5794 to lock EXIDX input sections. Fix a formatting issue. Call
5795 Arm_exidx_merged_section::build_contents to create merged section
5796 contents.
5797 (Arm_output_section::create_stub_group): New parameter TASK. Use it
5798 to lock object of stub table owner.
5799 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
5800 TEXT_SIZE to initialize data member TEXT_SIZE_.
5801 (Arm_exidx_input_section::addralign): Fix typo in comment.
5802 (Arm_exidx_input_section::text_size): New method.
5803 (Target_arm::do_relax): New parameter TASK. Pass it to callees
5804 that require locking objects. Lock objects before scanning for stubs
5805 and updating local symbols.
5806 (Arm_input_section<big_endian>::init): Copy contents of original
5807 input section.
2e702c99 5808 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
5809 original input section instead of calling Object::section_contents
5810 without locking.
5811 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
5812 size without calling Object::section_size().
5813 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
5814 for size. Allocate a buffer for merged EXIDX entries.
5815 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 5816 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
5817 building code to Arm_exidx_merged_section::build_contetns. Write
5818 out contetns in buffer instead of building it on the fly.
5819 (Arm_relobj::make_exidx_input_section): Also pass text section size
5820 to Arm_exidx_input_section constructor.
5821 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
5822 (Arm_dynobj::do_read_symbols): Fix memory leak.
5823 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
5824 * target.h: (class Task): Add forward declaration.
5825 (Target::relax): Add new parameter TASK and pass it to
5826 Target::do_relax().
5827 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
5828
5f9bcf58
CC
58292010-11-05 Cary Coutant <ccoutant@google.com>
5830
5831 PR gold/10708
5832 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
5833 object when reading from the file.
5834 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
5835 second layout pass.
5836 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
5837 when reading section contents.
5838 (get_section_contents): Likewise.
5839 (icf::find_identical_sections): Likewise.
5840 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
5841 object when reading from the file.
5842 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
5843 the object when doing deferred section layout.
5844
e597fa08
NC
58452010-11-03 Nick Clifton <nickc@redhat.com>
5846
5847 PR gold/12001
5848 * script.h (class Symbol_assignment: name): New member. Returns
5849 the name of the symbol.
5850 * scrfipt.cc (Script_options::is_pending_assignment): New member.
5851 Returns true if the given symbol name is on the list of
5852 assignments wating to be processed.
5853 * archive.cc (should_incldue_member): If the symbol is undefined,
5854 check to see if it is on the list of symbols pending assignment.
5855
3f9a3278
ILT
58562010-11-03 Ryan Mansfield <rmansfield@qnx.com>
5857
5858 * script-sections.cc (Script_sections::find_memory_region): Check
5859 for a NULL output section pointer.
5860
d06fb4d1
DK
58612010-10-29 Doug Kwan <dougkwan@google.com>
5862
5863 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
5864 Output_section::add_relaxed_input_section.
5865 * output.cc (Output_section::add_relaxed_input_section): Add new
5866 arguments LAYOUT and NAME. Set section order index.
5867 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5868 Copy section order index.
5869 * output.h (Output_section::add_relaxed_input_section): Add new
5870 arguments LAYOUT and NAME.
5871
90e24de5
ILT
58722010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5873
5874 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 5875 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
5876 * testsuite/Makefile.in: Regenerate.
5877
c9484ea5
DK
58782010-10-20 Doug Kwan <dougkwan@google.com>
5879
5880 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
5881 without SHF_LINK_ORDER flags.
5882 * layout.cc (Layout::choose_output_section): Do not filter
5883 SHF_LINK_ORDER flag in a relocatable link.
5884
5bc2f5be
CC
58852010-10-17 Cary Coutant <ccoutant@google.com>
5886
5887 * output.h (Output_segment::set_section_addresses): Change function
5888 signature. Update all callers.
5889 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
5890 sections.
5891 (Output_segment::set_section_addresses): Align after last TLS
5892 section. Add padding before last relro section instead of after.
5893
0c91cf04
DK
58942010-10-17 Doug Kwan <dougkwan@google.com>
5895
5896 * gold/arm.cc (Target_arm::got_section): Use correct order and set
5897 GOT output section to be writable.
5898
8c21d9d3
CC
58992010-10-14 Cary Coutant <ccoutant@google.com>
5900
5901 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
5902 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
5903 * gold.cc (queue_initial_tasks): Check parameters for incremental link
5904 mode.
5905 * incremental.cc (report_command_line): Ignore all forms of
5906 --incremental.
5907 * layout.cc (Layout::Layout): Check parameters for incremental link
5908 mode.
5909 * options.cc (General_options::parse_incremental): New function.
5910 (General_options::parse_no_incremental): New function.
5911 (General_options::parse_incremental_full): New function.
5912 (General_options::parse_incremental_update): New function.
5913 (General_options::incremental_mode_): New data member.
5914 (General_options::finalize): Check incremental_mode_.
5915 * options.h (General_options): Update help text for --incremental.
5916 Add --no-incremental, --incremental-full, --incremental-update.
5917 (General_options::Incremental_mode): New enum type.
5918 (General_options::incremental_mode): New function.
5919 (General_options::incremental_mode_): New data member.
5920 * parameters.cc (Parameters::incremental_mode_): New data member.
5921 (Parameters::set_options): Set incremental_mode_.
5922 (Parameters::set_incremental_full): New function.
5923 (Parameters::incremental): New function.
5924 (Parameters::incremental_update): New function.
5925 (set_parameters_incremental_full): New function.
5926 * parameters.h (Parameters::set_incremental_full): New function.
5927 (Parameters::incremental): New function.
5928 (Parameters::incremental_update): New function.
5929 (Parameters::incremental_mode_): New data member.
5930 (set_parameters_incremental_full): New function.
5931 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
5932 incremental link mode.
5933 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
5934 (Sized_relobj::do_relocate_sections): Likewise.
5935 * testsuite/Makefile.am (incremental_test): Use --incremental-full
5936 option.
5937 * testsuite/Makefile.in: Regenerate.
5938 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 5939
bb32aa18 59402010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
5941
5942 * script-sections.h (class Script_sections): Make
5943 Sections_elements typedef public.
5944 * script-sections.cc (class Sort_output_sections): Add elements_
5945 field. Add constructor which sets it; change all callers.
5946 (Sort_output_sections::is_before): New function.
5947 (Sort_output_sections::operator()): Call is_before.
5948 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
5949 conditional.
5950 * testsuite/script_test_10.sh: New test. Test script section
5951 order.
5952 * testsuite/script_test_10.t: Likewise.
5953 * testsuite/script_test_10.s: Likewise.
5954 * testsuite/Makefile.am: Wrap the cross linker tests and the
5955 common tests into NATIVE_OR_CROSS_LINKER.
5956 (check_SCRIPTS): Add script_test_10.sh.
5957 (check_DATA): Add script_test_10.stdout.
5958 (script_test_10.o, script_test_10): New targets.
5959 (script_test_10.stdout): New target.
5960 * configure, testsuite/Makefile.in: Regenerate.
5961
3cef7179
ILT
59622010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5963
5964 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
5965 error for the deprecated relocations.
5966 (Target_arm::Scan::global): Likewise.
5967 (Target_arm::Relocate::relocate): Likewise.
5968
7411e9a8
RS
59692010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
5970
5971 * fileread.cc (Input_file::find_file): Initialize *found_name
5972 and *namep when using the fallback search for case 4.
5973
6a9da32a
CC
59742010-10-11 Cary Coutant <ccoutant@google.com>
5975
5976 * options.h (class General_options): Redefine -z lazy as an alias for
5977 the negation of -z now.
5978
ac897c20
ILT
59792010-10-11 Ian Lance Taylor <iant@google.com>
5980
5981 * resolve.cc (symbol_to_bits): Report the value of the unsupported
5982 binding.
5983
ea5cae92
NC
59842010-10-06 Nick Clifton <nickc@redhat.com>
5985
5986 * script-sections.cc(class Memory_region): Remove
5987 current_lma_offset_ field. Rename current_vma_offset_ to
5988 current_offset_. Add last_section_ field.
5989 (Memory_region::get_current_vma_address): Rename to
5990 get_current_address.
5991 (Memory_region::get_current_lma_address): Delete.
5992 (Memory_region::increment_vma_offset): Rename to
5993 increment_offset.
5994 (Memory_region::increment_lma_offset): Delete.
5995 (Memory_region::attributes_compatible): New method. Returns
5996 true if the provided section is compatible with the region.
5997 (Memory_region::get_last_section): New method. Returns the last
5998 section to use the region.
5999 (Memory_region::set_last_section): New method. Stores the last
6000 section to use the region.
6001 (Script_sections::block_in_region): New method. Returns true if
6002 a block of memory is contained within a region.
6003 (Script_sections::find_memory_region): New method. Locates a
6004 memory region to be used to set a VMA or LMA address.
6005 (Output_section_definition::set_section_addresses): Add code to
6006 check for addresses set by memory regions.
6007 (Output_segment::set_section_addresses): Remove memory region
6008 walking code.
6009 (Script_sections::create_segment): Add a warning if a header
6010 segment is created outside of any region.
6011 * script-sections.h (class Script_sections): Add prototypes for
6012 find_memory_region and block_in_region methods.
6013 * testsuite/memory_test.s: Use .long instead of .word.
6014 * testsuite/memory_test.t: Add some more output sections.
6015 * testsuite/memory_test.sh: Update expected output.
6016
a9bfd952
DK
60172010-10-02 Doug Kwan <dougkwan@google.com>
6018
6019 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6020 defintion to symtab.h
6021 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6022 declaration to defintion.
6023
bacff3ab
NC
60242010-10-01 Nick Clifton <nickc@redhat.com>
6025
6026 * expression.cc (eval): Replace dummy argument with NULL.
6027 (eval_maybe_dot): Check for a NULL result section pointer.
6028 (Symbol_expression::value): Likewise.
6029 (Dot_expression::value): Likewise.
6030 (BINARY_EXPRESSION): Likewise.
6031 (Max_expression::value): Likewise.
6032 (Min_expression::value): Likewise.
6033 (Absolute_expression::value): Likewise.
6034 (Addr_expression::value_from_output_section): Likewise.
6035 (Loaddddr_expression::value_from_output_section): Likewise.
6036 (Segment_start_expression::value): Likewise.
6037 * script-sections.cc
6038 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6039 argument with NULL.
6040 (Sections_elememt_dot_assignment::set_section_addresses):
6041 Likewise.
6042 (Output_data_expression::do_write_to_buffer): Likewise.
6043 (Output_section_definition::finalize_symbols): Likewise.
6044 (Output_section_definition::set_section_addresses): Likewise.
6045
f81bc8b5
DK
60462010-09-30 Doug Kwan <dougkwan@google.com>
6047
6048 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6049
c95e9f27
ST
60502010-09-28 Sriraman Tallam <tmsriram@google.com>
6051
6052 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6053 function.
c95e9f27
ST
6054 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6055 virtual function.
6056 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6057 virtual function.
6058 * icf.cc (get_section_contents): Inline merge sections only when
6059 target allows it.
6060
3cac54d2
RW
60612010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6062
6063 * configure: Regenerate.
6064
2904037a
ILT
60652010-09-17 Ian Lance Taylor <iant@google.com>
6066
6067 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6068 * testsuite/Makefile.am (memory_test.o): New target.
6069 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6070 memory_test.t.
6071 * testsuite/Makefile.in: Rebuild.
2904037a 6072
bca7fb63
DK
60732010-09-17 Doug Kwan <dougkwan@google.com>
6074
6075 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6076 defintion if relocation uses GOT entries of the symbol.
6077 * testsuite/icf_safe_test.sh: Fix test.
6078 * testsuite/icf_safe_so_test.sh: Fix test.
6079
4ef28648
CC
60802010-09-16 Cary Coutant <ccoutant@google.com>
6081
6082 * script_sections.cc (class Memory_region): Remove "NULL" from
6083 vector initializations.
6084
793990de
CC
60852010-09-15 Cary Coutant <ccoutant@google.com>
6086
6087 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
6088 Resolve forwarding symbols.
6089
81e015e2
DK
60902010-09-15 Doug Kwan <dougkwan@google.com>
6091
6092 * gold/testsuite/script_test_3.t: Add ARM special sections.
6093 * gold/testsuite/script_test_4.t: Same.
6094 * gold/testsuite/script_test_5.t: Same.
6095 * gold/testsuite/script_test_6.t: Same.
6096 * gold/testsuite/script_test_7.t: Same.
6097 * gold/testsuite/script_test_7.t: Same.
6098 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
6099
36171d64
CC
61002010-09-14 Cary Coutant <ccoutant@google.com>
6101
6102 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
6103 (Target_x86_64::Relocate::relocate_tls): Replace check for
6104 saw_tls_block_reloc_ with test for executable section.
6105
d89051bd
CC
61062010-09-12 Cary Coutant <ccoutant@google.com>
6107
6108 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
6109 position-independent executables to shared libraries need dynamic
6110 relocations.
6111 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
6112 position-independent executables.
6113 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
6114 * testsuite/Makefile.in: Regenerate.
6115
fca41f0f
NC
61162010-09-10 Nick Clifton <nickc@redhat.com>
6117
6118 PR gold/11997
6119 * testsuite/memory_test.t: Discard any sections that are not
6120 needed.
6121
6695e4b3
L
61222010-09-09 H.J. Lu <hongjiu.lu@intel.com>
6123
6124 PR gold/11996
6125 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
6126 "This::" to work around a bug in gcc 4.2.
6127
6128 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
6129
0f72bf6f
RÁE
61302010-09-09 Rafael Espindola <espindola@google.com>
6131
6132 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
6133 sections with different PF_X flags in the same segment.
6134 (Layout::find_first_load_seg): Search all segments to find the first
6135 one.
6136 * options.h (rosegment): New.
6137
61382010-09-08 Rafael Espindola <espindola@google.com>
a6577478 6139
05a79166 6140 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 6141
aa98ff75
DK
61422010-09-08 Doug Kwan <dougkwan@google.com>
6143
6144 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
6145 (Arm_relobj::do_relocate_sections): Add new parameter for output
6146 file to match the parent.
6147 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
6148 of local symbols instead of input values. Update code to track
6149 changes in gold::relocate_section.
6150 * object.cc (Sized_relobj::compute_final_local_value): New methods.
6151 (Sized_relobj::compute_final_local_value_internal): New methods.
6152 (Sized_relobj::do_finalize_local_symbols): Move code from loop
6153 body into private version of Sized_relobj::compute_final_local_value.
6154 Call the inline method.
6155 * object.h (Symbol_value::Symbol_value): Define destructor. Free
6156 merged symbol value if there is one.
6157 (Symbol_value::has_output_value): New method defintiion.
6158 (Sized_relobj::Compute_final_local_value_status): New enum type.
6159 (Sized_relobj::compute_final_local_value): New methods.
6160 (Sized_relobj::compute_final_local_value_internal): New methods.
6161 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
6162 and arm_cortex_a8.sh.
6163 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
6164 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
6165 New tests.
6166 * Makefile.in: Regenerate.
6167 * testsuite/arm_bl_out_of_range.s: Update test.
6168 * testsuite/thumb_bl_out_of_range.s: Ditto.
6169 * testsuite/thumb_blx_out_of_range.s: Ditto.
6170 * testsuite/arm_branch_out_of_range.sh: New file.
6171 * testsuite/arm_cortex_a8.sh: Ditto.
6172 * testsuite/arm_cortex_a8_b.s: Ditto.
6173 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
6174 * testsuite/arm_cortex_a8_b_local.s: Ditto.
6175 * testsuite/arm_cortex_a8_bl.s: Ditto.
6176 * testsuite/arm_cortex_a8_blx.s: Ditto.
6177 * testsuite/arm_cortex_a8_local.s: Ditto.
6178 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
6179 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
6180
05a79166
L
61812010-09-08 Rafael Espindola <espindola@google.com>
6182
6183 * Makefile.am (memory_test.stdout): Run readelf with -W.
6184 * Makefile.in: Regenerate.
6185 * testsuite/memory_test.sh: Make the regexps accept both 32 and
6186 64 bit output.
6187
33dbc701
RÁE
61882010-09-08 Rafael Espindola <espindola@google.com>
6189
6190 * script-sections.cc (Script_sections::add_memory_region): Convert
6191 field precision to int.
6192 * script.cc (script_set_section_region, script_set_section_region):
6193 Convert field precision to int.
6194
731ca54a
RÁE
61952010-09-08 Rafael Espindola <espindola@google.com>
6196
6197 * arm.cc (do_finalize_sections): Create the __exidx_start and
6198 __exdix_end symbols even when the section is missing.
6199
7f8cd844
NC
62002010-09-08 Nick Clifton <nickc@redhat.com>
6201
6202 * README: Remove claim that MEMORY is not supported.
6203 * expression.cc (script_exp_function_origin)
6204 (script_exp_function_length): Move from here to ...
6205 * script.cc: ... here.
6206 (script_set_section_region, script_add_memory)
6207 (script_parse_memory_attr, script_include_directive): New
6208 functions.
6209 * script-sections.cc
6210 (class Memory_region): New class.
6211 (class Output_section_definition): Add set_memory_region,
6212 set_section_vma, set_section_lma and get_section_name methods.
6213 (class Script_Sections): Add add_memory_region,
6214 find_memory_region, find_memory_region_origin,
6215 find_memory_region_length and set_memory_region methods.
6216 Have set_section_addresses method walk the list of set memory
6217 regions.
6218 Extend the print methos to display memory regions.
6219 * script-sections.h: Add prototypes for new methods.
6220 Add enum for MEMORY region attributes.
6221 * yyscript.y: Add support for parsing MEMORY regions.
6222 * script-c.h: Add prototypes for new functions.
6223 * testsuite/Makefile.am: Add test of MEMORY region functionality.
6224 * testsuite/Makefile.in: Regenerate.
6225 * testsuite/memory_test.sh: New script.
6226 * testsuite/memory_test.s: New assembler source file.
6227 * testsuite/memory_test.t: New linker script.
6228
a4649286
DK
62292010-08-27 Doug Kwan <dougkwan@google.com>
6230
6231 * gold/resolve.cc (Symbol_table::should_override): Let a weak
6232 reference override an existing dynamic weak reference.
6233 * testsuite/Makefile.am: Add new test dyn_weak_ref.
6234 * testsuite/Makefile.in: Regenerate.
6235 * testsuite/dyn_weak_ref.sh: New file.
6236 * testsuite/dyn_weak_ref_1.c: Ditto.
6237 * testsuite/dyn_weak_ref_2.c: Ditto.
6238
b56648ad
ILT
62392010-08-27 Ian Lance Taylor <iant@google.com>
6240
6241 * incremental.h (class Incremental_input_entry): Add virtual
6242 destructor.
6243
809313cb
ILT
62442010-08-27 Ian Lance Taylor <iant@google.com>
6245
6246 * testsuite/start_lib_test_3.c: Mark t3 as used.
6247
11e32464
NC
62482010-08-27 Nick Clifton <nickc@redhat.com>
6249
6250 * options.cc (version_script): Fix small typo in previous
6251 whitespace tidyup.
6252
ca09d69a
NC
62532010-08-25 Nick Clifton <nickc@redhat.com>
6254
6255 * archive.cc: Formatting fixes: Remove whitespace between
6256 typename and following asterisk. Remove whitespace between
6257 function name and opening parenthesis.
6258 * archive.h: Likewise.
6259 * arm.cc: Likewise.
6260 * attributes.cc: Likewise.
6261 * attributes.h: Likewise.
6262 * common.cc: Likewise.
6263 * copy-relocs.cc: Likewise.
6264 * dirsearch.h: Likewise.
6265 * dynobj.cc: Likewise.
6266 * ehframe.cc: Likewise.
6267 * ehframe.h: Likewise.
6268 * expression.cc: Likewise.
6269 * fileread.cc: Likewise.
6270 * fileread.h: Likewise.
6271 * gc.h: Likewise.
6272 * gold-threads.cc: Likewise.
6273 * gold.cc: Likewise.
6274 * i386.cc: Likewise.
6275 * icf.h: Likewise.
6276 * incremental-dump.cc: Likewise.
6277 * incremental.cc: Likewise.
6278 * layout.cc: Likewise.
6279 * layout.h: Likewise.
6280 * main.cc: Likewise.
6281 * merge.cc: Likewise.
6282 * merge.h: Likewise.
6283 * object.cc: Likewise.
6284 * object.h: Likewise.
6285 * options.cc: Likewise.
6286 * options.h: Likewise.
6287 * output.cc: Likewise.
6288 * output.h: Likewise.
6289 * plugin.cc: Likewise.
6290 * plugin.h: Likewise.
6291 * powerpc.cc: Likewise.
6292 * reloc.cc: Likewise.
6293 * script-c.h: Likewise.
6294 * script-sections.cc: Likewise.
6295 * script.cc: Likewise.
6296 * stringpool.cc: Likewise.
6297 * symtab.cc: Likewise.
6298 * symtab.h: Likewise.
6299 * target.cc: Likewise.
6300 * timer.cc: Likewise.
6301 * timer.h: Likewise.
6302 * version.cc: Likewise.
6303 * x86_64.cc: Likewise.
6304
b8fa8750
NC
63052010-08-24 Nick Clifton <nickc@redhat.com>
6306
6307 PR 11899
6308 * layout.cc (segment_precedes): Sort segments by their physical
6309 addresses, if they have been set.
6310
9919d93b
CC
63112010-08-23 Cary Coutant <ccoutant@google.com>
6312
6313 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
6314 symbols data.
6315 (Lib_group::include_member): Unlock object after deleting its
6316 symbols data.
6317 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
6318 the bug fixed here.
6319
97b4be1c
CC
63202010-08-19 Neil Vachharajani <nvachhar@google.com>
6321 Cary Coutant <ccoutant@google.com>
6322
6323 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
6324 constructor, and set_blocker.
6325 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
6326 readsyms_blocker_.
6327 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
6328 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
6329 * testsuite/Makefile.am (start_lib_test): New test case.
6330 * testsuite/Makefile.in: Regenerate.
6331 * testsuite/start_lib_test_main.c: New file.
6332 * testsuite/start_lib_test_1.c: New file.
6333 * testsuite/start_lib_test_2.c: New file.
6334 * testsuite/start_lib_test_3.c: New file.
6335
dd0b1884
ILT
63362010-08-19 Ian Lance Taylor <iant@google.com>
6337
6338 * Makefile.in: Rebuild with automake 1.11.1.
6339 * aclocal.m4: Likewise.
6340 * testsuite/Makefile.in: Likewise.
6341
7223e9ca
ILT
63422010-08-19 Ian Lance Taylor <iant@google.com>
6343
6344 PR 10893
6345 * i386.cc (class Output_data_plt_i386): Update declarations.
6346 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
6347 local_ifuncs_ fields.
6348 (Target_i386::do_plt_section_for_global): New function.
6349 (Target_i386::do_plt_section_for_local): New function.
6350 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
6351 parameter; change all callers. Initialize global_ifuncs_ and
6352 local_ifuncs_. If doing a static link define __rel_iplt_start and
6353 __rel_iplt_end.
6354 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
6355 (Output_data_plt_i386::add_local_ifunc_entry): New function.
6356 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
6357 symbols.
6358 (Target_i386::make_plt_section): New function, broken out of
6359 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
6360 (Target_i386::make_plt_entry): Call make_plt_section.
6361 (Target_i386::make_local_ifunc_plt_entry): New function.
6362 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
6363 (Target_i386::Scan::local): Handle IFUNC symbols. Add
6364 R_386_IRELATIVE to switch.
6365 (Target_i386::Scan::global): Likewise.
6366 (Target_i386::Relocate::relocate): Likewise.
6367 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
6368 switch.
6369 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
6370 (Target_x86_64::do_plt_section_for_global): New function.
6371 (Target_x86_64::do_plt_section_for_local): New function.
6372 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
6373 parameter; change all callers. If doing a static link define
6374 __rela_iplt_start and __rela_iplt_end.
6375 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
6376 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
6377 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
6378 to point to .plt.
6379 (Target_x86_64::make_local_ifunc_plt_entry): New function.
6380 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
6381 switch.
6382 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
6383 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
6384 R_X86_64_IRELATIVE to switch.
6385 (Target_x86_64::Scan::global): Likewise.
6386 (Target_x86_64::Relocate::relocate): Likewise.
6387 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
6388 switch.
6389 * target.h (class Target): Add plt_section_for_global and
6390 plt_section_for_local functions. Add do_plt_section_for_global
6391 and do_plt_section_for_local virtual functions.
6392 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
6393 clarifying comments.
6394 (Symbol::use_plt_offset): Handle IFUNC symbol.
6395 * object.cc (Sized_relobj::Sized_relobj): Initialize
6396 local_plt_offsets_.
6397 (Sized_relobj::local_has_plt_offset): New function.
6398 (Sized_relobj::local_plt_offset): New function.
6399 (Sized_relobj::set_local_plt_offset): New function.
6400 (Sized_relobj::do_count): Handle IFUNC symbol.
6401 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
6402 a bit away from input_shndx_ field. Add set_is_func_symbol and
6403 is_ifunc_symbol functions.
6404 (class Sized_relobj): Update declarations. Remove Tls_got_entry
6405 and Local_tls_got_offsets. Define Local_plt_offsets. Add
6406 local_plt_offsets_ field.
6407 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
6408 * output.h (class Output_section_data): Add non-const
6409 output_section function.
6410 (class Output_data_got): Update declarations.
6411 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
6412 Add use_plt_offset parameter to global and local constructors.
6413 Change all callers. Change local_sym_index_ field to 31 bits.
6414 Change GSYM_CODE and CONSTANT_CODE accordingly.
6415 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
6416 doing a static link don't set sh_link field.
6417 (Output_data_got::Got_entry::write): Use PLT offset if
6418 appropriate.
6419 (Output_data_got::add_global_plt): New function.
6420 (Output_data_got::add_local_plt): New function.
6421 * target-reloc.h (relocate_section): Handle IFUNC symbol.
6422 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
6423 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
6424 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
6425 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
6426 IFUNC conditional.
6427 * testsuite/ifunc-sel.h: New file.
6428 * testsuite/ifuncmain1.c: New file.
6429 * testsuite/ifuncmain1vis.c: New file.
6430 * testsuite/ifuncmod1.c: New file.
6431 * testsuite/ifuncdep2.c: New file.
6432 * testsuite/ifuncmain2.c: New file.
6433 * testsuite/ifuncmain3.c: New file.
6434 * testsuite/ifuncmod3.c: New file.
6435 * testsuite/ifuncmain4.c: New file.
6436 * testsuite/ifuncmain5.c: New file.
6437 * testsuite/ifuncmod5.c: New file.
6438 * testsuite/ifuncmain6pie.c: New file.
6439 * testsuite/ifuncmod6.c: New file.
6440 * testsuite/ifuncmain7.c: New file.
6441 * configure, testsuite/Makefile.in: Rebuild.
6442
56f75c03
ILT
64432010-08-18 Ian Lance Taylor <iant@google.com>
6444
6445 * incremental.cc
6446 (Output_section_incremental_inputs::write_input_files): Add cast
6447 to avoid signed/unsigned comparison warning.
6448 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6449
55455f89
CC
64502010-08-12 Cary Coutant <ccoutant@google.com>
6451
6452 * common.cc (Sort_commons::operator()): Remove unnecessary code.
6453
e2054bcb
ILT
64542010-08-13 Ian Lance Taylor <iant@google.com>
6455
6456 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
6457
74f67560
DK
64582010-08-12 Cary Coutant <ccoutant@google.com>
6459 Doug Kwan <dougkwan@google.com>
6460
6461 * resolve.cc (Symbol_table::should_override): When a weak dynamic
6462 defintion overrides non-weak undef, remember that the original undef
6463 is not weak.
6464 * symtab.cc (Symbol_table::sized_write_global): For undef without
6465 an original weak binding, set binding to global in output.
6466 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
6467 * testsuite/Makefile.in: Regenerate.
6468 * testsuite/strong_ref_weak_def.sh: New file.
6469 * testsuite/strong_ref_weak_def_1.c: Ditto.
6470 * testsuite/strong_ref_weak_def_2.c: Ditto.
6471
d1238d12
CC
64722010-08-12 Cary Coutant <ccoutant@google.com>
6473
6474 * testsuite/incremental_test.sh: Rewrite.
6475 * testsuite/incremental_test_1.c: Rewrite.
6476 * testsuite/incremental_test_2.c: Rewrite.
6477
0e70b911
CC
64782010-08-12 Cary Coutant <ccoutant@google.com>
6479
6480 * arm.cc (Target_arm::got_size): Add const.
6481 (Target_arm::got_entry_count): New function.
6482 (Target_arm::plt_entry_count): New function.
6483 (Target_arm::first_plt_entry_offset): New function.
6484 (Target_arm::plt_entry_size): New function.
6485 (Output_data_plt_arm::entry_count): New function.
6486 (Output_data_plt_arm::first_plt_entry_offset): New function.
6487 (Output_data_plt_arm::get_plt_entry_size): New function.
6488 * i386.cc (Target_i386::got_size): Add const.
6489 (Target_i386::got_entry_count): New function.
6490 (Target_i386::plt_entry_count): New function.
6491 (Target_i386::first_plt_entry_offset): New function.
6492 (Target_i386::plt_entry_size): New function.
6493 (Output_data_plt_i386::entry_count): New function.
6494 (Output_data_plt_i386::first_plt_entry_offset): New function.
6495 (Output_data_plt_i386::get_plt_entry_size): New function.
6496 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
6497 find_incremental_inputs_sections. Dump incremental_got_plt section.
6498 * incremental.cc: Include target.h.
6499 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
6500 parameter. Adjust all callers. Find incremental_got_plt section.
6501 (Incremental_inputs::create_data_sections): Create incremental_got_plt
6502 section.
6503 (Output_section_incremental_inputs::set_final_data_size): Calculate
6504 size of incremental_got_plt section.
6505 (Output_section_incremental_inputs::do_write): Write the
6506 incremental_got_plt section.
6507 (Got_plt_view_info): New struct.
6508 (Local_got_offset_visitor): New class.
6509 (Global_got_offset_visitor): New class.
6510 (Global_symbol_visitor_got_plt): New class.
6511 (Output_section_incremental_inputs::write_got_plt): New function.
6512 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
6513 Add parameter. Adjust all callers.
6514 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6515 (Incremental_inputs::got_plt_section): New function.
6516 (Incremental_inputs::got_plt_section_): New data member.
6517 (Incremental_got_plt_reader): New class.
6518 * layout.cc (Layout::create_incremental_info_sections): Add the
6519 incremental_got_plt section.
6520 * object.h (Got_offset_list::get_list): New function.
6521 (Got offset_list::for_all_got_offsets): New function.
6522 (Sized_relobj::local_got_offset_list): New function.
6523 * powerpc.cc (Target_powerpc::got_size): Add const.
6524 (Target_powerpc::got_entry_count): New function.
6525 (Target_powerpc::plt_entry_count): New function.
6526 (Target_powerpc::first_plt_entry_offset): New function.
6527 (Target_powerpc::plt_entry_size): New function.
6528 (Output_data_plt_powerpc::entry_count): New function.
6529 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
6530 (Output_data_plt_powerpc::get_plt_entry_size): New function.
6531 * sparc.cc (Target_sparc::got_size): Add const.
6532 (Target_sparc::got_entry_count): New function.
6533 (Target_sparc::plt_entry_count): New function.
6534 (Target_sparc::first_plt_entry_offset): New function.
6535 (Target_sparc::plt_entry_size): New function.
6536 (Output_data_plt_sparc::entry_count): New function.
6537 (Output_data_plt_sparc::first_plt_entry_offset): New function.
6538 (Output_data_plt_sparc::get_plt_entry_size): New function.
6539 * symtab.h (Symbol::got_offset_list): New function.
6540 (Symbol_table::for_all_symbols): New function.
6541 * target.h (Sized_target::got_entry_count): New function.
6542 (Sized_target::plt_entry_count): New function.
6543 (Sized_target::plt_entry_size): New function.
6544 * x86_64.cc (Target_x86_64::got_size): Add const.
6545 (Target_x86_64::got_entry_count): New function.
6546 (Target_x86_64::plt_entry_count): New function.
6547 (Target_x86_64::first_plt_entry_offset): New function.
6548 (Target_x86_64::plt_entry_size): New function.
6549 (Output_data_plt_x86_64::entry_count): New function.
6550 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
6551 (Output_data_plt_x86_64::get_plt_entry_size): New function.
6552
09ec0418
CC
65532010-08-12 Cary Coutant <ccoutant@google.com>
6554
6555 * archive.cc: Include incremental.h.
6556 (Archive::Archive): Initialize incremental_info_.
6557 (Archive::include_member): Record archive members in incremental info.
6558 (Add_archive_symbols::run): Record begin and end of an archive in
6559 incremental info.
6560 (Lib_group::include_member): Record objects in incremental info.
6561 * archive.h (Incremental_archive_entry): Forward declaration.
6562 (Archive::set_incremental_info): New member function.
6563 (Archive::incremental_info): New member function.
6564 (Archive::Unused_symbol_iterator): New class.
6565 (Archive::unused_symbols_begin): New member function.
6566 (Archive::unused_symbols_end): New member function.
6567 (Archive::incremental_info_): New data member.
6568 * incremental-dump.cc (find_input_containing_global): New function.
6569 (dump_incremental_inputs): Dump new incremental info sections.
6570 * incremental.cc: Include symtab.h.
6571 (Output_section_incremental_inputs): New class.
6572 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
6573 new incremental info sections.
6574 (Sized_incremental_binary::do_check_inputs): Likewise.
6575 (Incremental_inputs::report_archive): Remove.
6576 (Incremental_inputs::report_archive_begin): New function.
6577 (Incremental_inputs::report_archive_end): New function.
6578 (Incremental_inputs::report_object): New function.
6579 (Incremental_inputs::finalize_inputs): Remove.
6580 (Incremental_inputs::report_input_section): New function.
6581 (Incremental_inputs::report_script): Rewrite.
6582 (Incremental_inputs::finalize): Do nothing but finalize string table.
6583 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6584 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6585 (Incremental_inputs::create_data_sections): New function.
6586 (Incremental_inputs::relocs_entsize): New function.
6587 (Output_section_incremental_inputs::set_final_data_size): New function.
6588 (Output_section_incremental_inputs::do_write): New function.
6589 (Output_section_incremental_inputs::write_header): New function.
6590 (Output_section_incremental_inputs::write_input_files): New function.
6591 (Output_section_incremental_inputs::write_info_blocks): New function.
6592 (Output_section_incremental_inputs::write_symtab): New function.
6593 * incremental.h (Incremental_script_entry): Forward declaration.
6594 (Incremental_object_entry): Forward declaration.
6595 (Incremental_archive_entry): Forward declaration.
6596 (Incremental_inputs): Forward declaration.
6597 (Incremental_inputs_header_data): Remove.
6598 (Incremental_inputs_header): Remove.
6599 (Incremental_inputs_header_write): Remove.
6600 (Incremental_inputs_entry_data): Remove.
6601 (Incremental_inputs_entry): Remove.
6602 (Incremental_inputs_entry_write): Remove.
6603 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
6604 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
6605 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
6606 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
6607 Likewise.
6608 (Incremental_input_entry): New class.
6609 (Incremental_script_entry): New class.
6610 (Incremental_object_entry): New class.
6611 (Incremental_archive_entry): New class.
6612 (Incremental_inputs::Incremental_inputs): Initialize new data members.
6613 (Incremental_inputs::report_inputs): Remove.
6614 (Incremental_inputs::report_archive): Remove.
6615 (Incremental_inputs::report_archive_begin): New function.
6616 (Incremental_inputs::report_archive_end): New function.
6617 (Incremental_inputs::report_object): Change prototype.
6618 (Incremental_inputs::report_input_section): New function.
6619 (Incremental_inputs::report_script): Change prototype.
6620 (Incremental_inputs::get_reloc_count): New function.
6621 (Incremental_inputs::set_reloc_count): New function.
6622 (Incremental_inputs::create_data_sections): New function.
6623 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
6624 (Incremental_inputs::inputs_section): New function.
6625 (Incremental_inputs::symtab_section): New function.
6626 (Incremental_inputs::relocs_section): New function.
6627 (Incremental_inputs::get_stringpool): Add const.
6628 (Incremental_inputs::command_line): Add const.
6629 (Incremental_inputs::inputs): Remove.
6630 (Incremental_inputs::command_line_key): New function.
6631 (Incremental_inputs::input_file_count): New function.
6632 (Incremental_inputs::input_files): New function.
6633 (Incremental_inputs::relocs_entsize): New function.
6634 (Incremental_inputs::sized_create_inputs_section_data): Remove.
6635 (Incremental_inputs::finalize_inputs): Remove.
6636 (Incremental_inputs::Input_info): Remove.
6637 (Incremental_inputs::lock_): Remove.
6638 (Incremental_inputs::inputs_): Change type.
6639 (Incremental_inputs::inputs_map_): Remove.
6640 (Incremental_inputs::current_object_entry_): New data member.
6641 (Incremental_inputs::inputs_section_): New data member.
6642 (Incremental_inputs::symtab_section_): New data member.
6643 (Incremental_inputs::relocs_section_): New data member.
6644 (Incremental_inputs::reloc_count_): New data member.
6645 (Incremental_inputs_reader): New class.
6646 (Incremental_symtab_reader): New class.
6647 (Incremental_relocs_reader): New class.
6648 * layout.cc (Layout::finalize): Move finalization of incremental info
6649 and creation of incremental info sections to follow finalization of
6650 symbol table. Set offsets for postprocessing sections.
6651 (Layout::create_incremental_info_sections): Call
6652 Incremental_inputs::create_data_sections. Add incremental symtab
6653 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
6654 sections to layout after input sections.
6655 * layout.h (struct Timespec): Forward declaration.
6656 (Layout::incremental_inputs): Add const.
6657 (Layout::create_incremental_info_sections): Add parameter.
6658 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
6659 * object.cc: Include incremental.h.
6660 (Relobj::finalize_incremental_relocs): New function.
6661 (Sized_relobj::do_layout): Record input sections in incremental info.
6662 * object.h (Object::output_section): New function.
6663 (Object::output_section_offset): Moved from Relobj.
6664 (Object::get_incremental_reloc_base): New function.
6665 (Object::get_incremental_reloc_count): New function.
6666 (Object::do_output_section): New function.
6667 (Object::do_output_section_offset): Moved from Relobj.
6668 (Object::do_get_incremental_reloc_base): New function.
6669 (Object::do_get_incremental_reloc_count): New function.
6670 (Object::Object): Initialize new data members.
6671 (Relobj::output_section): Renamed do_output_section and moved to
6672 protected.
6673 (Relobj::output_section_offset): Moved to Object.
6674 (Relobj::do_get_incremental_reloc_base): New function.
6675 (Relobj::do_get_incremental_reloc_count): New function.
6676 (Relobj::allocate_incremental_reloc_counts): New function.
6677 (Relobj::count_incremental_reloc): New function.
6678 (Relobj::finalize_incremental_relocs): New function.
6679 (Relobj::next_incremental_reloc_index): New function.
6680 (Relobj::reloc_counts_): New data member.
6681 (Relobj::reloc_bases_): New data member.
6682 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
6683 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
6684 (Sized_relobj::incremental_relocs_scan): New function.
6685 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6686 (Sized_relobj::incremental_relocs_write): New function.
6687 (Sized_relobj::incremental_relocs_write_reltype): New function.
6688 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
6689 incremental link.
6690 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
6691 archives and object files elsewhere.
6692 (Add_symbols::run): Report object files here.
6693 (Finish_group::run): Report end of archive at end of group.
6694 * reloc.cc: Include layout.h, incremental.h.
6695 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
6696 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
6697 (Sized_relobj::incremental_relocs_scan): New function.
6698 (Sized_relobj::incremental_relocs_scan_reltype): New function.
6699 (Sized_relobj::do_relocate_sections): Write incremental relocations.
6700 (Sized_relobj::incremental_relocs_write): New function.
6701 (Sized_relobj::incremental_relocs_write_reltype): New function.
6702 * script.cc (read_input_script): Rewrite test for incremental link.
6703 Change call to Incremental_inputs::report_script.
6704 * symtab.h (Symbol_table::first_global_index): New function.
6705 (Symbol_table::output_count): New function.
6706
ce0d1972
DK
67072010-08-12 Doug Kwan <dougkwan@google.com>
6708
6709 * arm.cc (Target_arm::merge_object_attributes): Check command line
6710 options --no-wchar-size-warning and --no-enum-size-warning.
6711 * options.h (General_options): Add ld-compatible options
6712 --no-enum-size-warning and --no-wchar-size-warning.
6713
6e5710ce
ILT
67142010-08-04 Ian Lance Taylor <iant@google.com>
6715
6716 * x86_64.cc (Target_x86_64::Scan::local): Use
6717 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
6718 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
6719 (Target_x86_64::Scan::global): Likewise.
6720 (Target_x86_64::Relocate::relocate): Likewise.
6721 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
6722 Likewise.
6723
fef830db
CC
67242010-08-03 Cary Coutant <ccoutant@google.com>
6725
6726 * merge.cc (Output_merge_string::do_add_input_section): Count strings
6727 to reserve space in merged_strings vector. Keep total input size
6728 for stats.
6729 (Output_merge_string::do_print_merge_stats): Print total input size.
6730 * merge.h (Output_merge_string): Add input_size_ field.
6731 * stringpool.cc (Stringpool_template::string_length): Move
6732 implementations out of Stringpool_template class and place in
6733 stringpool.h.
6734 * stringpool.h (string_length): Move out of Stringpool_template.
6735
1e3811b0
ILT
67362010-08-03 Ian Lance Taylor <iant@google.com>
6737
6738 PR 11712
6739 * layout.cc (relaxation_loop_body): If address of load segment is
6740 set, adjust address to include headers if possible.
6741
7af0c620
ILT
67422010-08-03 Ian Lance Taylor <iant@google.com>
6743
6744 * version.cc (version_string): Bump to 1.10.
6745
22f0da72
ILT
67462010-08-03 Ian Lance Taylor <iant@google.com>
6747
6748 PR 11805
6749 * layout.h (enum Output_section_order): Define.
6750 (class Layout): Update declarations.
6751 * layout.cc (Layout::get_output_section): Add order parameter.
6752 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
6753 is_first_non_relro parameters. Change all callers.
6754 (Layout::choose_output_section): Likewise.
6755 (Layout::add_output_section_data): Likewise.
6756 (Layout::make_output_section): Likewise. Set order.
6757 (Layout::default_section_order): New function.
6758 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
6759 * output.cc (Output_section::Output_section): Initialize order_.
6760 Don't initialize deleted fields.
6761 (Output_segment::Output_segment): Don't initialize deleted
6762 fields.
6763 (Output_segment::add_output_section_to_load): New function
6764 replacing add_output_section. Change all callers to call this or
6765 add_output_section_to_nonload.
6766 (Output_segment::add_output_section_to_nonload): New function.
6767 (Output_segment::remove_output_section): Rewrite.
6768 (Output_segment::add_initial_output_data): Likewise.
6769 (Output_segment::has_any_data_sections): Likewise.
6770 (Output_segment::is_first_section_relro): Likewise.
6771 (Output_segment::maximum_alignment): Likewise.
6772 (Output_segment::has_dynamic_reloc): New function replacing
6773 dynamic_reloc_count. Change all callers.
6774 (Output_segment::has_dynamic_reloc_list): New function replacing
6775 dynamic_reloc_count_list. Change all callers.
6776 (Output_segment::set_section_addresses): Rewrite.
6777 (Output_segment::set_offset): Rewrite.
6778 (Output_segment::find_first_and_last_list): Remove.
6779 (Output_segment::set_tls_offsets): Rewrite.
6780 (Output_segment::first_section_load_address): Likewise.
6781 (Output_segment::output_section_count): Likewise.
6782 (Output_segment::section_with_lowest_load_address): Likewise.
6783 (Output_segment::write_section_headers): Likewise.
6784 (Output_segment::print_sections_to_map): Likewise.
6785 * output.h (class Output_data): Remove dynamic_reloc_count_
6786 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
6787 (Output_data::add_dynamic_reloc): Rewrite.
6788 (Output_data::has_dynamic_reloc): New function.
6789 (Output_data::dynamic_reloc_count): Remove.
6790 (class Output_section): Add order_ field. Remvoe is_relro_local_,
6791 is_last_relro_, is_first_non_relro_, is_interp_,
6792 is_dynamic_linker_section_ fields. Add order and set_order
6793 functions. Remove is_relro_local, set_is_relro_local,
6794 is_last_relro, set_is_last_relro, is_first_non_relro,
6795 set_is_first_non_relro functions, is_interp, set_is_interp,
6796 is_dynamic_linker_section, and set_is_dynamic_linker_section
6797 functions.
6798 (class Output_segment): Change Output_data_list from std::list to
6799 std:;vector. Add output_lists_ field. Remove output_data_ and
6800 output_bss_ fields. Update declarations.
6801
3ff2ccb0
ILT
68022010-08-02 Ian Lance Taylor <iant@google.com>
6803
6804 * arm.cc (Target_arm::gc_process_relocs): Use typename.
6805 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
6806 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
6807
88a4108b
ILT
68082010-08-02 Ian Lance Taylor <iant@google.com>
6809
6810 PR 11855
6811 * script.cc (Script_options::Script_options): Initialize
6812 symbol_definitions_ and symbol_references_.
6813 (Script_options::add_symbol_assignment): Update
6814 symbol_definitions_ and symbol_references_.
6815 (Script_options::add_symbol_reference): New function.
6816 (script_symbol): New function.
6817 * script.h (class Script_options): Add symbol_definitions_ and
6818 symbol_references_ fields.
6819 (Script_options::referenced_const_iterator): New type.
6820 (Script_options::referenced_begin): New function.
6821 (Script_options::referenced_end): New function.
6822 (Script_options::is_referenced): New function.
6823 (Script_options::any_unreferenced): New function.
6824 * script-c.h (script_symbol): Declare.
6825 * yyscript.y (exp): Call script_symbol.
6826 * symtab.cc: Include "script.h".
6827 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
6828 Change all callers. Check symbols referenced by scripts.
6829 (Symbol_table::add_undefined_symbols_from_command_line): Add
6830 layout parameter. Change all callers.
6831 (Symbol_table::do_add_undefined_symbols_from_command_line):
6832 Likewise. Break out loop body. Check symbols referenced by
6833 scripts.
6834 (Symbol_table::add_undefined_symbol_from_command_line): New
6835 function broken out of
6836 do_add_undefined_symbols_from_command_line.
6837 * symtab.h (class Symbol_table): Update declarations.
6838 * archive.cc: Include "layout.h".
6839 (Archive::should_include_member): Add layout parameter. Change
6840 all callers. Check for symbol mentioned in expression.
6841 * archive.h (class Archive): Update declaration.
6842 * object.cc (Sized_relobj::do_should_include_member): Add layout
6843 parameter.
6844 * object.h (Object::should_include_member): Add layout parameter.
6845 Change all callers.
6846 (Object::do_should_include_member): Add layout parameter.
6847 (class Sized_relobj): Update declaration.
6848 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
6849 parameter.
6850 * dynobj.h (class Sized_dynobj): Update declaration.
6851 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
6852 layout parameter.
6853 * plugin.h (class Sized_pluginobj): Update declaration.
6854
5f1ab67a
ILT
68552010-08-02 Ian Lance Taylor <iant@google.com>
6856
6857 PR 11866
6858 * output.cc (Output_segment::set_offset): Search for the first and
6859 last sections rather than assuming that the list is in order.
6860 (Output_segment::find_first_and_last_list): New function.
6861 * output.h (class Output_segment): Update declarations.
6862 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
6863 (relro_strip_test_SOURCES): New variable.
6864 (relro_strip_test_DEPENDENCIES): New variable.
6865 (relro_strip_test_LDFLAGS): New variable.
6866 (relro_strip_test_LDADD): New variable.
6867 (relro_strip_test.so): New target.
6868
a8df5856
ILT
68692010-08-02 Ian Lance Taylor <iant@google.com>
6870
6871 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
6872 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
6873 (Target_i386::got_tlsdesc_section): New function.
6874 (Target_i386::got_section): Create space for GOT entries for
6875 TLSDESC relocations.
6876 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
6877 R_386_TLS_GOTDESC.
6878 (Target_i386::Scan::global): Likewise.
6879 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
6880 using TLSDESC GOT.
6881 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
6882 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
6883 (Target_x86_64::got_tlsdesc_section): New function.
6884 (Target_x86_64::got_section): Create space for GOT entries for
6885 TLSDESC relocations.
6886 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
6887 R_386_TLS_GOTDESC.
6888 (Target_x86_64::Scan::global): Likewise.
6889 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
6890 using TLSDESC GOT.
6891
0c10a0a6
ILT
68922010-08-02 Ian Lance Taylor <iant@google.com>
6893
6894 * testsuite/final_layout.sh: Use dc to convert from hex to
6895 decimal.
6896
41cbeecc
ST
68972010-07-29 Sriraman Tallam <tmsriram@google.com>
6898
6899 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
6900 paramter to the call to gold::gc_process_relocs.
6901 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
6902 paramter to the call to gold::gc_process_relocs.
6903 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
6904 parameter to the call to gold::gc_process_relocs.
6905 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
6906 template parameter to the call to gold::gc_process_relocs.
6907 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
6908 paramter to the call to gold::gc_process_relocs.
6909 * gc.h (get_embedded_addend_size): New function.
6910 (gc_process_relocs): Save the size of the reloc for use by ICF.
6911 * icf.cc (get_section_contents): Get the addend from the text section
6912 for SHT_REL relocation sections.
6913 * icf.h (Icf::Reloc_addend_size_info): New typedef.
6914 (Icf::Reloc_info): Add new member reloc_addend_size_info.
6915 * int_encoding.h (read_from_pointer): New overloaded function.
6916 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
6917 * testsuite/icf_sht_rel_addend_test.sh: New file.
6918 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
6919 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
6920
6ea55b82
RW
69212010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6922
6923 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
6924 * Makefile.in: Regenerate.
6925 * testsuite/Makefile.in: Regenerate.
6926
9691462b
ILT
69272010-07-27 Jeffrey Yasskin <jyasskin@google.com>
6928
6929 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
6930 * gold/testsuite/debug_msg.cc: Likewise.
6931 * gold/testsuite/odr_violation1.cc
6932 * gold/testsuite/odr_violation2.cc
6933
76897331
CC
69342010-07-21 Cary Coutant <ccoutant@google.com>
6935
6936 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
6937 string, and length fields.
6938 (Output_merge_string::Merged_strings_list): New type.
6939 (Output_merge_string::Merged_strings_lists): New typedef.
6940 (Output_merge_string): Replace merged_strings_ with
6941 merged_strings_lists_.
6942 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
6943 Merged_strings_list per input object and section. Don't store pointer
6944 to the string. Don't store length with each merged string entry.
6945 (Output_merge_string::finalize_merged_data): Loop over list of merged
6946 strings lists. Recompute length of each merged string.
6947
78384e8f
CC
69482010-07-15 Cary Coutant <ccoutant@google.com>
6949
6950 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
6951 here.
6952
783659f9
ILT
69532010-07-14 Ian Lance Taylor <iant@google.com>
6954
6955 * descriptors.cc (Descriptors::open): Report correct name in error
6956 message.
6957
131687b4
DK
69582010-07-13 Doug Kwan <dougkwan@google.com>
6959
6960 * arm.cc (Arm_input_section::Arm_input_section): For a
6961 SHT_ARM_EXIDX section, always keeps the input sections.
6962 (Arm_input_section::set_exidx_section_link): New method.
6963 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
6964 has_errors_ to false.
6965 (Arm_exidx_input_section::has_errors,
6966 Arm_exidx_input_section::set_has_errors): New methods.
6967 (Arm_exidx_input_section::has_errors_): New data member.
6968 (Arm_relobj::get_exidx_shndx_list): New method.
6969 (Arm_output_section::append_text_sections_to_list): Do not skip
6970 section without SHF_EXECINSTR.
6971 (Arm_output_section::fix_exidx_coverage): Skip input sections with
6972 errors.
2e702c99 6973 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
6974 section header. Make error messages more verbose. Check for
6975 a non-executable section linked to an EXIDX section.
6976 (Arm_relobj::do_read_symbols): Remove error checking, which has been
6977 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
6978 check that there is no deferred EXIDX section if we exit early.
6979 Instead of not making an EXIDX section in case of an error, make one
6980 and set the has_errors flag of it.
6981 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
6982 in a relocatable link.
6983 (Target_arm::do_relax): Look for the EXIDX output section instead of
6984 assuming that it is called .ARM.exidx.
2e702c99 6985 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
6986 section list. Do not check for SHF_EXECINSTR section flags but
6987 skip any input section with errors.
6988 * output.cc (Output_section::Output_section): Initialize
6989 always_keeps_input_sections_ to false.
6990 (Output_section::add_input_section): Check for
6991 always_keeps_input_sections_.
6992 * output.h (Output_section::always_keeps_input_sections,
6993 Output_section::set_always_keeps_input_sections): New methods.
6994 (Output_section::always_keeps_input_sections): New data member.
6995
69517287
RÁE
69962010-07-13 Rafael Espindola <espindola@google.com>
6997
6998 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
6999 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7000
82742395
ILT
70012010-07-13 Philip Herron <herron.philip@googlemail.com>
7002 Ian Lance Taylor <iant@google.com>
7003
7004 * output.h (Output_section_lookup_maps::add_merge_section):
7005 Correct check of whether value was inserted.
7006 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7007 (Output_section_lookup_maps::add_relaxed_input_section):
7008 Likewise.
7009 * arm.cc (Target_arm::got_section): Remove used local os.
7010 * i386.cc (Target_i386::got_section): Likewise.
7011 * x86_64.cc (Target_x86_64::got_section): Likewise.
7012 * sparc.cc (Target_sparc::got_section): Likewise.
7013 (Target_sparc::relocate): Remove unused local have_got_offset.
7014 * powerpc.cc (Target_powerpc::relocate): Likewise.
7015
f2d707b5
ILT
70162010-07-13 Ian Lance Taylor <iant@google.com>
7017
241531d6
ILT
7018 * compressed_output.cc (zlib_decompress): Fix signature in
7019 !HAVE_ZLIB_H case.
7020
f2d707b5
ILT
7021 * archive.cc (Archive::include_member): Unlock an external member
7022 of a thin archive. Don't bother to delete an object we know is
7023 NULL.
7024
a2e47362
CC
70252010-07-12 Cary Coutant <ccoutant@google.com>
7026
7027 * compressed_output.cc (zlib_decompress): New function.
7028 (get_uncompressed_size): New function.
7029 (decompress_input_section): New function.
7030 * compressed_output.h (get_uncompressed_size): New function.
7031 (decompress_input_section): New function.
7032 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7033 Handle compressed debug sections.
7034 * layout.cc (is_compressed_debug_section): New function.
7035 (Layout::output_section_name): Map compressed section names to
7036 canonical names.
7037 * layout.h (is_compressed_debug_section): New function.
7038 (is_debug_info_section): Recognize compressed debug sections.
7039 * merge.cc: Include compressed_output.h.
7040 (Output_merge_data::do_add_input_section): Handle compressed
7041 debug sections.
7042 (Output_merge_string::do_add_input_section): Handle compressed
7043 debug sections.
7044 * object.cc: Include compressed_output.h.
7045 (Sized_relobj::Sized_relobj): Initialize new data members.
7046 (build_compressed_section_map): New function.
7047 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7048 * object.h (Object::section_is_compressed): New method.
7049 (Object::do_section_is_compressed): New method.
7050 (Sized_relobj::Compressed_section_map): New type.
7051 (Sized_relobj::do_section_is_compressed): New method.
7052 (Sized_relobj::compressed_sections_): New data member.
7053 * output.cc (Output_section::add_input_section): Handle compressed
7054 debug sections.
7055 * reloc.cc: Include compressed_output.h.
7056 (Sized_relobj::write_sections): Handle compressed debug sections.
7057
ce279a62
CC
70582010-07-08 Cary Coutant <ccoutant@google.com>
7059
7060 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7061 weak when resolving to a dynamic def.
7062 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7063 for weak undef/dynamic def cases. Adjust callers.
7064 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7065 undef_binding_weak_.
7066 (Symbol_table::sized_write_globals): Adjust symbol binding.
7067 (Symbol_table::sized_write_symbol): Add binding parameter.
7068 * symtab.h (Symbol::set_undef_binding): New method.
7069 (Symbol::is_undef_binding_weak): New method.
7070 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7071 (Symbol_table::should_override): Add new parameter.
7072 (Symbol_table::sized_write_symbol): Add new parameter.
7073
7074 * testsuite/weak_undef_file1.cc: Add new test case.
7075 * testsuite/weak_undef_file2.cc: Fix header comment.
7076 * testsuite/weak_undef_test.cc: Add new test case.
7077
b2286c10
DK
70782010-06-29 Doug Kwan <dougkwan@google.com>
7079
7080 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7081 Initialize USE_SYMBOL_.
7082 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7083 definition.
7084 (Arm_reloc_property::uses_symbol_): New data member declaration.
7085 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
7086 uses symbol value and symbol is undefined but not weakly undefined.
7087
4802450a
RÁE
70882010-06-28 Rafael Espindola <espindola@google.com>
7089
7090 * plugin.cc (Plugin::load): Use dlerror.
7091
e5ca47ba
ILT
70922010-06-26 Jeffrey Yaskin <jyasskin@google.com>
7093
7094 * symtab.cc (detect_odr_violations): When reporting an ODR
7095 violation, report an object where the symbol is defined.
7096
8a75a161
DK
70972010-06-25 Doug Kwan <dougkwan@google.com>
7098
7099 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
7100 (Target_arm::section_may_have_icf_unsafe_pointers): New method
7101 definition.
7102 (Target_arm::Scan::local_reloc_may_be_function_pointer,
7103 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
7104 target hook to detect function points.
7105 (Target_arm::Scan::possible_function_pointer_reloc): New method.
7106 * icf.h (Icf::check_section_for_function_pointers): Change type of
7107 parameter SECTION_NAME to const reference to std::string. Use
7108 target hook to determine if section may have unsafe pointers.
7109 * target.h (Target::section_may_have_icf_unsafe_pointers): New
7110 method definition.
7111
42218b9f
RÁE
71122010-06-21 Rafael Espindola <espindola@google.com>
7113
7114 * fileread.cc (Input_file::find_fie): New
7115 (Input_file::open): Use Input_file::find_fie.
7116 * fileread.h (Input_file::find_fie): New
7117 * plugin.cc (set_extra_library_path): New.
7118 (Plugin::load): Add set_extra_library_path to the transfer vector.
7119 (Plugin_manager::set_extra_library_path): New.
7120 (Plugin_manager::add_input_file): Use the extra search path if set.
7121 (set_extra_library_path(): New.
7122 * plugin.h (Plugin_manager): Add set_extra_library_path and
7123 extra_search_path_.
7124
a0506cca
CC
71252010-06-19 Cary Coutant <ccoutant@google.com>
7126
7127 * layout.cc (gdb_sections): Add .debug_types.
7128 (lines_only_debug_sections): Likewise.
7129
6508b958
RÁE
71302010-06-18 Rafael Espindola <espindola@google.com>
7131
7132 * plugin.cc (add_input_file,add_input_library)
7133 (Plugin_manager::add_input_file): Make filename arguments const.
7134 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
7135 const.
7136
3e235302
DK
71372010-06-16 Doug Kwan <dougkwan@google.com>
7138
7139 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
7140 .ARM.attributes section if we have not merged any input
7141 attributes sections.
7142
106e8a6c
DK
71432010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7144
7145 * arm.cc: Allow combining objects with no EABI version
7146 information.
7147
91ff43fe
RÁE
71482010-06-15 Rafael Espindola <espindola@google.com>
7149
7150 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
7151
68ed838c
ILT
71522010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7153
7154 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
7155 (struct iovec): Correct !HAVE_READV definition.
7156
f3a2388f
CC
71572010-06-10 Cary Coutant <ccoutant@google.com>
7158
7159 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
7160 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
7161 reloc sections.
7162 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
7163
7164 PR 11683
7165 * symtab.h (Symbol::is_placeholder): New member function.
7166 * target-reloc.h (relocate_section): Check for placeholder symbols.
7167
7168 * testsuite/Makefile.am (plugin_test_8): New test.
7169 (plugin_test_9): New test.
7170 * testsuite/Makefile.in: Regenerate.
7171
e1df38aa
NC
71722010-06-09 Nick Clifton <nickc@redhat.com>
7173
7174 * yyscript.y (input_list_element): Allow strings prefixed with
7175 the '-' character. Treat these as libraries.
7176 * script.cc (script_add_library): New function. Adds a library
7177 specified by "-l<name>" found in an input script.
7178 * script-c.h: Add prototype for script_add_library.
7179
25bbe950
DK
71802010-06-07 Doug Kwan <dougkwan@google.com>
7181
7182 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
7183 Restrict stub-group size to be within long conditional branch
7184 range when working around cortex-A8 erratum.
7185
0f32ea4c
ILT
71862010-06-07 Damien Diederen <dd@crosstwine.com>
7187
7188 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
7189 #ifdef typo.
7190
8fe2a369
ST
71912010-06-03 Sriraman Tallam <tmsriram@google.com>
7192
7193 PR gold/11658
7194 * output.cc
7195 (Output_section::Input_section_sort_entry::compare_section_ordering):
7196 Change to return non-zero correctly.
7197 (Output_section::Input_section_sort_section_order_index_compare
7198 ::operator()): Change to fix ambiguity in comparisons.
7199
6e9ba2ca
ST
72002010-06-01 Sriraman Tallam <tmsriram@google.com>
7201
7202 * gold.h (is_wildcard_string): New function.
7203 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
7204 (Layout::layout_eh_frame): Ditto.
7205 (Layout::find_section_order_index): New method.
7206 (Layout::read_layout_from_file): New method.
7207 * layout.h (Layout::find_section_order_index): New method.
7208 (Layout::read_layout_from_file): New method.
7209 (Layout::input_section_position_): New private member.
7210 (Layout::input_section_glob_): New private member.
7211 * main.cc (main): Call read_layout_from_file here.
7212 * options.h (--section-ordering-file): New option.
7213 * output.cc (Output_section::input_section_order_specified_): New
7214 member.
7215 (Output_section::Output_section): Initialize new member.
7216 (Output_section::add_input_section): Add new parameter.
7217 Keep input sections when --section-ordering-file is used.
7218 (Output_section::set_final_data_size): Sort input sections when
7219 section ordering file is specified.
7220 (Output_section::Input_section_sort_entry): Add new parameter.
7221 Check sorting type.
7222 (Output_section::Input_section_sort_entry::compare_section_ordering):
7223 New method.
7224 (Output_section::Input_section_sort_compare::operator()): Change to
7225 consider section_order_index.
7226 (Output_section::Input_section_sort_init_fini_compare::operator()):
7227 Change to consider section_order_index.
7228 (Output_section::Input_section_sort_section_order_index_compare
7229 ::operator()): New method.
7230 (Output_section::sort_attached_input_sections): Change to sort
7231 according to section order when specified.
e1df38aa
NC
7232 (Output_section::add_input_section<32, true>): Add new parameter.
7233 (Output_section::add_input_section<64, true>): Add new parameter.
7234 (Output_section::add_input_section<32, false>): Add new parameter.
7235 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
7236 * output.h (Output_section::add_input_section): Add new parameter.
7237 (Output_section::input_section_order_specified): New
7238 method.
7239 (Output_section::set_input_section_order_specified): New method.
7240 (Input_section::Input_section): Initialize section_order_index_.
7241 (Input_section::section_order_index): New method.
7242 (Input_section::set_section_order_index): New method.
7243 (Input_section::section_order_index_): New member.
7244 (Input_section::Input_section_sort_section_order_index_compare): New
7245 struct.
7246 (Output_section::input_section_order_specified_): New member.
7247 * script-sections.cc (is_wildcard_string): Delete and move modified
7248 method to gold.h.
7249 (Output_section_element_input::Output_section_element_input): Modify
7250 call to is_wildcard_string.
7251 (Output_section_element_input::Input_section_pattern
7252 ::Input_section_pattern): Ditto.
7253 (Output_section_element_input::Output_section_element_input): Ditto.
7254 * testsuite/Makefile.am (final_layout): New test case.
7255 * testsuite/Makefile.in: Regenerate.
7256 * testsuite/final_layout.cc: New file.
7257 * testsuite/final_layout.sh: New file.
7258
3537c84b
RÁE
72592010-06-01 Rafael Espindola <espindola@google.com>
7260
7261 * plugin.cc (Plugin::load): Pass the output name to the plugin.
7262
105b6afd
RÁE
72632010-06-01 Rafael Espindola <espindola@google.com>
7264
7265 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
7266 visibility of symbols.
7267
29e11421
DK
72682010-05-27 Doug Kwan <dougkwan@google.com>
7269
7270 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
7271 from start of output section instead of address for a local symbol
7272 in a merged or relaxed section when doing a relocatable link.
7273
5e0f337e
RÁE
72742010-05-26 Rafael Espindola <espindola@google.com>
7275
703d02da 7276 PR 11604
5e0f337e
RÁE
7277 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
7278 adding sections the garbage collector removed.
7279 * gold/testsuite/Makefile.am: Add test.
7280 * gold/testsuite/Makefile.in: Regenerate.
7281 * gold/testsuite/plugin_test_7.sh: New.
7282 * gold/testsuite/plugin_test_7_1.c: New.
7283 * gold/testsuite/plugin_test_7_2.c: New.
7284
f4187277
RÁE
72852010-05-26 Rafael Espindola <espindola@google.com>
7286
7287 * script-sections.cc (Output_section_definition::set_section_addresses):
7288 Check for --section-start.
7289
5c388529
DK
72902010-05-26 Doug Kwan <dougkwan@google.com>
7291
7292 * arm.cc (Arm_scan_relocatable_relocs): New class.
7293 (Target_arm::relocate_special_relocatable): New method.
7294 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
7295 (Arm_relocate_functions::thumb_branch_common): Same.
7296 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
7297 instead of Default_scan_relocatable_relocs.
7298 * target-reloc.h (relocate_for_relocatable): Let target handle
7299 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
7300 * target.h (Sized_target::relocate_special_relocatable): New method.
7301
bca1c3ae
ILT
73022010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7303
7304 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
7305
0439c796
DK
73062010-05-23 Doug Kwan <dougkwan@google.com>
7307
7308 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
7309 instead of a cast.
7310 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
7311 with a direct branch, not a conditional branch, to a stub.
7312 * merge.cc (Output_merge_base::record_input_section): New method
7313 defintion.
7314 (Output_merge_data::do_add_input_section): Record input section if
7315 keeps-input-sections flag is set.
7316 (Output_merge_string::do_add_input_section): Ditto.
7317 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
7318 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
7319 INPUT_SECTIONS_.
7320 (Output_merge_base::keeps_input_sections,
7321 Output_merge_base::set_keeps_input_sections,
7322 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
7323 method definitions.
7324 (Output_merge_base::Input_sections): New type declaration.
7325 (Output_merge_base::input_sections_begin,
7326 Output_merge_base::input_sections_end,
7327 Output_merge_base::do_set_keeps_input_sections): New method definitions.
7328 (Output_merge_base::bool keeps_input_sections_,
7329 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
7330 Output_merge_base::input_sections_): New data members.
7331 (Output_merge_data::do_set_keeps_input_sections): New method
7332 defintion.
7333 (Output_merge_string::do_set_keeps_input_sections): Ditto.
7334 * output.cc (Output_section::Input_section::relobj): Move method
7335 defintion from class declaration to here and handle merge sections.
7336 (Output_section::Input_section::shndx): Ditto.
7337 (Output_section::Output_section): Remove initializations of removed
7338 data members and initialize new data member LOOKUP_MAPS_.
7339 (Output_section::add_input_section): Set keeps-input-sections flag
7340 for a newly created merge output section as appropriate. Adjust code
7341 to use Output_section_lookup_maps class.
7342 (Output_section::add_relaxed_input_section): Adjst code for lookup
7343 maps code refactoring.
2e702c99 7344 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
7345 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
7346 class. If adding input section to a newly created merge output
7347 section fails, remove the new merge section.
7348 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 7349 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 7350 (Output_section::find_merge_section): Ditto.
0439c796 7351 (Output_section::build_lookup_maps): New method defintion.
2e702c99 7352 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
7353 Output_section_lookup_maps class.
7354 (Output_section::get_input_sections): Export merge sections. Adjust
7355 code to use Output_section_lookup_maps class.
7356 (Output_section:::add_script_input_section): Adjust code to use
7357 Output_section_lookup_maps class. Update lookup maps for merge
7358 sections also.
7359 (Output_section::discard_states): Use Output_section_lookup_maps.
7360 (Output_section::restore_states): Same.
7361 * output.h (Merge_section_properties): Move class defintion out of
7362 Output_section.
7363 (Output_section_lookup_maps): New class.
7364 (Output_section::Input_section::is_merge_section): New method
7365 defintion.
7366 (Output_section::Input_section::relobj): Move defintion out of class
7367 defintion. Declare method only.
7368 (Output_section::Input_section::shndx): Ditto.
7369 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 7370 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
7371 (Output_section::Merge_section_by_properties_map,
7372 Output_section::Output_section_data_by_input_section_map,
7373 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
7374 Remove types.
2e702c99 7375 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
7376 KEEPS_INPUT_SECTIONS.
7377 (Output_section::build_lookup_maps): New method declaration.
7378 (Output_section::merge_section_map_,
7379 Output_section::merge_section_by_properties_map_,
7380 Output_section::relaxed_input_section_map_,
7381 Output_section::is_relaxed_input_section_map_valid_): Remove data
7382 members.
7383 (Output_section::lookup_maps_): New data member.
7384
76295588
L
73852010-05-21 Doug Kwan <dougkwan@google.com>
7386
7387 PR gold/11619
7388 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
7389 avoid a compilation error.
7390
d103a984
RÁE
73912010-05-19 Rafael Espindola <espindola@google.com>
7392
7393 * script-sections.cc (Output_section_definition::allocate_to_segment):
7394 Update the phdrs_list even when the output section is NULL.
7395 * testsuite/Makefile.am: Add test.
7396 * testsuite/Makefile.in: Regenerate.
7397 * testsuite/script_test_9.cc: New.
7398 * testsuite/script_test_9.sh: New.
7399 * testsuite/script_test_9.t: New.
7400
6625d24e
DK
74012010-05-19 Doug Kwan <dougkwan@google.com>
7402
7403 * arm.cc (Arm_input_section::original_size): New method.
7404 (Arm_input_section::do_addralign): Add a cast.
7405 (Arm_input_section::do_output_offset): Remove static cast.
7406 (Arm_input_section::original_addralign,
7407 Arm_input_section::original_size_): Change type to uint32_t.
7408 (Arm_input_section::init): Add safe casts for section alignment
7409 and size.
7410 (Arm_input_section::set_final_data_size): Do not set address and
7411 offset of stub table.
7412 (Arm_output_section::fix_exidx_coverage): Change use of of
7413 Output_section::Simple_input_section to that of
7414 Output_section::Input_section.
7415 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
7416 except for the first pass.
7417 * output.cc (Output_section::get_input_sections): Change type of
7418 input_sections to std::list<Input_section>.
7419 (Output_section::add_script_input_section): Rename from
7420 Output_section::add_simple_input_section. Change type of SIS
7421 parameter from Simple_input_section to Input_section.
7422 * output.h (Output_section::Simple_input_section): Remove class.
7423 (Output_section::Input_section): Change class visibility to public.
7424 (Output_section::Input_section::addralign): Use stored alignments
7425 for special input sections if set.
7426 (Output_section::Input_section::set_addralign): New method.
7427 (Output_section::get_input_sections): Change parameter type from
7428 list of Simple_input_section to list of Input_section.
7429 (Output_section::add_script_input_section): Rename from
7430 Output_section::add_simple_input_section. Change first parameter's
7431 type from Simple_input_section to Input_section and remove the
7432 second and third parameters.
7433 * script-sections.cc (Input_section::Input_section_list): Change
7434 type to list of Output_section::Input_section/
7435 (Input_section_info::Input_section_info): Change parameter type of
7436 INPUT_SECTION to Output_section::Input_section.
7437 (Input_section_info::input_section): Change return type.
7438 (Input_section_info::input_section_): Change type to
7439 Output_section::Input_section.
7440 (Output_section_element_input::set_section_addresses): Adjust code
7441 to use Output_section::Input_section instead of
7442 Output_section::Simple_input_section. Adjust code for renaming
7443 of Output_section::add_simple_input_section.
7444 (Orphan_output_section::set_section_addresses): Ditto.
7445
e1e82ea4
RW
74462010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7447
7448 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
7449 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
7450
91e75c8a
RÁE
74512010-05-18 Rafael Espindola <espindola@google.com>
7452
7453 * options.cc (General_options::finalize): Handle -nostdlib.
7454 * options.h (nostdlib): New option.
7455 * script.cc (script_add_search_dir): Handle -nostdlib.
7456
da59ad79
DK
74572010-05-12 Doug Kwan <dougkwan@google.com>
7458
7459 * arm.cc (Target_arm::do_finalize_sections): Create an empty
7460 attributes section only if there no attributes section after merging.
7461 (Target_arm::merge_object_attributes): Move value of
e1df38aa 7462 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
7463 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
7464 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
7465 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
7466 and arm_attr_merge_7.stdout.
7467 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
7468 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
7469 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
7470 arm_attr_merge_7b.o): New rules.
7471 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
7472 arm_attr_merge_7
7473 * testsuite/Makefile.in: Regenerate.
7474 * testsuite/arm_attr_merge.sh: New file.
7475 * testsuite/arm_attr_merge_[67][ab].s: Same.
7476
3e01a7fd
NC
74772010-05-05 Nick Clifton <nickc@redhat.com>
7478
7479 * po/es.po: Updated Spanish translation.
7480
7ad2014a
L
74812010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7482
7483 * Makefile.am (install-exec-local): Properly install gold as
7484 default cross linker.
7485 * Makefile.in: Regenerated.
7486
4fda8867
NC
74872010-04-27 H.J. Lu <hongjiu.lu@intel.com>
7488 Nick Clifton <nickc@redhat.com>
7489
7490 * configure.ac (install_as_default): Define and set to false
7491 unless --enable-gold or --enable-gold=both/gold has been
7492 specified.
7493 * configure: Regenerate.
7494
7495 * Makefile.am (install-exec-local): Install the executable as
7496 'ld.gold'. If install_as_default is true then also install it as
7497 'ld'.
7498 * Makefile.in: Regenerated.
7499
bd288ea2
ILT
75002010-04-24 Ian Lance Taylor <iant@google.com>
7501
7502 * layout.cc (Layout::layout_reloc): In relocatable link don't
7503 combine reloc sections for grouped sections.
7504
ef38fd8a
ST
75052010-04-23 Sriraman Tallam <tmsriram@google.com>
7506
7507 * gc.h (gc_process_relocs): Pass information on relocs pointing to
7508 sections that are not ordinary to icf.
7509 * icf.cc (get_section_contents): Handle relocation pointing to section
7510 with no object or shndx information.
7511 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
7512 * testsuite/Makefile.in: Regenerate.
7513 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
7514 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
7515
f6973bdc
ILT
75162010-04-22 Ian Lance Taylor <iant@google.com>
7517
7518 * expression.cc (Expression::Expression_eval_info): Add
7519 result_alignment_pointer field.
7520 (Expression::eval_with_dot): Add result_alignment_pointer
7521 parameter. Change all callers.
7522 (Expression::eval_maybe_dot): Likewise.
7523 (class Binary_expression): Add alignment_pointer parameter to
7524 left_value and right_value. Change all callers.
7525 (BINARY_EXPRESSION): Set result alignment.
7526 (class Trinary_expression): Add alignment_pointer parameter to
7527 arg2_value and arg3_value. Change all callers.
7528 (Trinary_cond::value): Set result alignment.
7529 (Max_expression::value, Min_expression::value): Likewise.
7530 (Align_expression::value): Likewise.
7531 * script-sections.cc (class Sections_element): Add dot_alignment
7532 parameter to set_section_addresses virtual function. Update
7533 instantiations.
7534 (class Output_section_element): Likewise.
7535 (Script_sections::create_segments): Add dot_alignment parameter.
7536 Change all callers.
7537 (Script_sections::create_segments_from_phdrs_clause): Likewise.
7538 (Script_sections::set_phdrs_clause_addresses): Likewise.
7539 * script-sections.h: Update declarations.
7540 * script.h: Update declarations.
7541 * output.h (Output_segment::set_minimum_p_align): Don't decrease
7542 min_p_align.
7543 * testsuite/script_test_3.t: Set large alignment.
7544 * testsuite/script_test_3.sh: Make sure that at least one LOAD
7545 segment has expected alignment.
7546
9c9c98a5
NC
75472010-04-22 Nick Clifton <nickc@redhat.com>
7548
7549 * po/gold.pot: Updated by the Translation project.
7550 * po/vi.po: Updated Vietnamese translation.
7551
2253bfba
L
75522010-04-22 H.J. Lu <hongjiu.lu@intel.com>
7553
7554 * testsuite/Makefile.am (check_PROGRAMS): Add
7555 icf_virtual_function_folding_test.
7556 * testsuite/Makefile.in: Regenerated.
7557
85fdf906
AH
75582010-04-15 Andrew Haley <aph@redhat.com>
7559
7560 * options.h (merge_exidx_entries): New option.
7561 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
7562 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
7563 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
7564 (Target_arm::merge_exidx_entries): New function.
7565 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
7566 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
7567 to Arm_exidx_fixup constructor.
7568 Add new arg, merge_exidx_entries.
7569 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
7570 Arm_output_section::fix_exidx_coverage.
7571
ce97fa81
ST
75722010-04-18 Sriraman Tallam <tmsriram@google.com>
7573
7574 * icf.cc (get_section_contents): Check for preemptible functions.
7575 Ignore addend when appropriate.
7576 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
7577 section folded.
7578 (add_from_relobj): Check for section folded.
7579 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
7580 * symtab.h (should_add_dynsym_entry): Add new parameter.
7581 * target-reloc.h (scan_relocs): Check for section folded.
7582 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
7583 Check reloc types for function pointers in shared objects.
7584 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
7585 case.
7586 (icf_preemptible_functions_test): New test case.
7587 (icf_string_merge_test): New test case.
7588 * testsuite.Makefile.in: Regenerate.
7589 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
7590 bar_glob. Refactor code.
7591 * testsuite/icf_preemptible_functions_test.cc: New file.
7592 * testsuite/icf_preemptible_functions_test.sh: New file.
7593 * testsuite/icf_string_merge_test.cc: New file.
7594 * testsuite/icf_string_merge_test.sh: New file.
7595 * testsuite/icf_virtual_function_folding_test.cc: New file.
7596 * testsuite/icf_virtual_function_folding_test.sh: New file.
7597
04ceb17c
DK
75982010-04-14 Doug Kwan <dougkwan@google.com>
7599
7600 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
7601 for local symbol recounting if we remove a section due to ICF.
7602 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
7603 there are no regular objects in input.
7604
153e7da4
DK
76052010-04-13 Doug Kwan <dougkwan@google.com>
7606
7607 * arm.cc (Arm_input_section::set_final_data_size): Compute
7608 accurate final data size instead of using current data size.
7609
4dbd9faf
DK
76102010-04-09 Doug Kwan <dougkwan@google.com>
7611
7612 * layout.cc (Layout::choose_output_section): Handle script section
7613 types.
7614 (Layout::make_output_section_for_script): Add section type parameter.
7615 Handle script section types.
7616 * layout.h (Layout::make_output_section_for_script): Add section
7617 type parameter.
7618 * output.cc (Output_section::Output_section): Initialize data member
7619 is_noload_.
7620 (Output_section::do_reset_address_and_file_offset): Do not set address
7621 to 0 if section is a NOLOAD section.
7622 * output.h (Output_section::is_noload): New method.
7623 (Output_section::set_is_noload): Ditto.
7624 (Output_section::is_noload_): New data member.
7625 * script-c.h (Script_section_type): New enum type.
7626 (struct Parser_output_section_header): Add new file section_type.
7627 * script-sections.cc (Sections_element::output_section_name): Add
7628 parameter for returning script section type.
7629 (Output_section_definition::output_section_name): Ditto.
7630 (Output_section_definition::section_type)P; New method.
7631 (Output_section_definiton::script_section_type_name): Ditto.
7632 (Output_section_definition::script_section_type_): New data member.
7633 (Output_section_definition::Output_section_definition): Initialize
7634 data member Output_section_definition::script_section_type_.
7635 (Output_section_definition::create_sections): Pass script section type
7636 to Layout::make_output_section_for_script.
7637 (Output_section_definition::output_section_name): Return script
7638 section type to caller.
7639 (Output_section_definition::set_section_address): Do not advance
7640 dot value and load address if section type is NOLOAD. Set address
7641 of NOLOAD sections regardless of section flags.
7642 (Output_section_definition::print): Print section type if it is
7643 not SCRIPT_SECTION_TYPE_NONE.
7644 (Output_section_definition::section_type): New method.
7645 (Output_section_definition::script_section_type_name): Ditto.
7646 (Script_sections::output_section_name): Add new parameter
7647 PSECTION_TYPE for returning script section type. Pass it to
7648 section elements. Handle discard sections.
7649 (Sort_output_sections::operator()): Handle NOLOAD sections.
7650 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 7651 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
7652 returning script section type.
7653 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
7654 INFO and NOLOAD.
7655 * yyscript.y (union): Add new field SECTION_TYPE.
7656 (COPY, DSECT, INFO, NOLOAD): New tokens.
7657 (opt_address_and_section_type): Change type to output_section_header.
7658 (section_type): New non-terminal
7659 (section_header): Handle section type.
2253bfba 7660 (opt_address_and_section_type): Return section type value.
4dbd9faf 7661
721ea635
L
76622010-04-09 H.J. Lu <hongjiu.lu@intel.com>
7663
7664 * testsuite/plugin_common_test_1.c (foo): Add prototype.
7665 * testsuite/plugin_common_test_2.c (foo): Likewise.
7666
6bf924b0
DK
76672010-04-08 Doug Kwan <dougkwan@google.com>
7668
7669 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
7670 Output_merge_data.
7671 * output.cc (Output_section::add_merge_input_section): Simplify
7672 code and return status of Output_merge_base::add_input_section.
e1df38aa 7673 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
7674 returns true.
7675
24af6f92
DK
76762010-04-07 Doug Kwan <dougkwan@google.com>
7677
7678 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
7679 if section is marked as containing instructions but has no mapping
7680 symbols.
7681 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
7682 correct section index.
7683 (Arm_relobj::find_linked_text_section): Ditto.
7684
00698fc5
CC
76852010-04-07 Cary Coutant <ccoutant@google.com>
7686
7687 * archive.cc (include_member): Destroy Read_symbols_data object before
7688 releasing file.
7689 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
7690 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
7691 (Read_symbols_data::~Read_symbols_data) New destructor.
7692 (Section_relocs::Section_relocs) New constructor.
7693 (Section_relocs::~Section_relocs) New destructor.
7694 (Read_relocs_data::Read_relocs_data) New constructor.
7695 (Read_relocs_data::~Read_relocs_data) New destructor.
7696 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
7697 pointers to NULL after deleting.
7698
7296d933
DK
76992010-04-07 Doug Kwan <dougkwan@google.com>
7700
7701 * arm.cc: Replace "endianity" with "endianness" in comments.
7702 (Arm_exidx_cantunwind): Ditto.
7703 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
7704 (Arm_relobj::merge_flags_and_attributes): New method.
7705 (Arm_relobj::merge_flags_and_attributes_): New data member.
7706 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
7707 (Arm_relobj::scan_sections_for_stubs): Ditto.
7708 (Arm_relobj::do_read_symbols): Check to see if we really want to
7709 merge processor-specific flags and attributes. Exit early if
7710 an object is empty except for section names and the undefined symbol.
7711 (Target_arm::do_finalize_sections): Move check for ELF format to
7712 Arm_relobj::do_read_symbols. Merge processor specific flags and
7713 attributes from a regular object only when we have determined that
7714 it is aapropriate. Do not create an .ARM.attributes section in
7715 output if there is no regular input object.
7716 (Target_arm::merge_processor_specific_flags): Check
7717 --warn-mismatch before printing any error.
7718 (Target_arm::merge_object_attributes): Ditto.
7719 * gold.cc (queue_middle_tasks): Handle the case in which there is
7720 no regular object in input.
7721 * options.cc (General_options::parse_EB): New method.
7722 (General_options::parse_EL): Same.
7723 (General_options::General_options): Initialize endianness_.
7724 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
7725 New options.
7726 (General_options::Endianness): New enum.
7727 (General_options::endianness): New method.
7728 (General_options::endianness_): New data member.
7729 * parameters.cc (Parameters::set_options): Check target endianness.
7730 (Parameters::set_target_once): Ditto.
7731 (Parameters::check_target_endianness): New method.
7732 (parameters_force_valid_target): If either -EL or -EB is specified,
7733 use it to define endianness of default target.
7734 * parameters.h (Parameters::check_target_endianness): New method
7735 declaration.
7736 * target.h (class Target): Change "endianity" to "endianness"
7737 in comments.
7738
efc8d4f2
RW
77392010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7740
7741 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
7742 * configure: Regenerate.
7743 * Makefile.in: Regenerate.
7744 * testsuite/Makefile.in: Regenerate.
7745
be234d88
CC
77462010-04-06 Cary Coutant <ccoutant@google.com>
7747
7748 gcc PR lto/42757
7749 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
7750 prevailing definitions of common symbols.
7751 * testsuite/plugin_test_6.sh: New test case.
7752 * testsuite/plugin_common_test_1.c: New test case.
7753 * testsuite/plugin_common_test_2.c: New test case.
7754 * testsuite/Makefile.am (plugin_test_6): New test case.
7755 * testsuite/Makefile.in: Regenerate.
7756
bd32c6bd
NC
77572010-04-06 Nick Clifton <nickc@redhat.com>
7758
7759 * po/vi.po: New Vietnamese translation.
7760
323c532f
DK
77612010-03-30 Doug Kwan <dougkwan@google.com>
7762
7763 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
7764
4fcd97eb
DK
77652010-03-25 Doug Kwan <dougkwan@google.com>
7766
7767 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
7768 to avoid a conversion warning on a 32-bit host.
7769
4ebf39db
ILT
77702010-03-24 Ian Lance Taylor <iant@google.com>
7771
7772 * testsuite/script_test_3.t: Add a TLS segment.
7773 * testsuite/Makefile.am (check_PROGRAMS): Add
7774 tls_phdrs_script_test.
7775 (tls_phdrs_script_test_SOURCES): Define.
7776 (tls_phdrs_script_test_DEPENDENCIES): Define.
7777 (tls_phdrs_script_test_LDFLAGS): Define.
7778 (tls_phdrs_script_test_LDADD): Define.
7779 * testsuite/Makefile.in: Rebuild.
7780
4a599bdd
CC
77812010-03-23 Cary Coutant <ccoutant@google.com>
7782
7783 * fileread.cc (find_or_make_view): Fix comment.
7784
6c93b22c
ILT
77852010-03-23 Ian Lance Taylor <iant@google.com>
7786
7787 * script-sections.cc (class Orphan_section_placement): Define
7788 PLACE_TLS and PLACE_TLS_BSS.
7789 (Orphan_section_placement::Orphan_section_placement): Initialize
7790 new places.
7791 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
7792 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
7793 (tls_script_test_SOURCES): Define.
7794 (tls_script_test_DEPENDENCIES): Define.
7795 (tls_script_test_LDFLAGS): Define.
7796 (tls_script_test_LDADD): Define.
7797 * testsuite/Makefile.in: Rebuild.
7798
a2c7281b
DK
77992010-03-22 Doug Kwan <dougkwan@google.com>
7800
7801 * arm.cc (Arm_relocate_functions::abs8,
7802 Arm_relocate_functions::abs16): Use correct check for overflow
7803 specified in the ARM ELF specs.
7804 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
7805 target of a BLX instruction specially.
7806 (Reloc_stub::stub_type_for_reloc): Ditto.
7807 (Relocate::relocate): Use symbolic names instead of numeric relocation
7808 codes to report error.
7809 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
7810 workaround.
7811 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
7812 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
7813 thumb2_blx_out_of_range.stdout
7814 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
7815 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
7816 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
7817 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
7818 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
7819 thumb2_blx_in_range, thumb2_blx_in_range.o,
7820 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
7821 thumb2_blx_out_of_range.o): New rules.
2e702c99 7822 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
7823 thumb2_blx_in_range and thumb2_blx_out_of_range.
7824 * testsuite/Makefile.in: Regenerate.
7825 * arm_branch_in_range.sh: Add tests for THUMB BLX.
7826 * testsuite/thumb_blx_in_range.s: New file.
7827 * testsuite/thumb_blx_out_of_range.s: New file.
7828
b0193076
RÁE
78292010-03-22 Rafael Espindola <espindola@google.com>
7830
7831 * archive.cc (Should_include): Move to archive.h.
7832 (should_include_member): Make it a member of Archive.
7833 (Lib_group): New.
7834 (Add_lib_group_symbols): New.
7835 * archive.h: Include options.h.
7836 (Archive_member): Moved from Archive.
7837 (Should_include): Moved from archive.cc.
7838 (Lib_group): New.
7839 (Add_lib_group_symbols): New.
7840 * dynobj.cc (do_should_include_member): New.
7841 * dynobj.h (do_should_include_member): New.
7842 * gold.cc (queue_initial_tasks): Update call to queue.
7843 * main.cc (main): Print lib group stats.
7844 * object.cc (do_should_include_member): New.
7845 * object.h: Include archive.h.
7846 (Object::should_include_member): New.
7847 (Object::do_should_include_member): New.
7848 (Sized_relobj::do_should_include_member): New.
7849 * options.cc (General_options::parse_start_lib): New.
7850 (General_options::parse_end_lib): New.
7851 (Input_arguments::add_file): Handle lib groups.
7852 (Input_arguments::start_group): Check we are not in a lib.
7853 (Input_arguments::start_lib): New.
7854 (Input_arguments::end_lib): New.
7855 * options.h (General_options): Add start_lib and end_lib.
7856 (Input_argument::lib_): New.
7857 (Input_argument::lib): New.
7858 (Input_argument::is_lib): New.
7859 (Input_file_lib): New.
7860 (Input_arguments::in_lib_): New.
7861 (Input_arguments::in_lib): New.
7862 (Input_arguments::start_lib): New.
7863 (Input_arguments::end_lib_): New.
7864 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
7865 in unused members as preempted.
7866 (Sized_pluginobj::do_should_include_member): New.
7867 * plugin.h (Sized_pluginobj::do_should_include_member): New.
7868 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
7869 return the blocker.
7870 (Read_symbols::do_whole_lib_group): New.
7871 (Read_symbols::do_lib_group): New.
7872 (Read_symbols::do_read_symbols): Handle lib groups.
7873 (Read_symbols::get_name): Handle lib groups.
7874 * readsyms.h (Read_symbols): Add an archive member pointer.
7875 (Read_symbols::do_whole_lib_group): New.
7876 (Read_symbols::do_lib_group): New.
7877 (Read_symbols::member_): New.
7878 * script.cc (read_input_script): Update call to queue_soon.
7879
d099120c
DK
78802010-03-19 Doug Kwan <dougkwan@google.com>
7881
7882 * arm.cc (Stub_table::Stub_table): Initialize new data members
7883 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7884 (Stub_table::add_reloc_stub): Assign stub offset and update
7885 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
7886 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
7887 New data members.
2e702c99 7888 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
7889 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
7890 instead of going over all reloc stubs.
2e702c99 7891 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
7892 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7893 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 7894 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
7895 Stringpool_template::offset_.
7896 * stringpool.h (Stringpool_template::set_no_zero_null): Set
7897 Stringpool_template::offset_ to zero.
7898
1aa37384
DK
78992010-03-15 Doug Kwan <dougkwan@google.com>
7900
7901 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
7902 offset_.
7903 (Stringpool_template::new_key_offset): New method.
7904 (Stringpool_template::add_string): Assign offsets when adding new
7905 strings.
7906 (Stringpool_template::set_string_offsets): Do not set string offsets
7907 when not optimizing.
7908 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
7909 member size_.
2e702c99
RM
7910 (Chunked_vector::clear): Clear size_.
7911 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
7912 (Chunked_vector::size): Return size_.
7913 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 7914 (Chunked_vector::size_): New data member.
1aa37384
DK
7915 (Stringpool_template::set_no_zero_null): Assert string set is empty.
7916 (Stringpool_template::new_key_offset): New method declaration.
7917 (Stringpool_template::offset_): New data member.
7918
b672b057
RÁE
79192010-03-15 Rafael Espindola <espindola@google.com>
7920
7921 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
7922 Add_symbols' constructor.
7923 * readsyms.h (Add_symbols): Remove the input_group member.
7924
b6848d3c
ILT
79252010-03-10 Ian Lance Taylor <iant@google.com>
7926
7927 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
7928 target to ask whether a reference to a symbol requires a stack
7929 split.
7930 * target.h (Target::is_call_to_non_split): New function.
7931 (Target::do_is_call_to_non_split): Declare virtual function.
7932 * target.cc: Include "symtab.h".
7933 (Target::do_is_call_to_non_split): New function.
7934 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
7935
a2a5469e
CC
79362010-03-10 Cary Coutant <ccoutant@google.com>
7937
7938 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
7939 (File_read::open[1]): Remove initial mapping of whole_file_view_.
7940 (File_read::open[2]): Add whole_file_view_ to list of views.
7941 (File_read::make_view): Remove test of whole_file_view_.
7942 (File_read::find_or_make_view): Create whole_file_view_ if
7943 necessary.
7944 (File_read::clear_views): Replace bool parameter with enum;
7945 adjust all callers. Don't delete views with permanent data;
7946 do delete cached views and views from archives if
7947 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
7948 if clearing the corresponding view.
7949 * fileread.h (File_read::Clear_views_mode): New enum.
7950 (File_read::View::is_permanent_view): New method.
7951 (File_read::clear_views): Replace bool parameter
7952 with enum; adjust all callers.
7953 * options.h (General_options): Change keep_files_mapped option;
7954 add map_whole_files.
7955 * readsyms.cc (Add_symbols::run): Delete sd_ object before
7956 releasing the file.
7957 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
7958 the file.
7959
8861f32b
DM
79602010-03-10 David S. Miller <davem@davemloft.net>
7961
7962 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
7963
d62d0f5f
ST
79642010-03-09 Sriraman Tallam <tmsriram@google.com>
7965
7966 * icf.cc (get_section_contents): Add '@' marker after processing the
7967 merge reloc.
7968
9177756d
DK
79692010-03-08 Doug Kwan <dougkwan@google.com>
7970
7971 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
7972 due to a conversion warning.
7973 (Arm_relobj::update_output_local_symbol_count): Check for local
7974 symbol with unset output index.
7975
9e9e071b
ILT
79762010-03-05 Ian Lance Taylor <iant@google.com>
7977
7978 * options.h (class General_options): Add --spare-dynamic-tags.
7979 * output.cc (Output_data_dynamic::set_final_data_size): Implement
7980 --spare-dynamic-tags.
7981
a81ee015
ILT
79822010-03-05 Ian Lance Taylor <iant@google.com>
7983
7984 * incremental.cc: Include "libiberty.h".
7985
44ec90b9
RO
79862010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
7987
7988 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
7989 function, is_info_ member.
7990 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
7991 (Versions::Versions): Update caller.
7992 (Versions::define_base_version): Likewise.
7993 (Versions::add_def): Likewise.
7994
0897ed3b
ST
79952010-03-03 Sriraman Tallam <tmsriram@google.com>
7996
7997 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
7998 (Scan::possible_function_pointer_reloc): New function.
7999 (Scan::local_reloc_may_be_function_pointer): Change to call
8000 possible_function_pointer_reloc.
8001 (Scan::global_reloc_may_be_function_pointer): Ditto.
8002 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8003 relocations in ".data.rel.ro._ZTV" section.
8004 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8005 * testsuite/icf_safe_so_test.cc: Ditto.
8006 * testsuite/icf_safe_test.cc: Ditto.
8007 * testsuite/icf_safe_test.sh: Ditto.
8008
d3bbad62
ILT
80092010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8010 Ian Lance Taylor <iant@google.com>
8011
8012 * target-reloc.h (relocate_section): Check the symbol table index
8013 for -1U before setting the local symbol index.
8014 (scan_relocatable_relocs): If copying the relocation, record that
8015 the local symbol is required.
8016 * object.h (Symbol_value::is_output_symtab_index_set): New
8017 function.
8018 (Symbol_value::may_be_discarded_from_output_symtab): New
8019 function.
8020 (Symbol_value::has_output_symtab_entry): New function.
8021 (Symbol_value::needs_output_symtab_entry): Remove.
8022 (Symbol_value::output_symtab_index): Make sure the symbol index is
8023 set.
8024 (Symbol_value::set_output_symtab_index): Make sure the symbol
8025 index is not set. Make sure the new index is valid.
8026 (Symbol_value::set_must_have_output_symtab_entry): New function.
8027 (Symbol_value::has_output_dynsym_entry): New function.
8028 (Symbol_value::set_output_dynsym_index): Make sure the new index
8029 is valid.
8030 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8031 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8032 local symbol if permitted.
8033 (Sized_relobj::do_finalize_local_symbols): Call
8034 is_output_symtab_index_set rather than needs_output_symtab_entry.
8035 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8036 rather than needs_output_symtab_entry. Call
8037 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8038 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8039 is_output_symtab_index_set rather than needs_output_symtab_entry.
8040 * testsuite/discard_locals_relocatable_test.c: New file.
8041 * testsuite/discard_locals_test.sh: Test -r.
8042 * testsuite/Makefile.am (check_DATA): Add
8043 discard_locals_relocatable_test1.syms,
8044 discard_local_relocatable_test2.syms.
8045 (MOSTLYCLEANFILES): Likewise. Also add
8046 discard_locals_relocatable_test1.lout and
8047 discard_locals_relocatable_test2.out.
8048 (discard_locals_relocatable_test1.syms): New target.
8049 (discard_locals_relocatable_test.o): New target.
8050 (discard_locals_relocatable_test1.out): New target.
8051 (discard_locals_relocatable_test2.syms): New target.
8052 (discard_locals_relocatable_test2.out): New target.
8053 (various): Add missing ../ld-new dependencies.
8054 * testsuite/Makefile.in: Rebuild.
8055
7e8ccf26
NC
80562010-03-03 Nick Clifton <nickc@redhat.com>
8057
8058 * po/fi.po: New Finnish translation.
8059
2a0ff005
DK
80602010-03-01 Doug Kwan <dougkwan@google.com>
8061
8062 * layout.cc (Layout::Layout): Force section types of .init_array*,
8063 .preinit_array* and .fini_array* sections.
8064 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8065 Fix check of return value of std::string::find.().
8066 (Output_section::Input_section_sort_compare::operator()): Remove
8067 comment about .init_array.
8068 (Output_section::Input_section_sort_init_fini_compare::operator()):
8069 New method.
8070 (Output_section::sort_attached_input_sections): Handle .init_array
8071 and .fini_array specially.
8072 * output.h (Output_section::Inut_section_sort_compare): Update
8073 comment.
8074 (Output_section::Input_section_sort_init_fini_compare): New struct.
8075
c3e4ae29
DK
80762010-02-26 Doug Kwan <dougkwan@google.com>
8077
8078 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8079 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8080 * testsuite/debug_msg.sh: Avoid matching source line number for
8081 use of global variable undef_int.
8082
2fd9ae7a
DK
80832010-02-26 Doug Kwan <dougkwan@google.com>
8084
8085 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
8086 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
8087 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
8088 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
8089 * options.cc (General_options::General_options): Initialize member
8090 fix_v4bx_.
8091 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
8092 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
8093 and rm_no_fix_v4bx.stdout
8094 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
8095 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
8096 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
8097 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
8098 and arm_no_fix_v4bx.
8099 * Makefile.in: Regenerate.
8100 * testsuite/arm_fix_v4bx.s: New file.
8101 * testsuite/arm_fix_v4bx.sh: Ditto.
8102
67ec7d0b
DK
81032010-02-24 Doug Kwan <dougkwan@google.com>
8104
8105 * arm.cc (Target_arm::got_section): Make the .got section the first
8106 non RELRO section in the data segment.
8107 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
8108 suffixes of section names.
8109
10165461
DK
81102010-02-24 Doug Kwan <dougkwan@google.com>
8111
8112 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
8113 flags and attributes merging if an input file is a binary file.
8114 * fileread.cc (Input_file::open): Record format of original file.
8115 * fileread.h (Input_file::Format): New enum type.
2e702c99 8116 (Input_file::Input_file): Initialize data member format_.
10165461
DK
8117 (Input_file::format): New method definition.
8118 (Input_file::format_):: New data member.
8119
4a54abbb
DK
81202010-02-24 Doug Kwan <dougkwan@google.com>
8121
8122 * arm.cc (Arm_output_data_got): New class.
8123 (ARM_TCB_SIZE): New constant
8124 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
8125 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
8126 If user uses a script with a SECTIONS clause, issue only a warning
8127 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 8128 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
8129 garbage collection.
8130 (Target_arm::got_mode_index_entry): Handle static linking.
8131 (Target_arm::Scan::local): Ditto.
8132 (Target_arm::Scan::global): Ditto.
8133 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
8134 all incorrectly implemented relocations.
e1df38aa 8135 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
8136 Arm_output_section::fix_exidx_coverage.
8137 * layout.cc (Layout::section_name_mapping): Remove trailing dots
8138 from ".ARM.exidx." and ".ARM.extab.".
8139
ca419a6f
ILT
81402010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8141
8142 * arm.cc (Target_arm::do_finalize_sections): Create attribute
8143 section if it does not already exist.
8144 * attributes.cc (Attributes_section_data::Attributes_section_data):
8145 Don't crash if size is zero.
8146
135b9c78
ILT
81472010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8148 Ian Lance Taylor <iant@google.com>
8149
8150 * gold.cc (queue_middle_tasks): If no input files were opened,
8151 exit.
8152 * workqueue.h (Task_function::Task_function): Assert that there is
8153 a blocker.
8154
bb0bfe4f
DK
81552010-02-22 Doug Kwan <dougkwan@google.com>
8156
8157 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
8158 * icf.cc (get_section_contents): Cast snprintf arguments to long long
8159 types to avoid warnings due to different uint64_t implementations
8160 on different hosts.
8161
2a2b6d42
DK
81622010-02-21 Doug Kwan <dougkwan@google.com>
8163
8164 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
8165 handling of the maximum backward branch offset.
2e702c99 8166 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
8167 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
8168 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 8169 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
8170 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
8171 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
8172 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
8173 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
8174 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
8175 thumb_bl_out_of_range thumb_bl_out_of_range.o,
8176 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
8177 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
8178 thumb2_bl_out_of_range.o): New rules.
8179 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
8180 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
8181 thumb2_bl_out_of_range
8182 * testsuite/Makefile.in: Regenerate.
8183 * testsuite/arm_bl_in_range.s: New file.
8184 * testsuite/arm_bl_out_of_range.s: Ditto.
8185 * testsuite/arm_branch_in_range.sh: Ditto.
8186 * testsuite/arm_branch_range.t: Ditto.
8187 * testsuite/thumb2_branch_range.t: Ditto.
8188 * testsuite/thumb_bl_in_range.s: Ditto.
8189 * testsuite/thumb_bl_out_of_range.s: Ditto.
8190 * testsuite/thumb_branch_range.t: Ditto.
8191
b487ad64
ST
81922010-02-20 Sriraman Tallam <tmsriram@google.com>
8193
8194 * gc.h (gc_process_relocs): Change vectors to point to the new list.
8195 Add reloc offset information.
8196 * icf.cc (get_section_contents): Change iterators to point to the new
8197 vectors. Add reloc offset information to the contents.
8198 * icf.h (Icf::Sections_reachable_info): New typedef.
8199 (Icf::Sections_reachable_list): New typedef.
8200 (Icf::Offset_info): New typedef.
8201 (Icf::Reloc_info): New struct typedef.
8202 (Icf::Reloc_info_list): New typedef.
8203 (Icf::symbol_reloc_list): Delete method.
8204 (Icf::addend_reloc_list): Delete method.
8205 (Icf::section_reloc_list): Delete method.
8206 (Icf::reloc_info_list): New method.
8207 (Icf::reloc_info_list_): New member.
8208
f96accdf
DK
82092010-02-19 Doug Kwan <dougkwan@google.com>
8210
8211 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
8212 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
8213 * arm.cc (Arm_relocation_functions): New forward declaration.
8214 (Target_arm::Target_arm): Initialize new data members
8215 got_mod_index_offset_ and tls_base_symbol_defined_.
8216 (Target_arm::Relocate::relocate_tls): New method.
8217 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
8218 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
8219 New methods.
2e702c99 8220 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
8221 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
8222 (Target_arm::got_mod_index_offset_,
8223 Target_arm::tls_base_symbol_defined_): New data members.
8224 (Target_arm::Scan::local, Target::Scan::global,
8225 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
8226 relocations.
8227
c8761b9a
DK
82282010-02-18 Doug Kwan <dougkwan@google.com>
8229
8230 * arm.cc (Arm_relobj::find_linked_text_section): New method.
8231 (Arm_relobj::make_exidx_input_section): Pass section index of linked
8232 text section as a parameter becuase some broken tools may not set
8233 the link in section header.
8234 (Target_arm::has_got_section): New method.
8235 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
8236 without any mapping symbol as data only. Remove warning.
8237 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
8238 link in its section header, try to discover the link by inspecting the
8239 REL31 relocation at the beginning of the section.
8240 (Target_arm::Scan::check_non_pic): Report name of offending relocation
8241 in error message.
8242 (Target_arm::Scan::global): Treat any reference to the symbol
8243 _GLOBAL_OFFSET_TABLE_ as a GOT access.
8244
21bb3914
ST
82452010-02-12 Sriraman Tallam <tmsriram@google.com>
8246
8247 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
8248 (Scan::global_reloc_may_be_function_pointer): New function.
8249 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8250 (Scan::global_reloc_may_be_function_pointer): New function.
8251 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
8252 (Scan::global_reloc_may_be_function_pointer): New function.
8253 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
8254 (Scan::global_reloc_may_be_function_pointer): New function.
8255 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
8256 (Scan::global_reloc_may_be_function_pointer): New function.
8257 (Scan::possible_function_pointer_reloc): New function.
8258 (Target_x86_64::can_check_for_function_pointers): New function.
8259 * gc.h (gc_process_relocs): Scan relocation types to determine if
8260 function pointers were taken for targets that support it.
8261 * icf.cc (Icf::find_identical_sections): Include functions for
8262 folding in safe ICF whose pointer is not taken.
8263 * icf.h (Secn_fptr_taken_set): New typedef.
8264 (fptr_section_id_): New member.
8265 (section_has_function_pointers): New function.
8266 (set_section_has_function_pointers): New function.
8267 (check_section_for_function_pointers): New function.
8268 * options.h: Fix comment for safe ICF option.
8269 * target.h (can_check_for_function_pointers): New function.
8270 * testsuite/Makefile.am: Add icf_safe_so_test test case.
8271 Modify icf_safe_test for X86-64.
8272 * testsuite/Makefile.in: Regenerate.
8273 * testsuite/icf_safe_so_test.cc: New file.
8274 * testsuite/icf_safe_so_test.sh: New file.
8275 * testsuite/icf_safe_test.cc (kept_func_3): New function.
8276 (main): Change to take pointer to function kept_func_3.
8277 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
8278 folding is done correctly for X86-64.
8279
0da6fa6c
DM
82802010-02-12 David S. Miller <davem@davemloft.net>
8281
8282 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
8283 is_symbolless parameter.
8284 (Output_reloc<SHT_REL>::is_symbolless): New.
8285 (Output_reloc<SHT_REL>::is_symbolless_): New.
8286 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
8287 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
8288 (Output_reloc<SHT_RELA>::is_symbolless): New.
8289 (Output_data_reloc::add_global): Handle is_symbolless.
8290 (Output_data_reloc::add_global_relative): Likewise.
8291 (Output_data_reloc::add_local): Likewise.
8292 (Output_data_reloc::add_local_relative): Likewise.
8293 (Output_data_reloc::add_symbolless_global_addend): New.
8294 (Output_data_reloc::add_symbolless_local_addend): New.
8295 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
8296 is_symbolless.
8297 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
8298 instead of ->is_relative_
8299 (Output_reloc::write): Likewise.
8300 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
8301 (Output_reloc::write_rel): Simplify.
8302
8303 * sparc.cc (Target_sparc::Scan::local): Use
8304 ->add_symbolless_local_addend as needed.
8305 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
8306 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
8307 based upon relocation offset.
8308
e4782e83
DK
83092010-02-11 Doug Kwan <dougkwan@google.com>
8310
8311 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
8312 (Target_arm::Scan::global): Ditto. Also remove a comment before the
8313 beginning of function.
8314 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
8315 and MOVT_ABS relocations. Those are non issued in scanning. Fix
8316 parameter is_32bit in calls to should_apply_static_reloc.
8317 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
8318 (check_DATA): Add arm_abs_global.stdout.
8319 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
8320 arm_abs_global.stdout): New rules.
8321 (MOSTLLYCLEANFILES): Add arm_abs_global
8322 * Makefile.in: Regenerate.
8323 * testsuite/arm_abs_global.s: New file.
8324 * testsuite/arm_abs_global.sh: Ditto.
8325 * testsuite/arm_abs_lib.s: Ditto.
8326
93ceb764
ILT
83272010-02-11 Ian Lance Taylor <iant@google.com>
8328
8329 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
8330 Read_relocs task.
8331 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
8332 Allocate_commons_task first.
8333 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
8334 task, rather than symtab_lock_.
8335 (Gc_process_relocs::~Gc_process_relocs): New function.
8336 (Gc_process_relocs::is_runnable): Check this_blocker_.
8337 (Gc_process_relocs::locks): Use next_blocker_ rather than
8338 blocker_.
8339 (Scan_relocs::~Scan_relocs): New function.
8340 (Scan_relocs::is_runnable): Check this_blocker_ rather than
8341 symtab_lock_.
8342 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
8343 next_blocker_.
8344 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
8345 fields. Add this_blocker_ and next_blocker_ fields. Adjust
8346 constructor accordingly.
8347 (class Gc_process_relocs): Likewise.
8348 (class Scan_relocs): Likewise.
8349 * common.h (class Allocate_commons_task): Remove symtab_lock_
8350 field, and corresponding constructor parameter.
8351 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
8352 symtab_lock_.
8353 (Allocate_commons_task::locks): Likewise.
8354
114dfbe1
ILT
83552010-02-11 Ian Lance Taylor <iant@google.com>
8356
8357 * gold-threads.h (class Once): Define.
8358 (class Initialize_lock): Rewrite as child of Once.
8359 * gold-threads.cc (class Once_initialize): Define.
8360 (once_pointer_control): New static variable.
8361 (once_pointer, once_arg): New static variables.
8362 (c_run_once): New static function.
8363 (Once::Once, Once::run_once, Once::internal_run): New functions.
8364 (class Initialize_lock_once): Remove.
8365 (initialize_lock_control): Remove.
8366 (initialize_lock_pointer): Remove.
8367 (initialize_lock_once): Remove.
8368 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
8369 (Initialize_lock::initialize): Rewrite.
8370 (Initialize_lock::do_run_once): New function.
8371 * archive.cc (Archive::interpret_header): Only clear name if it is
8372 not already empty.
8373 * fileread.cc: Include "gold-threads.h"
8374 (file_counts_lock): New static variable.
8375 (file_counts_initialize_lock): Likewise.
8376 (File_read::release): Only increment counts when using --stats.
8377 Use a lock around the increment.
8378 * parameters.cc (class Set_parameters_target_once): Define.
8379 (set_parameters_target_once): New static variable.
8380 (Parameters::Parameters): Move here from parameters.h.
8381 (Parameters::set_target): Rewrite.
8382 (Parameters::set_target_once): New function.
8383 (Parameters::clear_target): Move here and rewrite.
8384 * parameters.h (class Parameters): Update declarations. Add
8385 set_parameters_target_once_ field.
8386 (Parameters::Parameters): Move to parameters.cc.
8387 (Parameters::clear_target): Likewise.
8388 * readsyms.cc (Read_symbols::do_group): Create a Start_group
8389 task.
8390 (Start_group::~Start_group): New function.
8391 (Start_group::is_runnable): New function.
8392 (Start_group::locks, Start_group::run): New functions.
8393 (Finish_group::run): Change saw_undefined to size_t.
8394 * readsyms.h (class Start_group): Define.
8395 (class Finish_group): Change saw_undefined_ field to size_t.
8396 (Finish_group::Finish_group): Remove saw_undefined and
8397 this_blocker parameters. Change all callers.
8398 (Finish_group::set_saw_undefined): New function.
8399 (Finish_group::set_blocker): New function.
8400 * symtab.h (class Symbol_table): Change saw_undefined to return
8401 size_t. Change saw_undefined_ field to size_t.
8402 * target-select.cc (Set_target_once::do_run_once): New function.
8403 (Target_selector::Target_selector): Initialize set_target_once_
8404 field. Don't initialize lock_ and initialize_lock_ fields.
8405 (Target_selector::instantiate_target): Rewrite.
8406 (Target_selector::set_target): New function.
8407 * target-select.h (class Set_target_once): Define.
8408 (class Target_selector): Update declarations. Make
8409 Set_target_once a friend. Remove lock_ and initialize_lock_
8410 fields. Add set_target_once_ field.
8411
fa17a3f4
ILT
84122010-02-10 Ian Lance Taylor <iant@google.com>
8413
8414 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
8415 queueing any tasks.
8416 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
8417 (queue_middle_tasks): Add all blockers before queueing any tasks.
8418 (queue_final_tasks): Likewise.
8419 * token.h (Task_token::add_blockers): New function.
8420 * object.h (Input_objects::number_of_relobjs): New function.
8421
c7177d31
ILT
84222010-02-10 Ian Lance Taylor <iant@google.com>
8423
5de0e392
ILT
8424 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
8425 shared, not if not position independent.
8426 * x86_64.cc (Relocate::relocate_tls): Likewise.
8427 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
8428 (tls_pie_pic_test): New target.
8429 * testsuite/Makefile.in: Rebuild.
8430
c7177d31
ILT
8431 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
8432 (tls_test_main_pie.o, tls_test_pie.o): New targets.
8433 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
8434 * testsuite/Makefile.in: Rebuild.
8435
684b268a
DM
84362010-02-09 David S. Miller <davem@davemloft.net>
8437
8438 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
8439 R_SPARC_RELATIVE using ->add_local_relative().
8440 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
8441
612a8d3d
DM
8442 * output.h (Output_data_dynamic::add_section_size): New method
8443 that takes two Output_data objects.
8444 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
8445 entry param. Handle it in initializers.
8446 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
8447 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
8448 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
8449 arg.
8450 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
8451 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
8452 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
8453 for dynrel_includes_plt.
8454 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8455 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8456 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
8457 before .rela.plt
8458 (Target_sparc::do_finalize_sections): Update to pass true for
8459 dynrel_includes_plt.
8460 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
8461 output before .rela.plt
8462 (Target_powerpc::do_finalize_sections): Update to pass true for
8463 dynrel_includes_plt when 32-bit.
8464
cb1be87e
DK
84652010-02-08 Doug Kwan <dougkwan@google.com>
8466
8467 * arm.cc (Arm_relobj::simple_input_section_output_address): New
8468 method.
8469 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
8470 Arm_relobj::scan_section_for_cortex_a8_stubs,
8471 Arm_relobj::do_relocation_section): Instead of calling
8472 Output_section::output_address, use faster
8473 Arm_relobj::simple_input_section_output_address.
8474
705b5121
DM
84752010-02-08 David S. Miller <davem@davemloft.net>
8476
8477 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
8478 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
8479 relocation helper function.
8480
024c4466
DM
8481 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
8482 just like R_SPARC_GOT{10,13,22}.
8483 (Target_sparc::Scan::local): Likewise.
8484 (Target_sparc::Relocate:relocate): Likewise.
8485
9109c078
ILT
84862010-02-06 Ian Lance Taylor <iant@google.com>
8487
8488 * configure.ac: Rewrite targetobjs duplicate removal code to use
8489 only shell constructs.
8490 * configure: Rebuild.
8491
cf846138
DK
84922010-02-05 Doug Kwan <dougkwan@google.com>
8493
8494 PR 11247
8495 * arm.cc (Arm_relobj::section_is_scannable): New method.
8496 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
8497 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
8498
6cfaf60b
DK
84992010-02-04 Doug Kwan <dougkwan@google.com>
8500
8501 PR 11247
8502 * arm-reloc-property.cc (cstdio): Include.
8503 * configure.ac (targetobjs): Remove duplicates.
8504 * configure: Regenerate.
8505 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
8506 big and little endian version for a given address size.
8507
5c57f1be
DK
85082010-02-03 Doug Kwan <dougkwan@google.com>
8509
8510 * arm-reloc-property.cc
8511 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8512 definition.
8513 * arm-reloc-property.h
8514 (Arm_reloc_property_table::get_implemented_static_reloc_property):
8515 New method definition.
8516 (Arm_reloc_property_table::reloc_name_in_error_message): New method
8517 declaration.
8518 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
8519 overflow to N.
8520 (GOT_PREL): Change implemented to Y.
8521 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
8522 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
8523 (Arm_relocate_functions::movw_abs_nc): Remove method.
8524 (Arm_relocate_functions::movt_abs): Ditto.
8525 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
8526 (Arm_relocate_functions::thm_movt_abs): Ditto.
8527 (Arm_relocate_functions::movw_rel_nc): Ditto.
8528 (Arm_relocate_functions::movw_rel): Ditto.
8529 (Arm_relocate_functions::movt_rel): Ditto.
8530 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
8531 (Arm_relocate_functions:thm_movw_rel): Ditto.
8532 (Arm_relocate_functions:thm_movt_rel): Ditto.
8533 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
8534 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
8535 New method definitions.
8536 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
8537 (Arm_relocation_functions::arm_grp_ldr): Ditto.
8538 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
8539 (Arm_relocation_functions::arm_grp_ldc): Ditto.
8540 (Target_arm::Relocate::relocate): Check for non-static or
8541 unimplemented relocation code and exit early. Change calls to
8542 Target_arm::reloc_uses_thumb_bit and
8543 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
8544 instead. Refactor code to handle similar relocations to increase
8545 code sharing. Remove check for unsupported relocation code in switch
8546 statement.
8547 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
8548 relocation property table to find out size. Change error message to
8549 print out the name of a relocation code instead of the numeric value.
8550 (Target_arm::scan_reloc_for_stub): Use relocation property table
8551 instead of calling Target_arm::reloc_uses_thumb_bit().
8552
218c5831
DK
85532010-02-02 Doug Kwan <dougkwan@google.com>
8554
8555 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
8556 types of relaxed input section.
8557
0d31c79d
DK
85582010-02-02 Doug Kwan <dougkwan@google.com>
8559
8560 * Makefile.am (HFILES): Add arm-reloc-property.h.
8561 (DEFFILES): New.
2e702c99
RM
8562 (TARGETSOURCES): Add arm-reloc-property.cc
8563 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
8564 (libgold_a_SOURCES): $(DEFFILES)
8565 * Makefile.in: Regenerate.
8566 * arm-reloc-property.cc: New file.
8567 * arm-reloc-property.h: New file.
8568 * arm-reloc.def: New file.
8569 * arm.cc: Update comments.
8570 (arm-reloc-property.h): New included header.
8571 (arm_reloc_property_table): New global variable.
8572 (Target_arm::do_select_as_default_target): New method definition.
8573 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
8574 arm-reloc-property to targ_extra_obj.
8575 * parameters.cc (set_parameters_target): Call
8576 Target::select_as_default_target().
8577 * target.h (Target::select_as_default_target): New method definition.
8578 (Target::do_select_as_default_target): Same.
8579
546c7457
DK
85802010-02-01 Doug Kwan <dougkwan@google.com>
8581
8582 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
8583 first_output_text_section_.
8584 (Arm_exidx_fixup::first_output_text_section): New method definition.
8585 (Arm_exidx_fixup::first_output_text_section_): New data member.
8586 (Arm_exidx_fixup::process_exidx_section): Record the first text
8587 output section seen.
8588 (Arm_output_section::fix_exidx_coverage): Set correct linked section
8589 and entsize in output section header.
8590
11b861d5
DK
85912010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8592
8593 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
8594 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
8595 (Arm_relocate_functions::thm_alu11): New Method.
8596 (Arm_relocate_functions::thm_pc8): New Method.
8597 (Arm_relocate_functions::thm_pc12): New Method.
8598 (Target_arm::Scan::local): Handle the relocations.
8599 (Target_arm::Scan::global): Likewise.
8600 (Target_arm::Relocate::relocate): Likewise.
8601 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8602
c9a2c125
DK
86032010-01-29 Doug Kwan <dougkwan@google.com>
8604
8605 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
8606 of relocation types as ld.
8607
1521477a
DK
86082010-01-29 Doug Kwan <dougkwan@google.com>
8609
8610 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
8611 to public.
8612 (Arm_relocate_functions::thumb_branch_common): Ditto.
8613 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
8614 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
8615 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
8616 Arm_relocate_functions::jump24): Remove.
8617 (Target_arm::Relocate::relocate): Adjust code to call
8618 Arm_relocation_functions::arm_branch_common and
8619 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 8620 wrappers. Merge switch-cases together to reduce source code size.
1521477a 8621
e7eca48c
DK
86222010-01-29 Doug Kwan <dougkwan@google.com>
8623
8624 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
8625 output_local_symbol_count_needs_update_.
8626 (Arm_relobj::output_local_symbol_count_needs_update,
8627 Arm_relobj::set_output_local_symbol_count_needs_update,
8628 Arm_relobj::update_output_local_symbol_count): New methods.
8629 (Arm_relobj::output_local_symbol_count_needs_update_): New data
8630 member.
8631 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
8632 of pointed function as in a R_ARM_PREL31 relocation.
8633 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
8634 for output local symbol count updating.
8635 (Target_arm::do_relax): Update output local symbol counts in objects
8636 if necessary.
8637 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
8638
02961d7e
ILT
86392010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8640
8641 * arm.cc: Added support for the ARM relocations:
8642 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
8643 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
8644 (Arm_relocate_functions::movw_rel_nc): Renamed (was
8645 movw_prel_nc).
8646 (Arm_relocate_functions::movw_rel): New method.
8647 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
8648 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
8649 thm_movw_prel_nc).
8650 (Arm_relocate_functions::thm_movw_rel): New method.
8651 (Arm_relocate_functions::thm_movt_rel): Renamed (was
8652 thm_movt_prel).
8653 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
8654 relocations.
8655 (Target_arm::Scan::global): Likewise.
8656 (Target_arm::Relocate::relocate): Likewise.
8657 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8658 Likewise.
8659
b10d2873
ILT
86602010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8661
8662 * arm.cc: Added support for ARM group relocations.
8663 (Target_arm::reloc_needs_sym_origin): New method.
8664 (Arm_relocate_functions::calc_grp_kn): New method.
8665 (Arm_relocate_functions::calc_grp_residual): New method.
8666 (Arm_relocate_functions::calc_grp_gn): New method.
8667 (Arm_relocate_functions::arm_grp_alu): New Method.
8668 (Arm_relocate_functions::arm_grp_ldr): New Method.
8669 (Arm_relocate_functions::arm_grp_ldrs): New Method.
8670 (Arm_relocate_functions::arm_grp_ldc): New Method.
8671 (Target_arm::Scan::local): Handle the ARM group relocations.
8672 (Target_arm::Scan::global): Likewise.
8673 (Target_arm::Relocate::relocate): Likewise.
8674 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8675 Likewise.
8676
2b328d4e
DK
86772010-01-26 Doug Kwan <dougkwan@google.com>
8678
8679 * arm.cc (set): Include.
8680 (class Arm_exidx_fixup): Change type of last_input_section_ to const
8681 pointer type.
2e702c99 8682 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
8683 (Arm_output_section::append_text_sections_to_list): New method.
8684 (Arm_output_section::fix_exidx_coverage): Ditto.
8685 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 8686 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
8687 Relobj::set_section_offset() instead of
8688 Sized_relobj::invalidate_section_offset().
2e702c99 8689 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
8690 parameter for section headers. Ignore relocation sections for
8691 unallocated sections and EXIDX sections.
8692 (Target_arm::fix_exidx_coverage): New method.
8693 (Target_arm::output_section_address_less_than): New type.
8694 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
8695 linked text section instead of the EXIDX section.
8696 (Arm_output_section::create_stub_group): Add an assertion to check
8697 that this is not an EXIDX output section.
8698 (Arm_output_section::append_text_sections_to_list): New method.
8699 (Arm_output_section::fix_exidx_coverage): Ditto.
8700 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 8701 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
8702 (Target_arm::do_relax): Fix EXIDX output section coverage in the
8703 first pass.
8704 (Target_arm::fix_exidx_coverage): New method.
8705 * object.h (Relobj::set_output_section): New method.
8706 (Sized_relobj::invalidate_section_offset): Remove method.
8707 (Sized_relobj::do_invalidate_section_offset): Remove method.
8708 (Sized_relobj::do_set_section_offset): Handle offset value -1.
8709
c7f3c371
DK
87102010-01-25 Doug Kwan <dougkwan@google.com>
8711
8712 * arm.cc (Arm_exidx_merged_section::do_output_offset):
8713 Fix warning due to signed and unsigned comparison on a 32-bit host.
8714
8923b24c
DK
87152010-01-22 Doug Kwan <dougkwan@google.com>
8716
8717 * arm.cc (Target_arm::do_relax): Record an output section for section
8718 offset adjustment it contains any stub table that has changed.
8719 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
8720 offsets in an output section if necessary.
8721 * output.cc (Output_section::Output_section): Initialize
8722 section_offsets_need_adjustments_.
8723 (Output_section::add_input_section_for_script): Renamed to
8724 Output_section::add_simple_input_section.
8725 (Output_section::save_states): Add a comment.
8726 (Output_section::discard_states): New method defintion.
8727 (Output_section::adjust_section_offsets): Same.
8728 * output.h (Output_section::add_input_section_for_script): Renamed to
8729 Output_section::add_simple_input_section.
8730 (Output_section::discard_states): New method declaration.
8731 (Output_section::adjust_section_offsets): Same.
8732 (Output_section::section_offsets_need_adjustment,
8733 Output_section::set_section_offsets_need_adjustment): New method
8734 definitions.
8735 (Output_section::section_offsets_need_adjustment_): New data member.
8736 * script-sections.cc
8737 (Output_section_element_input::set_section_address): Adjust code for
8738 renaming of Output_section::add_input_section_for_script.
8739 (Orphan_output_section::set_section_address): Same.
8740
9b2fd367
DK
87412010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8742
8743 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
8744 Fix_v4bx enum values .
8745 * gold/options.h (General_options): New option definitions.
8746 (General_options::fix_v4bx): New method.
8747 (General_options::Fix_v4bx): New enum.
8748 * gold/options.cc (General_options::parse_fix_v4bx): New method.
8749 (General_options::parse_fix_v4bx_interworking): New method.
8750
80d0d023
DK
87512010-01-22 Doug Kwan <dougkwan@google.com>
8752
8753 * arm.cc (Arm_exidx_fixup): New class.
8754
af2cdeae
DK
87552010-01-21 Doug Kwan <dougkwan@google.com>
8756
8757 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
8758 classes.
8759 (Arm_exidx_section_offset_map): New type.
8760
993d07c1
DK
87612010-01-21 Doug Kwan <dougkwan@google.com>
8762
8763 * arm.cc (Arm_exidx_input_section): New class.
8764 (Arm_relobj::exidx_input_section_by_link,
8765 Arm_relobj::exidx_input_section_by_shndx,
8766 Arm_relobj::make_exidx_input_section): New methods.
8767 (read_arm_attributes_section): Remove.
8768 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
8769 information about them.
8770 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
8771 to here.
8772
5ac169d4
DK
87732010-01-20 Doug Kwan <dougkwan@google.com>
8774
8775 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
8776 Input_section_specifier to Section_id.
8777 (Target_arm::new_arm_input_section: Adjust code for change of key
8778 type.
8779 (Target_arm::find_arm_input_section): Ditto.
8780 * gc.h (object.h): Include for Section_id nand Section_id_hash.
8781 (Section_id): Remove.
8782 (Garbage_collection::Section_id_hash): Remove.
8783 * icf.h (object.h): Include for Section_id nand Section_id_hash.
8784 (Section_id): Remove.
8785 (Icf::Section_id_hash): Remove.
8786 * object.h (Section_id, Const_section_id, Section_id_hash,
8787 Const_section_id_hash): New type definitions.
8788 * output.cc (Output_section::add_relaxed_input_section): Change to
8789 use Const_section_id instead of Input_section_specifier as key type.
8790 (Output_section::add_merge_input_section): Ditto.
8791 (Output_section::build_relaxation_map): Change to use Section_id
8792 instead of Input_section_specifier as key type.
2e702c99 8793 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
8794 Ditto.
8795 (Output_section::convert_input_sections_to_relaxed_sections): Change
8796 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 8797 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
8798 (Output_section::find_relaxed_input_section): Ditto.
8799 * output.h (Input_section_specifier): Remove class.
8800 (Output_section::Output_section_data_by_input_section_map): Change
8801 key type to Const_section_id.
8802 (Output_section::Output_relaxed_input_section_by_input_section_map):
8803 Ditto.
8804 (Output_section::Relaxation_map): Change key type to Section_id.
8805
a2162063
ILT
88062010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8807
8808 * gold/arm.cc: Added support for R_ARM_V4BX relocation
8809 (class Arm_v4bx_stub): New class.
8810 (DEF_STUBS): Updated definition to support v4_veneer_bx.
8811 (Stub_factory::make_arm_v4bx_stub): New method.
8812 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
8813 (Stub_table::empty): Handle v4bx stubs.
8814 (Stub_table::add_arm_v4bx_stub): New method.
8815 (Stub_table::find_arm_v4bx_stub): New method.
8816 (Arm_relocate_functions::v4bx): New method.
8817 (Target_arm::fix_v4bx): New method.
8818 (Target_arm::Target_arm): Handle R_ARM_V4BX.
8819 (Stub_table::relocate_stubs): Likewise.
8820 (Stub_table::do_write): Likewise.
8821 (Stub_table::update_data_size_and_addralign): Likewise.
8822 (Stub_table::finalize_stubs): Likewise.
8823 (Target_arm::Scan::local): Likewise.
8824 (Target_arm::Scan::global): Likewise.
8825 (Target_arm::do_finalize_sections): Likewise.
8826 (Target_arm::Relocate::relocate): Likewise.
8827 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8828 Likewise.
8829 (Target_arm::scan_reloc_for_stub): Likewise.
8830 (Target_arm::scan_reloc_section_for_stubs): Likewise.
8831
5696ab0b
ILT
88322010-01-19 Ian Lance Taylor <iant@google.com>
8833
8834 * output.cc (Output_section_headers::do_sized_write): Write large
8835 segment count to sh_info field.
8836 (Output_file_header::do_sized_write): For large segment count,
8837 write PN_XNUM to e_phnum field.
8838
800d0f56
ILT
88392010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8840
8841 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
8842 (Arm_relocate_functions::thm_jump8): New function.
8843 (Arm_relocate_functions::thm_jump11): New function.
8844 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
8845 R_ARM_THM_JUMP11.
8846 (Target_arm::Scan::global): Likewise.
8847 (Target_arm::Relocate::relocate): Likewise.
8848 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8849 Likewise.
8850
41263c05
DK
88512010-01-14 Doug Kwan <dougkwan@google.com>
8852
8853 * arm.cc (map, utility): Include headers.
8854 (Target_arm::apply_cortex_a8_workaround): New method.
8855 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
8856 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
8857 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
8858 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
8859 the --[no-]fix-cortex-a8 command line options.
8860 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
8861 (Target_arm::relocate_stub): Use addend in instruction template.
8862 * options.h (DEFINE_bool): Set the user-set flag.
8863 (General_options): Add --[no-]-fix-cortex options.
8864 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 8865 : Update fast look-up map after conversion.
41263c05 8866
459e9b03
ST
88672010-01-14 Sriraman Tallam <tmsriram@google.com>
8868
8869 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
8870 in the first pass of do_layout.
8871
b521dfe4
DK
88722010-01-13 Doug Kwan <dougkwan@google.com>
8873
8874 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8875 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
8876 apparent compiler problem of not folding static constant integral
8877 data members of elfcpp::Elf_sizes<32>.
8878
44272192
DK
88792010-01-13 Doug Kwan <dougkwan@google.com>
8880
8881 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
8882 Arm_relobj::section_needs_cortex_a8_stub_scanning,
8883 Arm_relobj::scan_section_for_cortex_a8_erratum,
8884 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
8885 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
8886 sections to scan for relocation stubs into a new method
8887 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
8888 relocation and Cortex-A8 stub scanning.
8889 (Target_arm::do_relax): Force stubs to be after stubbed sections
8890 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 8891 the beginning of a new relaxation pass. Update a comment.
44272192
DK
8892 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
8893
44b71ece
ILT
88942010-01-12 Ian Lance Taylor <iant@google.com>
8895
8896 * target-reloc.h (visibility_error): New inline function.
8897 (relocate_section): Call visibility_error.
8898 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
8899 (MOSTLYCLEANFILES): Likewise.
8900 (protected_4_pic.o, protected_3.err): New targets.
8901 * testsuite/protected_4.cc: New file.
8902
a120bc7f
DK
89032010-01-12 Doug Kwan <dougkwan@google.com>
8904
8905 * arm.cc (Cortex_a8_reloc): New class.
8906 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
8907 and cortex_a8_relocs_info_.
8908 (Target_arm::fix_cortex_a8): New method definition.
8909 (Target_arm::Cortex_a8_relocs_info): New type.
8910 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
8911 New data member declarations.
8912 (Target_arm::scan_reloc_for_stub): Record information about
8913 relocations for THUMB branches that might be exempted from the
8914 Cortex-A8 workaround.
8915 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
8916 at the beginning of a relaxation pass.
8917
20138696
DK
89182010-01-12 Doug Kwan <dougkwan@google.com>
8919
8920 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
8921 (Arm_relobj::Mapping_symbol_position,
8922 Arm_reloj::Mapping_symbol_position_less,
8923 Arm_relobj::Mapping_symbols_info): New types.
8924 (Target_arm::is_mapping_symbol_name): New method definition.
8925 (Arm_relobj::do_count_local_symbols): Save information about mapping
8926 symbols.
8927
089d69dc
DK
89282010-01-11 Doug Kwan <dougkwan@google.com>
8929
8930 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
8931 Arm_relocate_functions::thumb32_branch_upper,
8932 Arm_relocate_functions::thumb32_branch_lower,
8933 Arm_relocate_functions::thumb32_cond_branch_offset,
8934 Arm_relocate_functions::thumb32_cond_branch_upper,
8935 Arm_relocate_functions::thumb32_cond_branch_lower,
8936 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
8937 branch offset encoding.
8938 (Arm_relocate_functions::thumb_branch_common): Use new branch
8939 offset encoding methods to avoid code duplication.
8940 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
8941 (Stub_addend_reader::operator()): Use new branch encoding method
8942 to avoid code duplication.
8943
99e5bff2
DK
89442010-01-11 Doug Kwan <dougkwan@google.com>
8945
8946 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
8947 (Target_arm::do_finalize_sections): Define special EXIDX section
8948 symbols only if referenced.
8949 * gc.h (Garbage_collection::add_reference): New method.
8950 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
8951 code duplication.
8952
98e090bd
ILT
89532010-01-11 Ian Lance Taylor <iant@google.com>
8954
d0a91bd8
ILT
8955 * script.cc (Version_script_info::build_expression_list_lookup):
8956 Change complaing about duplicate wildcard match from error to
8957 warning.
8958
98e090bd
ILT
8959 * script.cc (class Lazy_demangler): Recreate--revert part of patch
8960 of 2009-12-30.
8961 (Version_script_info::Version_script_info): Initialize globs_,
8962 default_version_, default_is_global_, and exact_. Don't
8963 initialize globals_ or locals_.
8964 (Version_script_info::build_lookup_tables): Build local symbols
8965 first.
8966 (Version_script_info::unquote): New function.
8967 (Version_script_info::add_exact_match): New function.
8968 (Version_script_info::build_expression_list_lookup): Remove lookup
8969 parameter. Add is_global parameter. Change all callers. Handle
8970 wildcard pattern specially. Unquote pattern. Call
8971 add_exact_match.
8972 (Version_script_info::get_name_to_match): New function.
8973 (Version_script_info::get_symbol_version): New function.
8974 (Version_script_info::get_symbol_version_helper): Remove.
8975 (Version_script_info::check_unmatched_names): Call unquote.
8976 * script.h (class Version_script_info): Change get_symbol_version
8977 to be non-inline and add is_global parameter; change all callers.
8978 Rewrite symbol_is_local. Update declarations. Define struct
8979 Version_tree_match, Exact, Globs. Don't define struct Lookup.
8980 Remove globals_ and locals_ members. Add exact_, globs_,
8981 default_version_, is_global_.
8982 (Version_script_info::Glob): Remove pattern, add expression and
8983 is_global. Update constructor. Change all callers.
8984 * dynobj.cc (Versions::finalize): Mark the version symbol as the
8985 default version.
8986 (Versions::symbol_section_contents): If a symbol is undefined, or
8987 defined in a dynamic object, set the version index to
8988 VER_NDX_LOCAL.
8989 * symtab.cc (Symbol_table::add_from_relobj): Don't call
8990 symbol_is_local.
8991 (Symbol_table::add_from_pluginobj): Likewise.
8992 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
8993
d56962d3
DK
89942010-01-11 Doug Kwan <dougkwan@google.com>
8995
8996 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
8997 (incremental_dump_LDADD): Add linking option for libintl.
8998 * Makefile.in: Regenerate.
8999
94e6ee91
L
90002010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9001
9002 PR gold/11144
9003 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9004 instead of -Ds.
9005 * testsuite/Makefile.in: Regenerated.
9006
e96c574b
DK
90072010-01-10 Doug Kwan <dougkwan@google.com>
9008
9009 * options.h (DEFINE_var): Use parentheses around argument varname__
9010 in macro body to avoid any unintended subsequent substitutions.
9011
7198066b
ILT
90122010-01-10 Ian Lance Taylor <iant@google.com>
9013
ba4d53bf
ILT
9014 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9015 candidates before doing symbol resolution.
9016
7198066b
ILT
9017 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9018 ODR candidates if only one is weak.
9019
a2beed37
ILT
90202010-01-08 Ian Lance Taylor <iant@google.com>
9021
9022 * script.cc (Version_script_info::build_expression_list_lookup):
9023 Don't warn about ambiguous version, just record the ambiguity.
9024 (Version_script_info::get_symbol_version_helper): Give error if
9025 version is ambiguous.
9026
2fb7225c
DK
90272010-01-08 Doug Kwan <dougkwan@google.com>
9028
9029 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9030 prev_data_size_ and prev_addralign_. Remove initializer for
9031 deleted data member has_been_changed_.
9032 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9033 to determine if the table is empty.
9034 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9035 Remove.
9036 (Stub_table::add_reloc_stub): Define method in class definition
9037 instead of just declaring it there.
9038 (Stub_table::add_cortex_a8_stub): New method definition.
9039 (Stub_table::update_data_size_and_addralign): Ditto.
9040 (Stub_table::finalize_stubs): Ditto.
9041 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9042 (Stub_table::do_addralign_): Return address alignment in the
9043 (Stub_table::do_reset_address_and_file_offset): Define method in
9044 class definition instead of declaring it there. Set current data
9045 size to be the data size of the previous pass.
9046 (Stub_table::set_final_data_size): Use current data size as the
9047 final data size.
9048 (Stub_table::relocate_stub): Change parameter type of stub from
9049 Reloc_stub pointer to Stub pointer.
9050 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9051 (Stub_table::Cortex_a8_stub_list): New typedef.
9052 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9053 Stub_table::prev_addralign_): New data member.
9054 (Arm_relobj::Arm_relobj): Initialize data member
9055 section_has_cortex_a8_workaround_.
9056 (Arm_relobj::section_has_cortex_a8_workaround,
9057 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9058 definitions.
9059 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9060 declarations.
9061 (Target_arm::relocate_stub): Change parameter type of stub from
9062 Reloc_stub pointer to Stub pointer.
9063 (Insn_template::size, Insn_template::alignment): Handle
9064 THUMB16_SPECIAL_TYPE.
9065 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9066 Stub_table::update_data_size_and_addralign,
9067 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9068 definitions.
9069 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9070 (Stub_table::do_write): Ditto.
9071 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9072
880cd20d
ILT
90732010-01-08 Ian Lance Taylor <iant@google.com>
9074
9075 PR 11108
9076 * symtab.h (class Symbol): Remove fields is_target_special_ and
9077 has_plt_offset_. Add field is_defined_in_discarded_section_.
9078 (Symbol::is_defined_in_discarded_section): New function.
9079 (Symbol::set_is_defined_in_discarded_section): New function.
9080 (Symbol::has_plt_offset): Rewrite.
9081 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9082 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9083 Don't initialize is_target_special_ or has_plt_offset_.
9084 Initialize is_defined_in_discarded_section_.
9085 (Symbol_table::add_from_relobj): If appropriate, set
9086 is_defined_in_discarded_section.
9087 * resolve.cc (Symbol::override_base_with_special): Don't test
9088 is_target_special_. Change has_plt_offset_ to has_plt_offset().
9089 * target-reloc.h (relocate_section): Do special handling for
9090 symbols defined in discarded sections for global symbols as well
9091 as local symbols.
9092
2703e3eb
ILT
90932010-01-08 Ian Lance Taylor <iant@google.com>
9094
9095 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
9096 the SHT_SYMTAB case.
9097
339d40a3
ILT
90982010-01-08 Ian Lance Taylor <iant@google.com>
9099
9100 * object.cc (Sized_relobj::do_layout): Don't get confused if
9101 layout_eh_frame returns NULL.
9102
abecea76
ILT
91032010-01-08 Ian Lance Taylor <iant@google.com>
9104
9105 PR 11084
9106 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
9107 dynamic symbol table, use the normal symbol table.
9108 (Sized_dynobj::do_read_symbols): Remove assertion about type of
9109 symbol table.
9110
6b7dd3f3
ILT
91112010-01-08 Ian Lance Taylor <iant@google.com>
9112
9113 PR 11072
9114 * layout.cc (Layout::include_section): Remove .gnu_debuglink
9115 sections.
9116
36c50e63
L
91172010-01-08 H.J. Lu <hongjiu.lu@intel.com>
9118
9119 * version.cc (print_version): Change to "Copyright 2010".
9120
e291e7b9
ILT
91212010-01-08 Ian Lance Taylor <iant@google.com>
9122
9123 PR 10287
9124 PR 11063
9125 * i386.cc (class Target_i386): Change return type of plt_section
9126 to be non-const.
9127 (class Output_data_plt_i386): Add tls_desc_rel_ field.
9128 (Output_data_plt_i386::Output_data_plt_i386): Initialize
9129 tls_desc_rel_ field.
9130 (Output_data_plt_i386::rel_tls_desc): New function.
9131 (Target_i386::rel_tls_desc_section): New function.
9132 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
9133 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
9134 R_386_TLS_DESC reloc in rel_tls_desc_section.
9135 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
9136 Define struct Tlsdesc_info.
9137 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
9138 (Target_x86_64::do_reloc_symbol_index): New function.
9139 (Target_x86_64::add_tlsdesc_info): New function.
9140 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
9141 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
9142 tlsdesc_rel_ field.
9143 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
9144 all callers.
9145 (Output_data_plt_x86_64::rela_tlsdesc): New function.
9146 (Target_x86_64::rela_tlsdesc_section): New function.
9147 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
9148 handling.
9149 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
9150 (Target_x86_64::do_reloc_addend): New function.
9151 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
9152 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
9153 declarations. Define TARGET_CODE. Add arg field to u1_ union.
9154 (Output_reloc::type): New function.
9155 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
9156 (Output_reloc::is_target_specific): New function.
9157 (Output_reloc::target_arg): New function.
9158 (class Output_reloc) [SHT_RELA]: Add four new constructors for
9159 absolute relocs and target specific relocs.
9160 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
9161 add_target_specific.
9162 (class Output_data_reloc) [SHT_RELA]: Likewise.
9163 * output.cc (Output_reloc::Output_reloc): Add four new versions
9164 for absolute relocs and target specific relocs.
9165 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
9166 (Output_reloc::get_symbol_index): Likewise.
9167 (Output_reloc::local_section_offset): Check that local_sym_index_
9168 is not TARGET_CODE or 0.
9169 (Output_reloc::symbol_value): Likewise.
9170 (Output_reloc::write) [SHT_RELA]: Call target for target specific
9171 reloc.
9172 * target.h (class Target): Add reloc_symbol_index and reloc_addend
9173 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
9174 functions.
9175 * layout.cc (add_target_dynamic_tags): Use output section for
9176 DT_PLTRELSZ and DT_JMPREL.
9177
3a44184e
ILT
91782010-01-07 Ian Lance Taylor <iant@google.com>
9179
9180 PR 11061
9181 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
9182 function.
9183 (class Output_data_reloc_generic): Define.
9184 (class Output_data_reloc_base): Change base class to
9185 Output_data_reloc_generic. Change add() method to call
9186 bump_relative_reloc_count for a relative reloc. Remove
9187 sort_relocs_ field.
9188 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
9189 to sort_relocs().
9190 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
9191 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
9192 appropriate.
9193 * layout.h (class Layout): Update declaration.
9194
ea715a34
ILT
91952010-01-07 Ian Lance Taylor <iant@google.com>
9196
9197 * output.h (class Output_data): Add const version of
9198 output_section and do_output_section.
9199 (class Output_section_data): Add const version of
9200 do_output_section.
9201 (class Output_section): Likewise.
9202 * layout.cc (Layout::add_target_dynamic_tags): New function.
9203 * layout.h (class Layout): Update declarations.
9204 * arm.cc (Target_arm::do_finalize_sections): Use
9205 add_target_dynamic_tags.
9206 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9207 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
9208 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
9209 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9210
659948a4
ILT
92112010-01-07 Ian Lance Taylor <iant@google.com>
9212
9213 PR 11042
9214 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
9215 object as needed.
9216
9d3b86f6
ILT
92172010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
9218 Ian Lance Taylor <iant@google.com>
9219
9220 PR 11019
9221 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
9222 Xindex::read_symtab_xindex.
9223
bb0d3eb0
DK
92242010-01-07 Doug Kwan <dougkwan@google.com>
9225
9226 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
9227 (Insn_template::thumb16_bcond_insn): New method declaration.
9228 (Insn_template): Fix spelling.
9229 (Stub::thumb16_special): New method declaration.
9230 (Stub::do_write): Define virtual method which was previously pure
9231 virtual.
9232 (Stub::do_thumb16_special): New method declaration.
9233 (Stub::do_fixed_endian_write): New template member.
9234 (Reloc_stub::do_write): Remove.
9235 (Reloc_stub::do_fixed_endian_write): Remove.
9236 (Cortex_a8_stub): New class definition.
9237 (Stub_factory::make_cortex_a8_stub): New method definition.
9238 (Stub_factory::Stub_factory): Add missing static storage class
9239 qualifier for elf32_arm_stub_a8_veneer_blx.
9240
ffeef7df
ILT
92412010-01-07 Ian Lance Taylor <iant@google.com>
9242
dc3f80fe
ILT
9243 PR 10980
9244 * options.h (class General_options): Add --warn-unresolved-symbols
9245 and --error-unresolved-symbols.
9246 * errors.cc (Errors::undefined_symbol): Implement
9247 --warn-unresolved-symbols.
9248
ffeef7df
ILT
9249 * options.h (class General_options): Add -z text and -z textoff.
9250 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
9251
f1ec9ded
ST
92522010-01-06 Sriraman Tallam <tmsriram@google.com>
9253
9254 * gc.h (Garbage_collection::Cident_section_map): New typedef.
9255 (Garbage_collection::cident_sections): New function.
9256 (Garbage_collection::add_cident_section): New function.
9257 (Garbage_collection::cident_sections_): New member.
9258 (gc_process_relocs): Add references to sections whose names are C
9259 identifiers.
9260 * gold.h (cident_section_start_prefix): New constant.
9261 (cident_section_stop_prefix): New constant.
9262 (is_cident): New function.
9263 * layout.cc (Layout::define_section_symbols): Replace string constants
9264 with the newly defined constants.
9265 * object.cc (Sized_relobj::do_layout): Track sections whose names are
9266 C identifiers.
9267 * testsuite/Makefile.am: Add gc_orphan_section_test.
9268 * testsuite/Makefile.in: Regenerate.
9269 * testsuite/gc_orphan_section_test.cc: New file.
9270 * testsuite/gc_orphan_section_test.sh: New file.
9271
6eda8c29
ILT
92722010-01-06 Ian Lance Taylor <iant@google.com>
9273
b9674e17
ILT
9274 PR 10980
9275 * options.h (class General_options): Add --warn-shared-textrel.
9276 * layout.cc (Layout::finish_dynamic_section): Implement
9277 --warn-shared-textrel.
9278
6eda8c29
ILT
9279 PR 10980
9280 * options.h (class General_options): Add --warn-multiple-gp.
9281
32dcd44e
ILT
92822010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9283
9284 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
9285 $(THREADSLIB) and $(LIBDL).
9286 * Makefile.in: Rebuild.
9287
a192ba05
ILT
92882010-01-06 Ian Lance Taylor <iant@google.com>
9289
9290 PR 10980
9291 * options.cc (General_options::parse_section_start): New function.
9292 (General_options::section_start): New function.
9293 (General_options::General_options): Initialize all members.
9294 * options.h: Include <map>
9295 (class General_options): Add --section-start. Add section_starts_
9296 member.
9297 * layout.cc (Layout::attach_allocated_section_to_segment): If
9298 --section-start was used, set the address of the segment. Remove
9299 local sort_sections.
9300 (Layout::relaxation_loop_body): If the address of the load segment
9301 has been set by --section-start, don't use it.
9302 * output.h (Output_segment::update_flags_for_output_section): New
9303 function.
9304 * output.cc (Output_segment::add_output_section): Call
9305 update_flags_for_output_section.
9306
dde3f402
ILT
93072010-01-05 Ian Lance Taylor <iant@google.com>
9308
62dfdd4d
ILT
9309 PR 10980
9310 * options.h (class General_options): Add --undefined-version.
9311 * script.cc (struct Version_expression): Add was_matched_by_symbol
9312 field.
9313 (Version_script_info::matched_symbol): New function.
9314 (Version_script_info::get_symbol_version_helper): Call
9315 matched_symbol.
9316 (Version_script_info::check_unmatched_names): New function.
9317 * script.h (class Version_script_info): Update declarations.
9318 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
9319
9c4ae156
ILT
9320 * options.h (class General_options): Use DEFINE_bool_alias for
9321 allow_multiple_definition.
9322 * resolve.cc (Symbol_table::should_override): Don't test
9323 allow_multiple_definition.
9324
dde3f402
ILT
9325 PR 10980
9326 * options.h (class General_options): Add --cref.
9327 * main.cc (main): Print cref table if --cref. Don't close mapfile
9328 until after printing cref table.
9329 * cref.cc: Include "symtab.h".
9330 (class Cref_inputs): Define Cref_table_compare and Cref_table.
9331 (Cref_table_compare::operator()): New function.
9332 (Cref_inputs::gather_cref): New function.
9333 (filecol): New static const.
9334 (Cref_inputs::print_cref): New function.
9335 (Cref::print_cref): New function.
9336 * cref.h: Include <cstdio>.
9337 (class Cref): Update declarations.
9338 * mapfile.h (Mapfile::file): New function.
9339 * object.h (class Object): Define Symbols. Declare virtual
9340 do_get_global_symbols.
9341 (Object::get_global_symbols): New function.
9342 * object.cc (Input_objects::add_object): Pass object to cref_ if
9343 --cref.
9344 (Input_objects::archive_start): Likewise.
9345 (Input_objects::archive_stop): Likewise.
9346 (Input_objects::print_cref): New function.
9347 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
9348 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
9349 --cref.
9350 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
9351 function.
9352 * plugin.h (class Sized_pluginobj): Update declarations.
9353
8781f709
ILT
93542010-01-05 Ian Lance Taylor <iant@google.com>
9355
9356 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
9357 to is_default_version. Rename insdef to insdefault.
9358 (Symbol_table::add_from_relobj): Rename def to is_default_version
9359 and local to is_forced_local.
9360 (Symbol_table::add_from_pluginobj): Likewise.
9361 (Symbol_table::add_from_dynobj): Likewise.
9362 (Symbol_table::define_special_symbol): Rename insdef to
9363 insdefault.
9364
fe35d28d
ILT
93652010-01-04 Ian Lance Taylor <iant@google.com>
9366
30bc8c46
ILT
9367 PR 10980
9368 * options.h (class General_options): Add
9369 --allow-multiple-definition and -z muldefs.
9370 * resolve.cc (Symbol_table::should_override): Don't warn about a
9371 multiple symbol definition if --allow-multiple-definition or -z
9372 muldefs.
9373
7eaea549
ILT
9374 PR 10980
9375 * options.h (class General_options): Add --add-needed and
9376 --copy-dt-needed-entries. Tweak --as-needed help entry.
9377 * object.cc (Input_objects::check_dynamic_dependencies): Give an
9378 error if --copy-dt-needed-entries aka --add-needed is used and
9379 would cause a change in behaviour.
9380
fe35d28d
ILT
9381 PR 10980
9382 * options.h (class General_options): Add -G as a short version of
9383 --shared. Add no-op options -assert, -g, and -i.
9384
55a2bb35
ST
93852010-01-04 Sriraman Tallam <tmsriram@google.com>
9386
9387 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
9388 check for .text or .gnu.linkonce.t sections.
9389 * icf.cc (Icf::find_identical_sections): Ditto.
9390 Change the detection for mangled function name within the section
9391 name.
9392 * icf.h (is_section_foldable_candidate): New function.
9393
719328e1
ILT
93942009-12-30 Ian Lance Taylor <iant@google.com>
9395
9396 PR 10980
9397 * options.h (class General_options): Permit two dashes with
9398 --retain-symbols-file.
9399
d7bb5745
ILT
94002009-12-30 Ian Lance Taylor <iant@google.com>
9401
403a15dd
ILT
9402 PR 10979
9403 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
9404 don't put the file header and segment headers in the text
9405 segment.
9406
eda294df
ILT
9407 PR 10979
9408 * common.cc (Sort_commons::operator()): Stabilize sort when both
9409 entries are NULL.
9410 (Symbol_table::do_allocate_commons_list): When allocating common
9411 symbols, skip a symbol which is no longer common.
9412 * symtab.h (Symbol::is_common): Test whether the symbol comes from
9413 an object before checking its type.
9414 * testsuite/common_test_2.c: New file.
9415 * testsuite/common_test_3.c: New file.
9416 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
9417 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
9418 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
9419 (common_test_2_pic.o, common_test_2.so): New targets.
9420 (common_test_3_pic.o, common_test_3.so): New targets.
9421 * testsuite/Makefile.in: Rebuild.
9422
d7bb5745
ILT
9423 PR 10979
9424 * script.cc (read_input_script): If we see a new SECTIONS clause,
9425 and we have added an input section, give an error.
9426 * layout.h (class Layout): Add have_added_input_section function.
9427 Add have_added_input_section_ field.
9428 * layout.cc (Layout::Layout): Initialize
9429 have_added_input_section_.
9430 (Layout::layout): Set have_added_input_section_.
9431 (Layout::layout_eh_frame): Likewise.
9432
fc59c572
ILT
94332009-12-30 Ian Lance Taylor <iant@google.com>
9434
9435 PR 10931
9436 * options.h (class General_options): Add --sort-common option.
9437 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
9438 * common.cc (Sort_common): Add sort_order parameter to
9439 constructor. Add sort_order_ field.
9440 (Sort_commons::operator): Check sort_order_.
9441 (Symbol_table::allocate_commons): Determine the sort order.
9442 (Symbol_table::do_allocate_commons): Add sort_order parameter.
9443 Change all callers.
9444 (Symbol_table::do_allocate_commons_list): Likewise.
9445
1c74fab0
ILT
94462009-12-30 Ian Lance Taylor <iant@google.com>
9447
9448 PR 10916
9449 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
9450 symbols from this object, don't change the visibility of an
9451 undefined symbol.
9452 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
9453
6affe781
ILT
94542009-12-30 Ian Lance Taylor <iant@google.com>
9455
9456 PR 10861
9457 * script.h (class Version_script_info): Define Language enum.
9458 Update declarations. Define Glob, Exact, and Lookup types. Add
9459 new fields globals_, locals_, and is_finalized_.
9460 * script.cc: Various formatting fixes.
9461 (class Parser_closure): Change language_stack_ from a vector of
9462 std::string to one of Version_script_info::Language. Adjust all
9463 uses accordingly.
9464 (class Lazy_demangler): Remove.
9465 (struct Version_expression): Change language from std::string to
9466 Version_script_info::Language.
9467 (Version_script_info::Version_script_info): New function.
9468 (Version_script_info::~Version_script_info): Don't call clear.
9469 (Version_script_info::finalize): New function.
9470 (Version_script_info::build_lookup_tables): New function.
9471 (Version_script_info::build_expression_list_lookup): New
9472 function.
9473 (Version_script_info::get_symbol_version_helper): Rewrite to use
9474 lookup tables.
9475 (Version_script_info::print_expression_list): Adjust to use
9476 Version_script_info::Language.
9477 (script_push_lex_into_version_mode): Check that the version script
9478 has not been finalized.
9479 (version_script_push_lang): Change language string to
9480 Version_script_info::Language.
9481 * options.cc (Command_line::version_script): New function.
9482 * options.h (class General_options): Add finalize_dynamic_list
9483 function. Change version_script from declaration to definition.
9484 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
9485 * testsuite/version_script.map: Remove duplicate def of foo.
9486 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
9487 version_script.map.
9488 * testsuite/Makefile.in: Rebuild.
9489
818bf354
ILT
94902009-12-30 Ian Lance Taylor <iant@google.com>
9491
9492 PR 10843
9493 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
9494 if the input symbol index is 0, make the output symbol index 0.
9495
ebcc8304
ILT
94962009-12-30 Ian Lance Taylor <iant@google.com>
9497
9498 PR 10670
9499 * options.h (class General_options): Add -x/--discard-all.
9500 * object.cc (Sized_relobj::do_count_local_symbols): Handle
9501 --discard-all. If the local symbol needs a dynamic entry, check
9502 that before handling --discard-locals.
9503
176fe33f
ILT
95042009-12-30 Ian Lance Taylor <iant@google.com>
9505
bb321bb1
ILT
9506 PR 10450
9507 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
9508 flags to PF_R.
9509 (Output_segment::add_output_section): Don't change the flags if
9510 the type is PT_TLS.
9511
176fe33f
ILT
9512 PR 10450
9513 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
9514 GNU hash table if they need a dynamic value. Otherwise, don't add
9515 them if they are defined in a dynamic object or are forced local.
9516
e8cd95c7
ILT
95172009-12-29 Ian Lance Taylor <iant@google.com>
9518
1b81fb71
ILT
9519 PR 10450
9520 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
9521 .gnu.hash table for a 32-bit target.
9522
8d6d383d
ILT
9523 PR 10450
9524 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
9525 regular and a dynamic object only needs a dynamic symbol table
9526 entry if it is externally visible.
9527
e785ec03
ILT
9528 PR 10450
9529 * i386.cc (class Target_i386): Initialize global_offset_table_ in
9530 constructor. Add global_offset_table_ field.
9531 (Target_i386::got_section): Set global_offset_table_.
9532 (Target_i386::do_finalize_sections): Set global_offset_table_
9533 size.
9534 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
9535 in constructor. Add global_offset_table_ field.
9536 (Target_x86_64::got_section): Set global_offset_table_.
9537 (Target_x86_64::do_finalize_sections): Set global_offset_table_
9538 size.
9539
1a2dff53
ILT
9540 * layout.cc (Layout::Layout): Initialize increase_relro_.
9541 (Layout::get_output_section): Add is_relro, is_last_relro, and
9542 is_first_non_relro parameters. Change all callers.
9543 (Layout::choose_output_section): Likewise.
9544 (Layout::add_output_section_data): Likewise.
9545 (Layout::make_output_section): Likewise.
9546 (Layout::set_segment_offsets): Clear increase_relro when using a
9547 linker script.
9548 * layout.h (class Layout): Add increase_relro method. Add
9549 increase_relro_ field. Update declarations.
9550 * output.cc (Output_section::Output_section): Initialize
9551 is_last_relro_ and is_first_non_relro_.
9552 (Output_segment::add_output_section): Group relro sections is
9553 do_sort is true. Handle is_last_relro and is_first_non_relro.
9554 (Output_segment::maximum_alignment): Remove relro handling.
9555 (Output_segment::set_section_addresses): Add increase_relro
9556 parameter. Change all callers. Add initial alignment to align
9557 relro sections on separate page. Remove old relro handling.
9558 (Output_segment::set_section_list_addresses): Remove in_relro
9559 parameter. Change all callers.
9560 (Output_segment::set_offset): Add increase parameter. Change all
9561 callers. Remove old relro handling.
9562 * output.h (class Output_section): Add new methods: is_last_relro,
9563 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
9564 Add is_last_relro_ and is_first_non_relro_ fields.
9565 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
9566 Create separate .got.plt section. Call increase_relro.
9567 * x86_64.cc (Target_x86_64::got_section): Likewise.
9568 * testsuite/relro_script_test.t: Add .got.plt.
9569
f0ba79e2
ILT
9570 PR 10450
9571 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
9572 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
9573 (Layout::finalize): Call set_dynamic_symbol_size.
9574 (Layout::set_dynamic_symbol_size): New function.
9575 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
9576 set_dynamic_symbol_size.
9577
e8cd95c7
ILT
9578 PR 10450
9579 * output.h (class Output_section): Add is_entsize_zero_ field.
9580 * output.cc (Output_section::Output_section): Initialize
9581 is_entsize_zero_.
9582 (Output_section::set_entsize): If two different entsizes are
9583 requested, force it to zero.
9584 (Output_section::add_input_section): Set flags for .debug_str
9585 before updating section flags. Set entsize.
9586 (Output_section::update_flags_for_input_section): Set SHF_MERGE
9587 and SHF_STRING if all input sections have those flags.
9588
3e1b9a8a
RÁE
95892009-12-29 Rafael Espindola <espindola@google.com>
9590
9591 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
9592 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
9593 reporting.
3e1b9a8a 9594
3dcad376
ST
95952009-12-29 Sriraman Tallam <tmsriram@google.com>
9596
9597 * options.cc (General_options::parse_version): Allow -v to exit
9598 without an error if there is nothing to link.
9599
084e2665
ILT
96002009-12-29 Ian Lance Taylor <iant@google.com>
9601
9602 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
9603 using a version of gcc before 4.1.
9604 * configure: Rebuild.
9605
250acde3
CD
96062009-12-28 Chris Demetriou <cgd@google.com>
9607
9608 * attributes.cc (Output_attributes_section_data::do_write): Use
9609 std::vector::front rather than std::vector::data.
9610
99fff23b
ILT
96112009-12-28 Ian Lance Taylor <iant@google.com>
9612
9613 * symtab.h (class Symbol_table): Add enum Defined.
9614 * resolve.cc (Symbol_table::should_override): Add defined
9615 parameter. Change all callers. Test whether object is NULL
9616 before calling a method on it.
9617 (Symbol_table::report_resolve_problem): Add defined parameter.
9618 Change all callers.
9619 (Symbol_table::should_override_with_special): Likewise.
9620 * symtab.cc (Symbol_table::define_in_output_data): Add defined
9621 parameter. Change all callers.
9622 (Symbol_table::do_define_in_output_data): Likewise.
9623 (Symbol_table::define_in_output_segment): Likewise.
9624 (Symbol_table::do_define_in_output_segment): Likewise.
9625 (Symbol_table::define_as_constant): Likewise.
9626 (Symbol_table::do_define_as_constant): Likewise.
9627 * script.h (class Symbol_assignment): Add is_defsym parameter to
9628 constructor; change all callers.
9629 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
9630 parameter. Change all callers. Add is_defsym_ field.
9631 (class Parser_closure): Add parsing_defsym parameter to
9632 constructor; change all callers. Add parsing_defsym accessor
9633 function. Add parsing_defsym_ field.
9634
556bd683
ILT
96352009-12-28 Ian Lance Taylor <iant@google.com>
9636
9637 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 9638 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 9639
1782c879
ILT
96402009-12-23 Ian Lance Taylor <iant@google.com>
9641
9642 * i386.cc (Target_i386::do_calls_non_split): Recognize
9643 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
9644 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
9645 -fsplit-stack prologue when using %r11.
1782c879 9646
329ca2b1
ST
96472009-12-21 Sriraman Tallam <tmsriram@google.com>
9648
9649 * options.cc (General_options::parse_version): Make -v continue and do
9650 the link like GNU ld does.
9651
d675ff46
RÁE
96522009-12-17 Rafael Avila de Espindola <espindola@google.com>
9653
9654 * Makefile.am (CCFILES): Add timer.cc.
9655 (HFILES): Add timer.h.
9656 * configure.ac: Check for sysconf and times.
9657 * main.cc: include timer.h.
9658 (main): Use Timer instead of get_run_time.
9659 * timer.cc: New.
9660 * timer.h: New.
9661 * workqueue.cc: include timer.h.
9662 (Workqueue::find_and_run_task):
9663 Report user, sys and wall time.
9664 * Makefile.in: Regenerate.
9665 * config.in: Regenerate.
9666 * configure: Regenerate.
9667
d6344fb5
DK
96682009-12-16 Doug Kwan <dougkwan@google.com>
9669
9670 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
9671 sections.
9672 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
9673 relaxed input sections.
9674 * output.cc (Output_section::find_relaxed_input_section): Change
9675 return type to Output_relaxed_input_section pointer. Adjust code
9676 for new type of relaxed_input_section_map_.
9677 * output.h (Output_section::find_relaxed_input_section): Change
9678 return type to Output_relaxed_input_section pointer.
9679 (Output_section::Output_relaxed_input_section_by_input_section_map):
9680 New type.
9681 (Output_section::relaxed_input_section_map_): Change type to
9682 Output_section::Output_relaxed_input_section_by_input_section_map.
9683 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
9684 input section.
9685
0e0d5469
ILT
96862009-12-15 Ian Lance Taylor <iant@google.com>
9687
9688 * layout.cc (Layout::create_shstrtab): Only write out after input
9689 sections if we are compressing debug sections.
9690
0649a889
ILT
96912009-12-15 Ian Lance Taylor <iant@google.com>
9692
9693 * archive.cc (Archive::add_symbols): Only look up a symbol without
9694 a version if there is, in fact, a version.
9695
2ea97941
ILT
96962009-12-14 Ian Lance Taylor <iant@google.com>
9697
9698 Revert -Wshadow changes, all changes from:
9699 2009-12-11 Doug Kwan <dougkwan@google.com>
9700 2009-12-11 Nick Clifton <nickc@redhat.com>
9701 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
9702
b0eec2cc
DK
97032009-12-11 Doug Kwan <dougkwan@google.com>
9704
9705 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
9706 due to -Wshadow.
9707 * attributes.cc (Object_attribute::size): Ditto.
9708 (Attributes_section_data::size): Ditto.
9709 (Attributes_section_data::Attributes_section_data): Ditto.
9710 (Output_attributes_section_data::do_write): Ditto.
9711 * attributes.h (Object_attribute::set_type): Ditto.
9712 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
9713
91d6fa6a
NC
97142009-12-11 Nick Clifton <nickc@redhat.com>
9715
9716 * archive.cc: Fix shadowed variable warnings.
9717 * arm.cc: Likewise.
9718 * compressed_output.cc: Likewise.
9719 * compressed_output.h: Likewise.
9720 * configure: Likewise.
9721 * dwarf_reader.cc: Likewise.
9722 * dynobj.cc: Likewise.
9723 * dynobj.h: Likewise.
9724 * ehframe.cc: Likewise.
9725 * ehframe.h: Likewise.
9726 * errors.cc: Likewise.
9727 * expression.cc: Likewise.
9728 * fileread.cc: Likewise.
9729 * fileread.h: Likewise.
9730 * freebsd.h: Likewise.
9731 * i386.cc: Likewise.
9732 * icf.cc: Likewise.
9733 * incremental.h: Likewise.
9734 * layout.cc: Likewise.
9735 * layout.h: Likewise.
9736 * mapfile.cc: Likewise.
9737 * merge.cc: Likewise.
9738 * merge.h: Likewise.
9739 * object.cc: Likewise.
9740 * object.h: Likewise.
9741 * options.h: Likewise.
9742 * output.cc: Likewise.
9743 * output.h: Likewise.
9744 * parameters.cc: Likewise.
9745 * plugin.cc: Likewise.
9746 * powerpc.cc: Likewise.
9747 * reduced_debug_output.cc: Likewise.
9748 * reduced_debug_output.h: Likewise.
9749 * reloc.cc: Likewise.
9750 * reloc.h: Likewise.
9751 * resolve.cc: Likewise.
9752 * script-sections.cc: Likewise.
9753 * script.cc: Likewise.
9754 * script.h: Likewise.
9755 * sparc.cc: Likewise.
9756 * symtab.cc: Likewise.
9757 * symtab.h: Likewise.
9758 * target-select.cc: Likewise.
9759 * target-select.h: Likewise.
9760 * token.h: Likewise.
9761 * workqueue.cc: Likewise.
9762 * workqueue.h: Likewise.
9763 * x86_64.cc: Likewise.
9764
a0351a69
DK
97652009-12-10 Doug Kwan <dougkwan@google.com>
9766
9767 * arm.cc (attributes.h): New include.
9768 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
9769 (Arm_relobj::~Arm_relobj): Delete object pointed by
9770 attributes_section_data_.
9771 (Arm_relobj::attributes_section_data): New method definition.
9772 (Arm_relobj::attributes_section_data_): New data member declaration.
9773 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
9774 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
9775 attributes_section_data_.
9776 (Arm_dynobj::attributes_section_data): New method definition.
9777 (Arm_dynobj::attributes_section_data_): New data member declaration.
9778 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
9779 initialization value of may_use_blx_ to false.
2e702c99 9780 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
9781 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
9782 object attributes to compute results instead of hard-coding.
9783 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
9784 Target_arm::get_secondary_compatible_arch,
9785 Target_arm::set_secondary_compatible_arch
9786 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9787 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
9788 New method declarations.
9789 (Target_arm::get_aeabi_object_attribute): New method definition.
9790 (Target_arm::attributes_section_data_): New data member declaration.
9791 (read_arm_attributes_section): New template definition.
9792 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
9793 (Arm_dynobj::do_read_symbols): Ditto.
9794 (Target_arm::do_finalize_sections): Merge attributes sections from
9795 input. Check for BLX use after attributes section merging.
9796 Fix __exidx_start and __exidx_end visibility. Create an
9797 .ARM.attributes section if necessary.
9798 (Target_arm::get_secondary_compatible_arch,
9799 Target_arm::set_secondary_compatible_arch,
9800 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
9801 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 9802 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
9803 New method definitions.
9804
b59befec
ILT
98052009-12-09 Ian Lance Taylor <iant@google.com>
9806
9807 * plugin.cc (Plugin::load): Don't cast from void* to a function
9808 pointer.
9809
1276bc89
ILT
98102009-12-09 Ian Lance Taylor <iant@google.com>
9811
9812 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
9813 information fields.
9814
2f2de248
L
98152009-12-09 H.J. Lu <hongjiu.lu@intel.com>
9816
9817 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
9818 Replace two_file_shared_1.so with two_file_shared_2.so.
9819 * testsuite/Makefile.in: Regenerated.
9820
4f787271
DK
98212009-12-08 Doug Kwan <dougkwan@google.com>
9822
9823 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
9824 (HFILES): Add attributes.h and int_encoding.h.
9825 * Makefile.in: Regenerate.
9826 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
9827 function definitions to int_encoding.cc
9828 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
9829 prototypes to int_encoding.h
9830 * reduced_debug_output.cc (int_encoding.h): New include.
9831 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
9832 function definitions to int_encoding.cc
9833 (insert_into_vector, read_from_pointer): Move template definitions to
9834 int_encoding.h
9835 * attributes.cc: New file.
9836 * attributes.h: New file.
9837 * int_encoding.cc: New file.
9838 * int_encoding.h: New file.
9839
20b52f1a
RÁE
98402009-12-07 Rafael Avila de Espindola <espindola@google.com>
9841
9842 PR gold/11055
9843 * incremental-dump.cc (dump_incremental_inputs): New.
9844 (main): Use dump_incremental_inputs.
9845
53d7974c
L
98462009-12-07 H.J. Lu <hongjiu.lu@intel.com>
9847
9848 PR gold/10893
9849 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
9850 checking elfcpp::STT_FUNC.
9851 (Target_i386::Relocate::relocate): Likewise.
9852 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
9853
9854 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
9855 symbols from shared libraries into normal FUNC symbols.
9856
9857 * symtab.h (Symbol): Add is_func and use it.
9858
05a352e6
DK
98592009-12-05 Doug Kwan <dougkwan@google.com>
9860
9861 * arm.cc (Target_arm::arm_info): Initialize new fields
9862 attributes_section and attributes_vendor.
9863 * i386.cc (Target_i386::i386_info): Same.
9864 * object.cc (Sized_relobj::do_layout): Skip attribute section.
9865 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
9866 fields attributes_section and attributes_vendor.
53d7974c 9867 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
9868 * target.h (Target::attributes_section, Target::attributes_vendor,
9869 Target::is_attributes_section, Target::attribute_arg_type,
9870 Target::attributes_order): New method definitions.
9871 (Target::Target_info::attributes_section,
9872 Target::Target_info::attributes_vendor): New fields.
9873 (Target::do_attribute_arg_type, Target::do_attributes_order): New
9874 virtual method definitions.
9875 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
9876 attributes_section and attributes_vendor.
9877 * testsuite/testfile.cc (Target_test::test_target_info): Same.
9878
f4e5969c
DK
98792009-12-05 Doug Kwan <dougkwan@google.com>
9880
9881 * arm.cc: Update comments about interworking and stub generation.
9882 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
9883 considered as non-PIC.
9884 (Arm_relocate_functions::base_abs): Fix formatting.
9885 (Arm_relocate_functions::got_prel): Fix comment. Change interface
9886 of function to use GOT entry address instead of offset.
9887 (Target_arm::Scan::global): Issue an error if a symbol would need a
9888 PLT does not get one because it is untyped. Remove code to create
9889 dynamic symbols for relative branches.
9890 (Target_arm::Relocate::relocate: Use 0 instead of false since function
9891 takes unsigned integer instead of boolean.
9892
1abce4a6
L
98932009-12-05 H.J. Lu <hongjiu.lu@intel.com>
9894
9895 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
9896 (two_file_test_LDADD): Likewise.
9897 (common_test_1_LDADD): Likewise.
9898 (exception_test_LDADD) Likewise.
9899 (weak_test_LDADD): Likewise.
9900 (many_sections_test_LDADD): Likewise.
9901 (initpri1_LDADD): Likewise.
9902 (script_test_1_LDADD): Likewise.
9903 (script_test_2_LDADD): Likewise.
9904 (justsyms_LDADD): Likewise.
9905 (binary_test_LDADD): Likewise.
9906 (large_LDADD): Likewise.
9907 * testsuite/Makefile.in: Regenerated.
9908
adcf2816 99092009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 9910
adcf2816
L
9911 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
9912 (Symbol_table::override_with_special): Likewise.
9913 (Symbol_table::add_from_object): Likewise.
9914
28e67f5d
RÁE
99152009-12-04 Rafael Avila de Espindola <espindola@google.com>
9916
9917 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9918 Don't set the data_offset twice.
9919
ae10a101
RÁE
99202009-12-04 Rafael Avila de Espindola <espindola@google.com>
9921
9922 * testsuite/Makefile.in: Regenerate.
9923
f59f41f3
DK
99242009-12-03 Doug Kwan <dougkwan@google.com>
9925
9926 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
9927 (Target_arm::do_finalize_sections): Add parameter for symbol table
9928 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
9929 * i386.cc (Target_i386::do_finalize_sections): Add an additional
9930 parameter for symbol table pointer.
9931 * layout.cc (Layout::finalize): Call Target::finalize_sections with
9932 an additional parameter for a pointer to symbol table.
9933 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
9934 parameter for a symbol table pointer.
9935 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
9936 * target.h (Target::finalize_sections, Target::do_finalize_sections):
9937 Ditto.
9938 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
9939 parameter for a symbol table pointer.
9940
ca55d848
RÁE
99412009-12-03 Rafael Avila de Espindola <espindola@google.com>
9942
9943 * incremental.cc (Incremental_inputs_header)
9944 (Incremental_inputs_header_write, Incremental_inputs_entry)
9945 (Incremental_inputs_entry_write): Move ...
9946 * incremental.h (Incremental_inputs_header)
9947 (Incremental_inputs_header_write, Incremental_inputs_entry)
9948 (Incremental_inputs_entry_write): here.
9949
3aec4f9c
RÁE
99502009-12-02 Rafael Avila de Espindola <espindola@google.com>
9951
9952 * incremental.cc (make_sized_incremental_binary): Set the target.
9953 Error if it is incompatible.
9954 * output.h (Output_file): Add filename method.
9955
9c0ae74d
RÁE
99562009-12-02 Rafael Avila de Espindola <espindola@google.com>
9957
9958 * incremental.cc (Incremental_inputs_entry): Remove unused argument
9959 from the get_* methods.
9960
a45500ae
RÁE
99612009-12-02 Rafael Avila de Espindola <espindola@google.com>
9962
9963 * incremental-dump.cc (main): Check that the offeset of a script is 0.
9964 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
9965 Write 0 for the data_offset of scripts.
9966
325e6408
RÁE
99672009-12-02 Rafael Avila de Espindola <espindola@google.com>
9968
9969 * testsuite/Makefile.am: Add the incremental_test.sh test.
9970 * testsuite/incremental_test.sh: New.
9971 * testsuite/incremental_test_1.c: New.
9972 * testsuite/incremental_test_2.c: New.
9973
954c3e2e
RÁE
99742009-12-01 Rafael Avila de Espindola <espindola@google.com>
9975
703d02da 9976 * incremental-dump.cc (main): Fix typos.
954c3e2e 9977
f8086623
RÁE
99782009-11-27 Rafael Avila de Espindola <espindola@google.com>
9979
9980 PR gold/11025
9981 * incremental-dump.cc (main): Use llu to print 64 bit values.
9982
3b0dd6ac
L
99832009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
9984 H.J. Lu <hongjiu.lu@intel.com>
9985
9986 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
9987 $(LIBDL).
9988 (incremental_dump_LDADD): Likewise.
9989 * Makefile.in: Regenerated.
9990
a6d1ef57 99912009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 9992
a6d1ef57
DK
9993 Revert:
9994
9995 2009-11-25 Doug Kwan <dougkwan@google.com>
9996
9997 * arm.cc (Target_arm::Target_arm): Move method definition
9998 outside of class definition. Add code to handle
9999 --target1-rel, --target1-abs and --target2= options.
10000 (Target_arm::get_reloc_reloc_type): Change method to be
10001 non-static and const.
10002 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10003 New data member declaration.
10004 (Target_arm::Scan::local, Target_arm::Scan::global,
10005 Target_arm::Relocate::relocate,
10006 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10007 Adjust call to Target_arm::get_real_reloc_type.
10008 (Target_arm::get_real_reloc_type): Use command line options
10009 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10010 * options.h (--target1-rel, --target1-abs, --target2): New
10011 ARM-only options.
10012
50aeb7d4
DK
100132009-11-25 Doug Kwan <dougkwan@google.com>
10014
10015 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10016 class definition. Add code to handle --target1-rel, --target1-abs
10017 and --target2= options.
10018 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10019 and const.
10020 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10021 member declaration.
10022 (Target_arm::Scan::local, Target_arm::Scan::global,
10023 Target_arm::Relocate::relocate,
10024 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10025 call to Target_arm::get_real_reloc_type.
10026 (Target_arm::get_real_reloc_type): Use command line options to
10027 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10028 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10029 options.
10030
51938283
DK
100312009-11-25 Doug Kwan <dougkwan@google.com>
10032
10033 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10034 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10035 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10036 formatting.
10037 (Arm_relocate_functions::thm_call): Replace body with a call to
10038 Arm_relocate_functions::thumb_branch_common.
10039 (Arm_relocate_functions::thm_jump24,
10040 Arm_relocate_functions::thm_xpc22): New method definitions.
10041 (Arm_relocate_functions::thumb_branch_common): New method definition.
10042 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10043 operator.
10044 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10045 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10046
e2b8f3c4
RÁE
100472009-11-24 Rafael Avila de Espindola <espindola@google.com>
10048
10049 * Makefile.am: Build incremental-dump
10050 * Makefile.in: Regenerate.
10051 * incremental-dump.cc: New.
10052 * incremental.cc (Incremental_inputs_header_data,
10053 Incremental_inputs_entry_data): Move to incremental.h
10054 * incremental.h: (Incremental_inputs_header_data,
10055 Incremental_inputs_entry_data): Move from incremental.cc
10056
bcba9aec
RÁE
100572009-11-24 Rafael Avila de Espindola <espindola@google.com>
10058
10059 * incremental.cc (Incremental_inputs_header,
10060 Incremental_inputs_header_write, Incremental_inputs_entry,
10061 Incremental_inputs_entry_write): Add a typedef with the data type.
10062
7c3afe08
RÁE
100632009-11-24 Rafael Avila de Espindola <espindola@google.com>
10064
10065 * incremental.cc (Incremental_inputs_header,
10066 Incremental_inputs_header_write, Incremental_inputs_entry,
10067 Incremental_inputs_entry_write): Update comment about which
10068 type has the filed descriptions.
10069
d204b6e9
DK
100702009-11-15 Doug Kwan <dougkwan@google.com>
10071
10072 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10073 (Arm_relocate_functions::arm_branch_common): Change method defintion
10074 in class definition to a method declaration and update list of formal
10075 parameters.
10076 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10077 Arm_relocation_functions::jump24): Adjust call to
10078 Arm_relocate_functions::arm_branch_common. Update list of formal
10079 parameters.
10080 (Arm_relocate_functions::xpc25): New method definition.
10081 (Arm_relocate_functions::arm_branch_common): Move method defintion
10082 out from class definition. Use stubs for mode-switching and extending
10083 branch ranges.
10084 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10085 specially. Change code to enable use of stubs in ARM branches.
10086
43d12afe
DK
100872009-11-10 Doug Kwan <dougkwan@google.com>
10088
10089 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
10090 in method declaration.
10091 (Target_arm::relocate_stub): New method declaration.
10092 (Target_arm::default_target): Change to return a pointer instead of
10093 a const reference.
10094 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
10095 Target_arm::default_target.
10096 (Arm_Relobj::do_relocate_sections): Remove options paramater in
10097 method definition.
10098 (Target_arm::relocate_section): Adjust view.
10099 (Target_arm::relocate_stub): New method definition.
10100
ac33a407
DK
101012009-11-10 Doug Kwan <dougkwan@google.com>
10102
10103 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
10104 a format warning.
10105 * incremental.cc (open_incremental_binary): Initialized local
10106 variables to avoid warnings.
10107 * object.cc (make_elf_object): Ditto.
10108 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
10109 a format warning.
e1df38aa 10110
88ee28e9
L
10111009-11-09 H.J. Lu <hongjiu.lu@intel.com>
10112
10113 PR gold/10930
10114 * testsuite/plugin_test.c: Include "config.h".
10115
2daedcd6
DK
101162009-11-09 Doug Kwan <dougkwan@google.com>
10117
10118 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
10119 (arm_symbol_value): Remove.
10120 (Arm_relocate_functions::arm_branch_common,
10121 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
10122 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
10123 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
10124 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
10125 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
10126 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
10127 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
10128 Arm_relocate_functions::thm_mobw_abs_nc,
10129 Arm_relocate_functions::thm_mov_abs,
10130 Arm_relocate_functions::movw_prel_nc,
10131 Arm_relocate_functions::thm_movt_abs,
10132 Arm_relocate_functions::movt_prel,
10133 Arm_relocate_functions::thm_movw_prel_nc,
10134 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
10135 (Target_arm::Relocate::relocate): Only decompose address into two
10136 parts if relocation type uses the thumb-bit and pass the actual
10137 bit instead of a flag indicating that the thumb-bit is used. Adjust
10138 calls to methods in Arm_relocate_functions for this change.
10139
1276bc89 101402009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
10141
10142 PR 10925
10143 * reloc.cc: Instantiate
10144 Sized_relobj::initialize_input_to_output_maps and
10145 Sized_relobj:free_input_to_output_maps.
10146
e53ad1b5
ILT
101472009-11-06 Ian Lance Taylor <iant@google.com>
10148
10149 PR 10876
10150 * defstd.cc (in_segment): Set only_if_ref true for "end".
10151
eb44217c
DK
101522009-11-06 Doug Kwan <dougkwan@google.com>
10153
10154 * arm.cc (class Reloc_stub): Correct a comment.
10155 (Target_arm::Target_arm): Initialize arm_input_section_map_.
10156 (Target_arm::scan_section_for_stubs): New method declaration.
10157 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
10158 Change methods from private to protected.
10159 (Target_arm::do_may_relax): New method definition.
10160 (Target_arm::do_relax, Target_arm::group_sections,
10161 Target_arm::scan_reloc_for_stub,
10162 Target_arm::scan_reloc_section_for_stubs): New method declarations.
10163 (Target_arm::arm_input_section_map_): New data member declaration.
10164 (Target_arm::scan_reloc_for_stub,
10165 Target_arm::scan_reloc_section_for_stubs,
10166 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
10167 Target_arm::do_relax): New method definitions.
10168
5d329b7d
ILT
101692009-11-06 Mikolaj Zalewski <mikolaj@google.com>
10170
10171 * configure.ac: Check for (struct stat)::st_mtim
10172 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
10173 * config.in: Regenerate.
10174 * configure: Regenerate.
10175
96a0d71b
ILT
101762009-11-05 Ian Lance Taylor <iant@google.com>
10177
10178 PR 10910
10179 * output.cc (Output_segment::add_output_section): Add missing
10180 return statement.
10181
594c8e5e
ILT
101822009-11-04 Ian Lance Taylor <iant@google.com>
10183
10184 PR 10880
10185 * object.h (class Object): Add is_needed and set_is_needed
10186 methods. Add is_needed_ field. Make bool fields into bitfields.
10187 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
10188 defined in a dynamic object and referenced by a regular object,
10189 set is_needed for the dynamic object.
10190 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
10191 if the file is marked with as_needed and it is not needed.
10192
22b127cc
ILT
101932009-11-04 Ian Lance Taylor <iant@google.com>
10194
10195 PR 10887
10196 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
10197 tags if data is discarded by linker script.
10198 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10199 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10200 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10201 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10202
f5c870d2
ILT
102032009-11-04 Ian Lance Taylor <iant@google.com>
10204
10205 * layout.cc (Layout::get_output_section): Add is_interp and
10206 is_dynamic_linker_section parameters. Change all callers.
10207 (Layout::choose_output_section): Likewise.
10208 (Layout::make_output_section): Likewise.
10209 (Layout::add_output_section_data): Add is_dynamic_linker_section
10210 parameter. Change all callers.
10211 * layout.h (class Layout): Update declarations.
10212 * output.h (class Output_section): Add is_interp, set_is_interp,
10213 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
10214 Add is_interp_, is_dynamic_linker_section_ fields. Change
10215 generate_code_fills_at_write_ to a bitfield.
10216 * output.cc (Output_section::Output_sections): Initialize new
10217 fields.
10218 (Output_segment::add_output_section): Add do_sort parameter.
10219 Change all callers.
10220
1ae4d23b
ILT
102212009-11-03 Ian Lance Taylor <iant@google.com>
10222
10223 PR 10860
10224 * options.h (class General_options): Add --warn-common.
10225 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
10226 merging two common symbols.
10227 (Symbol_table::should_override): Handle --warn-common when merging
10228 a common symbol with a defined symbol. Use report_resolve_problem
10229 for multiple definitions.
10230 (Symbol_table::report_resolve_problem): New function.
10231 * symtab.h (class Symbol_table): Declare report_resolve_problem.
10232
55da9579
DK
102332009-11-03 Doug Kwan <dougkwan@google.com>
10234
10235 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
10236 stub_factory_.
10237 (Target_arm::stub_factory): New method definition.
10238 (Target_arm::new_arm_input_section,
10239 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
10240 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 10241 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
10242 New type definitions.
10243 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
10244 member declarations.
10245 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
10246 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
10247 New method definitions.
10248
37a9ac43
ILT
102492009-11-03 Ian Lance Taylor <iant@google.com>
10250
10251 * options.h (class General_options): Add --warn_constructors.
10252
b3d6a3d4
ILT
102532009-11-03 Ian Lance Taylor <iant@google.com>
10254
10255 PR 10893
10256 * defstd.cc (in_section): Add entries for __rel_iplt_start,
10257 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
10258
934b01dd
ILT
102592009-11-03 Ian Lance Taylor <iant@google.com>
10260
10261 PR 10895
10262 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
10263 --msgid-bugs-address.
10264 (install-pdf): New target.
10265 (install-data_yes): Look up one directory to find mkinstalldirs.
10266
03c1939b
L
102672009-11-03 H.J. Lu <hongjiu.lu@intel.com>
10268
10269 * po/Make-in (.po.gmo): Don't generate .gmo files in source
10270 tree.
10271
ebd95253
DK
102722009-10-30 Doug Kwan <dougkwan@google.com>
10273
10274 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
10275
e9bbb538
DK
102762009-10-30 Doug Kwan <dougkwan@google.com>
10277
10278 * arm.cc (Stub_addend_reader): New struct template definition
10279 and partial specializations.
10280 (Stub_addend_reader::operator()): New method definition for a
10281 partially specialized template.
10282
d5b40221
DK
102832009-10-30 Doug Kwan <dougkwan@google.com>
10284
10285 * arm.cc (Arm_relobj::processor_specific_flags): New method
10286 definition.
10287 (Arm_relobj::do_read_symbols): New method declaration.
10288 (Arm_relobj::processor_specific_flags_): New data member declaration.
10289 (Arm_dynobj): New class definition.
10290 (Target_arm::do_finalize_sections): Add input_objects parameter.
10291 (Target_arm::do_adjust_elf_header): New method declaration.
10292 (Target_arm::are_eabi_versions_compatible,
10293 (Target_arm::merge_processor_specific_flags): New method declaration.
10294 (Target_arm::do_make_elf_object): New overloaded method definitions
10295 and declaration.
10296 (Arm_relobj::do_read_symbols): New method definition.
10297 (Arm_dynobj::do_read_symbols): Ditto.
10298 (Target_arm::do_finalize_sections): Add input_objects parameters.
10299 Merge processor-specific flags from all input objects.
10300 (Target_arm::are_eabi_versions_compatible,
10301 Target_arm::merge_processor_specific_flags,
10302 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
10303 New method definitions.
10304 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
10305 Input_objects pointer type parameter.
10306 * layout.cc (Layout::finalize): Pass input objects to target's.
10307 finalize_sections function.
10308 * output.cc (Output_file_header::do_sized_write): Set ELF file
10309 header's processor-specific flags.
10310 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
10311 Input_objects pointer type parameter.
10312 * sparc.cc (Target_sparc::do_finalize_sections): Same.
10313 * target.h (Input_objects): New forward class declaration.
10314 (Target::processor_specific_flags,
10315 Target::are_processor_specific_flags_sect): New method definitions.
10316 (Target::finalize_sections): Add input_objects parameter.
10317 (Target::Target): Initialize processor_specific_flags_ and
10318 are_processor_specific_flags_set_.
10319 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
10320 parameter.
10321 (Target::set_processor_specific_flags): New method definition.
10322 (Target::processor_specific_flags_,
10323 Target::are_processor_specific_flags_set_): New data member
10324 declarations.
10325 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
10326 Input_objects pointer type parameter.
10327
ebabffbd
DK
103282009-10-30 Doug Kwan <dougkwan@google.com>
10329
10330 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
10331
ad0f2072
ILT
103322009-10-28 Ian Lance Taylor <iant@google.com>
10333
10334 * object.h (class Relobj): Drop options parameter from
10335 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
10336 do_scan_relocs, do_relocate. Change all callers.
10337 (class Sized_relobj): Drop options parameters from
10338 do_gc_process_relocs, do_scan_relocs, do_relocate,
10339 do_relocate_sections, relocate_sections, emit_relocs_scan,
10340 emit_relocs_scan_reltype. Change all callers.
10341 (struct Relocate_info): Remove options field and all references to
10342 it.
10343 * reloc.h (class Read_relocs): Remove options constructor
10344 parameter and options_ field. Change all callers.
10345 (class Gc_process_relocs, class Scan_relocs): Likewise.
10346 (class Relocate_task): Likewise.
10347 * target-reloc.h (scan_relocs): Remove options parameter. Change
10348 all callers.
10349 (scan_relocatable_relocs): Likewise.
10350 * target.h (class Sized_target): Remove options parameter from
10351 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
10352 all callers.
10353 * gc.h (gc_process_relocs): Remove options parameter. Change all
10354 callers.
10355 * arm.cc: Update functions to remove options parameters.
10356 * i386.cc: Likewise.
10357 * powerpc.cc: Likewise.
10358 * sparc.cc: Likewise.
10359 * x86_64.cc: Likewise.
10360 * testsuite/testfile.cc: Likewise.
10361
8ffa3667
DK
103622009-10-28 Doug Kwan <dougkwan@google.com>
10363
10364 * arm.cc (Arm_relobj): New class definition.
e1df38aa 10365 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
10366 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
10367 New method definitions.
10368
40f36857
CC
103692009-10-28 Cary Coutant <ccoutant@google.com>
10370
10371 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
10372 (Plugin::cleanup_done_): New member.
10373 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
10374 (Plugin_manager::cleanup_done_): Remove.
10375 (Plugin_manager::add_input_file): Edit error message.
10376 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
10377 (Plugin_manager::cleanup): Remove use of cleanup_done_.
10378
2c849493
ILT
103792009-10-27 Mikolaj Zalewski <mikolajz@google.com>
10380
10381 * fileread.cc: (File_read::View::~View): Use the new
10382 data_ownership_ filed.
10383 (File_read::~File_read): Dispose the new whole_file_view_.
10384 (File_read::open): Mmap the whole file if needed.
10385 (File_read::open): Use whole_file_view_ instead of contents_.
10386 (File_read::find_view): Use whole_file_view_ if applicable.
10387 (File_read::do_read): Use whole_file_view_ instead of contents_.
10388 (File_read::make_view): Use whole_file_view_ instead of contents_,
10389 update File_read::View::View call.
10390 (File_read::find_or_make_view): Update File_read::View::View
10391 call.
10392 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
10393 remove contents_
10394 (File_read::View::Data_ownership): New enum.
10395 (File_read::View::View): Replace bool mapped_ with Data_ownership
10396 argument.
10397 (File_read::View::mapped_): Remove (replaced by data_ownership_).
10398 (File_read::View::data_ownership_): New field.
10399 (File_read::contents_): Remove (replaced by whole_file_view_).
10400 (File_read::whole_file_view_): New field.
10401 * options.h (class General_options): Add --keep-files-mapped.
10402
24998053
CC
104032009-10-27 Cary Coutant <ccoutant@google.com>
10404
10405 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
10406 * testsuite/Makefile.am (plugin_test_5): New test case.
10407 * testsuite/Makefile.in: Regenerate.
10408
72adc4fa
DK
104092009-10-25 Doug Kwan <dougkwan@google.com>
10410
10411 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
10412 from private to protected to allow access by child class.
10413 (Sized_relobj::do_relocate_sections): New method declaration.
10414 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 10415 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
10416 Sized_relobj::relocate_sections. Instantiate template explicitly
10417 for different target sizes and endianity.
10418
07f508a2
DK
104192009-10-24 Doug Kwan <dougkwan@google.com>
10420
10421 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
10422 (Arm_input_section::as_arm_input_section): New method.
10423 (Arm_output_section): New class definition.
10424 (Arm_output_section::create_stub_group,
10425 Arm_output_section::group_sections): New method definitions.
10426
10ad9fe5
DK
104272009-10-22 Doug Kwan <dougkwan@google.com>
10428
10429 * arm.cc (Arm_input_section): New class definition.
10430 (Arm_input_section::init, Arm_input_section:do_write,
10431 Arm_input_section::set_final_data_size,
10432 Arm_input_section::do_reset_address_and_file_offset): New method
10433 definitions.
10434
56ee5e00
DK
104352009-10-21 Doug Kwan <dougkwan@google.com>
10436
10437 * arm.cc (Stub_table, Arm_input_section): New forward class
10438 declarations.
10439 (Stub_table): New class defintion.
10440 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
10441 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
10442 New method definition.
10443
b569affa
DK
104442009-10-21 Doug Kwan <dougkwan@google.com>
10445
10446 * arm.cc: Update copyright comments.
10447 (Target_arm): New forward class template declaration.
10448 (Arm_address): New type.
10449 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
10450 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
10451 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
10452 constants.
10453 (Insn_template): Same.
10454 (DEF_STUBS): New macro.
10455 (Stub_type): New enum type.
10456 (Stub_template): New class definition.
10457 (Stub): Same.
10458 (Reloc_stub): Same.
10459 (Stub_factory): Same.
10460 (Target_arm::Target_arm): Initialize may_use_blx_ and
10461 should_force_pic_veneer_.
10462 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
10463 Target_arm::should_force_pic_veneer,
10464 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
10465 Target_arm::using_thumb_only, Target_arm:;default_target): New
10466 method defintions.
10467 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
10468 New data member declarations.
10469 (Insn_template::size, Insn_template::alignment): New method defintions.
10470 (Stub_template::Stub_template): New method definition.
10471 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
10472 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
10473 (Stub_factory::Stub_factory): New method definition.
10474 * gold.h (string_hash): New template.
10475 * output.h (Input_section_specifier::hash_value): Use
10476 gold::string_hash.
10477 (Input_section_specifier::string_hash): Remove.
10478 * stringpool.cc (Stringpool_template::string_hash): Use
10479 gold::string_hash.
10480
6c172549
DK
104812009-10-20 Doug Kwan <dougkwan@google.com>
10482
10483 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
10484 symbols of relaxed input sections.
10485 * output.h (Output_section::find_relaxed_input_section): Make
10486 method public.
10487
c5617f2f
DK
104882009-10-16 Doug Kwan <dougkwan@google.com>
10489
10490 * dynobj.cc (Versions::Versions): Initialize version_script_.
10491 Only insert base version symbol definition for a shared object
10492 if version script defines any version versions.
10493 (Versions::define_base_version): New method definition.
10494 (Versions::add_def): Check that base version is not needed.
10495 (Versions::add_need): Define base version lazily.
10496 * dynobj.h (Versions::define_base_version): New method declaration.
10497 (Versions::needs_base_version_): New data member declaration.
10498 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
10499 (check_DATA): Add no_version_test.stdout.
10500 (libno_version_test.so, no_version_test.o no_version_test.stdout):
10501 New make rules.
10502 * testsuite/Makefile.in: Regenerate.
10503 * testsuite/no_version_test.c: New file.
10504 * testsuite/no_version_test.sh: Ditto.
10505
3c12dcdb
DK
105062009-10-16 Doug Kwan <dougkwan@google.com>
10507
10508 * expression.cc (class Segment_start_expression): New class definition.
10509 (Segment_start_expression::value): New method definition.
10510 (script_exp_function_segment_start): Return a new
10511 Segment_start_expression.
10512 * gold/script-c.h (script_saw_segment_start_expression): New function
10513 prototype.
10514 * script-sections.cc (Script_sections::Script_sections): Initialize
10515 SAW_SEGMENT_START_EXPRESSION_ to false.
10516 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
10517 and -Tbbs options to specify section addresses if given in
10518 command line and no SEGMENT_START expression is seen in a script.
10519 * script-sections.h (Script_sections::saw_segment_start_expression,
10520 Script_sections::set_saw_segment_start_expression): New method
10521 definition.
10522 (Script_sections::saw_segment_start_expression_): New data member
10523 declaration.
10524 * script.cc (script_saw_segment_start_expression): New function.
10525 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
10526 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
10527 script_test_7.sh and script_test_8.sh.
10528 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
10529 script_test_8.stdout.
10530 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
10531 (script_test_6, script_test_6.stdout, script_test_7,
10532 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
10533 * Makefile.in: Regenerate.
10534 * testsuite/script_test_6.sh: New file.
10535 * testsuite/script_test_6.t: Same.
10536 * testsuite/script_test_7.sh: Same.
10537 * testsuite/script_test_7.t: Same.
10538 * testsuite/script_test_8.sh: Same.
10539
64b1ae37
DK
105402009-10-16 Doug Kwan <dougkwan@google.com>
10541
10542 * output.cc (Output_segment::set_section_list_address): Cast
10543 expressions to unsigned long long type to avoid format warnings.
10544
661be1e2
ILT
105452009-10-15 Ian Lance Taylor <iant@google.com>
10546
12edd763 10547 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 10548 dot assignment to script_sections_.
12edd763
ILT
10549 * script-sections.cc (Script_sections::add_dot_assignment):
10550 Initialize if necessary.
10551
68b6574b
ILT
10552 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
10553 program headers with no load segment if there is a linker script.
10554
661be1e2
ILT
10555 * layout.cc (Layout::set_segment_offsets): Align the file offset
10556 to the segment aligment for -N or -n with no load segment.
10557 * output.cc (Output_segment::add_output_section): Don't crash if
10558 the first section is a TLS section.
10559 (Output_segment::set_section_list_addresses): Print an error
10560 message if the address moves backward in a linker script.
10561 * script-sections.cc
10562 (Output_section_element_input::set_section_addresses): Don't
10563 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
10564 (Orphan_output_section::set_section_addresses): Likewise.
10565
f15f61a7
DK
105662009-10-15 Doug Kwan <dougkwan@google.com>
10567
10568 * layout.cc (Layout::finish_dynamic_section): Generate tags
10569 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
10570 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
10571 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
10572
82bb573a
ILT
105732009-10-14 Ian Lance Taylor <iant@google.com>
10574
10575 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
10576 fields.
10577 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
10578 data_shdr fields of relinfo.
10579 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
10580 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
10581 R_386_TLS_LDO_32, adjust based on section flags.
10582 (Target_i386::Relocate::fix_up_ldo): Remove.
10583
374ad285
ILT
105842009-10-13 Ian Lance Taylor <iant@google.com>
10585
10586 Add support for -pie.
10587 * options.h (class General_options): Add -pie and
10588 --pic-executable.
10589 (General_options::output_is_position_independent): Test -pie.
10590 (General_options::output_is_executable): Return true if not shared
10591 and not relocatable.
10592 (General_options::output_is_pie): Remove.
10593 * options.cc (General_options::finalize): Reject incompatible uses
10594 of -pie.
10595 * gold.cc (queue_middle_tasks): A -pie link is not static.
10596 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
10597 * symtab.cc (Symbol::final_value_is_known): Return false if
10598 output_is_position_independent.
10599 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
10600 output_is_position_independent.
10601 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
10602 output_is_position_independent.
10603 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
10604 output_is_position_independent.
10605 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
10606 two_file_pie_test.
10607 (basic_pie_test.o, basic_pie_test): New targets.
10608 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
10609 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
10610 (two_file_pie_test): New target.
10611 * testsuite/Makefile.in: Rebuild.
10612 * README: Remove note saying that -pie is not supported.
10613
c6585162
ILT
106142009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
10615
10616 * options.h (class General_options): Add -init and -fini.
10617 * layout.cc (Layout::finish_dynamic_section): Emit
10618 given init and fini functions.
10619
032ce4e9
ST
106202009-10-13 Sriraman Tallam <tmsriram@google.com>
10621
10622 * gc.h (gc_process_relocs): Check if icf is enabled using new
10623 function.
10624 * gold.cc (queue_initial_tasks): Likewise.
10625 (queue_middle_tasks): Likewise.
10626 * object.cc (do_layout): Likewise.
10627 * symtab.cc (is_section_folded): Likewise.
10628 * main.cc (main): Likewise.
10629 * reloc.cc (Read_relocs::run): Likewise.
10630 (Sized_relobj::do_scan_relocs): Likewise.
10631 * icf.cc (is_function_ctor_or_dtor): New function.
10632 (Icf::find_identical_sections): Check if function is ctor or dtor when
10633 safe icf is chosen.
10634 * options.h (General_options::icf): Change option to be an enum.
10635 (Icf_status): New enum.
10636 (icf_enabled): New method.
10637 (icf_safe_folding): New method.
10638 (set_icf_status): New method.
10639 (icf_status_): New variable.
10640 * (options.cc) (General_options::finalize): Set icf_status_.
10641 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
10642 icf_test and icf_keep_unique_test to use the --icf enum flag.
10643 * testsuite/icf_safe_test.sh: New file.
e1df38aa 10644 * testsuite/icf_safe_test.cc: New file.
032ce4e9 10645
f345227a
ST
106462009-10-12 Sriraman Tallam <tmsriram@google.com>
10647
10648 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
10649 includes to gc.h and icf.h.
10650 * arm.cc: Include gc.h.
10651 * gold.cc: Likewise.
10652 * i386.cc: Likewise.
10653 * powerpc.cc: Likewise.
10654 * sparc.cc: Likewise.
10655 * x86_64.cc: Likewise.
10656 * gc.h: Include icf.h.
10657
1c7814ed
ILT
106582009-10-11 Ian Lance Taylor <iant@google.com>
10659
10660 * plugin.cc: Include "gold.h" before other header files.
10661
ae3b5189
CD
106622009-10-10 Chris Demetriou <cgd@google.com>
10663
10664 * options.h (Input_file_argument::Input_file_type): New enum.
10665 (Input_file_argument::is_lib_): Replace with...
10666 (Input_file_argument::type_): New member.
10667 (Input_file_argument::Input_file_argument): Take Input_file_type
10668 'type' rather than boolean 'is_lib' as second argument.
10669 (Input_file_argument::is_lib): Use type_.
10670 (Input_file_argument::is_searched_file): New function.
10671 (Input_file_argument::may_need_search): Handle is_searched_file.
10672 * options.cc (General_options::parse_library): Support -l:filename.
10673 (General_options::parse_just_symbols): Update for Input_file_argument
10674 changes.
10675 (Command_line::process): Likewise.
10676 * archive.cc (Archive::get_file_and_offset): Likewise.
10677 * plugin.cc (Plugin_manager::release_input_file): Likewise.
10678 * script.cc (read_script_file, script_add_file): Likewise.
10679 * fileread.cc (Input_file::Input_file): Likewise.
10680 (Input_file::will_search_for): Handle is_searched_file.
10681 (Input_file::open): Likewise.
10682 * readsyms.cc (Read_symbols::get_name): Likewise.
10683 * testsuite/Makefile.am (searched_file_test): New test.
10684 * testsuite/Makefile.in: Regenerate.
10685 * testsuite/searched_file_test.cc: New file.
10686 * testsuite/searched_file_test_lib.cc: New file.
10687
f3048a1d
ILT
106882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10689 Ian Lance Taylor <iant@google.com>
10690
10691 * descriptor.cc: Include <cstdio> and "binary-io.h".
10692 (Descriptors::open): Open the files in binary mode always.
10693 * script.cc (Lex::get_token): Treat \r as whitespace.
10694
d4780e57
ILT
106952009-10-09 Ian Lance Taylor <iant@google.com>
10696
10697 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
10698
d9a893b8
ILT
106992009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10700 Ian Lance Taylor <iant@google.com>
10701
10702 * configure.ac: Check for readv function also.
10703 * fileread.cc (readv): Define if not HAVE_READV.
10704 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
10705 does not exist.
10706 * config.in: Regenerate.
10707 * configure: Regenerate.
10708
c0a62865
DK
107092009-10-09 Doug Kwan <dougkwan@google.com>
10710
10711 * layout.cc (Layout::make_output_section): Call target hook to make
10712 ordinary output section.
10713 (Layout::finalize): Adjust parameter list of call the
10714 Target::may_relax().
10715 * layout.h (class Layout::section_list): New method.
10716 * merge.h (Output_merge_base::entsize): Change visibility to public.
10717 (Output_merge_base::is_string, Output_merge_base::do_is_string):
10718 New methods.
10719 (Output_merge_string::do_is_string): New method.
10720 * object.cc (Sized_relobj::do_setup): renamed from
10721 Sized_relobj::set_up.
10722 * object.h (Sized_relobj::adjust_shndx,
10723 Sized_relobj::initializ_input_to_output_maps,
10724 Sized_relobj::free_input_to_output_maps): Change visibilities to
10725 protected.
10726 (Sized_relobj::setup): Virtualize.
10727 (Sized_relobj::do_setup): New method declaration.
10728 (Sized_relobj::invalidate_section_offset,
10729 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
10730 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
10731 * options.cc (parse_int): New function.
10732 * options.h (parse_int): New declaration.
10733 (DEFINE_int): New macro.
10734 (stub_group_size): New option.
10735 * output.cc (Output_section::Output_section): Initialize memebers
10736 merge_section_map_, merge_section_by_properties_map_,
10737 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
10738 (Output_section::add_input_section): Handled deferred code-fill
10739 generation and remove an old comment.
10740 (Output_section::add_relaxed_input_section): New method definition.
10741 (Output_section::add_merge_input_section): Use merge section by
10742 properties map to speed to search. Update merge section maps
10743 as appropriate.
10744 (Output_section::build_relaxation_map): New method definition.
10745 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
10746 Same.
10747 (Output_section::relax_input_section): Renamed to
10748 Output_section::convert_input_sections_to_relaxed_sections and change
10749 interface to take a vector of pointers to relaxed sections.
10750 (Output_section::find_merge_section,
10751 Output_section::find_relaxed_input_section): New method definitions.
10752 (Output_section::is_input_address_mapped,
10753 Output_section::output_offset, Output_section::output_address):
10754 Use output section data maps to speed up searching.
10755 (Output_section::find_starting_output_address): Add comments.
10756 (Output_section::do_write,
10757 Output_section::write_to_postprocessing_buffer): Do code-fill
10758 generation as appropriate.
10759 (Output_section::get_input_sections): Invalidate relaxed input section
10760 map.
10761 (Output_section::restore_states): Adjust type of checkpoint .
10762 Invalidate relaxed input section map.
10763 * output.h (Output_merge_base): New class declaration.
10764 (Input_section_specifier): New class defintion.
10765 (class Output_relaxed_input_section) Change base class to
10766 Output_section_data_build.
10767 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
10768 base class initializer.
10769 (Output_section::add_relaxed_input_section): New method declaration.
10770 (Output_section::Input_section): Change visibility to protected.
2e702c99 10771 (Output_section::Input_section::relobj,
c0a62865
DK
10772 Output_section::Input_section::shndx): Handle relaxed input sections.
10773 Output_section::input_sections) Change visibility to protected. Also
10774 define overload to return a non-const pointer.
10775 (Output_section::Merge_section_properties): New class defintion.
10776 (Output_section::Merge_section_by_properties_map,
10777 Output_section::Output_section_data_by_input_section_map,
10778 Output_section::Relaxation_map): New types.
10779 (Output_section::relax_input_section): Rename method to
10780 Output_section::convert_input_sections_to_relaxed_sections and change
10781 interface to take a vector of relaxed section pointers.
10782 (Output_section::find_merge_section,
10783 Output_section::find_relaxed_input_section,
10784 Output_section::build_relaxation_map,
10785 Output_section::convert_input_sections_in_list_to_relaxed_sections):
10786 New method declarations.
10787 (Output_section::merge_section_map_
10788 Output_section::merge_section_by_properties_map_,
10789 Output_section::relaxed_input_section_map_,
10790 Output_section::is_relaxed_input_section_map_valid_,
10791 Output_section::generate_code_fills_at_write_): New data members.
10792 * script-sections.cc
10793 (Output_section_element_input::set_section_addresses): Call
10794 current_data_size and addralign methods of relaxed input sections.
10795 (Orphan_output_section::set_section_addresses): Call current_data_size
10796 and addralign methods of relaxed input sections.
10797 * symtab.cc (Symbol_table::compute_final_value): Extract template
10798 from the body of Symbol_table::sized_finalize_symbol.
10799 (Symbol_table::sized_finalized_symbol): Call
10800 Symbol_table::compute_final_value.
10801 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
10802 (Symbol_table::compute_final_value): New templated method declaration.
10803 * target.cc (Target::do_make_output_section): New method defintion.
10804 * target.h (Target::make_output_section): New method declaration.
10805 (Target::relax): Add more parameters for input objects, symbol table
10806 and layout. Adjust call to do_relax.
10807 (Target::do_make_output_section): New method declaration.
10808 (Target::do_relax): Add parameters for input objects, symbol table
10809 and layout.
10810
d446d6c4
ILT
108112009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10812
10813 * pread.c: Include stdio.h.
10814
bc06c745
ILT
108152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10816
10817 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
10818 defined.
10819
75aea3d0
ILT
108202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
10821
10822 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
10823 Change read_shndx type to unsigned int.
10824 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10825 int.
10826 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10827 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
10828 Change read_shndx type to unsigned int.
10829 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
10830 int.
10831 (Sized_dwarf_line_info::read_line_mappings): Likewise.
10832 * layout.cc (Layout::create_symtab_sections): Cast the result of
10833 local_symcount * symsize to off_t in the gold_assert.
10834
be8fcb75
ILT
108352009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10836
10837 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
10838 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
10839 R_ARM_BASE_ABS.
10840 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
10841 (Arm_relocate_functions::thm_abs5): New function.
10842 (Arm_relocate_functions::abs12): New function.
10843 (Arm_relocate_functions::abs16): New function.
10844 (Arm_relocate_functions::base_abs): New function.
10845 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
10846 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
10847 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
10848 R_ARM_BASE_ABS.
10849 (Scan::global): Likewise.
10850 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
10851 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
10852 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
10853 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
10854 R_ARM_BASE_ABS.
10855
c2a122b6
ILT
108562009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10857
10858 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
10859 (Arm_relocate_functions::movt_prel): New function.
10860 (Arm_relocate_functions::thm_movw_prel_nc): New function.
10861 (Arm_relocate_functions::thm_movt_prel): New function.
10862 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
10863 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
10864 (Scan::global, Relocate::relocate): Likewise.
10865 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10866
c4aa1e2d
ILT
108672009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10868
10869 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
10870 Incremental_checker.
10871 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
10872 unsigned int.
10873 (class Incremental_inputs_header): New class.
10874 (Incremental_inputs_header_writer): Edit comment.
10875 (Incremental_inputs_entry): New class.
10876 (Incremental_inputs_entry_writer): Edit comment.
10877 (Sized_incremental_binary::do_find_incremental_inputs_section):
10878 Add *strtab_shndx parameter, fill it.
10879 (Sized_incremental_binary::do_check_inputs): New method.
10880 (Incremental_checker::can_incrementally_link_output_file): Use
10881 Sized_incremental_binary::check_inputs.
10882 (Incremental_inputs::report_command_line): Save command line in
10883 command_line_.
10884 * incremental.h:
10885 (Incremental_binary::find_incremental_inputs_section): New
10886 method.
10887 (Incremental_binary::do_find_incremental_inputs_section): Add
10888 strtab_shndx parameter.
10889 (Incremental_binary::do_check_inputs): New pure virtual method.
10890 (Sized_incremental_binary::do_check_inputs): Declare.
10891 (Incremental_checker::Incremental_checker): Add incremental_inputs
10892 parameter, use it to initialize incremental_inputs_.
10893 (Incremental_checker::incremental_inputs_): New field.
10894 (Incremental_checker::command_line): New method.
10895 (Incremental_checker::inputs): New method.
10896 (Incremental_checker::command_line_): New field.
10897
c549a694
ILT
108982009-10-09 Mikolaj Zalewski <mikolajz@google.com>
10899
10900 * incremental.cc: Include <cstdarg> and "target-select.h".
10901 (vexplain_no_incremental): New function.
10902 (explain_no_incremental): New function.
10903 (Incremental_binary::error): New method.
10904 (Sized_incremental_binary::do_find_incremental_inputs_section): New
10905 method.
10906 (make_sized_incremental_binary): New function.
10907 (open_incremental_binary): New function.
10908 (can_incrementally_link_file): Add checks if output is ELF and has
10909 inputs section.
10910 * incremental.h: Include "elfcpp_file.h" and "output.h".
10911 (Incremental_binary): New class.
10912 (Sized_incremental_binary): New class.
10913 (open_incremental_binary): Declare.
10914 * object.cc (is_elf_object): Use
10915 elfcpp::Elf_recognizer::is_elf_file.
10916 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
10917 * output.h (Output_file::filesize): New method.
10918
fd3c5f0b
ILT
109192009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10920
10921 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
10922 New function.
10923 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
10924 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
10925 function.
10926 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
10927 function.
10928 (Arm_relocate_functions::movw_abs_nc): New function.
10929 (Arm_relocate_functions::movt_abs): New function.
10930 (Arm_relocate_functions::thm_movw_abs_nc): New function.
10931 (Arm_relocate_functions::thm_movt_abs): New function.
10932 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
10933 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
10934 (Scan::global): Likewise.
10935 (Relocate::relocate): Likewise.
10936 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10937
7f5309a5
ILT
109382009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10939
10940 * arm.cc (Arm_relocate_functions::got_prel) New function.
10941 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
10942 (Relocate::relocate): Likewise.
10943 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
10944
364c7fa5
ILT
109452009-10-06 Ian Lance Taylor <iant@google.com>
10946
10947 * options.h (class General_options): Define
10948 split_stack_adjust_size parameter.
10949 * object.h (class Object): Add uses_split_stack_ and
10950 has_no_split_stack_ fields. Add uses_split_stack and
10951 has_no_split_stack accessor functions. Declare
10952 handle_split_stack_section.
10953 (class Reloc_symbol_changes): Define.
10954 (class Sized_relobj): Define Function_offsets. Declare
10955 split_stack_adjust, split_stack_adjust_reltype, and
10956 find_functions.
10957 * object.cc (Object::handle_split_stack_section): New function.
10958 (Sized_relobj::do_layout): Call handle_split_stack_section.
10959 * dynobj.cc (Sized_dynobj::do_layout): Call
10960 handle_split_stack_section.
10961 * reloc.cc (Sized_relobj::relocate_sections): Call
10962 split_stack_adjust for executable sections in split_stack
10963 objects. Pass reloc_map to relocate_section.
10964 (Sized_relobj::split_stack_adjust): New function.
10965 (Sized_relobj::split_stack_adjust_reltype): New function.
10966 (Sized_relobj::find_functions): New function.
10967 * target-reloc.h: Include "object.h".
10968 (relocate_section): Add reloc_symbol_changes parameter. Change
10969 all callers.
10970 * target.h (class Target): Add calls_non_split method. Declare
10971 do_calls_non_split virtual method. Declare match_view and
10972 set_view_to_nop.
10973 * target.cc: Include "elfcpp.h".
10974 (Target::do_calls_non_split): New function.
10975 (Target::match_view): New function.
10976 (Target::set_view_to_nop): New function.
10977 * gold.cc (queue_middle_tasks): Give an error if mixing
10978 split-stack and non-split-stack objects with -r.
10979 * i386.cc (Target_i386::relocate_section): Add
10980 reloc_symbol_changes parameter.
10981 (Target_i386::do_calls_non_split): New function.
10982 * x86_64.cc (Target_x86_64::relocate_section): Add
10983 reloc_symbol_changes parameter.
10984 (Target_x86_64::do_calls_non_split): New function.
10985 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
10986 parameter.
10987 * powerpc.cc (Target_powerpc::relocate_section): Add
10988 reloc_symbol_changes parameter.
10989 * sparc.cc (Target_sparc::relocate_section): Add
10990 reloc_symbol_changes parameter.
10991 * configure.ac: Call AM_CONDITIONAL for the default target.
10992 * configure: Rebuild.
10993 * testsuite/Makefile.am (TEST_AS): New variable.
10994 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
10995 (check_DATA): Add split_i386 and split_x86_64 files.
10996 (SPLIT_DEFSYMS): Define.
10997 (split_i386_[1234n].o): New targets.
10998 (split_i386_[124]): New targets.
10999 (split_i386_[1234r].stdout): New targets.
11000 (split_x86_64_[1234n].o): New targets.
11001 (split_x86_64_[124]): New targets.
11002 (split_x86_64_[1234r].stdout): New targets.
11003 (MOSTLYCLEANFILES): Add new executables.
11004 * testsuite/split_i386.sh: New file.
11005 * testsuite/split_x86_64.sh: New file.
11006 * testsuite/split_i386_1.s: New file.
11007 * testsuite/split_i386_2.s: New file.
11008 * testsuite/split_i386_3.s: New file.
11009 * testsuite/split_i386_4.s: New file.
11010 * testsuite/split_i386_n.s: New file.
11011 * testsuite/split_x86_64_1.s: New file.
11012 * testsuite/split_x86_64_2.s: New file.
11013 * testsuite/split_x86_64_3.s: New file.
11014 * testsuite/split_x86_64_4.s: New file.
11015 * testsuite/split_x86_64_n.s: New file.
11016 * testsuite/testfile.cc (Target_test): Update relocation_section
11017 function.
11018 * testsuite/Makefile.in: Rebuild.
11019
e8a9fcda
ILT
110202009-10-06 Ian Lance Taylor <iant@google.com>
11021
11022 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11023 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11024 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11025 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11026 the address on ldo_addrs_.
11027 (Target_i386::Relocate::fix_up_ldo): New function.
11028
e99daf92
ILT
110292009-10-06 Rafael Espindola <espindola@google.com>
11030
11031 * plugin.cc (add_input_library): New.
11032 (Plugin::load): Add add_input_library to tv.
11033 (Plugin_manager::add_input_file): Add the is_lib argument.
11034 (add_input_file): Update call to Plugin_manager::add_input_file.
11035 (add_input_library): New.
11036 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11037
966d4097
DK
110382009-09-30 Doug Kwan <dougkwan@google.com>
11039
11040 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11041 symbol and call Symbol::may_need_copy_reloc to determine if
11042 a copy reloc is needed.
11043 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11044 nocopyreloc is given in command line.
11045 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11046 given in command line.
11047 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11048 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11049 of the removed Target_i386::may_need_copy_reloc.
11050 * options.h (copyreloc): New option with default value false.
11051 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11052 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11053 instead of the removed Target_powerpc::may_need_copy_reloc.
11054 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11055 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11056 instead of the removed Target_sparc::may_need_copy_reloc.
11057 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11058 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11059 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11060 instead of the removed Target_x86_64::may_need_copy_reloc.
11061
029ba973
ILT
110622009-09-30 Ian Lance Taylor <iant@google.com>
11063
11064 * object.h (class Object): Remove target_ field, and target,
11065 sized_target, and set_target methods.
11066 (Object::sized_target): Remove.
11067 (class Sized_relobj): Update declarations. Remove sized_target.
11068 * object.cc (Sized_relobj::setup): Remove target parameter.
11069 Change all callers.
11070 (Input_objects::add_object): Don't do anything with the target.
11071 (make_elf_sized_object): Add punconfigured parameter. Change all
11072 callers. Set or test parameter target.
11073 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11074 Change all callers.
11075 * parameters.cc (Parameters::set_target): Change parameter type to
11076 be non-const.
11077 (Parameters::default_target): Remove.
11078 (set_parameters_target): Change parameter type to be non-const.
11079 (parameters_force_valid_target): New function.
11080 (parameters_clear_target): New function.
11081 * parameters.h (class Parameters): Update declarations. Remove
11082 default_target method. Add sized_target and clear_target
11083 methods. Change target_ to be non-const.
11084 (set_parameters_target): Update declaration.
11085 (parameters_force_valid_target): Declare.
11086 (parameters_clear_target): Declare.
11087 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
11088 as NULL if we aren't searching.
11089 (Add_symbols::run): Don't check for compatible target.
11090 * fileread.cc (Input_file::open_binary): Call
11091 parameters_force_valid_target.
11092 * gold.cc (queue_middle_tasks): Likewise.
11093 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
11094 set_target on object.
11095 * dynobj.h (class Sized_dynobj): Update declarations.
11096 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
11097 make_elf_object returns NULL.
11098 (Archive::include_member): Don't check whether object target is
11099 compatible.
11100 * output.cc (Output_section::add_input_section): Get target from
11101 parameters.
11102 (Output_section::relax_input_section): Likewise.
11103 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
11104 parameters.
11105 (Sized_relobj::do_scan_relocs): Likewise.
11106 (Sized_relobj::relocate_sections): Likewise.
11107 * resolve.cc (Symbol_table::resolve): Likewise.
11108 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
11109 parameter. Change all callers.
11110 (Symbol_table::add_from_object): Get target from parameters.
11111 (Symbol_table::add_from_relobj): Don't check object target.
11112 (Symbol_table::add_from_dynobj): Likewise.
11113 (Symbol_table::define_special_symbol): Get target from
11114 parameters.
11115 * symtab.h (class Symbol_table): Update declaration.
11116 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
11117 parameter. Change all callers. Clear parameter target.
11118 (Binary_test): Test target here.
11119 * testsuite/object_unittest.cc (gold_testsuite): Remove
11120 target_test_pointer parameter. Change all callers.
11121 (Object_test): Test target here.
11122
a6a22b83
ILT
111232009-09-26 Ian Lance Taylor <iant@google.com>
11124
11125 * testsuite/initpri1.c: Don't try to use constructor priorities if
11126 compiling with gcc before 4.3.
11127
6a8f49fe
ILT
111282009-09-22 Mikolaj Zalewski <mikolajz@google.com>
11129
11130 * testsuite/retain_symbols_file_test.sh (check_present): Change
11131 output file name to retain_symbols_file_test.stdout.
11132 (check_absent): Likewise.
11133
8c604651
CS
111342009-09-18 Craig Silverstein <csilvers@google.com>
11135
11136 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
11137 * options.cc: Include <cerrno> and <fstream>.
11138 (General_options::finalize): Parse -retain-symbols-file tag.
11139 * options.h: New flag.
11140 (General_options): New method should_retain_symbol, new
11141 variable symbols_to_retain.
11142 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
11143 should_retain_symbol map.
11144 * testsuite/Makefile.am (retain_symbols_file_test): New test.
11145 * testsuite/Makefile.in: Regenerate.
11146 * testsuite/retain_symbols_file_test.sh: New file.
11147
ca58b19f
NC
111482009-09-18 Nick Clifton <nickc@redhat.com>
11149
11150 * po/es.po: Updated Spanish translation.
11151
20e6d0d6
DK
111522009-09-17 Doug Kwan <dougkwan@google.com>
11153
11154 * debug.h (DEBUG_RELAXATION): New constant.
11155 (DEBUG_ALL): Add DEBUG_RELAXATION.
11156 (debug_string_to_enum): Add relaxation debug option.
11157 * layout.cc
11158 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
11159 Layout::Relaxation_debug_check::read_sections,
11160 Layout::Relaxation_debug_check::read_sections): New method definitions.
11161 (Layout::Layout): Initialize data members
11162 record_output_section_data_from_scrips_,
11163 script_output_section_data_list_ and relaxation_debug_check_.
11164 (Layout::save_segments, Layout::restore_segments,
11165 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11166 Layout::relaxation_loop_body): New method definitions.
11167 (Layout::finalize): Support relaxation. Move section layout code to
11168 Layout::relaxation_loop_body.
11169 (Layout::set_asection_address_from_script): Move code for orphan
11170 section placement out.
11171 (Layout::place_orphan_sections_in_script): New method definition.
11172 * layout.h (Output_segment_headers, Output_file_header):
11173 New forward class declarations.
11174 (Layout::~Layout): Define.
11175 (Layout::new_output_section_data_from_script): New method definition.
11176 (Layout::place_orphan_sections_in_script): New method declaration.
11177 (Layout::Segment_states): New type declaration.
11178 (Layout::save_segments, Layout::restore_segments,
11179 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
11180 Layout::relaxation_loop_body): New method declarations.
11181 (Layout::Output_section_data_list): New type declaration.
11182 (Layout::Relaxation_debug_check): New class definition.
11183 (Layout::record_output_section_data_from_script_,
11184 Layout::script_output_section_data_list_, Layout::segment_states_,
11185 Layout::relaxation_debug_check_): New data members.
11186 * output.cc: (Output_section_headers::do_size): New method definition.
11187 (Output_section_headers::Output_section_headers): Move size
11188 computation to Output_section_headers::do_size.
11189 (Output_segment_headers::do_size): New method definition.
e1df38aa 11190 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
11191 Output_file_header::do_size and call it.
11192 (Output_file_header::do_size): New method definition.
11193 (Output_data_group::Output_data_group): Adjust call to
11194 Output_section_data.
11195 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
11196 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 11197 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
11198 RELAXED_INPUT_SECTION_CODE.
11199 (Output_section::Output_section): Initialize data member checkpoint_.
11200 (Output_section::~Output_section): Delete checkpoint object pointed
11201 by checkpoint_.
11202 (Output_section::add_input_section): Always add an Input_section if
11203 relaxing.
11204 (Output_section::add_merge_input_section): Add assert.
11205 (Output_section::relax_input_section): New method definition.
11206 (Output_section::set_final_data_size): Set load address to zero for
11207 an unallocated section.
11208 (Output_section::do_address_and_file_offset_have_reset_values):
11209 New method definition.
11210 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
11211 Handle relaxed input section.
11212 (Output_section::sort_attached_input_sections): Checkpoint input
11213 section list lazily.
11214 (Output_section::get_input_sections): Change type of input_sections to
11215 list of Simple_input_section pointers. Checkpoint input section list
11216 lazily. Also handle relaxed input sections.
11217 (Output_section::add_input_section_for_script): Take a reference to
11218 a Simple_input_section object instead of Relobj pointer and section
11219 index as parameter. Handle relaxed input sections.
11220 (Output_section::save_states, Output_section::restore_states): New
11221 method definitions.
11222 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
11223 (Output_data::is_data_size_fixed): New method definition.
11224 (Output_data::reset_addresss_and_file_offset): Do not reset data size
11225 if it is fixed.
11226 (Output_data::address_and_file_offset_have_reset_values): New method
11227 definition.
11228 (Output_data::do_address_and_file_offset_have_reset_values): New method
11229 definition.
11230 (Output_data::set_data_size): Check that data size is not fixed.
11231 (Output_data::fix_data_size): New method definition.
11232 (Output_data::is_data_size_fixed_): New data member.
11233 (Output_section_headers::set_final_data_size): New method definition.
11234 (Output_section_headers::do_size): New method declaration.
11235 (Output_segment_headers::set_final_data_size): New method definition.
11236 (Output_segment_headers::do_size): New method declaration.
11237 (Output_file_header::set_final_data_size)::New method definition.
11238 (Output_file_header::do_size)::New method declaration.
11239 (Output_section_data::Output_section_data): Add new parameter
11240 is_data_size_fixed and use it to fix data size.
11241 (Output_data_const::Output_data_const): Adjust call to base class
11242 constructor and fix data size.
11243 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
11244 base class constructor and fix data size.
11245 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
11246 base class constructor and fix data size.
11247 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
11248 class constructor and fix data size.
11249 (Output_data_group::set_final_data_size): New method definition.
11250 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
11251 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
11252 class constructor and fix data size.
11253 (Output_relaxed_input_section): New class definition.
11254 (Output_section::Simple_input_section): New class definition.
11255 (Output_section::get_input_sections): Adjust parameter list.
11256 (Output_section::add_input_section_for_script): Same.
11257 (Output_section::save_states, Output_section::restore_states,
11258 Output_section::do_address_and_file_offset_have_reset_values,
11259 (Output_section::Input_section::Input_section): Handle
11260 RELAXED_INPUT_SECTION_CODE. Add new overload for
11261 Output_relaxed_input_section.
11262 (Output_section::Input_section::is_input_section,
11263 Output_section::Input_section::set_output_section): Handle relaxed
11264 input section.
11265 (Output_section::Input_section::is_relaxed_input_section,
11266 Output_section::Input_section::output_section_data,
11267 Output_section::Input_section::relaxed_input_section): New method
11268 definitions.
11269 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
11270 value.
11271 (Output_section::Input_section::u1_): Update comments.
11272 (Output_section::Input_section::u2_): Add new union member poris.
11273 (Output_section::Checkpoint_output_section): New classs definition.
11274 (Output_section::relax_input_section): New method declaration.
11275 (Output_section::checkpoint_): New data member.
11276 (Output_segment): Update comments.
11277 (Output_segment::Output_segment): Un-privatize copy constructor.
11278 (Output_segment::operator=): Un-privatize.
11279 * script-sections.cc (Output_section_element::Input_section_list):
11280 Change element type to Output_section::Simple_input_section.
11281 (Output_section_element_dot_assignment::set_section_addresses):
11282 Register output section data for relaxation clean up.
11283 (Output_data_exression::Output_data_expression): Adjust call to base
11284 constructor to fix data size.
11285 (Output_section_element_data::set_section_addresses): Register
11286 Output_data_expression object for relaxation clean up.
11287 (struct Input_section_info): Replace Relobj pointer and section index
11288 pair with Output_section::Simple_input_section and Convert struct to a
11289 class.
11290 (Input_section_sorter::operator()): Adjust access to
e1df38aa 11291 Input_section_info data member to use accessors.
20e6d0d6
DK
11292 (Output_section_element_input::set_section_addresses): Use layout
11293 parameter. Adjust code to use Output_section::Simple_input_section
11294 and Input_secction_info classes. Register filler for relaxation
11295 clean up.
11296 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
11297 and section index pair with Output_section::Simple_input_section
11298 class. Adjust code accordingly.
11299 (Phdrs_element::release_segment): New method definition.
11300 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
11301 segment list.
11302 (Script_sections::release_segments): New method definition.
11303 * gold/script-sections.h (Script_sections::release_segments): New
11304 method declaration.
11305 * gold/target.h (Target::may_relax, Target::relax,
11306 Target::do_may_relax, Target::do_relax): New method definitions.
11307
5e445df6
ILT
113082009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11309
11310 * arm.cc (has_signed_unsigned_overflow): New function.
11311 (Arm_relocate_functions::abs8): New function.
11312 (Target_arm::Scan::local): Handle R_ARM_ABS8.
11313 (Target_arm::Scan::global): Likewise.
11314 (Target_arm::relocate::relocate): Likewise.
11315 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11316 Likewise.
11317
8c604651 113182009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
11319
11320 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
11321 * testsuite/Makefile.in: Regenerate.
11322
1e9cc1c2
NC
113232009-09-11 Nick Clifton <nickc@redhat.com>
11324
11325 * po/gold.pot: Updated by the Translation project.
11326
6a89f575
CC
113272009-09-08 Cary Coutant <ccoutant@google.com>
11328
11329 * output.cc (Output_file::open): Add execute permission to empty file.
11330 * testsuite/Makefile.am (permission_test): New test.
11331 * testsuite/Makefile.in: Regenerate.
11332
fdcac5af
ILT
113332009-09-02 Ian Lance Taylor <iant@google.com>
11334
11335 * output.cc (Output_file::resize): Call map_no_anonymous rather
11336 than map.
11337
44453f85
ILT
113382009-09-01 Mikolaj Zalewski <mikolajz@google.com>
11339
11340 * gold.cc: Include "incremental.h".
11341 (queue_initial_tasks): Call Incremental_checker methods.
11342 * incremental.cc: Include "output.h".
11343 (Incremental_checker::can_incrementally_link_output_file): New
11344 method.
11345 * incremental.h (Incremental_checker): New class.
11346
11347 * output.cc (Output_file::open_for_modification): New method.
11348 (Output_file::map_anonymous): Changed return type to bool. Record
11349 map in base_ field.
11350 (Output_file::map_no_anonymous): New method, broken out of map.
11351 (Output_file::map): Use map_no_anonymous and map_anonymous.
11352 * output.h (class Output_file): Update declarations.
11353
293c1386
CC
113542009-08-24 Cary Coutant <ccoutant@google.com>
11355
11356 * options.h (Command_line::Pre_options): New class.
11357 (Command_line::pre_options): New member.
11358 * options.cc (gold::options::ready_to_register): New variable.
11359 (One_option::register_option): Do nothing if not registering options.
11360 Assert if same short option registered twice.
11361 (General_options::General_options): Turn off option registration when
11362 done constructing.
11363 (Command_line::Pre_options::Pre_options): New constructor.
11364
f773f3d2
CC
113652009-08-24 Cary Coutant <ccoutant@google.com>
11366
06a73cfe
CC
11367 * options.h (General_options::no_keep_memory): Remove incorrect
11368 short option.
f773f3d2 11369
a15af8e2
RW
113702009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11371
11372 * Makefile.am (am__skiplex, am__skipyacc): New.
11373 * Makefile.in: Regenerate.
11374
c462b41b
RW
113752009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
11376
14ec8efd
RW
11377 * Makefile.am (AM_CPPFLAGS): Renamed from ...
11378 (INCLUDES): ... this.
11379 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
11380 (AM_CPPFLAGS): Renamed from ...
11381 (INCLUDE): ... this.
11382 * Makefile.in, testsuite/Makefile.in: Regenerate.
11383
81ecdfbb
RW
11384 * Makefile.in: Regenerate.
11385 * aclocal.m4: Likewise.
11386 * config.in: Likewise.
11387 * configure: Likewise.
11388 * testsuite/Makefile.in: Likewise.
11389
c462b41b
RW
11390 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11391 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
11392 * Makefile.in: Regenerate.
11393 * testsuite/Makefile.in: Regenerate.
11394
2da73f13
CC
113952009-08-19 Cary Coutant <ccoutant@google.com>
11396
11397 * resolve.cc (Symbol_table::resolve): Don't complain about defined
11398 symbols in shared libraries overridden by hidden or internal symbols
11399 in the main program.
11400
2db70501
CD
114012009-08-19 Chris Demetriou <cgd@google.com>
11402
11403 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
11404 checking source file names in error messages.
11405
f733487b
DK
114062009-08-18 Doug Kwan <dougkwan@google.com>
11407
11408 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
11409 an elcpp::Ehdr as parameter. Adjust call to set_target.
11410 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
11411 an elfcpp::Ehdr as parameter.
11412 * object.cc (Object::set_target): Remove the version that looks up
11413 a target and sets it.
11414 (Sized_relobj::setup): Take a Target object instead of
11415 an elfcpp::Ehdr as parameter. Adjust call to set_target.
11416 (make_elf_sized_object): Find target and ask target to
11417 make an ELF object.
11418 * object.h: (Object::set_target): Remove the version that looks up
11419 a target and sets it.
11420 (Sized_relobj::setup): Take a Target object instead of
11421 an elfcpp:Ehdr as parameter.
11422 * target.cc: Include dynobj.h.
11423 (Target::do_make_elf_object_implementation): New.
2e702c99 11424 (Target::do_make_elf_object): New.
f733487b
DK
11425 * target.h (Target::make_elf_object): New template declaration.
11426 (Target::do_make_elf_object): New method declarations.
11427 (Target::do_make_elf_object_implementation): New template declaration.
11428
cc70f101
ILT
114292009-08-14 Ian Lance Taylor <iant@google.com>
11430
11431 * gold.h (FUNCTION_NAME): Define.
11432 (gold_unreachable): Use FUNCTION_NAME.
11433
ef5e0cb1
ST
114342009-08-12 Sriraman Tallam <tmsriram@google.com>
11435
11436 * icf.cc (Icf::find_identical_sections): Issue a warning when a
11437 symbol in the --keep-unique list is not found.
11438
48c187ce
ST
114392009-08-12 Sriraman Tallam <tmsriram@google.com>
11440
11441 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
11442 been maked as --keep-unique.
11443 (Icf::unfold_section): New function.
11444 * icf.h (Icf::unfold_section): New function.
11445 * options.h (General_options::keep_unique): New option.
11446 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
11447 * testsuite/Makefile.in: Regenerate.
11448 * testsuite/icf_keep_unique_test.sh: New file.
11449 * testsuite/icf_keep_unique_test.cc: New file.
11450
645afe0c
CC
114512009-08-12 Cary Coutant <ccoutant@google.com>
11452
11453 PR 10471
11454 * resolve.cc (Symbol_table::resolve): Check for references from
11455 dynamic objects to hidden and internal symbols.
11456 * testsuite/Makefile.am (hidden_test.sh): New test.
11457 * testsuite/Makefile.in: Regenerate.
11458 * testsuite/hidden_test.sh: New script.
11459 * testsuite/hidden_test_1.c: New test source.
11460 * testsuite/hidden_test_main.c: New test source.
11461
11af873f
DK
114622009-08-11 Doug Kwan <dougkwan@google.com>
11463
11464 * arm.cc: Update comments.
11465 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
11466 segment to locate the .ARM.exidx section if present.
11467
b9f7d72d
DK
114682009-08-09 Doug Kwan <dougkwan@google.com>
11469
11470 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
11471 patch.
11472
ddd3c53c
ST
114732009-08-07 Sriraman Tallam <tmsriram@google.com>
11474 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
11475 compiler warnings.
11476
27721062
ST
114772009-08-06 Sriraman Tallam <tmsriram@google.com>
11478
11479 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
11480 valid tls_segment only for non-debug-section relocations.
11481 * testsuite/Makefile.am: Add gc_tls_test.
11482 * testsuite/Makefile.in: Regenerate.
11483 * testsuite/gc_tls_test.cc: New file.
11484 * testsuite/gc_tls_test.sh: New file.
11485
ef15dade 114862009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 11487
ef15dade
ST
11488 * icf.cc: New file.
11489 * icf.h: New file.
11490 * Makefile.am (CCFILES): Add icf.cc.
11491 (HFILES): Add icf.h
11492 * Makefile.in: Regenerate.
11493 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
11494 * gc.h (gc_process_relocs): Populate lists used by icf to contain
11495 section, symbol and addend information for the relocs.
11496 * gold.cc (queue_middle_tasks): Call identical code folding.
11497 * gold.h: Add defines for multimap.
11498 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
11499 to the call of finalize_local_symbols.
11500 * main.cc (main): Create object of class Icf.
11501 * object.cc (Sized_relobj::do_layout): Allow this function to be
11502 called twice during icf.
11503 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
11504 to sections marked as identical by icf.
11505 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
11506 when available.
11507 (Sized_relobj::do_section_entsize): New function.
11508 * object.h (Object::section_entsize): New function.
11509 (Object::do_section_entsize): New pure virtual function.
11510 (Relobj::finalize_local_symbols): Add new parameter.
11511 (Relobj::do_section_entsize): New function.
11512 * options.h (General_options::icf): New option.
11513 (General_options::icf_iterations): New option.
11514 (General_options::print_icf_sections): New option.
11515 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
11516 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
11517 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
11518 icf.
11519 * symtab.cc (Symbol_table::is_section_folded): New function.
11520 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
11521 to sections marked as identical by icf.
11522 * symtab.h (Symbol_table::set_icf): New function.
11523 (Symbol_table::icf): New function.
11524 (Symbol_table::is_section_folded): New function.
11525 (Symbol_table::icf_): New data member.
11526 * target-reloc.h (relocate_section): Ignore sections folded by icf.
11527 * testsuite/Makefile.am: Add commands to build icf_test.
11528 * testsuite/Makefile.in: Regenerate.
11529 * testsuite/icf_test.sh: New file.
11530 * testsuite/icf_test.cc: New file.
11531
c3b65ac4
CD
115322009-07-24 Chris Demetriou <cgd@google.com>
11533
11534 * layout.cc (is_compressible_debug_section): Fix incorrect
11535 comment about compressed section names.
11536
1caf2c51
ILT
115372009-07-20 Ian Lance Taylor <ian@airs.com>
11538
11539 PR 10419
11540 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
11541
1ef4d87f
ILT
115422009-07-16 Ian Lance Taylor <iant@google.com>
11543
11544 PR 10400
11545 * layout.h: #include <map>.
11546 (class Kept_section): Change from struct to class. Add accessors
11547 and setters. Add section size to Comdat_group mapping. Change
11548 Comdat_group to std::map. Add is_comdat_ field. Add
11549 linkonce_size field in union.
11550 (class Layout): Update declaration of find_or_add_kept_section.
11551 Don't declare find_kept_object.
11552 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
11553 parameter. Add object, shndx, is_comdat, and is_group_name
11554 parameters. Change all callers. Adjust for new Kept_section.
11555 (Layout::find_kept_object): Remove.
11556 * object.cc (Sized_relobj::include_section_group): Update use of
11557 Kept_section. Rename secnum to shndx. Only record
11558 Kept_comdat_section if sections are the same size.
11559 (Sized_relobj::include_linkonce_section): Update use of
11560 Kept_section. Only record Kept_comdat_section if sections are the
11561 same size. Set size of linkonce section.
11562 (Sized_relobj::map_to_kept_section): Update call to
11563 get_kept_comdat_section.
11564 * object.h (class Sized_relobj): Rename fields in
11565 Kept_comdat_section to drop trailing underscores; change object
11566 field to Relobj*. Change Kept_comdat_section_table to store
11567 struct rather than pointer.
11568 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
11569 Add kept_object and kept_shndx parameters. Change all callers.
11570 (Sized_relobj::get_kept_comdat_section): Change return type to
11571 bool. Add kept_object and kept_shndx parameters. Change all
11572 callers.
11573 * plugin.cc (Pluginobj::include_comdat_group): Update call to
11574 Layout::find_or_add_kept_section.
11575
37c3b7b0
ILT
115762009-07-09 Ian Lance Taylor <iant@google.com>
11577
11578 * merge.cc (Object_merge_map::initialize_input_to_output_map):
11579 Reserve space in the hash table.
11580
98fa85cb
ILT
115812009-07-06 Mikolaj Zalewski <mikolajz@google.com>
11582
11583 * fileread.cc (File_read::get_mtime): New method.
11584 * fileread.h (Timespec): New structure.
11585 (File_read::get_mtime): New method.
11586 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
11587 Renamed from timestamp_nsec.
11588 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
11589 Elf_Xword.
e1df38aa 11590 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 11591 timestamp_nsec.
e1df38aa 11592 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
11593 (Incremental_inputs::report_obejct): Save mtime; style fix.
11594 (Incremental_inputs::report_script): Save mtime; style fix.
11595 (Incremental_inputs::finalize_inputs): Style fix.
11596 (Incremental_inputs::finalize): Style fix.
11597 (Incremental_inputs::create_input_section_data): Store inputs
11598 mtime.
11599 * incremental.h (Incremental_inputs::report_script): Add mtime
11600 argument.
11601 (Incremental_inputs::Input_info::Input_info): Intialize only one
11602 union member.
11603 (Incremental_inputs::Input_info::archive): Move to nameless
11604 union.
11605 (Incremental_inputs::Input_info::obejct): Move to nameless union.
11606 (Incremental_inputs::Input_info::script): Move to nameless union.
11607 (Incremental_inputs::mtime): New field.
11608 * script.cc (read_input_script): Pass file mtime to
11609 Incremental_input.
11610 * script.h (Script_info::inputs): Style fix.
11611
c9d70757
ILT
116122009-07-01 Ian Lance Taylor <ian@airs.com>
11613
11614 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
11615 instead of 32.
11616
9c547ec3
ILT
116172009-06-24 Ian Lance Taylor <iant@google.com>
11618
11619 PR 10156
11620 * layout.cc (Layout::choose_output_section): If we find an
11621 existing section, update the flags.
11622 (Layout::create_notes): New function, broken out of
11623 Layout::finalize.
11624 (Layout::finalize): Don't create note sections.
11625 (Layout::create_note): Don't crash if linker script discards
11626 section.
11627 (Layout::create_gold_note): Likewise.
11628 (Layout::create_build_id): Likewise. Don't set
11629 after_input_sections on the section.
11630 (Layout::create_executable_stack_info): Remove target parameter.
11631 Change caller.
11632 * layout.h (class Layout): Declare create_notes. Update
11633 declaration of create_executable_stack_info.
11634 * gold.cc (queue_middle_tasks): Call create_notes.
11635 * output.cc (Output_section::update_flags_for_input_section): Move
11636 here from output.h. If SHF_ALLOC flag is newly set, mark address
11637 invalid.
11638 * output.h (Output_data::mark_address_invalid): New function.
11639 (class Output_section): Only declare, not define,
11640 update_flags_for_input_section. Remove set_flags.
11641
55458500
ILT
116422009-06-24 Ian Lance Taylor <iant@google.com>
11643
11644 * script-sections.cc (Output_section_definition::
11645 set_section_addresses): Rename shadowing local load_address to
11646 laddr.
11647
1307d6cd
ILT
116482009-06-24 Ian Lance Taylor <iant@google.com>
11649
11650 PR 10244
11651 * reloc.cc (relocate_sections): Skip empty relocation sections.
11652
ec3f783e
ILT
116532009-06-23 Ian Lance Taylor <iant@google.com>
11654
11655 PR 10156
11656 * layout.cc (Layout::create_note): Use choose_output_section
11657 rather than make_output_section.
11658
459c9f1c
ILT
116592009-06-23 Ian Lance Taylor <iant@google.com>
11660
11661 PR 10237
11662 * options.cc (General_options::parse_V): Set printed_version_.
11663 (General_options::General_options): Initialize printed_version_.
11664 * options.h (class General_options): Add printed_version_ field.
11665 * gold.cc (queue_initial_tasks): If there are no input files,
11666 don't give a fatal error if we printed the version information.
11667 (queue_middle_tasks): If using -r with a shared object, give a
11668 fatal error rather than an ordinary error.
11669
1518dc8f
ILT
116702009-06-23 Ian Lance Taylor <iant@google.com>
11671
11672 PR 10219
11673 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
11674 (Layout::make_output_section): Set have_stabstr_section_ if we see
11675 a .stab*str section.
11676 (Layout::finalize): Call link_stabs_sections.
11677 (Layout::link_stabs_sections): New file.
11678 * layout.h (class Layout): Add have_stabstr_section_ field.
11679 Declare link_stabs_sections.
11680
3d857b98
DK
116812009-06-23 Doug Kwan <dougkwan@google.com>
11682
11683 * Makefile.am (libgold_a_LIBADD): New.
11684 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 11685 * Makefile.in: Regenerate.
3d857b98
DK
11686 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
11687 * configure: Regenerate.
11688 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
11689 * fileread.cc: Include sys/state.h
11690 * gold.h: Declare memmem and strndup if found missing.
11691 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
11692
0639a6f6
ILT
116932009-06-23 Ian Lance Taylor <iant@google.com>
11694
11695 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
11696 * configure: Rebuild.
11697
8d63875c
ILT
116982009-06-23 Ian Lance Taylor <iant@google.com>
11699
11700 PR 10147
11701 * object.cc (Object::section_contents): Don't try to get a view if
11702 the section has length zero.
11703 (Object::handle_gnu_warning_section): If the section is empty, use
11704 the name of the section as the warning.
11705
f7c8a183
ILT
117062009-06-23 Ian Lance Taylor <iant@google.com>
11707
11708 PR 10133
11709 * stringpool.h (class Stringpool_template): Add optimize_ field.
11710 (Stringpool_template::set_optimize): New function.
11711 * stringpool.cc (Stringpool_template::Stringpool_template):
11712 Initialize optimize_ field.
11713 (Stringpool_template::set_string_offsets): Test local optimize
11714 fild rather than parameter.
11715 * layout.cc (Layout::Layout): Call set_optimize on the section
11716 name stringpool.
11717
e6a307ba
ILT
117182009-06-22 Ian Lance Taylor <iant@google.com>
11719
11720 PR 10030
11721 * yyscript.y: Parse TARGET.
11722 * script.cc (script_set_target): New function.
11723 * script-c.h (script_set_target): Declare.
11724 * options.cc (General_options::string_to_object_format): Rename
11725 from string_to_object_format in anonymous namespace. Change
11726 callers.
11727 * options.h (class General_options): Declare
11728 string_to_object_format.
11729
3ee173de
ILT
117302009-06-22 Ian Lance Taylor <iant@google.com>
11731
11732 * script-sections.cc (Script_sections::create_segments): Don't put
11733 program headers in a PT_LOAD segment if -n or -N.
11734
117352009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
11736
11737 PR 10141
11738 * options.h (class General_options): Add -z lazy and -z now. Sort
11739 -z options into alphabetical order.
11740 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
11741
cd6739a1 117422009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
11743
11744 * layout.cc (Layout::make_output_section): Call
11745 Target::new_output_section.
11746 (Layout::attach_allocated_section_to_segment): Put large section
11747 sections in a separate load segment with the large segment flag
11748 set.
11749 (Layout::segment_precedes): Sort large data segments after other
11750 load segments.
11751 (align_file_offset): New static function.
11752 (Layout::set_segment_offsets): Use align_file_offset.
11753 * output.h (class Output_section): Add is_small_section_ and
11754 is_large_section_ fields.
11755 (Output_section::is_small_section): New function.
11756 (Output_section::set_is_small_section): New function.
11757 (Output_section::is_large_section): New function.
11758 (Output_section::set_is_large_section): New function.
11759 (Output_section::is_large_data_section): New function.
11760 (class Output_segment): Add is_large_data_segment_ field.
11761 (Output_segment::is_large_data_segment): New function.
11762 (Output_segment::set_is_large_data_segment): New function.
11763 * output.cc (Output_section::Output_section): Initialize new
11764 fields.
11765 (Output_segment::Output_segment): Likewise.
11766 (Output_segment::add_output_section): Add assertion that large
11767 data sections always go in large data segments. Force small data
11768 sections to the end of the list of data sections. Force small BSS
11769 sections to the start of the list of BSS sections. For large BSS
11770 sections to the end of the list of BSS sections.
11771 * symtab.h (class Symbol): Declare is_common_shndx.
11772 (Symbol::is_defined): Check Symbol::is_common_shndx.
11773 (Symbol::is_common): Likewise.
11774 (class Symbol_table): Define enum Commons_section_type. Update
11775 declarations. Add small_commons_ and large_commons_ fields.
11776 * symtab.cc (Symbol::is_common_shndx): New function.
11777 (Symbol_table::Symbol_table): Initialize new fields.
11778 (Symbol_table::add_from_object): Put small and large common
11779 symbols in the right list.
11780 (Symbol_table::sized_finalized_symbol): Check
11781 Symbol::is_common_shndx.
11782 (Symbol_table::sized_write_globals): Likewise.
11783 * common.cc (Symbol_table::do_allocate_commons): Allocate new
11784 common symbol lists. Don't call do_allocate_commons_list if the
11785 list is empty.
11786 (Symbol_table::do_allocate_commons_list): Remove is_tls
11787 parameter. Add comons_section_type parameter. Change all
11788 callers. Handle small and large common symbols.
11789 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
11790 Symbol::is_common_shndx.
11791 * resolve.cc (symbol_to_bits): Likewise.
11792 * target.h (Target::small_common_shndx): New function.
11793 (Target::small_common_section_flags): New function.
11794 (Target::large_common_shndx): New function.
11795 (Target::large_common_section_flags): New function.
11796 (Target::new_output_section): New function.
11797 (Target::Target_info): Add small_common_shndx, large_common_shndx,
11798 small_common_section_flags, and large_common_section_flags
11799 fields.
11800 (Target::do_new_output_section): New virtual function.
11801 * arm.cc (Target_arm::arm_info): Initialize new fields.
11802 * i386.cc (Target_i386::i386_info): Likewise.
11803 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
11804 Likewise.
11805 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
11806 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
11807 (Target_x86_64::do_new_output_section): New function.
11808 * configure.ac: Define conditional MCMODEL_MEDIUM.
11809 * testsuite/Makefile.am (check_PROGRAMS): Add large.
11810 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
11811 (large_LDFLAGS): Define.
11812 * testsuite/large.c: New file.
11813 * testsuite/testfile.cc (Target_test::test_target_info):
11814 Initialize new fields.
11815 * configure, testsuite/Makefile.in: Rebuild.
11816
bb04269c
DK
118172009-06-05 Doug Kwan <dougkwan@google.com>
11818
11819 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 11820 * Makefile.in: Regenerate.
bb04269c
DK
11821 * i386.cc (class Target_i386): Define new virtual method to
11822 override do_is_local_label_name in parent.
11823 * object.cc (Sized_relobj::do_count_local_symbols): Discard
11824 local symbols if --discard-locals or -X is given.
11825 * options.h (class General_options): Declare new options
11826 '--discard-locals' and '-X' for discarding locals.
11827 * target.h (class Target): Define new methods is_local_label_name.
11828 Declare new virtual method do_is_local_label_name.
11829 * target.cc: New file.
11830 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
11831 (check_SCRIPTS): Add discard_locals_test.sh.
11832 (check_DATA): Add discard_local_tests.syms.
11833 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
11834 (discard_local_tests.syms, discard_locals_test.o): New make rules.
11835 * testsuite/Makefile.in: Regenerate.
11836 * testsuite/discard_locals_test.c: New file.
11837 * testsuite/discard_locals_test.sh: Same.
11838
805bb01c
DK
118392009-06-05 Doug Kwan <dougkwan@google.com>
11840
11841 * object.cc (Sized_relobj::Sized_relobj): Initialize
11842 discarded_eh_frame_shndx_ to -1U.
11843 (Sized_relobj::do_layout): Record index of a discard .eh_frame
11844 section.
11845 (Sized_relobj::do_count_local_symbols): Skip local symbols in
11846 a discarded .eh_frame section.
11847 (Sized_relobj::do_finalize_local_symbols): Ditto.
11848 * object.h (class Sized_relobj): Declare new member
11849 discarded_eh_frame_shndx_.
11850 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
11851 (local_labels_test.o, local_labels_test): New rules.
11852 * testsuite/Makefile.in: Regenerate.
11853
1dcd334d
DK
118542009-06-04 Doug Kwan <dougkwan@google.com>
11855
11856 * layout.cc (Layout::section_name_mapping): Add mapping for
11857 special ARM sections.
11858
96d49306
DK
118592009-06-03 Doug Kwan <dougkwan@google.com>
11860
11861 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
11862 (utils::has_overflow): Same.
11863
dff16297
ILT
118642009-06-03 Ian Lance Taylor <iant@google.com>
11865
11866 * layout.cc (Layout::section_name_mapping): New array, replacing
11867 Layout::linkonce_mapping.
11868 (Layout::section_name_mapping_count): New variable, replacing
11869 Layout::linkonce_mapping_count.
11870 (Layout::linkonce_output_name): Remove.
11871 (Layout::output_section_name): Rewrite.
11872 * layout.h (class Layout): Rename Linkonce_mapping to
11873 Section_name_mapping, linkonce_mapping to section_name_mapping,
11874 linkonce_mapping_count to section_name_mapping_count. Don't
11875 declare linkonce_output_name.
11876
c121c671
DK
118772009-06-03 Doug Kwan <dougkwan@google.com>
11878
11879 * gold/arm.cc (namespace utils): New.
11880 (Target_arm::reloc_is_non_pic): Define new method.
11881 (class Arm_relocate_functions): New.
11882 (Target_arm::Relocate::relocate): Handle relocation types used by
11883 Android.
11884
07800fab
ILT
118852009-06-03 Ian Lance Taylor <iant@google.com>
11886
11887 * arm.cc (Target_arm::scan::global): Use || instead of |.
11888
c121c671
DK
118892009-06-02 Doug Kwan <dougkwan@google.com>
11890
11891 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
11892 issued_non_pic_error_.
11893 (class Target_arm::Scan): Declare new method check_non_pic.
11894 Define new method symbol_needs_plt_entry.
11895 Declare new data member issued_non_pic_error_.
11896 (class Target_arm::Relocate): Declare new method
11897 should_apply_static_reloc.
11898 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
11899 (Target_arm::Scan::check_non_pic): Define new method.
11900 (Target_arm::Scan::local): Handle a small subset of reloc types used
11901 by Android.
11902 (Target_arm::Scan::local): Same.
11903 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
11904
b19b0c6d
ILT
119052009-05-31 Mikolaj Zalewski <mikolajz@google.com>
11906
11907 * incremental.cc (Incremental_inputs::report_command_line): Filter
11908 out --incremental-* options.
11909
94cdfcff
DK
119102009-05-29 Doug Kwan <dougkwan@google.com>
11911
11912 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
11913 template class.
11914 (class Target_arm): Update comment.
11915 (Target_arm::Target_arm): Initialize new data members GOT_,
11916 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
11917 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
11918 and Target_arm::rel_dyn_section.
11919 Declare new_enum Target_arm::Got_type.
11920 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
11921 and DYNBSS_.
11922 Update commments for member do_dynsym_value.
11923 (Target_arm::got_size, Target_arm::plt_section,
11924 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
11925 new methods inside class defintion.
11926 (Target_arm::got_section): Define new method.
11927 (Target_arm::rel_dyn_section): Same.
11928 (Output_data_plt_arm): New template class.
11929 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
11930 (Output_data_plt_arm:do_adjust_output_section): Define new method.
11931 (Output_data_plt_arm::add_entry): Same.
11932 (Output_data_plt_arm::first_plt_entry): Define new
11933 static data member for PLT instruction template.
11934 (Output_data_plt_arm::plt_entry): Same.
11935 (Output_data_plt_arm::do_write): Define new method.
11936 (Target_arm::make_plt_entry): Same.
11937 (Target_arm::do_finalize_sections): Same.
11938 (Target_arm::do_dynsym_value): Same.
11939
4a657b0d
DK
119402009-05-28 Doug Kwan <dougkwan@google.com>
11941
11942 * Makefile.am (TARGETSOURCES): Add arm.cc.
11943 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
11944 * Makefile.in: Regenerate.
11945 * arm.cc: New file.
11946 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
11947
e7ae8c36
DK
119482009-05-26 Doug Kwan <dougkwan@google.com>
11949
11950 * options.cc (General_options::parse_exclude_libs). Fix a comment.
11951 (General_options::check_excluded_libs): Strip off directories in
11952 archive name before matching like GNU ld does.
11953 * testsuite/Makefile.am (MOSTLYCLEANFILES,
11954 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
11955 (exclude_libs_test_LDFLAGS): Add linker option
11956 -Wl,--exclude-libs,libexclude_libs_test_3
11957 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
11958 an explicit archive without using -l.
11959 (alt/libexclude_libs_test_3.a): New make rule.
11960 * testsuite/Makefile.in: Regenerate.
11961 * testsuite/exclude_libs_test.c : Declare lib3_default().
11962 (main): Call it.
11963 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
11964 * exclude_libs_test_3.c: New file.
11965
f12e7348
NC
119662009-05-26 Nick Clifton <nickc@redhat.com>
11967
11968 * po/id.po: New Indonesian translation.
11969 * po/gold.pot: Updated template file.
11970
4daadc0d
ST
119712009-05-22 Sriraman Tallam <tmsriram@google.com>
11972
e1df38aa 11973 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
11974 gc_comdat_test files. Add -Wl,--gc-sections to build
11975 gc_comdat_test.
11976 * testsuite/Makefile.in: Regenerate.
11977 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
11978
531813ad
ST
119792009-05-21 Sriraman Tallam <tmsriram@google.com>
11980
11981 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
11982 kept comdat section was garbage collected.
11983 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
11984 * testsuite/Makefile.in: Regenerate.
11985 * testsuite/gc_comdat_test.sh: New file.
11986 * testsuite/gc_comdat_test_1.cc: New file.
11987 * testsuite/gc_comdat_test_2.cc: New file.
11988
65514900
CC
119892009-05-19 Doug Kwan <dougkwan@google.com>
11990
11991 * archive.cc (Archive::Archive): Move constructor from archive.h
11992 to here. Initialize no_export_.
11993 (Archive::get_elf_object_for_member): Set no_export flag of object.
11994 * archive.h (Archive::Archive): Move constructor body to
11995 archive.cc.
11996 (Archive::no_export): New method.
11997 (Archive::no_export_): New field.
11998 * object.h (Object::Object): Initialize no_export_ to false.
11999 (Object::no_export, Object::set_no_export): New methods.
12000 (Object::no_export_): New field.
12001 * options.cc (General_options::parse_exclude_libs): New method.
12002 (General_options::check_excluded_libs) Same.
12003 * options.h (exclude_libs): New option.
12004 (General_options::check_excluded_libs): New method declaration.
12005 (General_options::excluded_libs_): New field.
12006 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12007 default or protected visibility if an object has no-export flag set.
12008 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12009 (check_SCRIPTS): Add exclude_libs_test.sh.
12010 (check_DATA): Add exclude_libs_test.syms.
12011 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12012 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12013 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12014 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12015 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12016 libexclude_libs_test_2.a): New rules.
12017 * testsuite/Makefile.in: Regenerate.
12018 * testsuite/exclude_libs_test.c: New file.
12019 * testsuite/exclude_libs_test.sh: Ditto.
12020 * testsuite/exclude_libs_test_1.c: Ditto.
12021 * testsuite/exclude_libs_test_2.c: Ditto.
12022
1b77ea50
ILT
120232009-05-15 Ian Lance Taylor <iant@google.com>
12024
12025 * configure.ac: Check for declarations for cases where libiberty.h
12026 checks HAVE_DECL_xxx.
12027 * configure, config.in: Rebuild.
12028
072fe7ce
ILT
120292009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12030
12031 * gold.h (Incremental_argument_list): Remove (invalid) forward
12032 declaration.
12033 * incremental.cc (Incremental_inputs::report_achive): New method.
12034 (Incremental_inputs::report_object): New method.
12035 (Incremental_inputs::report_script): New method.
12036 (Incremental_inputs::finalize_inputs): New method.
12037 (Incremental_inputs::finalize): Call finalize_inputs().
12038 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12039 Create inputs entries.
12040 * incremental.h (Incremental_input_type): New enum.
12041 (Incremental_inputs::Incremental_input): Initialize new fields.
12042 (Incremental_inputs::report_inputs): New method.
12043 (Incremental_inputs::report_achive): New method.
12044 (Incremental_inputs::report_object): New method.
12045 (Incremental_inputs::report_script): New method.
12046 (Incremental_inputs::finalize_inputs): New method.
12047 (Incremental_inputs::Input_info): New struct.
12048 (Incremental_inputs::Input_info_map): New typedef.
12049 (Incremental_inputs::lock_): New field.
12050 (Incremental_inputs::Inputs_): New field.
12051 (Incremental_inputs::Inputs_map): New field.
12052 * main.cc (main): Call Incremental_input::report_inputs.
12053 * options.h (Input_argument_list): Typedef moved from
12054 Input_arguments.
12055 (Input_file_group::Files): Remove, use ::Input_argument_list.
12056 (Input_file_group::Input_argument_list): Remove, use
12057 ::Input_argument_list.
12058 * plugin.cc (Plugin_manager::add_input_file): Add error in
12059 incremental build.
12060 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12061 functions.
12062 * script.cc (read_input_script): Call
12063 Incremental_input::report_script.
12064 * script.h (Script_info): New class.
12065
b0481b0b
ILT
120662009-04-27 Ian Lance Taylor <iant@google.com>
12067
12068 * x86_64.cc (do_adjust_output_section): Set entsize to
12069 plt_entry_size.
12070
b22a5a41 120712009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12072
12073 * output.cc (Output_file::close): After short writes, continue
12074 writing from the correct offset in the buffer being written.
12075
40fde488
CD
120762009-04-23 Chris Demetriou <cgd@google.com>
12077
12078 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12079 * configure: Regenerate.
12080 * config.in: Regenerate.
12081 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12082 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12083
3ce2c28e
ILT
120842009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12085
12086 * incremental.cc (Incremental_inputs_header_data): Renamed from
12087 Incremental_input_header_data.
12088 (Incremental_inputs_header_data::data_size): New field.
12089 (Incremental_inputs_header_data::put_input_file_count): Renamed
12090 from input_file_count.
12091 (Incremental_inputs_header_data::put_command_line_offset): Renamed
12092 from command_line_offset.
12093 (Incremental_inputs_header_data::put_reserved): Renamed from
12094 put_reserved.
12095 (Incremental_inputs_entry_data): Renamed from
12096 Incremental_input_entry_data.
12097 (Incremental_inputs_entry_data::data_size): New field.
12098 (Incremental_inputs::report_command_line): New method.
12099 (Incremental_inputs::finalize): New method.
12100 (Incremental_inputs::create_incremental_inputs_data): New method.
12101 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
12102 * incremental.h: New file.
12103 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 12104 (Layout::finalize): Create incremental inputs section in
3ce2c28e 12105 incremental builds.
703d02da 12106 (Layout::create_incremental_info_sections): New method.
3ce2c28e 12107 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
12108 (Layout::create_incremental_info_sections): New method.
12109 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
12110 * main.cc (main): Notify Incremental_input of the command line.
12111
e55bde5e
ILT
121122009-04-01 Ian Lance Taylor <iant@google.com>
12113 Mikolaj Zalewski <mikolajz@google.com>
12114
12115 * gold.h (reserve_unordered_map): Define, three versions, one for
12116 each version of Unordered_map.
12117 * layout.cc (Layout::Layout): Remove options parameter. Add
12118 number_of_input_files parameter. Don't initialize options_.
12119 Initialize number_of_input_files_ and resized_signatures_. Move
12120 sections_are_attached_.
12121 (Layout::layout_group): Reserve space for group_signatures_.
12122 (Layout::find_or_add_kept_section): Change name parameter to be a
12123 reference. Resize signatures_ map when it gets large enough.
12124 (Layout::layout_eh_frame): Use parameters->options() instead of
12125 this->options_.
12126 (Layout::make_output_section): Likewise.
12127 (Layout::attach_allocated_section_to_segment): Likewise.
12128 (Layout::finalize, Layout::create_executable_stack): Likewise.
12129 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
12130 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
12131 * layout.h (class Layout): Update declarations. Remove options_
12132 field. Add number_of_input_files_ and resized_signatures_
12133 fields. Move sections_are_attached_ field.
12134 * main.cc (main): Pass number of input files to Layout
12135 constructor. Don't pass options.
12136
154b857c
ILT
121372009-03-30 Ian Lance Taylor <iant@google.com>
12138
12139 * ffsll.c (ffsll): Correct implementation.
12140
2f35ab9b
ILT
121412009-03-27 Ian Lance Taylor <iant@google.com>
12142
fd03461a
ILT
12143 * ffsll.c: New file.
12144 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
12145 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
12146 * ftruncate.c (ftruncate): Declare before definition.
12147 * mremap.c (mremap): Likewise.
12148 * pread.c (pread): Likewise.
12149 * configure, Makefile.in, config.in: Rebuild.
12150
2f35ab9b
ILT
12151 * mremap.c: New file.
12152 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
12153 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
12154 (mremap): Declare if HAVE_MREMAP is not defined.
12155 * configure, Makefile.in, config.in: Rebuild.
12156
33aea2fd
CC
121572009-03-27 Cary Coutant <ccoutant@google.com>
12158
12159 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
12160 position independent.
12161 * sparc.cc (Target_sparc::check_non_pic): Likewise.
12162 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
12163
6d479619
CC
121642009-03-24 Cary Coutant <ccoutant@google.com>
12165
12166 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
12167 an executable.
12168 (needs_dynamic_reloc): Likewise.
12169
afc06bb8
ILT
121702009-03-24 Ian Lance Taylor <iant@google.com>
12171
12172 * yyscript.y (file_cmd): Recognize EXTERN.
12173 (extern_name_list, extern_name_list_body): New nonterminals.
12174 * script.cc (script_add_extern): Define.
12175 * script-c.h (script_add_extern): Declare.
12176
f6060a4d
ILT
121772009-03-24 Rafael Avila de Espindola <espindola@google.com>
12178
12179 * object.cc (is_elf_object): Define.
12180 * object.h (is_elf_object): Declare.
12181 * archive.cc (Archive::get_elf_object_for_member): Call
12182 is_elf_object.
33aea2fd 12183 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 12184
26736d8e
ILT
121852009-03-24 Elliott Hughes <enh@google.com>
12186
12187 * output.cc (Output_file::map_anonymous): Define.
12188 (Output_file::map): Use map_anonymous. If the regular mmap fails,
12189 try an anonymous one. Report the size if the mmap fails.
12190 * output.h (class Output_file): Declare map_anonymous.
12191
22fd9730
ILT
121922009-03-24 Ian Lance Taylor <iant@google.com>
12193
12194 * target-select.cc (instantiate_target): Don't acquire the lock if
12195 the instantiated_target_ field has already been set.
12196
cb010894
ILT
121972009-03-23 Ian Lance Taylor <iant@google.com>
12198
7f055c20
ILT
12199 * gold-threads.h (class Initialize_lock): Define.
12200 * gold-threads.cc (class Initialize_lock_once): Define.
12201 (initialize_lock_control): New static variable.
12202 (initialize_lock_pointer): New static variable.
12203 (initialize_lock_once): New static function.
12204 (Initialize_lock::Initialize_lock): Define.
12205 (Initialize_lock::initialize): Define.
12206 * target-select.h: Include "gold-threads.h".
12207 (class Target_selector): Add lock_ and initialize_lock_ fields.
12208 Don't define instantiate_target, just declare it.
12209 * target-select.cc (Target_selector::Target_selector): Initialize
12210 new fields.
12211 (Target_selector::instantiate_target): Define.
12212 * descriptors.h: Include "gold-threads.h".
12213 (class Descriptors): Add initialize_lock_ field.
12214 * descriptors.cc (Descriptors::Descriptors): Initialize new
12215 field.
12216 (Descriptors::open): Use initialize_lock_ field
12217 * errors.h (class Errors): Add initialize_lock_ field.
12218 * errors.cc (Errors::Errors): Initialize new field.
12219 (Errors::initialize_lock): Use initialize_lock_ field.
12220 * powerpc.cc (class Target_selector_powerpc): Remove
12221 instantiated_target_ field. In do_recognize call
12222 instantiate_target rather than do_instantiate_target. In
12223 do_instantiate_target just allocate a new target.
12224 * sparc.cc (class Target_selector_sparc): Likewise.
12225
36959681
ILT
12226 * freebsd.h: New file.
12227 * i386.cc: Include "freebsd.h".
12228 (Target_i386): Derive from Target_freebsd rather than
12229 Sized_target.
12230 (Target_selector_i386): Derive from Target_selector_freebsd rather
12231 than Target_selector.
12232 * x86_64.cc: Include "freebsd.h".
12233 (Target_x86_64): Derive from Target_freebsd rather than
12234 Sized_target.
12235 (Target_selector_x86_64): Derive from Target_selector_freebsd
12236 rather than Target_selector.
12237 * target.h (class Target): Add adjust_elf_header and
12238 do_adjust_elf_header.
12239 * output.cc (Output_file_header:: do_sized_write): Call target
12240 adjust_elf_header routine.
12241 * configure.tgt: Set targ_osabi.
12242 * configure.ac: Define GOLD_DEFAULT_OSABI.
12243 * parameters.cc (Parameters::default_target): Pass
12244 GOLD_DEFAULT_OSABI to select_target.
12245 * target-select.h (class Target_selector): Make instantiate_target
12246 protected rather than private.
12247 * Makefile.am (HFILES): Add freebsd.h.
12248 * configure, Makefile.in, config.in: Rebuild.
12249
cb010894
ILT
12250 * merge.cc (do_add_input_section): Correct pend value. Change
12251 message about last entry not being null terminated from error to
12252 warning.
12253
0e879927
ILT
122542009-03-20 Mikolaj Zalewski <mikolajz@google.com>
12255
12256 * incremental.cc: New file.
12257 * Makefile.am (CCFILES): Add incremental.cc.
12258 * Makefile.in: Rebuild.
12259
41105937
PP
122602009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
12261
12262 * layout.cc (Layout::output_section_name): Preserve names
12263 of '.note.' sections.
e1df38aa 12264
60439920
ILT
122652009-03-19 Ian Lance Taylor <iant@google.com>
12266
12267 * descriptors.cc (Descriptors::open): Check that the options are
12268 valid before using them.
12269
0d371ad3
ILT
122702009-03-18 Ian Lance Taylor <iant@google.com>
12271
12272 * script-sections.h: Include <list>.
12273 (class Script_sections): Change Sections_elements from std::vector
12274 to std::list. Typedef public Elements_iterator. Add
12275 orphan_section_placement_, data_segment_align_start_, and
12276 saw_data_segment_align_ fields. Remove data_segment_align_index_
12277 field.
12278 * script-sections.cc (class Orphan_section_placement): New class.
12279 (class Sections_element): Add virtual functions is_relro and
12280 orphan_section_init. Remove virtual function place_orphan_here.
12281 (class Output_section_definition): Add is_relro and
12282 orphan_section_init. Remove place_orphan_here.
12283 (class Orphan_output_section): Likewise.
12284 (Script_sections::Script_sections): Update for field changes.
12285 (Script_sections::data_segment_align): Set saw_data_segment_align_
12286 and data_segment_align_start_, not data_segment_align_index.
12287 (Script_sections::data_segment_relro_end): Check
12288 saw_data_segment_align_. Use data_segment_align_start_ rather
12289 than data_segment_align_index_.
12290 (Script_sections::place_orphan): Rewrite to use
12291 Orphan_section_placement.
12292
9201d894
ILT
122932009-03-17 Ian Lance Taylor <iant@google.com>
12294
9c5b8369
ILT
12295 * archive.cc (Archive::add_symbols): Check for a version attached
12296 to the symbol name in the archive map.
12297 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
12298 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
12299 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
12300 (ver_test_11.a): New target.
12301 * testsuite/Makefile.in: Rebuild.
12302
9201d894
ILT
12303 * configure.ac: Check for chsize and posix_fallocate. Replace
12304 ftruncate.
12305 * ftruncate.c: New file, from gnulib.
12306 * output.cc (posix_fallocate): Define dummy version if not
12307 HAVE_POSIX_FALLOCATE.
12308 (Output_file::map): Call posix_fallocate rather than lseek and
12309 write.
12310 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
12311 * configure, Makefile.in, config.in: Rebuild.
12312
ef4ab7a8 123132009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 12314
ef4ab7a8
PP
12315 * layout.h (Layout::create_note): Add section_name parameter.
12316 * layout.cc (Layout::create_note): Likewise.
12317 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 12318
8c500701
ILT
123192009-03-17 Ian Lance Taylor <iant@google.com>
12320
e85b18e1
ILT
12321 * descriptors.cc: Include "options.h".
12322 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
12323 (Descriptors::open): Always use O_CLOEXEC when opening a new
12324 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
12325 then set FD_CLOEXEC.
12326
9efe6174
ILT
12327 * sparc.cc (class Target_sparc): Add has_got_section.
12328 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
12329 make sure we have a GOT section.
12330
12331 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
12332 (Target_sparc::Scan::local): Likewise.
12333 (Target_sparc::Scan::global): Likewise.
12334 (Target_sparc::Relocate::relocate): Likewise.
12335 (Target_sparc::Relocate::relocate_tls): Likewise.
12336
8c500701
ILT
12337 * symtab.cc (Symbol_table::define_default_version): New function,
12338 broken out of add_from_object.
12339 (Symbol_table::add_from_object): Call define_default_version.
12340 (Symbol_table::define_special_symbol): Add resolve_oldsym
12341 parameter. Change all callers. If the version for a symbol comes
12342 from a version script, resolve it with the symbol with the same
12343 name with no version. Also add the symbol without a version if
12344 appropriate.
12345 (do_define_in_output_data): If resolving with oldsym, don't delete
12346 sym.
12347 (do_define_in_output_segment): Likewise.
12348 (do_define_as_constant): Likewise.
12349 * symtab.h (class Symbol_table): Update declarations.
12350
f1ed28fb
ILT
123512009-03-13 Ian Lance Taylor <iant@google.com>
12352
15f8229b
ILT
12353 * readsyms.cc (Read_symbols::incompatible_warning): New function.
12354 (Read_symbols::requeue): New function.
12355 (Read_symbols::do_read_symbols): If make_elf_object fails because
12356 the target type is not configured, and the file was searched for,
12357 issue a warning and retry with the next directory.
12358 (Add_symbols::run): If the file has an incompatible format, and
12359 it was searched for, requeue the Read_symbols task. On error,
12360 release the object.
12361 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
12362 dirindex parameter to constructor. Change all callers. Declare
12363 incompatible_warning and requeue.
12364 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
12365 input_argument_ and input_group_ fields. Add them to
12366 constructor. Change all callers.
12367 (class Read_script): Add dirindex_ field. Add it to constructor.
12368 Change all callers.
12369 * archive.cc (Archive::setup): Remove input_objects parameter.
12370 Change all callers.
12371 (Archive::get_file_and_offset): Likewise.
12372 (Archive::read_all_symbols): Likewise.
12373 (Archive::read_symbols): Likewise.
12374 (Archive::get_elf_object_for_member): Remove input_objects
12375 parameter. Add punconfigured parameter. Change all callers.
12376 (Archive::add_symbols): Change return type to bool. Check return
12377 value of include_member.
12378 (Archive::include_all_members): Likewise.
12379 (Archive::include_member): Change return type to bool. Return
12380 false if first included object has incompatible target. Set
12381 included_member_ field.
12382 (Add_archive_symbols::run): If add_symbols returns false, requeue
12383 Read_symbols task.
12384 * archive.h (class Archive): Add included_member_ field.
12385 Initialize it in constructor. Add input_file and searched_for
12386 methods. Update declarations.
12387 (class Add_archive_symbols): Add dirpath_, dirindex_, and
12388 input_argument_ fields. Add them to constructor. Change all
12389 callers.
12390 * script.cc: Include "target-select.h".
12391 (class Parser_closure): Add skip_on_incompatible_target_ and
12392 found_incompatible_target_ fields. Add
12393 skip_on_incompatible_target parameter to constructor. Change all
12394 callers. Add methods skip_on_incompatible_target,
12395 clear_skip_on_incompatible_target, found_incompatible_target, and
12396 set_found_incompatible_target.
12397 (read_input_script): Add dirindex parameter. Change all callers.
12398 If parser finds an incompatible target, requeue Read_symbols
12399 task.
12400 (script_set_symbol): Clear skip_on_incompatible_target in
12401 closure.
12402 (script_add_assertion, script_parse_option): Likewise.
12403 (script_start_sections, script_add_phdr): Likewise.
12404 (script_check_output_format): New function.
12405 * script.h (read_input_script): Update declaration.
12406 * script-c.h (script_check_output_format): Declare.
12407 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
12408 (ignore_cmd): Remove OUTPUT_FORMAT.
12409 * fileread.cc (Input_file::Input_file): Add explicit this.
12410 (Input_file::will_search_for): New function.
12411 (Input_file::open): Add pindex parameter. Change all callers.
12412 * fileread.h (class Input_file): Add input_file_argument method.
12413 Declare will_search_for. Update declarations.
12414 * object.cc (make_elf_object): Add punconfigured parameter.
12415 Change all callers.
12416 * object.h (class Object): Make input_file public. Add
12417 searched_for method.
12418 (make_elf_object): Update declaration.
12419 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
12420 restart search.
12421 * dirsearch.h (class Dirsearch): Update declaration.
12422 * options.h (class General_options): Add --warn-search-mismatch.
12423 * parameters.cc (Parameters::is_compatible_target): New function.
12424 * parameters.h (class Parameters): Declare is_compatible_target.
12425 * workqueue.cc (Workqueue::add_blocker): New function.
12426 * workqueue.h (class Workqueue): Declare add_blocker.
12427
f1ed28fb
ILT
12428 * fileread.cc (Input_file::open): Remove options parameter.
12429 Change all callers.
12430 (Input_file::open_binary): Likewise.
12431 * script.cc (read_input_script): Likewise.
12432 * readsyms.h (class Read_symbols): Remove options_ field. Remove
12433 options parameter from constructor. Change all callers.
12434 (class Read_script): Likewise.
12435 * fileread.h (class Input_file): Update declarations.
12436 * script.h (read_input_script): Update declaration.
12437
34dd024a
NC
124382009-03-10 Nick Clifton <nickc@redhat.com>
12439
12440 * po/es.po: New Spanish translation.
12441
6d71b17c
CC
124422009-03-06 Cary Coutant <ccoutant@google.com>
12443
12444 * options.cc (parse_short_option): Keep dash_z from registering itself.
12445
031cdbed
ILT
124462009-03-03 Ian Lance Taylor <iant@google.com>
12447
12448 PR 9918
12449 * target-reloc.h (relocate_section): Pass output_section to
12450 relocate.
12451 * i386.cc (Target_i386::should_apply_static_reloc): Add
12452 output_section parameter. Change all callers.
12453 (Target_i386::Relocate::relocate): Add output_section parameter.
12454 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12455 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
12456 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
12457 * testsuite/two_file_shared.sh: New script.
12458 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
12459 (check_DATA): Add two_file_shared.dbg.
12460 (two_file_shared.dbg): New target.
12461 * testsuite/Makefile.in: Rebuild.
12462
15d5fa16
ILT
124632009-03-01 Ian Lance Taylor <iant@google.com>
12464
12465 * configure.ac: Check for byteswap.h.
12466 * configure: Rebuild.
12467 * config.in: Rebuild.
12468
8a4c0b0d
ILT
124692009-03-01 Mikolaj Zalewski <mikolajz@google.com>
12470
12471 * layout.cc (Layout::find_or_add_kept_section): New function.
12472 (Layout::add_comdat): Removed.
12473 * layout.h (struct Kept_section): Move out of class Layout.
12474 Remove trailing underscores from field names. Add group_sections
12475 field. Rename group_ field to is_group. Change all uses.
12476 (class Layout): Declare find_or_add_kept_section, not add_comdat.
12477 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
12478 comdat_groups_ field.
12479 (Sized_relobj::include_section_group): Use
12480 find_or_add_kept_section and Kept_section::group_sections.
12481 (Sized_relobj::include_linkonce_section): Likewise.
12482 * object.cc (class Sized_relobj): Don't define Comdat_group or
12483 Comdat_group_table. Remove find_comdat_group and
12484 add_comdat_group. Remove comdat_groups_ field.
12485 * plugin.cc (include_comdat_group): Use
12486 Layout::find_or_add_kept_section.
12487
b4ecf66b
ILT
124882009-02-28 Ian Lance Taylor <iant@google.com>
12489
14359ca0
ILT
12490 * README: --gc-sections and map files are now supported. Document
12491 some build requirements.
12492
b4ecf66b
ILT
12493 PR 6992
12494 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
12495 relocatable link set the value of the section symbol to zero.
12496 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
12497 relocatable link don't include the section address in the local
12498 symbol value.
12499
0602e05a
ILT
125002009-02-27 Ian Lance Taylor <iant@google.com>
12501
fd9d194f
ILT
12502 PR 6811
12503 * options.h (class Search_directory): Add is_system_directory.
12504 (class General_options): Declare is_in_system_directory.
12505 * options.cc (get_relative_sysroot): Make static.
12506 (get_default_sysroot): Make static.
12507 (General_optoins::is_in_system_directory): New function.
12508 * fileread.cc (Input_file::is_in_system_directory): New function.
12509 * fileread.h (class Input_file): Declare is_in_system_directory.
12510 * object.h (class Object): Add is_in_system_directory.
12511 (class Input_objects): Remove system_library_directory_ field.
12512 * object.cc (Input_objects::add_object): Don't set
12513 system_library_directory_.
12514 (input_objects::found_in_system_library_directory): Remove.
12515 * symtab.cc (Symbol_table::write_globals): Remove input_objects
12516 parameter. Change all callers.
12517 (Symbol_table::sized_write_globals): Likewise.
12518 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
12519 Call Object::is_in_system_directory.
12520 * symtab.h (class Symbol_table): Update declarations.
12521
61edd21f
ILT
12522 PR 5990
12523 * descriptors.h (Open_descriptor): Add is_on_stack field.
12524 * descriptors.cc (Descriptors::open): If the descriptor is on the
12525 top of the stack, remove it. Initialize is_on_stack field.
12526 (Descriptors::release): Only add pod to stack if it is not on the
12527 stack already.
12528 (Descriptors::close_some_descriptor): Clear stack_next and
12529 is_on_stack fields.
12530
e29e076a
ILT
12531 PR 7091
12532 * output.cc (Output_section::find_starting_output_address): Rename
12533 from starting_output_address; add PADDR parameter; change return
12534 type.
12535 * output.h (class Output_section): Declare
12536 find_starting_output_address instead of starting_output_address.
12537 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
12538 section symbol for which we can't find a merge section.
12539
0602e05a
ILT
12540 PR 9836
12541 * symtab.cc (Symbol_table::add_from_object): If the visibility is
12542 hidden or internal, force the symbol to be local.
12543 * resolve.cc (Symbol::override_visibility): Define.
12544 (Symbol::override_base): Use override_visibility.
12545 (Symbol_table::resolve): Likewise.
12546 (Symbol::override_base_with_special): Likewise.
12547 (Symbol_table::override_with_special): If the visibility is hidden
12548 or internal, force the symbol to be local.
12549 * symtab.h (class Symbol): Add set_visibility and
12550 override_visibility.
12551 * testsuite/ver_test_1.sh: New file.
12552 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
12553 (check_DATA): Add ver_test_1.syms.
12554 (ver_test_1.syms): New target.
12555 * testsuite/Makefile.in: Rebuild.
12556
401a9a73
CC
125572009-02-25 Cary Coutant <ccoutant@google.com>
12558
12559 * layout.cc (Layout::choose_output_section): Don't rename sections
12560 when using a linker script that has a SECTIONS clause.
12561 * Makefile.in: Regenerate.
12562
12563 * testsuite/Makefile.am (script_test_5.sh): New test case.
12564 * testsuite/Makefile.in: Regenerate.
12565 * testsuite/script_test_5.cc: New file.
12566 * testsuite/script_test_5.sh: New file.
12567 * testsuite/script_test_5.t: New file.
12568
f488e4b0
CC
125692009-02-13 Rafael Avila de Espindola <espindola@google.com>
12570
12571 * archive.cc (Archive::include_member): Update calls to add_symbols.
12572 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
12573 the Layout argument.
12574 * dynobj.h (do_add_symbols): Add the Layout argument.
12575 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
12576 Layout argument.
12577 * object.h (Object::add_symbols): Add the Layout argument.
12578 (Object::do_add_symbols): Add the Layout argument.
12579 (Sized_relobj::do_add_symbols): Add the Layout argument.
12580 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
12581 Unify the two versions.
12582 (Add_plugin_symbols): Remove.
12583 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
12584 (Sized_pluginobj::do_add_symbols): Unify the two versions.
12585 (Add_plugin_symbols): Remove.
12586 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
12587 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
12588 (Add_symbols::run): Make it work with Pulginobj.
12589
89dd1680
ILT
125902009-02-06 Ian Lance Taylor <iant@google.com>
12591
12592 * object.cc (Sized_relobj::do_layout): Make info message start
12593 with lower case letter.
12594
266d0a74
ILT
125952009-02-06 Mikolaj Zalewski <mikolajz@google.com>
12596
602b464e
ILT
12597 * binary.cc: Fix file comment.
12598
266d0a74
ILT
12599 * options.h (enum Incremental_disposition): Define.
12600 (class General_options): Add new options: --incremental,
12601 --incremental_changed, --incremental_unchanged,
12602 --incremental_unknown. Add incremental_disposition_ and
12603 implicit_incremental_ fields.
12604 (General_options::incremental_disposition): New function.
12605 (class Position_dependent_options): Add incremental_disposition
12606 option.
12607 (Position_dependent_options::copy_from_options): Set incremental
12608 dispositions.
12609 * options.cc (General_options::parse_incremental_changed): New
12610 function.
2e702c99
RM
12611 (General_options::parse_incremental_unchanged): New function.
12612 (General_options::parse_incremental_unknown): New function.
12613 (General_options::General_options): Initialize new fields
266d0a74 12614 incremental_disposition_ and implicit_incremental_.
2e702c99 12615 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
12616 without --incremental.
12617
f073bbf7
CD
126182009-02-06 Chris Demetriou <cgd@google.com>
12619
12620 * gold.h (gold_undefined_symbol): Change to take only a Symbol
12621 pointer and to report location as the file name associated with
12622 the symbol.
12623 (gold_undefined_symbol_at_location): New function to replace the
12624 old gold_undefined_symbol functionality.
12625 * target-reloc.h (relocate_section): Update to use
12626 gold_undefined_symbol_at_location.
12627 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12628 Call gold_undefined_symbol function rather than gold_error.
12629 * errors.h (Errors::undefined_symbol): Take location as a
12630 string, rather than calculating it from a relocation.
12631 * errors.cc (Errors::fatal): Print "fatal error:" before the
12632 formatted message.
12633 (Errors::error, Errors::error_at_location): Print "error: "
12634 before the formatted message.
12635 (Errors::undefined_symbol): Take location as a string, rather
12636 than calculating it from a relocation.
12637 (gold_undefined_symbol_at_location): New function akin to
12638 old gold_undefined_symbol, calculates location from relocation.
12639 (gold_undefined_symbol): Change to take only a Symbol pointer
12640 and to report location as the file name associated with the symbol.
12641 * testsuite/debug_msg.sh: Update for changed error messages.
12642 * testsuite/undef_symbol.sh: Likewise.
12643
8e94a90c
ILT
126442009-02-04 Duncan Sands <baldrick@free.fr>
12645
12646 PR 9812
12647 * reduced_debug_output.h
12648 (Output_reduced_debug_abbrev_section::failed): Use format for
12649 gold_warning.
12650 (Output_reduced_debug_info_section::faild): Likewise.
12651
88a0e15b
ILT
126522009-01-31 Mikolaj Zalewski <mikolajz@google.com>
12653
12654 * script.cc (Lazy_demangler): New class.
2e702c99 12655 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
12656 symbol only once.
12657
5efc7cd2
CC
126582009-01-29 Cary Coutant <ccoutant@google.com>
12659
12660 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
12661 to __tls_get_addr.
12662 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
12663
e0ebcf42
ILT
126642009-01-28 Ian Lance Taylor <iant@google.com>
12665
5efc7cd2 12666 * version.cc (version_string): Bump to 1.9.
75fe7426 12667
e0ebcf42
ILT
12668 * gold.h: Include <cstring> and <stdint.h>.
12669 * version.cc: Include <cstdio>.
12670 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
12671 warning.
12672 * reduced_debug_output.cc (insert_into_vector): Rename from
12673 Insert_into_vector; change all callers. Use Swap_unaligned to
12674 avoid aliasing issue; remove union since it is unnecessary.
12675
8e2813be 126762009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
12677
12678 * Makefile.am (CCFILES): Add gc.cc.
12679 (HFILES): Add gc.h.
12680 * Makefile.in: Regenerate.
12681 * gold.cc (Gc_runner): New class.
12682 (queue_initial_tasks): Call garbage collection related tasks
12683 when corresponding options are invoked.
12684 (queue_middle_gc_tasks): New function.
12685 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
12686 processed early before laying out sections during garbage collection.
12687 * gold.h (queue_middle_gc_tasks): New function.
12688 (is_prefix_of): Move from "layout.cc".
12689 * i386.cc (Target_i386::gc_process_relocs): New function.
12690 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
12691 * main.cc (main): Create object of class "Garbage_collection".
12692 * object.cc (Relobj::copy_symbols_data): New function.
12693 (Relobj::is_section_name_included): New function.
e1df38aa
NC
12694 (Sized_relobj::do_layout): Allow this function to be called twice
12695 during garbage collection and defer layout of section during the
6d03d481
ST
12696 first call.
12697 * object.h (Relobj::get_symbols_data): New function.
12698 (Relobj::is_section_name_included): New function.
12699 (Relobj::copy_symbols_data): New function.
12700 (Relobj::set_symbols_data): New function.
12701 (Relobj::get_relocs_data): New function.
12702 (Relobj::set_relocs_data): New function.
12703 (Relobj::is_output_section_offset_invalid): New pure virtual function.
12704 (Relobj::gc_process_relocs): New function.
12705 (Relobj::do_gc_process_relocs): New pure virtual function.
12706 (Relobj::sd_): New data member.
12707 (Sized_relobj::is_output_section_offset_invalid): New function.
12708 (Sized_relobj::do_gc_process_relocs): New function.
12709 * options.h (General_options::gc_sections): Modify to not be a no-op.
12710 (General_options::print_gc_sections): New option.
12711 * plugin.cc (Plugin_finish::run): Remove function call to
12712 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
12713 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
12714 * reloc.cc (Read_relocs::run): Add task to process relocs and
12715 determine unreferenced sections when doing garbage collection.
12716 (Gc_process_relocs): New class.
12717 (Sized_relobj::do_gc_process_relocs): New function.
12718 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
12719 sections that are garbage collected.
12720 * reloc.h (Gc_process_relocs): New class.
12721 * sparc.cc (Target_sparc::gc_process_relocs): New function.
12722 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
12723 symbols whose corresponding sections are garbage collected.
12724 (Symbol_table::Symbol_table): Add new parameter for the garbage
12725 collection object.
12726 (Symbol_table::gc_mark_undef_symbols): New function.
12727 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12728 (Symbol_table::gc_mark_dyn_syms): New function.
12729 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
12730 as garbage.
12731 (Symbol_table::add_from_object): Likewise.
12732 (Symbol_table::add_from_relobj): When building shared objects, do not
12733 treat externally visible symbols as garbage.
12734 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
12735 table information for static and relocatable links.
12736 * symtab.h (Symbol_table::set_gc): New function.
12737 (Symbol_table::gc): New function.
12738 (Symbol_table::gc_mark_undef_symbols): New function.
12739 (Symbol_table::gc_mark_symbol_for_shlib): New function.
12740 (Symbol_table::gc_mark_dyn_syms): New function.
12741 (Symbol_table::gc_): New data member.
e1df38aa 12742 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
12743 function.
12744 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
12745 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
12746
3b293544
CF
127472009-01-20 Chris Faylor <me.sourceware@sourceware.org>
12748
12749 * options.h (General_options::gc_sections): Define as a no-op for now.
12750 (General_options::no_keep_memory): Ditto.
12751 (General_options::Bshareable): Define.
12752 * options.cc (General_options::finalize): Honor -Bshareable.
12753
83d22aa8
AS
127542009-01-20 Andreas Schwab <schwab@suse.de>
12755
12756 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
12757 read the value in the contents, since we don't use it. Use the
12758 template endianness when writing.
12759 (Relocate::relocate): Use it for R_PPC_REL16_HA.
12760
cd536b21
AS
127612009-01-19 Andreas Schwab <schwab@suse.de>
12762
12763 * configure.tgt (powerpc64-*): Fix targ_obj.
12764
99e9a495
ILT
127652009-01-15 Ian Lance Taylor <iant@google.com>
12766
12767 * object.cc (Sized_relobj::write_local_symbols): Don't write out
12768 local symbols when stripping all symbols.
12769
bbbfea06
CC
127702009-01-14 Cary Coutant <ccoutant@google.com>
12771
99e9a495 12772 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 12773
0f7c0701
CC
127742009-01-14 Cary Coutant <ccoutant@google.com>
12775
12776 * archive.cc (Archive::get_elf_object_for_member): Remove call
12777 to File_read::claim_for_plugin.
12778 * descriptors.cc (Descriptors::open): Remove reference to
12779 is_claimed.
12780 (Descriptors::claim_for_plugin): Remove.
12781 * descriptors.h (Descriptors::claim_for_plugin): Remove.
12782 (Descriptors::is_claimed): Remove.
12783 (claim_descriptor_for_plugin): Remove.
12784 * fileread.cc (File_read::claim_for_plugin): Remove.
12785 * fileread.h (File_read::claim_for_plugin): Remove.
12786 (File_read::descriptor): Reopen descriptor if necessary.
12787 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
12788 (Plugin_manager::all_symbols_read): Add task parameter. Change
12789 all callers.
12790 (Plugin_manager::get_input_file): New function.
12791 (Plugin_manager::release_input_file): New function.
12792 (Pluginobj::Pluginobj): Add filesize parameter and initialize
12793 corresponding data member.
12794 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
12795 and pass to base constructor. Change all callers.
12796 (get_input_file, release_input_file): New functions.
12797 (make_sized_plugin_object): Add filesize parameter. Change all callers.
12798 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
12799 (Plugin_manager::all_symbols_read): Add task parameter.
12800 (Plugin_manager::get_input_file): New function.
12801 (Plugin_manager::release_input_file): New function.
12802 (Plugin_manager::task_): New data member.
12803 (Pluginobj::Pluginobj): Add filesize parameter.
12804 (Pluginobj::filename): New function.
12805 (Pluginobj::descriptor): New function.
12806 (Pluginobj::filesize): New function.
12807 (Pluginobj::filesize_): New data member.
12808 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
12809 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
12810 File_read::claim_for_plugin; use Object::unlock to unlock the file.
12811
12812 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
12813 with archive libraries.
12814 * testsuite/Makefile.in: Regenerate.
12815 * testsuite/plugin_test.c (struct sym_info): New type.
12816 (get_input_file, release_input_file): New static variables.
12817 (onload): Capture new transfer vector entries.
12818 (claim_file_hook): Stop reading at end of file according to filesize.
12819 Factor out parsing of readelf output into separate function.
12820 (all_symbols_read_hook): Exercise get_input_file and release_input_file
12821 APIs and get the source file name from the symbol table. Convert
12822 source file name to corresponding object file name. Print info
12823 message when adding new input files.
12824 (parse_readelf_line): New function.
12825 * testsuite/plugin_test_1.sh: Add checks for new info messages.
12826 * testsuite/plugin_test_2.sh: Likewise.
12827 * testsuite/plugin_test_3.sh: Likewise.
12828 * testsuite/plugin_test_4.sh: New test case.
12829
62a6d109
ILT
128302009-01-07 Ian Lance Taylor <iant@google.com>
12831
12832 * version.cc (version_string): Bump to 1.8.
12833
483620e8
CC
128342008-12-23 Cary Coutant <ccoutant@google.com>
12835
12836 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
12837 * plugin.cc (Plugin_manager::finish): Rename as
12838 layout_deferred_objects. Move cleanup to separate function.
12839 (Plugin_manager::cleanup): New function.
12840 (Plugin_finish::run): Call layout_deferred_objects and cleanup
12841 separately.
12842 * plugin.h (Plugin_manager::finish): Rename as
12843 layout_deferred_objects.
12844 (Plugin_manager::cleanup): New function.
12845 (Plugin_manager::cleanup_done): New field.
12846
d66a9eb3
CC
128472008-12-23 Cary Coutant <ccoutant@google.com>
12848
12849 * plugin.cc (is_visible_from_outside): New function.
12850 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
12851 so we don't return "IR only" status for exported symbols or -r links.
12852
12853 * testsuite/Makefile.am (plugin_test_3): New test case.
12854 * testsuite/Makefile.in: Regenerate.
12855 * testsuite/plugin_test_3.sh: New file.
12856
5995b570
CC
128572008-12-22 Cary Coutant <ccoutant@google.com>
12858
12859 * object.cc (Sized_relobj::layout_section): New function.
12860 (Sized_relobj::do_layout): Defer layout of input sections until after
12861 plugin has provided replacement files.
12862 (Sized_relobj::do_layout_deferred_sections): New function.
12863 * object.h (Relobj::set_section_offset): Remove virtual keyword.
12864 (Relobj::layout_deferred_sections): New function.
12865 (Relobj::do_layout_deferred_sections): New function.
12866 (Sized_relobj::do_layout_deferred_sections): New function.
12867 (Sized_relobj::layout_section): New function.
12868 (Sized_relobj::Deferred_layout): New structure.
12869 (Sized_relobj::deferred_layout_): New field.
12870 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
12871 Change all callers. Layout deferred sections.
12872 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
12873 references.
12874 (Plugin_hook::run): Move code from do_plugin_hook inline.
12875 (Plugin_hook::do_plugin_hook): Remove.
12876 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
12877 (Plugin_manager::finish): Renamed, was cleanup.
12878 (Plugin_manager::should_defer_layout): New function.
12879 (Plugin_manager::add_deferred_layout_object): New function.
12880 (Plugin_manager::Deferred_layout_list): New type.
12881 (Plugin_manager::deferred_layout_objects_): New field.
12882 (Plugin_hook::do_plugin_hook): Remove.
12883
ee769c88
ILT
128842008-12-17 Ian Lance Taylor <iant@google.com>
12885
12886 * options.h (class General_options): Add --no case for
12887 --export-dynamic.
12888
abc8dcba
CC
128892008-12-16 Cary Coutant <ccoutant@google.com>
12890
12891 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
12892 vector.
12893 (Plugin_manager::claim_file): Create plugin object even if
12894 plugin did not call the add_symbols callback.
12895 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
12896 asking for more symbols than were added.
12897 * testsuite/Makefile.am (plugin_test_1): Add test case with
12898 no global symbols.
12899 (empty.syms): New target.
12900 * testsuite/Makefile.in: Regenerate.
12901 * testsuite/plugin_test.c (claim_file_hook): Add new debug
12902 message. Don't call add_symbols if no globals.
12903 (all_symbols_read_hook): Don't provide replacement for empty
12904 claimed file.
12905
b0074644
ILT
129062008-12-12 Ian Lance Taylor <iant@google.com>
12907
68943102
ILT
12908 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
12909 r_type == 0 for a local symbol with r_sym == 0.
12910 (scan_relocatable_relocs): Pass r_sym to
12911 local_non_section_strategy.
12912 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
12913 r_sym parameter.
12914
b0074644
ILT
12915 * configure.ac: Update test for TLS descriptors: they are
12916 supported as of glibc 2.9.
12917 * configure: Rebuild.
12918
c2508178
ILT
129192008-12-11 Ian Lance Taylor <iant@google.com>
12920
12921 PR 7091
12922 * target-reloc.h (Default_scan_relocatable_relocs): For each
12923 function, map r_type == 0 to RELOC_DISCARD.
12924
2756a258
CC
129252008-12-10 Cary Coutant <ccoutant@google.com>
12926
12927 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
12928 object to override a kept COMDAT group from a plugin object.
12929
bb6f53d3
ILT
129302008-12-09 Ian Lance Taylor <iant@google.com>
12931
fbc558e1
ILT
12932 PR 7088
12933 * yyscript.y (file_cmd): Handle INPUT.
12934
bb6f53d3
ILT
12935 * testsuite/initpri1.c: Change all declarations to be full
12936 prototypes by adding void, to avoid compiler warnings.
12937
4674ecfc
CC
129382008-12-05 Rafael Avila de Espindola <espindola@google.com>
12939
12940 * options.cc (General_options::parse_plugin_opt): New.
12941 (General_options::add_plugin): The argument now is just the filename.
12942 (General_options::add_plugin_option): New.
12943 * options.h (plugin_opt): New.
12944 (add_plugin): Change argument name.
12945 (add_plugin_option): New.
12946 * plugin.cc (Plugin::load): Don't parse the plugin option.
12947 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
12948 (Plugin::add_option): New.
12949 (Plugin::args_): Change type.
12950 (Plugin::filename_): New.
12951 (Plugin_manager::add_plugin_option): New.
12952 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
12953 * testsuite/Makefile.in: Regenerate.
12954
fd06b4aa
CC
129552008-12-05 Cary Coutant <ccoutant@google.com>
12956
12957 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
12958 Handle --strip-lto-sections option.
12959 * options.h (strip_lto_sections): New option.
12960
6c52134c
CC
129612008-12-01 Cary Coutant <ccoutant@google.com>
12962
12963 * plugin.cc (ld_plugin_message): Change format parameter to const.
12964 Fix mismatch between new[] and delete.
12965
a45248e0
CC
129662008-11-14 Cary Coutant <ccoutant@google.com>
12967
12968 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
12969 instead of -1U.
12970
c82fbeee
CS
129712008-11-05 Craig Silverstein <csilvers@google.com>
12972
12973 * options.cc (General_options::parse_dynamic_list): New function.
12974 * options.h (General_options): New flags dynamic_list,
12975 dynamic_list_data, dynamic_list_cpp_new, and
12976 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
12977 (General_options::in_dynamic_list): New function.
12978 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
12979 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
12980 (Lex::can_continue_name): Likewise.
12981 (yylex): Likewise.
12982 (read_script_file): New parameter script_options.
12983 (read_dynamic_list): New function.
12984 (Script_options::define_dynamic_list): New function.
12985 (dynamic_list_keyword_parsecodes): New variable.
12986 (dynamic_list_keywords): New variable.
12987 * script.h (Script_options::define_dynamic_list): New function
12988 prototype.
12989 (read_dynamic_list): New function prototype.
12990 * symtab.cc (strprefix): New macro.
12991 (Symbol::should_add_dynsym_entry): Support dynamic_list,
12992 dynamic_list_data, dynamic_list_cpp_new, and
12993 dynamic_list_cpp_typeinfo.
12994 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
12995 (dynamic_list_expr): New rule.
12996 (dynamic_list_nodes): Likewise.
12997 (dynamic_list_node): Likewise.
12998 * testsuite/Makefile.am (dynamic_list): New test.
12999 * testsuite/Makefile.in: Regenerated.
13000 * testsuite/dynamic_list.t: New file.
13001 * testsuite/dynamic_list.sh: New file.
13002
e0bb29a5
CS
130032008-11-05 Craig Silverstein <csilvers@google.com>
13004
13005 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13006 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13007 (t11_last): Likewise.
13008 * testsuite/ver_test_6.c (main): Likewise.
13009
4e1e25e0
CC
130102008-10-07 Cary Coutant <ccoutant@google.com>
13011
13012 * options.c (General_options::finalize): Add check for -static and
13013 -shared.
13014 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13015 is not empty.
13016
92f03fcb
CC
130172008-10-02 Cary Coutant <ccoutant@google.com>
13018
13019 * plugin.cc (make_sized_plugin_object): Fix conditional
13020 compilation to work when not all targets are enabled.
13021
fbd8a257
CC
130222008-09-29 Cary Coutant <ccoutant@google.com>
13023
13024 * archive.cc (Archive::get_file_and_offset): Use filename instead
13025 of name to get library path.
13026 (Archive::include_member): Unlock external member of a thin archive.
13027
13028 * testsuite/Makefile.am (TEST_AR): New variable.
13029 (thin_archive_test_1): New test.
13030 (thin_archive_test_2): New test.
81636b3f
CC
13031 * testsuite/Makefile.in: Regenerate.
13032 * testsuite/thin_archive_main.cc: New file.
13033 * testsuite/thin_archive_test_1.cc: New file.
13034 * testsuite/thin_archive_test_2.cc: New file.
13035 * testsuite/thin_archive_test_3.cc: New file.
13036 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13037
eff45813
CC
130382008-09-29 Cary Coutant <ccoutant@google.com>
13039
13040 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13041 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13042 instead of -1U.
13043 (Sized_relobj::do_finalize_local_symbols): Likewise.
13044 (Sized_relobj::map_to_kept_section): Likewise.
13045 * object.h (Sized_relobj::invalid_address): New constant.
13046 (Sized_relobj::do_output_section_offset): Check for invalid_address
13047 and return -1ULL.
13048 * output.cc (Output_reloc::local_section_offset): Use constant
13049 invalid_address instead of -1U.
13050 (Output_reloc::get_address): Likewise.
13051 (Output_section::output_address): Change -1U to -1ULL.
13052 * output.h (Output_reloc::invalid_address): New constant.
13053 * reloc.cc (Sized_relobj::write_sections): Use constant
13054 invalid_address instead of -1U.
13055 (Sized_relobj::relocate_sections): Likewise.
13056 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13057 values for merge sections.
13058 * target-reloc.h (relocate_for_relocatable): Use constant
13059 invalid_address instead of -1U.
13060
89fc3421
CC
130612008-09-19 Cary Coutant <ccoutant@google.com>
13062
13063 Add plugin functionality for link-time optimization (LTO).
13064 * configure.ac (plugins): Add --enable-plugins option.
13065 * configure: Regenerate.
13066 * config.in: Regenerate.
13067 * Makefile.am (LIBDL): New variable.
13068 (CCFILES): Add plugin.cc.
13069 (HFILES): Add plugin.h.
13070 (ldadd_var): Add LIBDL.
13071 * Makefile.in: Regenerate.
13072
13073 * archive.cc: Include "plugin.h".
13074 (Archive::setup): Don't preread archive symbols when using a plugin.
13075 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13076 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13077 files.
13078 (Archive::include_member): Add symbols from plugin objects.
13079 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13080 * descriptors.cc (Descriptors::open): Check for file descriptors
13081 abandoned by plugins.
13082 (Descriptors::claim_for_plugin): New function.
13083 * descriptors.h (Descriptors::claim_for_plugin): New function.
13084 (Open_descriptor::is_claimed): New field.
13085 (claim_descriptor_for_plugin): New function.
13086 * fileread.cc (File_read::claim_for_plugin): New function.
13087 * fileread.h (File_read::claim_for_plugin): New function.
13088 (File_read::descriptor): New function.
13089 * gold.cc: Include "plugin.h".
13090 (queue_initial_tasks): Add task to call plugin hooks for generating
13091 new object files.
13092 * main.cc: Include "plugin.h".
13093 (main): Load plugin libraries.
13094 * object.h (Pluginobj): Declare.
13095 (Object::pluginobj): New function.
13096 (Object::do_pluginobj): New function.
13097 (Object::set_target): New function.
13098 * options.cc: Include "plugin.h".
13099 (General_options::parse_plugin): New function.
13100 (General_options::General_options): Initialize plugins_ field.
13101 (General_options::add_plugin): New function.
13102 * options.h (Plugin_manager): Declare.
13103 (General_options): Add --plugin option.
13104 (General_options::has_plugins): New function.
13105 (General_options::plugins): New function.
13106 (General_options::add_plugin): New function.
13107 (General_options::plugins_): New field.
13108 * plugin.cc: New file.
13109 * plugin.h: New file.
13110 * readsyms.cc: Include "plugin.h".
13111 (Read_symbols::do_read_symbols): Check for archive before checking
13112 for ELF file. Call plugin hooks to claim files.
13113 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
13114 from a real object file; force override when processing replacement
13115 files.
13116 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
13117 (Symbol::init_base_object): Likewise.
13118 (Symbol::init_base_output_data): Likewise.
13119 (Symbol::init_base_output_segment): Likewise.
13120 (Symbol::init_base_constant): Likewise.
13121 (Symbol::init_base_undefined): Likewise.
13122 (Symbol::output_section): Assert that object is not a plugin.
13123 (Symbol_table::add_from_pluginobj): New function.
13124 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
13125 undefined.
13126 (Symbol_table::sized_write_globals): Likewise.
13127 (Symbol_table::add_from_pluginobj): Instantiate template.
13128 * symtab.h (Sized_pluginobj): Declare.
13129 (Symbol::in_real_elf): New function.
13130 (Symbol::set_in_real_elf): New function.
13131 (Symbol::in_real_elf_): New field.
13132 (Symbol_table::add_from_pluginobj): New function.
13133
13134 * testsuite/Makefile.am (AM_CFLAGS): New variable.
13135 (LIBDL): New variable.
13136 (LDADD): Add LIBDL.
13137 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
13138 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
13139 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
13140 (MOSTLYCLEANFILES): Likewise.
13141 * testsuite/Makefile.in: Regenerate.
13142 * testsuite/plugin_test.c: New file.
13143 * testsuite/plugin_test_1.sh: New file.
13144 * testsuite/plugin_test_2.sh: New file.
13145
de31bda5
ILT
131462008-09-16 Ian Lance Taylor <iant@google.com>
13147
9c2d0ef9
ILT
13148 * target-reloc.h (relocate_section): Check whether a symbol is
13149 defined by the ABI before reporting an undefined symbol error.
13150 * target.h (Target::is_defined_by_abi): Make parameter const.
13151 (Target::do_is_defined_by_abi): Likewise.
13152 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
13153 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
13154 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
13155 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
13156 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
13157 * testsuite/Makefile.in: Rebuild.
13158
de31bda5
ILT
13159 * fileread.cc (make_view): Add casts to avoid warning.
13160
9fa33bee
AO
131612008-09-16 Alexandre Oliva <aoliva@redhat.com>
13162
13163 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
13164 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13165
183fd0e3
AO
131662008-09-16 Alexandre Oliva <aoliva@redhat.com>
13167
13168 * options.h (General_options::output_is_executable): New.
13169 (General_options::output_is_pie): New.
13170 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
13171 for shared libraries.
13172 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
13173
7be8330a
CD
131742008-09-11 Chris Demetriou <cgd@google.com>
13175
13176 * options.h (origin): New -z option.
13177 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13178 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
13179 in DT_FLAGS_1.
13180
a9caad02
CC
131812008-09-05 Cary Coutant <ccoutant@google.com>
13182
13183 * fileread.cc (File_read::make_view): Add check for attempt to map
13184 beyond end of file.
13185
ae6dce4d
CC
131862008-09-05 Cary Coutant <ccoutant@google.com>
13187
13188 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
13189 explicit instantiations.
13190
d7ab2a47
KVH
131912008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
13192
13193 PR gold/6858
13194 * options.cc (General_options::finalize): Allow undefined symbols
13195 in shlibs if linking -shared.
13196
13197 PR gold/6859
13198 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
13199 symbols as not needing a dynsym entry.
13200
1e52a9c1
CS
132012008-08-20 Craig Silverstein <csilvers@google.com>
13202
13203 * fileread.cc (File_read::open): Do not lock the file unless it
13204 was successfully opened.
13205
d85c80a3
CC
132062008-08-14 Cary Coutant <ccoutant@google.com>
13207
13208 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
13209 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
13210 * testsuite/tls_test.cc (struct int128): 128-bit struct
13211 for testing TLS relocs with non-zero addend.
13212 (v12): New TLS variable.
13213 (t12): New test.
13214 (t_last): Add check for v12.
13215 * testsuite/tls_test.h (t12): New function.
13216 * testsuite/tls_test_main.cc (thread_routine): Call new test.
13217
2d924fd9
ILT
132182008-08-13 Ian Lance Taylor <iant@google.com>
13219
13220 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
13221 set tls_segment_ or relro_segment_.
13222 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
13223 when appropriate.
13224 * output.h (Output_section::clear_is_relro): New function.
13225 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
13226 sections specially even when output_data_ is empty.
13227 (Output_segment::maximum_alignment): When first section is relro,
13228 only force alignment for PT_LOAD segments.
13229 * script.cc (script_data_segment_align): New function.
13230 (script_data_segment_relro_end): New function.
13231 * script-c.h (script_data_segment_align): Declare.
13232 (script_data_segment_relro_end): Declare.
13233 * script-sections.h (class Script_sections): Declare
13234 data_segment_align and data_segment_relro_end. Add fields
13235 segment_align_index_ and saw_relro_end_.
13236 * script-sections.cc (class Sections_element): Add set_is_relro
13237 virtual function. Add new bool* parameter to place_orphan_here.
13238 Add get_output_section virtual function.
13239 (class Output_section_definition): Add set_is_relro. Add new
13240 bool* parameter to place_orphan_here. Add get_output_section.
13241 Add is_relro_ field.
13242 (Output_section_definition::Output_section_definition): Initialize
13243 evaluated_address_, evaluated_load_address, evaluated_addralign_,
13244 and is_relro_ fields.
13245 (Output_section_definition::place_orphan_here): Add is_relro
13246 parameter.
13247 (Output_section_definition::set_section_addresses): Set relro for
13248 output section.
13249 (Output_section_definition::alternate_constraint): Likewise.
13250 (class Orphan_output_section): Add new bool* parameter to
13251 place_orphan_here. Add get_output_section.
13252 (Orphan_output_section::place_orphan_here): Add is_relro
13253 parameter.
13254 (Script_sections::Script_sections): Initialize
13255 data_segment_align_index_ and saw_relro_end_.
13256 (Script_sections::data_segment_align): New function.
13257 (Script_sections::data_segment_relro_end): New function.
13258 (Script_sections::place_orphan): Set or clear is_relro.
13259 (Script_sections::set_section_addresses): Force alignment of first
13260 TLS section.
13261 * yyscript.y (exp): Call script_data_segment_align and
13262 script_data_segment_relro_end.
13263 * testsuite/relro_script_test.t: New file.
13264 * testsuite/relro_test.cc (using_script): Declare.
13265 (t1, t2): Test using_script.
13266 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
13267 (relro_script_test_SOURCES): Define.
13268 (relro_script_test_DEPENDENCIES): Define.
13269 (relro_script_test_LDFLAGS): Define.
13270 (relro_script_test_LDADD): Define.
13271 (relro_script_test.so): New target.
13272 * testsuite/Makefile.in: Rebuild.
13273
f827c9a9
CC
132742008-08-06 Cary Coutant <ccoutant@google.com>
13275
13276 * archive.cc (Archive::total_archives, Archive::total_members)
13277 (Archive::total_members_loaded): New variables.
13278 (Archive::setup): Add parameter. Add option to preread
13279 archive symbols.
13280 (Archive::read_armap): Add counter.
13281 (Archive::get_file_and_offset): New function.
13282 (Archive::get_elf_object_for_member): New function.
13283 (Archive::read_all_symbols): New function.
13284 (Archive::read_symbols): New function.
13285 (Archive::add_symbols): Add counters.
13286 (Archive::include_all_members): Use armap to find members if it's
13287 already built.
13288 (Archive::include_member): Skip reading symbols if already read.
13289 Factored code into Archive::get_file_and_offset and
13290 Archive::get_elf_object_for_member. Changed call to
13291 Mapfile::report_include_archive_member.
13292 (Archive::print_stats): New function.
13293 * archive.h: Declare Object and Read_symbols_data classes.
13294 (Archive::Archive): Add initializers for new members.
13295 (Archive::setup): Add parameter.
13296 (Archive::print_stats): New function.
13297 (Archive::total_archives, Archive::total_members)
13298 (Archive::total_members_loaded): New variables.
13299 (Archive::get_file_and_offset): New function.
13300 (Archive::get_elf_object_for_member): New function.
13301 (Archive::read_all_symbols): New function.
13302 (Archive::read_symbols): New function.
13303 (Archive::Archive_member): New class.
13304 (Archive::members_): New member.
13305 (Archive::num_members_): New member.
13306 * main.cc: Include archive.h.
13307 (main): Call Archive::print_stats.
13308 * mapfile.cc (Mapfile::report_include_archive_member): Delete
13309 archive parameter; member_name is now the fully-decorated name.
13310 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
13311 * options.h: (General_options): Add --preread-archive-symbols option.
13312 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
13313 Archive::setup.
13314
de4c45bd
ILT
133152008-08-04 Ian Lance Taylor <iant@google.com>
13316
13317 * symtab.h (Symbol::use_plt_offset): New function.
13318 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
13319 * powerpc.cc (Relocate::relocate): Likewise.
13320 * sparc.cc (Relocate::relocate): Likewise.
13321 * x86_64.cc (Relocate::relocate): Likewise.
13322 * testsuite/weak_plt.sh: New test.
13323 * testsuite/weak_plt_main.cc: New test.
13324 * testsuite/weak_plt_shared.cc: New test.
13325 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
13326 (check_PROGRAMS): Add weak_plt.
13327 (check_DATA): Add weak_plt_shared.so.
13328 (weak_plt_main_pic.o, weak_plt): New targets.
13329 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
13330 * testsuite/Makefile.in: Rebuild.
13331
13332 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
13333 gcctestdir/ld.
13334 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
13335 * testsuite/Makefile.in: Rebuild.
13336
323ee3f4
AM
133372008-08-04 Alan Modra <amodra@bigpond.net.au>
13338
13339 * Makefile.am (POTFILES.in): Set LC_ALL=C.
13340 * Makefile.in: Regenerate.
13341 * po/POTFILES.in: Regenerate.
13342
7c07ecec
ILT
133432008-07-29 Ian Lance Taylor <iant@google.com>
13344
13345 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
13346 symbols before other symbols.
13347 * testsuite/script_test_2.cc (test_addr): Declare.
13348 (test_addr_alias): Declare.
13349 (main): Check that test_addr and test_addr_alias have the right
cd536b21 13350 values.
7c07ecec
ILT
13351 * testsuite/script_test_2.t: Define test_addr_alias and
13352 test_addr.
13353
5778530e
ILT
133542008-07-24 Ian Lance Taylor <iant@google.com>
13355
2a00e4fb
ILT
13356 PR 5990
13357 * descriptors.cc: New file.
13358 * descriptors.h: New file.
13359 * gold-threads.h (class Hold_optional_lock): New class.
13360 * fileread.cc: Include "descriptors.h".
13361 (File_read::~File_read): Release descriptor rather than closing
13362 it.
13363 (File_read::open) [file]: Call open_descriptor rather than open.
13364 Set is_descriptor_opened_.
13365 (File_read::open) [memory]: Assert that descriptor is not open.
13366 (File_read::reopen_descriptor): New function.
13367 (File_read::release): Release descriptor.
13368 (File_read::do_read): Make non-const. Reopen descriptor.
13369 (File_read::read): Make non-const.
13370 (File_read::make_view): Reopen descriptor.
13371 (File_read::do_readv): Likewise.
13372 * fileread.h (class File_read): Add is_descriptor_opened_ field.
13373 Update declarations.
13374 * layout.cc: Include "descriptors.h".
13375 (Layout::create_build_id): Use open_descriptor rather than open.
13376 * output.cc: Include "descriptors.h".
13377 (Output_file::open): Use open_descriptor rather than open.
13378 * archive.cc (Archive::const_iterator): Change Archive to be
13379 non-const.
13380 (Archive::begin, Archive::end): Make non-const.
13381 (Archive::count_members): Likewise.
13382 * archive.h (class Archive): Update declarations.
13383 * object.h (Object::read): Make non-const.
13384 * Makefile.am (CCFILES): Add descriptors.cc.
13385 (HFILES): Add descriptors.h.
13386 * Makefile.in: Rebuild.
13387
801647d1
ILT
13388 PR 6716
13389 * gold.h: Always include <clocale>. Add Solaris workarounds
13390 following code in binutils/sysdep.h.
13391
5edd166e
ILT
13392 PR 6048
13393 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
13394 this->eh_frame_hdr_ is NULL before using it.
13395
c89ad728
ILT
13396 * dynobj.cc (Versions::Versions): Update comment.
13397
aa86f06b
ILT
13398 * dynobj.cc (Versions::Versions): If there is an soname, use it as
13399 the base version name.
13400
5778530e
ILT
13401 * stringpool.cc (Stringpool_template::add_with_length): Set key to
13402 array size plus one.
13403 (Stringpool_template::set_string_offsets): Subtract one from key
13404 before using it as an array index.
13405 (Stringpool_template::get_offset_with_length): Likewise.
13406 (Stringpool_template::write_to_buffer): Likewise.
13407 * stringpool.h (Stringpool_template::get_offset_from_key):
13408 Likewise.
13409
057ead22
ILT
134102008-07-23 Ian Lance Taylor <iant@google.com>
13411
7f649c59
ILT
13412 PR 6658
13413 * object.h (Merged_symbol_value::value): Do our best to handle a
13414 negative addend.
13415
057ead22
ILT
13416 PR 6647
13417 * script.cc (Version_script_info::get_versions): Don't add empty
13418 version tag to return value.
13419 (Version_script_info::get_symbol_version_helper): Change return
13420 type to bool. Add pversion parameter. Change all callers.
13421 (script_register_vers_node): Don't require a non-NULL tag.
13422 * script.h (class Version_script_info): Update declarations.
13423 (Version_script_info::get_symbol_version): Change return type to
13424 bool. Add version parameter. Change all callers.
13425 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
13426 handling. Handle an empty version from a version script.
13427 (Symbol_table::define_special_symbol): Likewise.
13428 * testsuite/ver_test_10.script: New file.
13429 * testsuite/ver_test_10.sh: New file.
13430 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
13431 (check_DATA): Add ver_test_10.syms.
13432 (ver_test_10.syms, ver_test_10.so): New target.
13433 * testsuite/Makefile.in: Rebuild.
13434
58e54ac2
CD
134352008-07-23 Simon Baldwin <simonb@google.com>
13436
13437 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
13438 to zero for undefined symbols from dynamic libraries.
13439
95d14cd3
ILT
134402008-07-23 Ian Lance Taylor <iant@google.com>
13441
13442 * symtab.cc (Symbol_table::resolve): Remove version parameter.
13443 Change all callers.
13444 * symtab.h (class Symbol_table): Update declaration.
13445 * testsuite/ver_test_9.cc: New file.
13446 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
13447 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
13448 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
13449 (ver_test_9.so, ver_test_9.o): New targets.
13450 * testsuite/Makefile.in: Rebuild.
13451
92de84a6
ILT
134522008-07-22 Ian Lance Taylor <iant@google.com>
13453
34810851
ILT
13454 * options.h (class General_options): Define --check-sections.
13455 * layout.cc (Layout::set_segment_offsets): Handle
13456 --check-sections.
13457
af6156ef
ILT
13458 * options.h (class General_options): Define -n/--nmagic and
13459 -N/--omagic.
13460 * options.cc (General_options::finalize): For -n/--nmagic or
13461 -N/--omagic, set -static.
13462 * layout.cc (Layout::attach_allocated_section_to_segment): If
13463 -N/--omagic, don't put read-only and read-write sections in
13464 different segments.
13465 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
13466 finding a read-only segment.
13467 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
13468 don't set the minimum segment alignment to the common page size,
13469 and don't set the file offset to the address modulo the page size.
13470 * script-sections.cc (Script_sections::create_segments): If
13471 -n/--omagic, don't put read-only and read-write sections in
13472 different segments.
13473
92de84a6
ILT
13474 * cref.cc: New file.
13475 * cref.h: New file.
13476 * options.h (class General_options): Add --print-symbol-counts.
13477 * main.cc (main): Issue defined symbol report if requested.
13478 * archive.cc (Archive::interpret_header): Make into a const member
13479 function.
13480 (Archive::add_symbols): Call Input_objects::archive_start and
13481 archive_stop.
13482 (Archive::const_iterator): Define new class.
13483 (Archive::begin, Archive::end): New functions.
13484 (Archive::include_all_members): Rewrite to use iterator.
13485 (Archive::count_members): New function.
13486 * archive.h (class Archive): Update declarations.
13487 (Archive::filename): New function.
13488 * object.cc: Include "cref.h".
13489 (Sized_relobj::Sized_relobj): Initialize defined_count_.
13490 (Sized_relobj::do_get_global_symbol_counts): New function.
13491 (Input_objects::add_object): Add object to cross-referencer.
13492 (Input_objects::archive_start): New function.
13493 (Input_objects::archive_stop): New function.
13494 (Input_objects::print_symbol_counts): New function.
13495 * object.h: Declare Cref and Archive.
13496 (Object::get_global_symbol_counts): New function.
13497 (Object::do_get_global_symbol_counts): New pure virtual function.
13498 (class Sized_relobj): Add defined_count_ field. Update
13499 declarations.
13500 (class Input_objects): Add cref_ field. Update constructor.
13501 Update declarations.
13502 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
13503 defined_count_.
13504 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
13505 symbol counts.
13506 (Sized_dynobj::do_get_global_symbol_counts): New function.
13507 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
13508 defined_count_. Update declarations. Define Symbols typedef.
13509 * symtab.cc (Symbol_table::add_from_relobj): Add defined
13510 parameter. Change all callers.
13511 (Symbol_table::add_from_dynobj): Add sympointers and defined
13512 parameters. Change all callers.
13513 * symtab.h (class Symbol_table): Update declarations.
13514 * Makefile.am (CCFILES): Add cref.cc.
13515 (HFILES): Add cref.h.
13516 * Makefile.in: Rebuild.
13517
3f7c5e1d
CD
135182008-07-22 Simon Baldwin <simonb@google.com>
13519
13520 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
13521 to zero when writing undefined symbols.
13522
e0b64032
ILT
135232008-07-22 Ian Lance Taylor <iant@google.com>
13524
13525 * output.cc (Output_section::add_input_section): Don't try to
13526 merge empty merge sections.
13527
096b02cf
CS
135282008-07-21 Craig Silverstein <csilvers@google.com>
13529
13530 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13531 Include symbol version in error message.
cd536b21 13532
1d1f116d
CD
135332008-07-20 Chris Demetriou <cgd@google.com>
13534
cd536b21 13535 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
13536 (RANDOM_SEED_CFLAGS): New substituted variable.
13537 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
13538 * configure: Rebuild.
13539 * Makefile.in: Likewise.
13540 * testsuite/Makefile.in: Likewise.
13541
a18f591e
ILT
135422008-07-18 Ian Lance Taylor <iant@google.com>
13543
13544 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13545 where we see NAME/NULL and NAME/VERSION as separate symbols.
13546 * testsuite/ver_test_main.cc (main): Call t4.
13547 (t4, t4_2a): Define.
13548 * testsuite/ver_test_2.cc (t4_2): Define.
13549 * testsuite/ver_test_2.script: Put t4_2a in VER2.
13550 * testsuite/ver_test_4.cc (t4_2a): Define.
13551 * testsuite/ver_test_4.script: Put t4_2a in VER2.
13552 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
13553
c6e3f6ed
ILT
135542008-07-17 Ian Lance Taylor <iant@google.com>
13555
13556 * dynobj.cc (Versions::add_def): If we give an error about a
13557 missing version, go ahead and create the version anyhow.
13558
ef9beddf
ILT
135592008-07-10 Ian Lance Taylor <iant@google.com>
13560
13561 Handle output sections with more than 0x7fffffff bytes.
13562 * object.h (class Relobj): Change map_to_output_ to
13563 output_sections_, and just keep a section pointer. Change all
13564 uses. Move comdat group support to Sized_relobj.
13565 (Relobj::is_section_specially_mapped): Remove.
13566 (Relobj::output_section): Remove poff parameter. Change all
13567 callers.
13568 (Relobj::output_section_offset): New function.
13569 (Relobj::set_section_offset): Rewrite.
13570 (Relobj::map_to_output): Remove.
13571 (Relobj::output_sections): New function.
13572 (Relobj::do_output_section_offset): New pure virtual function.
13573 (Relobj::do_set_section_offset): Likewise.
13574 (class Sized_relobj): Add section_offsets_ field. Add comdat
13575 group support from Relobj. Update declarations.
13576 (Sized_relobj::get_output_section_offset): New function.
13577 (Sized_relobj::do_output_section_offset): New function.
13578 (Sized_relobj::do_set_section_offset): New function.
13579 * object.cc (Relobj::output_section_address): Remove.
13580 (Sized_relobj::Sized_relobj): Initialize new fields.
13581 (Sized_relobj::include_section_group): Cast find_kept_object to
13582 Sized_relobj.
13583 (Sized_relobj::include_linkonce_section): Likewise.
13584 (Sized_relobj::do_layout): Use separate arrays for output section
13585 and output offset.
13586 (Sized_relobj::do_count_local_symbols): Change map_to_output to
13587 output_sections.
13588 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
13589 output_sections and section_offsets.
13590 (Sized_relobj::write_local_symbols): Likewise.
13591 (map_to_kept_section): Compute output address directly.
13592 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
13593 output_sections and section_offsets.
13594 (Sized_relobj::write_sections): Likewise.
13595 (Sized_relobj::relocate_sections): Likewise.
13596 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
13597 * output.h (class Output_reloc): Update declarations. Change
13598 u2_.relobj to Sized_relobj*.
13599 (class Output_data_reloc): Change add functions to use
13600 Sized_relobj*.
13601 * output.cc (Output_reloc::Output_reloc): Change relobj to
13602 Sized_relobj*.
13603 (Output_reloc::local_section_offset): Change return type to
13604 Elf_Addr. Use get_output_section_offset.
13605 (Output_reloc::get_address): Likewise.
13606 (Output_section::is_input_address_mapped): Don't call
13607 is_section_specially_mapped.
13608 (Output_section::output_offset): Likewise.
13609 (Output_section::output_address): Likewise.
13610 (Output_section::starting_output_address): Likewise.
13611 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
13612 parameter to Sized_relobj*.
13613 (Copy_relocs::need_copy_reloc): Likewise.
13614 (Copy_relocs::save): Likewise.
13615 * copy-relocs.h (class Copy_relocs): Update declarations.
13616 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
13617 Sized_relobj*. Change relobj_ field to Sized_relobj*.
13618 * target-reloc.h (relocate_for_relocatable): Change
13619 offset_in_output_section type to Elf_Addr. Change code that uses
13620 it as well.
13621 * layout.cc (Layout::layout): Always set *off.
13622 * mapfile.cc (Mapfile::print_input_section): Use
13623 output_section_offset.
13624 * i386.cc (Target_i386::copy_reloc): Change object parameter to
13625 Sized_relobj*.
13626 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
13627 * sparc.cc (Target_sparc::copy_reloc): Likewise.
13628 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
13629
5cb66f97
ILT
136302008-07-03 Ian Lance Taylor <iant@google.com>
13631
13632 * layout.cc (Layout::include_section): Do not discard unrecognized
13633 SHT_STRTAB sections.
13634
afe47622
CS
136352008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
13636
13637 * script.cc (Lex::can_continue_name): Make '?' allowable in
13638 version-script names.
13639 * testsuite/version_script.map: Change glob pattern to use '?'
13640
5adf9721
ILT
136412008-06-30 Manish Singh <yosh@gimp.org>
13642
13643 PR 6585
13644 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
13645 Correct typo.
13646
e6fde208
ILT
136472008-06-30 Ian Lance Taylor <iant@google.com>
13648
13649 PR 6660
13650 PR 6682
13651 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
13652 versions]: Don't try to read the value in the contents, since we
13653 don't use it. Use the template endianness when writing.
13654
3f2e6a2d
CC
136552008-06-25 Cary Coutant <ccoutant@google.com>
13656
13657 * fileread.cc (File_read::make_view): Assert on zero-length view.
13658 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
13659 symbol table when there are no symbols to read.
13660
c43d3a48
CS
136612008-06-23 Craig Silverstein <csilvers@google.com>
13662
13663 * version.cc (version_string): Bump to 1.7
13664
5f494ea0
CS
136652008-06-18 Craig Silverstein <csilvers@google.com>
13666
13667 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
13668 constant 0xFFFF to type Valtype.
13669 (Powerpc_relocate_functions::rel16_ha): Likewise.
13670
c42e122e
ILT
136712008-06-17 Ian Lance Taylor <iant@google.com>
13672
f34787f8
ILT
13673 * output.h (Output_section::Input_section): Initialize p2align_ to
13674 zero for Output_section_data constructors.
13675 (Output_section::Input_section::addralign): If not an input
13676 section, return the alignment of the Output_section_data.
13677 * testsuite/copy_test.cc: New file.
13678 * testsuite/copy_test_1.cc: New file.
13679 * testsuite/copy_test_2.cc: New file.
13680 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
13681 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
13682 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
13683 (copy_test_1_pic.o, copy_test_1.so): New targets.
13684 (copy_test_2_pic.o, copy_test_2.so): New targets.
13685 * testsuite/Makefile.in: Rebuild.
13686
c42e122e
ILT
13687 * script-sections.cc (Script_sections::place_orphan): Initialize
13688 local variable exact.
13689
ce3ac18a
DE
136902008-06-13 David Edelsohn <edelsohn@gnu.org>
13691
13692 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
13693
42cacb20
DE
136942008-06-12 David Edelsohn <edelsohn@gnu.org>
13695 David S. Miller <davem@davemloft.net>
13696
13697 * powerpc.cc: New file.
13698 * Makefile.am (TARGETSOURCES): Add powerpc.cc
13699 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
13700 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
13701 * Makefile.in: Rebuild.
13702
7b308235
ILT
137032008-06-09 Ian Lance Taylor <iant@google.com>
13704
13705 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
13706 <exception>.
13707 (throwing, orig_terminate): New static variables.
13708 (terminate_handler): New static function.
13709 (t2): Set terminate handler.
13710
f0b886e3
ILT
137112008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
13712
13713 PR 6584
cd536b21 13714 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
13715 alignment.
13716
3e90f135
CC
137172008-05-30 Cary Coutant <ccoutant@google.com>
13718
13719 * archive.cc (Archive::include_all_members) Correct to step
13720 over symbol table and extended name table in thin archives.
13721
e09ad04a
ILT
137222008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
13723
13724 PR 6407
13725 * target-reloc.h (relocate_for_relocatable): Fix new_offset
13726 calculation.
13727
62b01cb5
ILT
137282008-05-28 Caleb Howe <cshowe@google.com>
13729
13730 * reduced_debug_output.cc: New file.
13731 * reduced_debug_output.h: New file.
92de84a6 13732 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
13733 * options.cc (General_options::finalize): Add strip_debug_non_line
13734 to the strip heirarchy.
13735 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
13736 fields.
13737 * layout.cc: Include "reduced_debug_output.h".
13738 (Layout::Layout): Initialize new fields.
13739 (line_only_debug_sections): New static array.
13740 (is_lines_only_debug_sections): New static inline function.
13741 (Layout::include_section): Handle --strip-debug-non-line.
13742 (Layout::make_output_section): If --strip-debug-non-line, build
13743 new output sections for .debug_abbrev and .debug_info.
13744 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
13745 gold. Warn about possible overflow.
13746 (read_signed_LEB_128): Likewise.
13747 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
13748 (read_signed_LEB_128): Declare.
13749 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
13750 (HFILES): Add reduced_debug_output.h.
13751 * Makefile.in: Rebuild.
13752
7d9e3d98
ILT
137532008-05-21 Ian Lance Taylor <iant@google.com>
13754
13755 * mapfile.cc: New file.
13756 * mapfile.h: New file.
13757 * options.h (class General_options): Add -M/--print-map and -Map.
13758 * options.cc (General_options::finalize): Make -M equivalent to
13759 -Map -.
13760 * main.cc: Include <cstdio> and "mapfile.h".
13761 (main): Open mapfile if requested.
13762 * gold.cc (class Middle_runner): Add mapfile_ field. Update
13763 constructor. Change caller.
13764 (queue_initial_tasks): Add mapfile parameter. Change caller.
13765 (queue_middle_tasks): Likewise.
13766 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
13767 declarations.
13768 * archive.cc: Include "mapfile.h".
13769 (Archive::add_symbols): Add mapfile parameter. Change all
13770 callers. Pass mapfile, symbol, and reason to include_member.
13771 (Archive::include_all_members): Add mapfile parameter. Change all
13772 callers.
13773 (Archive::include_member): Add mapfile, sym, and why parameters.
13774 Change all callers. Report inclusion to map file.
13775 * archive.h: Include "fileread.h".
13776 (class Archive): Update declarations.
13777 (Archive::file): New const method.
13778 (class Add_archive_symbols): Add mapfile_ field. Update
13779 constructor. Change all callers.
13780 * readsyms.h (class Read_symbols): Likewise.
13781 (class Finish_group): Likewise.
13782 (class Read_script): Likewise.
13783 * common.cc: Include "mapfile.h".
13784 (Symbol_table::allocate_commons): Add mapfile parameter. Change
13785 all callers.
13786 (Symbol_table::do_allocate_commons): Likewise.
13787 (Symbol_table::do_allocate_commons_list): Likewise. Report common
13788 symbol allocation to mapfile.
13789 * common.h (class Allocate_commons_task): Add mapfile_ field.
13790 Update constructor. Change all callers.
13791 * symtab.h (class Symbol_table): Update declarations.
13792 * layout.cc: Include "mapfile.h".
13793 (Layout_task_runner::run): Print information to mapfile.
13794 (Layout::create_gold_note): Change Output_data_fixed_space to
13795 Output_data_zero_fill.
13796 (Layout::create_build_id): Likewise.
13797 (Layout::print_to_mapfile): New function.
13798 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
13799 constructor. Change caller.
13800 (class Layout): Declare print_to_mapfile.
13801 * output.cc (Output_section::Input_section::print_to_mapfile): New
13802 function.
13803 (Output_section::add_input_section): If producing a map, always
13804 add to input_sections_ list.
13805 (Output_section::do_print_to_mapfile): New function.
13806 (Output_segment::print_sections_to_mapfile): New function.
13807 (Output_segment::print_section_list_to_mapfile): New function.
13808 * output.h: Include "mapfile.h".
13809 (Output_data::print_to_mapfile): New function.
13810 (Output_data::do_print_to_mapfile): New virtual function.
13811 (Output_segment_headers::do_print_to_mapfile): New function.
13812 (Output_file_header::do_print_to_mapfile): New function.
13813 (Output_data_const::do_print_to_mapfile): New function.
13814 (class Output_data_const_buffer): Add map_name_ field. Update
13815 constructor. Change all callers. Add do_print_to_mapfile
13816 function.
13817 (class Output_data_fixed_space): Likewise.
13818 (class Output_data_space): Likewise.
13819 (class Output_data_zero_fill): New class.
13820 (Output_data_strtab::do_print_to_mapfile): New function.
13821 (Output_data_reloc_base::do_print_to_mapfile): New function.
13822 (Output_relocatable_relocs::do_print_to_mapfile): New function.
13823 (Output_data_group::do_print_to_mapfile): New function.
13824 (Output_data_got::do_print_to_mapfile): New function.
13825 (Output_data_dynamic::do_print_to_mapfile): New function.
13826 (Output_symtab_xindex::do_print_to_mapfile): New function.
13827 (class Output_section): Declare do_print_to_mapflie. Declare
13828 print_to_mapfile in Input_section.
13829 (class Output_segment): Declare new functions.
13830 * object.h (Sized_relobj::symbol_count): New function.
13831 * script-sections.cc
13832 (Output_section_element_dot_assignment::set_section_addresses):
13833 Change Output_data_fixed_space to Output_data_zero_fill.
13834 (Output_data_expression::do_print_to_mapfile): New function.
13835 * script.cc (read_input_script): Add mapfile parameter. Change
13836 all callers.
13837 * script.h (read_input_script): Update declaration.
13838 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
13839 (Eh_frame::do_print_to_mapfile): New function.
13840 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
13841 (Output_merge_string::do_print_to_mapfile): New function.
13842 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
13843 function.
13844 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
13845 function.
13846 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
13847 function.
13848 * Makefile.am (CCFILES): Add mapfile.cc.
13849 (HFILES): Add mapfile.h.
13850 * Makefile.in: Rebuild.
13851
9f1d377b
ILT
138522008-05-19 Ian Lance Taylor <iant@google.com>
13853
13854 * options.h (class General_options): Add -z relro.
13855 * layout.cc (Layout::Layout): Initialize relro_segment_.
13856 (Layout::add_output_section_data): Return the output section.
13857 (Layout::make_output_section): Rcognize relro sections and mark
13858 them appropriately.
13859 (Layout::attach_allocated_section_to_segment): Put relro sections
13860 in a PT_GNU_RELRO segment.
13861 (Layout::create_initial_dynamic_sections): Mark the .dynamic
13862 section as relro.
13863 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
13864 PT_TLS segments.
13865 (Layout::linkonce_mapping): Map d.rel.ro.local to
13866 .data.rel.ro.local.
13867 (Layout::output_section_name): Us .data.rel.ro.local for any
13868 section which begins with that.
13869 * layout.h (class Layout): Update add_output_section_data
13870 declaration. Add relro_segment_ field.
13871 * output.cc (Output_section::Output_section): Initialize is_relro_
13872 and is_relro_local_ fields.
13873 (Output_segment::add_output_section): Group relro sections.
13874 (Output_segment::is_first_section_relro): New function.
13875 (Output_segment::maximum_alignment): If there is a relro section,
13876 align the segment to the common page size.
13877 (Output_segment::set_section_addresses): Track whether we are
13878 looking at relro sections. If the last section is a relro
13879 section, align to the common page size.
13880 (Output_segment::set_section_list_addresses): Add in_relro
13881 parameter. Change all callers. Align to the page size when
13882 moving from relro to non-relro section.
13883 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
13884 segment.
13885 * output.h (class Output_section): Add is_relro_ and
13886 is_relro_local_ fields.
13887 (Output_section::is_relro): New function.
13888 (Output_section::set_is_relro): New function.
13889 (Output_section::is_relro_local): New function.
13890 (Output_section::set_is_relro_local): New function.
13891 (class Output_segment): Update declarations.
13892 * i386.cc (Target_i386::got_section): Mark .got section as relro.
13893 * sparc.cc (Target_sparc::got_section): Likewise.
13894 * x86_64.cc (Target_x86_64::got_section): Likewise.
13895 * testsuite/relro_test_main.cc: New file.
13896 * testsuite/relro_test.cc: New file.
13897 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
13898 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
13899 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
13900 (relro_test.so, relro_test_pic.o): New targets.
13901 * testsuite/Makefile.in: Rebuild.
13902
a984ee1d
ILT
139032008-05-16 Ian Lance Taylor <iant@google.com>
13904
01676dcd
ILT
13905 * output.cc (Output_segment::add_output_section): Remove front
13906 parameter.
13907 * output.h (class Output_segment): Remove
13908 add_initial_output_section and overloaded add_output_section.
13909 Update declaration of remaining add_output_section.
13910 * layout.cc (Layout::create_interp): Call add_output_section
13911 rather than add_initial_output_section.
13912 (Layout::finish_dynamic_section): Likewise.
13913
497897f9
ILT
13914 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
13915 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
13916 know the dynamic type.
13917 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
13918 field. Initialize it in constructor.
13919 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
13920 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
13921 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
13922 reloc.
13923
a984ee1d
ILT
13924 * output.cc (Output_reloc::get_address): Change return type to
13925 Elf_Addr.
13926 * output.h (class Output_reloc): Update get_address declaration.
13927 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
13928 for section addresses.
13929
55ba0940
ILT
139302008-05-09 Ian Lance Taylor <iant@google.com>
13931
13932 PR 6493
13933 * gold.cc (gold_nomem): Use return value of write.
13934
75517b77
ILT
139352008-05-08 Ian Lance Taylor <iant@google.com>
13936
13937 * symtab.c (Symbol::init_base_output_data): Add version
13938 parameter. Change all callers.
13939 (Symbol::init_base_output_segment): Likewise.
13940 (Symbol::init_base_constant): Likewise.
13941 (Symbol::init_base_undefined): Likewise.
13942 (Sized_symbol::init_output_data): Likewise.
13943 (Sized_symbol::init_output_segment): Likewise.
13944 (Sized_symbol::init_constant): Likewise.
13945 (Sized_symbol::init_undefined): Likewise.
13946 (Symbol_table::do_define_in_output_data): If the new symbol has a
13947 version, mark it as the default.
13948 (Symbol_table::do_define_in_output_segment): Likewise.
13949 (Symbol_table::do_define_as_constant): Likewise.
13950 * symtab.h (class Symbol): Update declarations.
13951 (class Sized_symbol): Likewise.
13952 * resolve.cc (Symbol::override_version): New function.
c42e122e 13953 (Symbol::override_base): Call override_version.
75517b77
ILT
13954 (Symbol::override_base_with_special): Likewise.
13955 * testsuite/ver_script_8.script: New file.
13956 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
13957 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
13958 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
13959 (ver_test_8_1.so, ver_test_8_2.so): New targets.
13960
f1f70eae
ILT
139612008-05-06 Ian Lance Taylor <iant@google.com>
13962
f3e9c5c5
ILT
13963 PR 6049
13964 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
13965 functions.
13966 (class General_options): Remove existing --undefined, and add
13967 --no-undefined instead. Add new --undefined as synonym for -u.
13968 * archive.cc (Archive::add_symbols): Check whether symbol was
13969 named with -u.
13970 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
13971 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
13972 all uses. Add IS_UNDEFINED. Update declarations to split
13973 different versions of init_base. Declare init_base_undefined.
13974 (Symbol::is_defined): Handle IS_UNDEFINED.
13975 (Symbol::is_undefined): Likewise.
13976 (Symbol::is_weak_undefined): Call is_undefined.
13977 (Symbol::is_absolute): Handle IS_CONSTANT.
13978 (class Sized_symbol): Update declarations to split different
13979 versions of init. Declare init_undefined.
13980 (class Symbol_table): Declare new functions.
13981 * symtab.cc (Symbol::init_base_object): Rename from init_base.
13982 Change all callers.
13983 (Symbol::init_base_output_data): Likewise.
13984 (Symbol::init_base_output_segment): Likewise.
13985 (Symbol::init_base_constant): Likewise.
13986 (Symbol::init_base_undefined): New function.
13987 (Sized_symbol::init_object): Rename from init. Change all
13988 callers.
13989 (Sized_symbol::init_output_data): Likewise.
13990 (Sized_symbol::init_output_segment): Likewise.
13991 (Sized_symbol::init_constant): Likewise.
13992 (Sized_symbol::init_undefined): New function.
13993 (Symbol_table::add_undefined_symbols_from_command_line): New
13994 function.
13995 (Symbol_table::do_add_undefined_symbols_from_command_line): New
13996 function.
13997 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
13998 (Symbol::output_section): Likewise.
13999 (Symbol::set_output_section): Likewise.
14000 (Symbol_table::sized_finalize_symbol): Likewise.
14001 (Symbol_table::sized_write_globals): Likewise.
14002 * resolve.cc (Symbol_table::should_override): Likewise.
14003 (Symbol::override_base_with_special): Likewise.
14004
8bdcdf2c
ILT
14005 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14006 symbol, change it to have default visibility.
14007 * testsuite/protected_1.cc: New file.
14008 * testsuite/protected_2.cc: New file.
14009 * testsuite/protected_3.cc: New file.
14010 * testsuite/protected_main_1.cc: New file.
14011 * testsuite/protected_main_2.cc: New file.
14012 * testsuite/protected_main_3.cc: New file.
14013 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14014 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14015 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14016 (protected_1.so): New target.
14017 (protected_1_pic.o, protected_2_pic.o): New targets.
14018 (protected_3_pic.o): New target.
14019 (check_PROGRAMS): Add protected_2.
14020 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14021 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14022 * testsuite/Makefile.in: Rebuild.
14023
2b706932
ILT
14024 * options.h (DEFINE_var): Add set_user_set_##varname__.
14025 (DEFINE_bool_alias): New macro.
14026 (class General_options): Define -Bstatic using DEFINE_bool_alias
14027 rather than DEFINE_special. Add --undefined as an alias for -z
14028 defs.
14029 * options.cc (General_options::parse_Bstatic): Remove.
14030
d82a5bcc
ILT
14031 * options.h (class General_options): Add --fatal-warnings.
14032 * main.cc (main): Implement --fatal-warnings.
14033 * errors.h (Errors::warning_count): New function.
14034
f1f70eae
ILT
14035 * options.h (class General_options): Add -Bsymbolic-functions.
14036 * symtab.h (Symbol::is_preemptible): Check for
14037 -Bsymbolic-functions.
14038
8825ac63
ILT
140392008-05-05 Ian Lance Taylor <iant@google.com>
14040
d98bc257
ILT
14041 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14042 as noVARNAME rather than no-VARNAME.
14043 (class General_options): Add option -z combreloc.
14044 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14045 get_address.
14046 (Output_reloc::sort_before) [SHT_REL]: New function.
14047 (Output_reloc::sort_before) [SHT_RELA]: New function.
14048 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14049 Sort_relocs_comparison.
14050 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14051 parameter. Change all callers.
14052 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14053 sort_relocs parameter. Change all callers.
14054 * output.cc (Output_reloc::get_address): New function, broken out
14055 of write_rel.
14056 (Output_reloc::write_rel): Call it.
14057 (Output_reloc::compare): New function.
14058 (Output_data_reloc_base::do_write): Optionally sort relocs.
14059
60b2b4e7
ILT
14060 * configure.ac: If targ_extra_obj is set, link it in.
14061 * configure.tgt: Initialize all variables.
14062 (x86_64*): Set targ_extra_obj and targ_extra_size.
14063 * configure: Rebuild.
14064
8825ac63
ILT
14065 * object.cc (Sized_relobj::include_section_group): Adjust section
14066 indexes read from group data. Build vector to pass to
14067 layout_group.
14068 * layout.cc (Layout::layout_group): Add flags and shndxes
14069 parameters. Remove contents parameter. Change caller. Update
14070 explicit instantiations.
14071 * layout.h (class Layout): Update layout_group declaration.
14072 * output.cc (Output_data_group::Output_data_group): Add flags and
14073 input_shndxes parameters. Remove contents parameter. Change
14074 caller.
14075 (Output_data_group::do_write): Change input_sections_ to
14076 input_shndxes_.
14077 * output.h (class Output_data_group): Update constructor
14078 declaration. Rename input_sections_ to input_shndxes_.
14079 * testsuite/many_sections_test.cc: Add template.
14080
e94cf127
CC
140812008-04-30 Cary Coutant <ccoutant@google.com>
14082
4418b2d5
CC
14083 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14084
e94cf127
CC
14085 * layout.cc (Layout::include_section): Refactored check for debug
14086 info section.
14087 (Layout::add_comdat): Add new parameters. Change type
14088 of signature parameter. Add object and shndx to signatures table.
14089 (Layout::find_kept_object): New function.
14090 * layout.h: Include <cstring>.
14091 (Layout::is_debug_info_section): New function.
14092 (Layout::add_comdat): Add new parameters.
14093 (Layout::find_kept_object): New function.
14094 (Layout::Kept_section): New struct.
14095 (Layout::Signatures): Change type of map range.
14096 * object.cc (Relobj::output_section_address): New function.
14097 (Sized_relobj::include_section_group): Add new parameters. Change
14098 calls to Layout::add_comdat. Change to build table of kept comdat
14099 groups and table mapping discarded sections to kept sections.
14100 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
14101 (Sized_relobj::do_layout): Change calls to include_section_group and
14102 include_linkonce_section.
14103 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
14104 value to zero when section is discarded.
14105 (Sized_relobj::map_to_kept_section): New function.
14106 * object.h (Relobj::output_section_address): New function.
14107 (Relobj::Comdat_group): New type.
14108 (Relobj::find_comdat_group): New function.
14109 (Relobj::Comdat_group_table): New type.
14110 (Relobj::Kept_comdat_section): New type.
14111 (Relobj::Kept_comdat_section_table): New type.
14112 (Relobj::add_comdat_group): New function.
14113 (Relobj::set_kept_comdat_section): New function.
14114 (Relobj::get_kept_comdat_section): New function.
14115 (Relobj::comdat_groups_): New field.
14116 (Relobj::kept_comdat_sections_): New field.
14117 (Symbol_value::input_value): Update comment.
14118 (Sized_relobj::map_to_kept_section) New function.
14119 (Sized_relobj::include_linkonce_section): Add new parameter.
14120 * target-reloc.h (Comdat_behavior): New type.
14121 (get_comdat_behavior): New function.
14122 (relocate_section): Add code to map a discarded section to the
14123 corresponding kept section when applying a relocation.
14124
e4e5049b
CS
141252008-04-30 Craig Silverstein <csilvers@google.com>
14126
14127 * dwarf_reader.cc (next_generation_count): New static var.
14128 (Addr2line_cache_entry): New struct.
14129 (addr2line_cache): New static var.
14130 (Dwarf_line_info::one_addr2line): Added caching.
14131 (Dwarf_line_info::clear_addr2line_cache): New function.
14132 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
14133 cache-size parameter.
14134 (Dwarf_line_info::one_addr2line_cache): New function.
14135 * symtab.cc (Symbol_table::detect_odr_violations): Pass
14136 new cache-size argument to one_addr2line(), and clear cache.
14137
d09e9154
CC
141382008-04-28 Cary Coutant <ccoutant@google.com>
14139
14140 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
14141 R_386_PC8 relocations.
14142
7ef73768
ILT
141432008-04-23 Ian Lance Taylor <iant@google.com>
14144
55438702
ILT
14145 * object.cc (Sized_relobj::include_section_group): Check for
14146 invalid section group.
14147
c165fb93
ILT
14148 * object.cc (make_elf_object): Correct test for 64-bit ELF file
14149 header size.
14150
7ef73768
ILT
14151 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
14152 than read for file header.
14153 * archive.cc (Archive::include_member): Likewise.
14154
6194aaab
L
141552008-04-23 Paolo Bonzini <bonzini@gnu.org>
14156
14157 * aclocal.m4: Regenerate.
14158 * configure: Regenerate.
14159
d491d34e
ILT
141602008-04-19 Ian Lance Taylor <iant@google.com>
14161
5ea2bac6
ILT
14162 * version.cc (version_string): Bump to 1.6.
14163
7bc3e21a
ILT
14164 * testsuite/Makefile.am (many_sections_r_test): New target.
14165 (many_sections_r_test_SOURCES): Remove.
14166 (many_sections_r_test_DEPENDENCIES): Remove.
14167 (many_sections_r_test_LDFLAGS): Remove.
14168 (many_sections_r_test_LDADD): Remove.
14169
7fcd3aa9
ILT
14170 * object.cc (Sized_relobj::do_add_symbols): Always pass
14171 local_symbol_count_ to add_from_relobj.
14172
4c94d6ae
ILT
14173 * testsuite/Makefile.am (many_sections_check.h): Only check one in
14174 every thousand variables.
14175 * testsuite/Makefile.in: Rebuild.
14176
d491d34e
ILT
14177 * object.cc (Xindex::initialize_symtab_xindex): New function.
14178 (Xindex::read_symtab_xindex): New function.
14179 (Xindex::sym_xindex_to_shndx): New function.
14180 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
14181 available.
14182 (Sized_relobj::do_initialize_xindex): New function.
14183 (Sized_relobj::do_read_symbols): Adjust section links.
14184 (Sized_relobj::symbol_section_and_value): Add is_ordinary
14185 parameter. Change all callers.
14186 (Sized_relobj::include_section_group): Adjust section links and
14187 symbol section indexes.
14188 (Sized_relobj::do_layout): Adjust section links.
14189 (Sized_relobj::do_count_local_symbols): Adjust section links and
14190 symbol section indexes.
14191 (Sized_relobj::do_finalize_local_symbols): Distinguish between
14192 ordinary and special symbols.
14193 (Sized_relobj::write_local_symbols): Add symtab_xindex and
14194 dynsym_xindex parameters. Change all callers. Adjust section
14195 links. Use SHN_XINDEX when needed.
14196 (Sized_relobj::get_symbol_location_info): Adjust section links.
14197 Don't get fooled by special symbols.
14198 * object.h (class Xindex): Define.
14199 (class Object): Add xindex_ parameter. Declare virtual functoin
14200 do_initialize_xindex.
14201 (Object::adjust_sym_shndx): New function.
14202 (Object::set_xindex): New protected function.
14203 (class Symbol_value): Add is_ordinary_shndx_ field.
14204 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
14205 (Symbol_value::value): Assert ordinary section.
14206 (Symbol_value::initialize_input_to_output_map): Likewise.
14207 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
14208 Change all callers.
14209 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
14210 all callers.
14211 (class Sized_relobj): Update declarations.
14212 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
14213 parameter. Change all callers.
14214 (Sized_relobj::adjust_shndx): New function.
14215 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
14216 field.
14217 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
14218 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
14219 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
14220 (Sized_dynobj::read_dynsym_section): Adjust section links.
14221 (Sized_dynobj::read_dynamic): Likewise.
14222 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
14223 section links.
14224 (Sized_dynobj::do_initialize_xindex): New function.
14225 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
14226 do_initialize_xindex.
14227 (Sized_dynobj::adjust_shndx): New function.
14228 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
14229 dynsym_xindex_ fields.
14230 (Layout::finalize): Add a call to set_section_indexes before
14231 creating the symtab sections.
14232 (Layout::set_section_indexes): Don't do anything if the section
14233 already has a section index.
14234 (Layout::create_symtab_sections): Add shnum parameter. Change
14235 caller. Create .symtab_shndx section if needed.
14236 (Layout::create_shdrs): Add shstrtab_section parameter. Change
14237 caller.
14238 (Layout::allocated_output_section_count): New function.
14239 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
14240 needed.
14241 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
14242 fields. Update declarations.
14243 (Layout::symtab_xindex): New function.
14244 (Layout::dynsym_xindex): New function.
14245 (class Write_symbols_task): Add layout_ field.
14246 (Write_symbols_task::Write_symbols_task): Add layout parameter.
14247 Change caller.
14248 * output.cc (Output_section_headers::Output_section_headers): Add
14249 shstrtab_section parameter. Change all callers.
14250 (Output_section_headers::do_sized_write): Store overflow values
14251 for section count and section string table section index in
14252 section header zero.
14253 (Output_file_header::do_sized_write): Check for overflow of
14254 section count and section string table section index.
14255 (Output_symtab_xindex::do_write): New function.
14256 (Output_symtab_xindex::endian_do_write): New function.
14257 * output.h (class Output_section_headers): Add shstrtab_section_.
14258 Update declarations.
14259 (class Output_symtab_xindex): Define.
14260 (Output_section::has_out_shndx): New function.
14261 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
14262 field.
14263 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
14264 Change all callers.
14265 (Sized_symbol::init): Likewise.
14266 (Symbol::output_section): Check for ordinary symbol.
14267 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
14268 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
14269 callers.
14270 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
14271 Change all callers. Simplify handling of symbols from sections
14272 not included in the link.
14273 (Symbol_table::add_from_dynobj): Handle ordinary symbol
14274 distinction.
14275 (Weak_alias_sorter::operator()): Assert that symbols are
14276 ordinary.
14277 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
14278 distinction.
14279 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
14280 parameters. Change all callers.
14281 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
14282 symbol distinction. Use SHN_XINDEX when needed.
14283 (Symbol_table::write_section_symbol): Add symtab_xindex
14284 parameter. Change all callers.
14285 (Symbol_table::sized_write_section_symbol): Likewise. Use
14286 SHN_XINDEX when needed.
14287 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
14288 declarations.
14289 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
14290 (Symbol::is_defined): Check is_ordinary.
14291 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
14292 (Symbol::is_absolute, Symbol::is_common): Likewise.
14293 (class Sized_symbol): Update declarations.
14294 (class Symbol_table): Update declarations.
14295 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
14296 parameters. Change all callers.
14297 (Sized_symbol::override): Likewise.
14298 (Symbol_table::override): Likewise.
14299 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
14300 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
14301 is_ordinary, and orig_st_shndx parameters. Change all callers.
14302 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
14303 to be in an ordinary section.
14304 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
14305 object and is_ordinary parameters. Change all callers.
14306 (Sized_dwarf_line_info::read_relocs): Add object parameter.
14307 Change all callers. Don't add undefined or non-ordinary symbols
14308 to reloc_map_.
14309 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
14310 Change all callers.
14311 * dwarf_reader.h (class Sized_dwarf_line_info): Update
14312 declarations.
14313 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
14314 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
14315 (Sized_relobj::relocate_sections): Likewise.
14316 * target-reloc.h (scan_relocs): Adjust section symbol index.
14317 (scan_relocatable_relocs): Likewise.
14318 * i386.cc (Scan::local): Check for ordinary symbols.
14319 * sparc.cc (Scan::local): Likewise.
14320 * x86_64.cc (Scan::local): Likewise.
14321 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
14322 to symbol_section_and_value.
14323 * testsuite/many_sections_test.cc: New file.
14324 * testsuite/Makefile.am (BUILT_SOURCES): Define.
14325 (check_PROGRAMS): Add many_sections_test.
14326 (many_sections_test_SOURCES): Define.
14327 (many_sections_test_DEPENDENCIES): Define.
14328 (many_sections_test_LDFLAGS): Define.
14329 (BUILT_SOURCES): Add many_sections_define.h.
14330 (many_sections_define.h): New target.
14331 (BUILT_SOURCES): Add many_sections_check.h.
14332 (many_sections_check.h): New target.
14333 (check_PROGRAMS): Add many_sections_r_test.
14334 (many_sections_r_test_SOURCES): Define.
14335 (many_sections_r_test_DEPENDENCIES): Define.
14336 (many_sections_r_test_LDFLAGS): Define.
14337 (many_sections_r_test_LDADD): Define.
14338 (many_sections_r_test.o): New target.
14339 * testsuite/Makefile.in: Rebuild.
14340
c5818ff1
CC
143412008-04-17 Cary Coutant <ccoutant@google.com>
14342
14343 * errors.cc (Errors::info): New function.
14344 (gold_info): New function.
14345 * errors.h (Errors::info): New function.
14346 * gold.h (gold_info): New function.
14347 * object.cc (Input_objects::add_object): Print trace output.
14348 * options.cc (options::parse_set): New function.
14349 (General_options::parse_wrap): Deleted.
14350 (General_options::General_options): Deleted initializer.
14351 * options.h (options::String_set): New typedef.
14352 (options::parse_set): New function.
14353 (DEFINE_set): New macro.
14354 (General_options::wrap): Changed to use DEFINE_set. Changed
14355 callers of any_wrap_symbols and is_wrap_symbol.
14356 (General_options::trace, General_options::trace_symbol):
14357 New options.
14358 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
14359 (General_options::wrap_symbols_): Deleted.
14360 * symtab.cc (Symbol_table::add_from_object): Print trace output.
14361
b5be4a7c
DM
143622008-04-17 David S. Miller <davem@davemloft.net>
14363
14364 * options.cc (General_options::parse_V): New function.
14365 * options.h: Add entries for -V and -Qy.
14366
155a0dd7
ILT
143672008-04-17 Ian Lance Taylor <iant@google.com>
14368
14369 * common.cc (Symbol_table::allocate_commons): Remove options
14370 parameter. Change caller.
14371 (Symbol_table::do_allocate_commons): Remove options parameter.
14372 Change caller. Just call do_allocate_commons_list twice.
14373 (Symbol_table::do_allocate_commons_list): New function, broken out
14374 of do_allocate_commons.
14375 * common.h (class Allocate_commons_task): Remove options_ field.
14376 Update constructor.
14377 * symtab.cc (Symbol_table::Symbol_table): Initialize
14378 tls_commons_.
14379 (Symbol_table::add_from_object): Put TLS common symbols on
14380 tls_commons_ list.
14381 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
14382 which are IN_OUTPUT_DATA.
14383 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
14384 allocate_commons and do_allocate_commons declarations. Declare
14385 do_allocate_commons_list.
14386 * gold.cc (queue_middle_tasks): Update creation of
14387 Allocate_commons_task to not pass options.
14388 * testsuite/Makefile.am (INCLUDES): Add -I.. .
14389 (TLS_TEST_C_FLAGS): New variable.
14390 (tls_test_c_pic.o): New target.
14391 (tls_test_shared.so): Link in tls_test_c_pic.o.
14392 (tls_test_c_pic_ie.o): New target.
14393 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
14394 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
14395 (tls_test_c.o): New target.
14396 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
14397 (tls_pic_test_LDADD): Likewise.
14398 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
14399 (tls_shared_gd_to_ie_test_LDADD): Likewise.
14400 (tls_test_c_gnu2.o): New target.
14401 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
14402 tls_test_c_gnu2.o.
14403 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
14404 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
14405 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
14406 * testsuite/tls_test.cc: Include "config.h".
14407 (t_last): Call t11_last.
14408 * testsuite/tls_test.h (t11, t11_last): Declare.
14409 * testsuite/tls_test_c.c: New file.
14410 * testsuite/tls_test_main.cc (thread_routine): Call t11.
14411 * configure.ac: Check for OpenMP support.
14412 * configure, config.in, Makefile.in: Rebuild.
14413 * testsuite/Makefile.in: Rebuild.
14414
edfbb029
CC
144152008-04-16 Cary Coutant <ccoutant@google.com>
14416
14417 * i386.cc (Target_i386::define_tls_base_symbol): New function.
14418 (Target_i386::tls_base_symbol_defined_): New field.
14419 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14420 (Target_i386::Scan::global): Likewise.
14421 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
14422 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
14423 (Target_x86_64::tls_base_symbol_defined_): New field.
14424 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
14425 (Target_x86_64::Scan::global): Likewise.
14426
f3c69fca
CC
144272008-04-16 Cary Coutant <ccoutant@google.com>
14428
14429 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
14430 (Symbol::needs_plt_entry): Allow weak undefined symbols.
14431 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
14432 building shared libraries.
14433 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
14434 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
14435 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
14436 * testsuite/Makefile.in: Rebuild.
14437 * testsuite/weak_undef.h: New file.
14438 * testsuite/weak_undef_file1.cc: Add extra test cases.
14439 * testsuite/weak_undef_file2.cc: Likewise.
14440 * testsuite/weak_undef_test.cc: Likewise.
14441
7c414435
DM
144422008-04-16 David S. Miller <davem@davemloft.net>
14443
32b769e1
DM
14444 * sparc.cc (Target_sparc::Scan): Change from struct to class.
14445 Add issued_non_pic_error_ field. Declare check_non_pic.
14446 (Target_sparc::Scan::check_non_pic): New function.
14447 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
14448 (Target_sparc::Scan::global): Likewise.
14449
11936fb1
DM
14450 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
14451 * configure: Rebuild.
14452
7c414435
DM
14453 * options.h (DEFINE_enable): New macro.
14454 (new_dtags): New enable option.
14455 (initfirst, interpose, loadfltr, nodefaultlib,
14456 nodelete, nodlopen, nodump): New -z options.
14457 * layout.cc (Layout:finish_dynamic_section): If new
14458 dtags enabled, emit DT_RUNPATH. Also, emit a
14459 DT_FLAGS_1 containing any specified -z flags.
14460
85c7bf8b
ILT
144612008-04-16 Ian Lance Taylor <iant@google.com>
14462
12c0daef
ILT
14463 * copy-relocs.cc: New file.
14464 * copy-relocs.h: New file.
14465 * reloc.cc: Remove Copy_relocs code.
14466 * reloc.h: Likewise.
14467 * reloc-types.h (struct Reloc_types) [both versions]: Add
14468 get_reloc_addend_noerror.
14469 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
14470 variants of add_global which take an addend which must be zero.
14471 * i386.cc: Include "copy-relocs.h".
14472 (class Target_i386): Change type of copy_relocs_ to variable,
14473 update initializer.
14474 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
14475 Change all callers.
14476 (Target_i386::do_finalize_sections): Change handling of
14477 copy_relocs_.
14478 * sparc.cc: Include "copy-relocs.h".
14479 (class Target_sparc): Change type of copy_relocs_ to variable,
14480 update initializer.
14481 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
14482 Change all callers.
14483 (Target_sparc::do_finalize_sections): Change handling of
14484 copy_relocs_.
14485 * x86_64.cc: Include "copy-relocs.h".
14486 (class Target_x86_64): Change type of copy_relocs_ to variable,
14487 update initializer.
14488 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
14489 class. Change all callers.
14490 (Target_x86_64::do_finalize_sections): Change handling of
14491 copy_relocs_.
14492 * Makefile.am (CCFILES): Add copy-relocs.cc.
14493 (HFILES): Add copy-relocs.h.
14494
4f4995b6
ILT
14495 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
14496
85c7bf8b
ILT
14497 * testsuite/script_test_4.sh: Permit leading zeroes.
14498
4f2a9edd
ILT
144992008-04-15 Ian Lance Taylor <iant@google.com>
14500
e6188289
ILT
14501 * script-sections.cc (Script_sections::create_segments): Use
14502 header_size_adjustment even when there is enough room for the
14503 headers.
14504 * testsuite/script_test_4.sh: New file.
14505 * testsuite/script_test_4.t: New file.
14506 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
14507 (check_DATA): Add script_test_4.stdout.
14508 (MOSTLYCLEANFILES): Likewise.
14509 (script_test_4): New target.
14510 (script_test_4.stdout): New target.
14511 * testsuite/Makefile.in: Rebuild.
14512
4f2a9edd
ILT
14513 * sparc.cc: Add definitions for Output_data_plt_sparc class
14514 constants.
14515
f5314dd5
DM
145162008-04-14 David S. Miller <davem@davemloft.net>
14517
14518 * sparc.cc: New file.
14519 * Makefile.am (TARGETSOURCES): Add sparc.cc
14520 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
14521 * configure.tgt: Document targ_extra_size and
14522 targ_extra_big_endian. Add entries for sparc-* and
14523 sparc64-*.
14524 * configure.ac: Handle targ_extra_size and
14525 targ_extra_big_endian.
14526 * Makefile.in: Rebuild.
14527 * configure: Likewise.
14528 * po/POTFILES.in: Likewise.
14529 * po/gold.pot: Likewise.
14530
154e0e9a
ILT
145312008-04-14 Ian Lance Taylor <iant@google.com>
14532
14533 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
14534 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
14535 in the name/type/flags to section mapping. Don't call
14536 allocate_output_section.
14537 (Layout::choose_output_section): Change parameter from adjust_name
14538 to is_input_section. Don't permit input sections after sections
14539 are attached to segments. Don't call allocate_output_section.
14540 (Layout::layout_eh_frame): Call update_flags_for_input_section,
14541 not write_enable_output_section.
14542 (Layout::make_output_section): Don't push to
14543 unattached_section_list_ nor call attach_to_segment. Call
14544 attach_section_to_segment if sections are attached.
14545 (Layout::attach_sections_to_segments): New function.
14546 (Layout::attach_section_to_segment): New function.
14547 (Layout::attach_allocated_section_to_segment): Rename from
14548 attach_to_segment. Remove flags parameter.
14549 (Layout::allocate_output_section): Remove function.
14550 (Layout::write_enable_output_section): Remove function.
14551 * layout.h (class Layout): Update for above changes. Add new
14552 field sections_are_attached_.
14553 * output.h (Output_section::update_flags_for_input_section): New
14554 function.
14555 * output.cc (Output_section::add_input_section): Call
14556 update_flags_for_input_section.
14557 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
14558
009a67a2
CC
145592008-04-11 Cary Coutant <ccoutant@google.com>
14560
14561 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
14562 thought unnecessary.
14563 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
14564
759b1a24
ILT
145652008-04-11 Ian Lance Taylor <iant@google.com>
14566
14567 * output.h (class Output_section_data): Remove inline definition
14568 of set_addralign.
14569 * output.cc (Output_section_data::set_addralign): New function.
14570
c2b45e22
CC
145712008-04-11 Cary Coutant <ccoutant@google.com>
14572
14573 Add support for TLS descriptors for i386 and x86_64.
14574 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
14575 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
14576 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
14577 GOT_TYPE_TLS_DESC.
14578 (Target_i386::got_mod_index_entry): Remove unnecessary code.
14579 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
14580 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
14581 relocations.
14582 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
14583 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
14584 Fix problem with initial-exec relocations.
14585 (Target_i386::Relocate::relocate_tls): Likewise.
14586 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
14587 relaxation.
14588 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
14589 support for section-plus-offset dynamic table entries.
14590 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
14591 (Output_data_dynamic::Dynamic_entry): Add support for
14592 section-plus-offset dynamic table entries.
14593 (Output_data_dynamic::Classification): Likewise.
14594 (Output_data_dynamic::classification_): Renamed offset_.
14595 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
14596 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
14597 (Target_x86_64::make_plt_section): New function.
14598 (Target_x86_64::reserve_tlsdesc_entries): New function.
14599 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
14600 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
14601 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
14602 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
14603 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
14604 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
14605 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
14606 add extra PLT entry for TLS descriptors.
14607 (Output_data_plt_x86_64::got_): New field.
14608 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
14609 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
14610 fields.
14611 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
14612 descriptors.
14613 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
14614 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
14615 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
14616 R_386_TLS_DESC_CALL relocations.
14617 (Target_x86_64::Scan::global): Likewise.
14618 (Target_x86_64::do_finalize_sections): Add dynamic table entries
14619 for TLS descriptors.
14620 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
14621 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
14622 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
14623 GD-to-IE relaxation.
14624 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
14625 and TLS_DESCRIPTORS.
14626 * Makefile.in: Rebuild.
14627 * configure: Rebuild.
14628 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
14629 (tls_test_shared2.so): New target.
14630 (tls_shared_gd_to_ie_test_SOURCES): New variable.
14631 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
14632 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
14633 (tls_shared_gd_to_ie_test_LDADD): New variable.
14634 (tls_shared_gnu2_gd_to_ie_test): New target.
14635 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
14636 New targets.
14637 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
14638 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
14639 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
14640 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
14641 (tls_shared_gnu2_test): New target.
14642 (tls_test_gnu2_shared.so): New target.
14643 (tls_shared_gnu2_test_SOURCES): New variable.
14644 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
14645 (tls_shared_gnu2_test_LDFLAGS): New variable.
14646 (tls_shared_gnu2_test_LDADD): New variable.
14647 * testsuite/Makefile.in: Rebuild.
14648 * testsuite/Makefile.
14649
83bfb6b7
ILT
146502008-04-11 Ian Lance Taylor <iant@google.com>
14651
14652 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
14653 justsyms.t.
14654 * testsuite/Makefile.in: Rebuild.
14655
14656 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
14657 long.
14658 * testsuite/script_test_2.cc (main): Adjust test.
14659
706e1f5e
ILT
146602008-04-11 David S. Miller <davem@davemloft.net>
14661 Ian Lance Taylor <iant@google.com>
14662
14663 * options.h (General_options): Add entries for '-Y' and
14664 '-relax'.
14665 * options.cc (General_options:finalize): If -Y was used, add those
14666 entries to the library path instead of the default "/lib" and
14667 "/usr/lib".
14668
7c98e6bb
DM
146692008-04-11 David S. Miller <davem@davemloft.net>
14670
14671 * testsuite/justsyms.t: Start at 0x100.
14672 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
14673 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
14674 long.
14675 * testsuite/script_test_2.cc: Adjust string and section length
14676 checks.
7c98e6bb 14677
99a37bfd
ILT
146782008-04-09 Ian Lance Taylor <iant@google.com>
14679
2cefc357
ILT
14680 PR gold/5996
14681 * script-sections.cc (Sections_element::allocate_to_segment): Add
14682 orphan parameter.
14683 (Output_section_definition::allocate_to_segment): Likewise.
14684 (Orphan_output_section::allocate_to_segment): Likewise.
14685 (Script_sections::attach_sections_using_phdrs_clause): Don't
14686 propagate non-PT_LOAD segments to orphan sections.
14687 * testsuite/Makefile.am (script_test_3.stdout): Generate using
14688 readelf rather than objdump.
14689 * testsuite/script_test_3.sh: Adjust accordingly. Test that
14690 .interp section and PT_INTERP segment are the same size.
14691 * testsuite/Makefile.in: Rebuild.
14692
99a37bfd
ILT
14693 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
14694 aliases for symbols defined in the same object.
14695 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
14696 (weak_alias_test_SOURCES): New variable.
14697 (weak_alias_test_DEPENDENCIES): New variable.
14698 (weak_alias_test_LDFLAGS): New variable.
14699 (weak_alias_test_LDADD): New variable.
14700 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
14701 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
14702 (weak_alias_test_3.o): New target.
14703 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
14704 * testsuite/weak_alias_test_main.cc: New file.
14705 * testsuite/weak_alias_test_1.cc: New file.
14706 * testsuite/weak_alias_test_2.cc: New file.
14707 * testsuite/weak_alias_test_3.cc: New file.
14708
780e49c5
ILT
147092008-04-08 Ian Lance Taylor <iant@google.com>
14710
cdb0b8f5
ILT
14711 * options.h (class General_options): Add --noinhibit-exec option.
14712 * main.cc (main): Check --noinhibit-exec.
14713
0864d551
ILT
14714 * options.h (class General_options): Define --wrap as a special
14715 option. Add wrap_symbols_ field.
14716 (General_options::any_wrap_symbols): New function.
14717 (General_options::is_wrap_symbol): New function.
14718 * options.cc (General_options::parse_wrap): New function.
14719 (General_options::General_options): Initialize wrap_symbols_.
14720 * symtab.cc (Symbol_table::wrap_symbol): New function.
14721 (Symbol_table::add_from_object): Handle --wrap.
14722 * symtab.h (class Symbol_table): Declare wrap_symbol.
14723 * target.h (Target::wrap_char): New function.
14724 (Target::Target_info): Add wrap_char field.
14725 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
14726 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14727 * testsuite/testfile.cc (Target_test::test_target_info):
14728 Likewise.
14729
789aa6de
ILT
14730 * errors.cc (Errors::undefined_symbol): Mention symbol version if
14731 there is one.
14732
2c38906f
ILT
14733 * layout.h (class Layout): Add added_eh_frame_data_ field.
14734 * layout.cc (Layout::Layout): Initialize new field.
14735 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
14736 output section until we find a section we merged successfully.
14737 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
14738 that the size be non-zero.
14739
780e49c5
ILT
14740 * merge.cc (Object_merge_map::get_output_offset): Remove inline
14741 qualifier.
14742
7fcd0256
ILT
147432008-04-08 Craig Silverstein <csilvers@google.com>
14744
14745 * configure.ac: Export new conditional variable HAVE_ZLIB.
14746 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
14747 on HAVE_ZLIB.
14748 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
14749 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14750
6835af53
ILT
147512008-04-07 Ian Lance Taylor <iant@google.com>
14752
e24f324c
ILT
14753 * version.cc (version_string): Set to "1.5".
14754
a036edd8
ILT
14755 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
14756 Add issued_non_pic_error_ field. Declare check_non_pic.
14757 (Target_x86_64::Scan::check_non_pic): New function.
14758 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
14759 (Target_x86_64::Scan::global): Likewise.
14760
624f8810
ILT
14761 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
14762 addend parameter. Change caller. Handle merge sections.
14763 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
14764 Address to Addend. Don't add in the result of
14765 local_section_offset, pass down the addend and use the returned
14766 value.
14767 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
14768 Update declarations of local_section_offset and symbol_value.
14769 * testsuite/two_file_test_1.cc (t18): New function.
14770 * testsuite/two_file_test_2.cc (f18): New function.
14771 * testsuite/two_file_test_main.cc (main): Call t18.
14772 * testsuite/two_file_test.h (t18, f18): Declare.
14773
6835af53
ILT
14774 * configure.ac: Don't test for objdump, c++filt, or readelf.
14775 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
14776 conditionals.
14777 (TEST_READELF): New variable.
14778 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
14779 (check_PROGRAMS): Add two_file_strip_test.
14780 (two_file_strip_test): New target.
14781 (check_PROGRAMS): Add two_file_same_shared_strip_test.
14782 (two_file_same_shared_strip_test_SOURCES): New variable.
14783 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
14784 (two_file_same_shared_strip_test_LDFLAGS): New variable.
14785 (two_file_same_shared_strip_test_LDADD): New variable.
14786 (two_file_shared_strip.so): New target.
14787 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
14788 (ver_test_5.syms, ver_test_7.syms): Likewise.
14789 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
14790 (strip_test_3.stdout): Use TEST_OBJDUMP.
14791 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14792
86925eef
CC
147932008-04-04 Cary Coutant <ccoutant@google.com>
14794
14795 * symtab.h (Symbol::is_weak_undefined): New function.
14796 (Symbol::is_strong_undefined): New function.
14797 (Symbol::is_absolute): New function.
14798 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
14799 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
14800 absolute symbols.
14801 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
14802 (weak_undef_test): New target.
14803 * testsuite/Makefile.in: Rebuild.
14804 * testsuite/weak_undef_file1.cc: New file.
14805 * testsuite/weak_undef_file2.cc: New file.
14806 * testsuite/weak_undef_test.cc: New file.
14807
126f3ece
ILT
148082008-04-03 Craig Silverstein <csilvers@google.com>
14809
14810 * compressed_output.h (class Output_compressed_section): Use
14811 unsigned buffer.
14812 * compressed_output.cc (zlib_compress): Use unsigned buffers,
14813 add zlib header.
14814 (zlib_compressed_suffix): Removed.
14815 (Output_compressed_section::set_final_data_size): Use unsigned
14816 buffers.
14817 * testsuite/Makefile.am (flagstest_compress_debug_sections):
14818 Fix linker invocation.
14819 (flagstest_o_specialfile_and_compress_debug_sections):
14820 Likewise.
14821 * testsuite/Makefile.in: Regenerated.
14822
deae2a14
DM
148232008-04-02 David S. Miller <davem@davemloft.net>
14824
14825 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
14826 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
14827
70752818
ILT
148282008-04-02 Craig Silverstein <csilvers@google.com>
14829
14830 * TODO: New file.
14831
39d0cb0e
ILT
148322008-04-02 Ian Lance Taylor <iant@google.com>
14833
14834 * fileread.cc (File_read::find_view): Add byteshift and vshifted
14835 parameters. Update for new key type to views_. Change all
14836 callers.
14837 (File_read::read): Adjust for byteshift in returned view.
14838 (File_read::add_view): New function, broken out of
14839 find_and_make_view.
14840 (File_read::make_view): New function, broken out of
14841 find_and_make_view.
14842 (File_read::find_or_make_view): Add offset and aligned
14843 parameters. Rewrite accordingly. Change all callers.
14844 (File_read::get_view): Add offset and aligned parameters. Adjust
14845 for byteshift in return value.
14846 (File_read::get_lasting_view): Likewise.
14847 * fileread.h (class File_read): Update declarations.
14848 (class File_read::View): Add byteshift_ field. Add byteshift to
14849 constructor. Add byteshift method.
14850 * archive.h (Archive::clear_uncached_views): New function.
14851 (Archive::get_view): Add aligned parameter. Change all callers.
14852 * object.h (Object::get_view): Add aligned parameter. Change all
14853 callers.
14854 (Object::get_lasting_view): Likewise.
14855
14856 * fileread.cc (File_read::release): Don't call clear_views if
14857 there are multiple objects.
14858 * fileread.h (File_read::clear_uncached_views): New function.
14859 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
14860 on the archive.
14861
a1207466
CC
148622008-03-31 Cary Coutant <ccoutant@google.com>
14863
14864 Add thin archive support.
14865 * archive.cc (Archive::armagt): New const.
14866 (Archive::setup): Remove task parameter and calls to unlock.
14867 (Archive::unlock_nested_archives): New function.
14868 (Archive::read_header): Add nested_off parameter. Change
14869 all callers.
14870 (Archive::interpret_header): Likewise.
14871 (Archive::include_all_members): Change to handle thin
14872 archives.
14873 (Archive::include_member): Likewise.
14874 * archive.h (Archive::Archive): Add new parameters and
14875 initializers.
14876 (Archive::armagt): New const.
14877 (Archive::setup): Remove task parameter.
14878 (Archive::unlock_nested_archives): New function.
14879 (Archive::read_header): Add nested_off parameter.
14880 (Archive::interpret_header): Likewise.
14881 (Archive::Nested_archive_table): New typedef.
14882 (Archive::is_thin_archive_): New field.
14883 (Archive::nested_archives_): New field.
14884 (Archive::options_): New field.
14885 (Archive::dirpath_): New field.
14886 (Archive::task_): New field.
14887 * readsyms.cc (Read_symbols::do_read_symbols): Add check
14888 for thin archives. Pass additional parameters to
14889 Archive::Archive. Unlock the archive file after calling
14890 Archive::setup.
cd536b21 14891
479f6503
ILT
148922008-03-29 Ian Lance Taylor <iant@google.com>
14893
686c8caf
ILT
14894 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
14895 version symbol to be local.
14896 * testsuite/ver_test_4.sh: New file.
14897 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
14898 (check_DATA): Add ver_test_4.syms.
14899 (ver_test_4.syms): New target.
14900 * testsuite/Makefile.in: Rebuild.
14901
ab794b6b
ILT
14902 * output.cc
14903 (Output_section::Input_section_sort_entry::has_priority): New
14904 function.
14905 (Output_section::Input_section_sort_entry::match_file_name): New
14906 function.
14907 (Output_section::Input_section_sort_entry::match_section_name):
14908 Remove.
14909 (Output_section::Input_section_sort_entry::match_section_name_prefix):
14910 Remove.
14911 (Output_section::Input_section_sort_entry::match_section_file):
14912 Remove.
14913 (Output_section::Input_section_sort_compare::operator()): Rewrite
14914 using new Input_section_sort_entry functions. Sort crtbegin and
14915 crtend first. Sort sections with no priority before sections with
14916 a priority.
14917 * testsuite/initpri1.c (d3): Check j != 4.
14918 (cd5): New constructor/destructor function.
14919 (main): Check j != 2.
14920
479f6503
ILT
14921 * symtab.cc (Symbol_table::add_from_object): If we don't use the
14922 new symbol when resolving, don't call set_is_default.
14923 * testsuite/ver_test_7.cc: New file.
14924 * testsuite/ver_test_7.sh: New file.
14925 * testsuite/Makefile.am (ver_test_7.so): New target.
14926 (ver_test_7.o): New target.
14927 (check_SCRIPTS): Add ver_test_7.sh.
14928 (check_DATA): Add ver_test_7.syms.
14929 (ver_test_7.syms): New target.
14930
2fd32231
ILT
149312008-03-28 Ian Lance Taylor <iant@google.com>
14932
14933 * layout.cc (Layout::layout): If we see an input section with a
14934 name that needs sorting, set the must_sort flag for the output
14935 section.
14936 (Layout::make_output_section): If the name of the output section
14937 indicates that it might require sorting, set the may_sort flag.
14938 * output.h (Output_section::may_sort_attached_input_sections): New
14939 function.
14940 (Output_section::set_may_sort_attached_input_sections): New
14941 function.
14942 (Output_section::must_sort_attached_input_sections): New
14943 function.
14944 (Output_section::set_must_sort_attached_input_sections): New
14945 function.
14946 (class Output_section): Declare Input_section_sort_entry. Define
14947 Input_section_sort_compare. Declare
14948 sort_attached_input_sections. Add new fields:
14949 may_sort_attached_input_sections_,
14950 must_sort_attached_input_sections_,
14951 attached_input_sections_are_sorted_.
14952 * output.cc (Output_section::Output_section): Initialize new
14953 fields.
14954 (Output_section::add_input_section): Add an entry to
14955 input_sections_ if may_sort or must_sort are true.
14956 (Output_section::set_final_data_size): Call
14957 sort_attached_input_sections if necessary.
14958 (Output_section::Input_section_sort_entry): Define new class.
14959 (Output_section::Input_section_sort_compare::operator()): New
14960 function.
14961 (Output_section::sort_attached_input_sections): New function.
14962 * configure.ac: Check whether the compiler supports constructor
14963 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
14964 * testsuite/initpri1.c: New file.
14965 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
14966 CONSTRUCTOR_PRIORITY.
14967 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
14968 (initpri1_LDFLAGS): New variable.
14969 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
14970
18e6b24e
ILT
149712008-03-27 Ian Lance Taylor <iant@google.com>
14972
49bdd526
ILT
14973 * common.cc (Sort_commons::operator): Correct sorting algorithm.
14974 * testsuite/common_test_1.c: New file.
14975 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
14976 (common_test_1_SOURCES): New variable.
14977 (common_test_1_DEPENDENCIES): New variable.
14978 (common_test_1_LDFLAGS): New variable.
14979
18e6b24e
ILT
14980 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
14981 and commons_ correctly when NAME/VERSION does not override
14982 NAME/NULL.
14983 * testsuite/ver_test_6.c: New file.
14984 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
14985 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
14986 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
14987
04bf7072
ILT
149882008-03-26 Ian Lance Taylor <iant@google.com>
14989
5871526f
ILT
14990 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
14991 of an undefined symbol from a version script.
14992 * testsuite/Makefile.am (ver_test_5.so): New target.
14993 (ver_test_5.o): New target.
14994 (check_SCRIPTS): Add ver_test_5.sh.
14995 (check_DATA): Add ver_test_5.syms.
14996 (ver_test_5.syms): New target.
14997 * testsuite/ver_test_5.cc: New file.
14998 * testsuite/ver_test_5.script: New file.
14999 * testsuite/ver_test_5.sh: New file.
15000 * Makefile.in, testsuite/Makefile.in: Rebuild.
15001
04bf7072
ILT
15002 PR gold/5986
15003 Fix problems building gold with gcc 4.3.0.
15004 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15005 (gold_error_at_location, gold_warning_at_location): Use it.
15006 * configure.ac: Check whether we can compile and use a template
15007 function with a printf attribute.
15008 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15009 when jumping over bytes.
15010 * object.cc: Instantiate Object::read_section_data.
15011 * debug.h: Include <cstring>
15012 * dwarf_reader.cc: Include <algorithm>
15013 * main.cc: Include <cstring>.
15014 * options.cc: Include <cstring>.
15015 * output.cc: Include <cstring>.
15016 * script.cc: Include <cstring>.
15017 * script.h: Include <string>.
15018 * symtab.cc: Include <cstring> and <algorithm>.
15019 * target-select.cc: Include <cstring>.
15020 * version.cc: Include <string>.
15021 * testsuite/testmain.cc: Include <cstdlib>.
15022 * configure, config.in: Rebuild.
15023
874c5b28
ILT
150242008-03-25 Ian Lance Taylor <iant@google.com>
15025
819d6c3a
ILT
15026 * options.cc: Include "../bfd/bfdver.h".
15027 (options::help): Print bug reporting address.
15028
f4b2c6f5
ILT
15029 * version.cc (print_version): Adjust output for current value of
15030 BFD_VERSION_STRING.
15031
15032 * NEWS: New file.
15033
e96caa79
ILT
15034 * options.cc (options::help): Print list of supported targets.
15035 * target-select.h: Include <vector>.
15036 (class Target_selector): Make machine_, size_, and is_big_endian_
15037 fields const. Add bfd_name_ and instantiated_target_ fields.
15038 (Target_selector::Target_selector): Add bfd_name parameter.
15039 (Target_selector::recognize): Make non-virtual, call
15040 do_recognize.
15041 (Target_selector::recognize_by_name): Make non-virtual, call
15042 do_recognize_by_name.
15043 (Target_selector::supported_names): New function.
15044 (Target_selector::bfd_name): New function.
15045 (Target_selector::do_instantiate_target): New pure virtual
15046 function.
15047 (Target_selector::do_recognize): New virtual function.
15048 (Target_selector::do_recognize_by_name): New virtual function.
15049 (Target_selector::instantiate_target): New private function.
15050 (supported_target_names): Declare.
15051 * target-select.cc (Target_selector::Target_selector): Update for
15052 new parameter and fields.
15053 (select_target_by_name): Check that the name matches before
15054 calling recognize_by_name.
15055 (supported_target_names): New function.
15056 * i386.cc (class Target_selector_i386): Update Target_selector
15057 constructor call. Remove recognize and recognize_by_name. Add
15058 do_instantiate_target.
15059 * x86_64.cc (class Target_selector_x86_64): Likewise.
15060 * testsuite/testfile.cc (class Target_selector_test): Update for
15061 changes to Target_selector.
15062
874c5b28
ILT
15063 * README: Rewrite, with some notes on unsupported features.
15064
0a65a3a7
CC
150652008-03-24 Cary Coutant <ccoutant@google.com>
15066
15067 * i386.cc (Target_i386::Got_type): New enum declaration.
15068 (Target_i386::Scan::local): Updated callers of Output_data_got
15069 member functions.
15070 (Target_i386::Scan::global): Likewise.
15071 (Target_i386::Relocate::relocate): Likewise.
15072 (Target_i386::Relocate::relocate_tls): Likewise.
15073 * object.h (Got_offset_list): New class.
15074 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15075 (Sized_relobj::local_got_offset): Likewise.
15076 (Sized_relobj::set_local_got_offset): Likewise.
15077 (Sized_relobj::local_has_tls_got_offset): Removed.
15078 (Sized_relobj::local_tls_got_offset): Removed.
15079 (Sized_relobj::set_local_tls_got_offset): Removed.
15080 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15081 * output.cc (Output_data_got::add_global): Added got_type parameter.
15082 (Output_data_got::add_global_with_rel): Likewise.
15083 (Output_data_got::add_global_with_rela): Likewise.
15084 (Output_data_got::add_global_pair_with_rel): New function.
15085 (Output_data_got::add_global_pair_with_rela): New function.
15086 (Output_data_got::add_local): Added got_type parameter.
15087 (Output_data_got::add_local_with_rel): Likewise.
15088 (Output_data_got::add_local_with_rela): Likewise.
15089 (Output_data_got::add_local_pair_with_rel): New function.
15090 (Output_data_got::add_local_pair_with_rela): New function.
15091 (Output_data_got::add_global_tls): Removed.
15092 (Output_data_got::add_global_tls_with_rel): Removed.
15093 (Output_data_got::add_global_tls_with_rela): Removed.
15094 (Output_data_got::add_local_tls): Removed.
15095 (Output_data_got::add_local_tls_with_rel): Removed.
15096 (Output_data_got::add_local_tls_with_rela): Removed.
15097 * output.h (Output_data_got::add_global): Added got_type parameter.
15098 (Output_data_got::add_global_with_rel): Likewise.
15099 (Output_data_got::add_global_with_rela): Likewise.
15100 (Output_data_got::add_global_pair_with_rel): New function.
15101 (Output_data_got::add_global_pair_with_rela): New function.
15102 (Output_data_got::add_local): Added got_type parameter.
15103 (Output_data_got::add_local_with_rel): Likewise.
15104 (Output_data_got::add_local_with_rela): Likewise.
15105 (Output_data_got::add_local_pair_with_rel): New function.
15106 (Output_data_got::add_local_pair_with_rela): New function.
15107 (Output_data_got::add_global_tls): Removed.
15108 (Output_data_got::add_global_tls_with_rel): Removed.
15109 (Output_data_got::add_global_tls_with_rela): Removed.
15110 (Output_data_got::add_local_tls): Removed.
15111 (Output_data_got::add_local_tls_with_rel): Removed.
15112 (Output_data_got::add_local_tls_with_rela): Removed.
15113 * resolve.cc (Symbol::override_base_with_special): Removed
15114 reference to has_got_offset_ field.
15115 * symtab.cc (Symbol::init_fields): Replaced initialization
15116 of got_offset_ with got_offsets_. Removed initialization
15117 of has_got_offset_
53fcba31 15118 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
15119 (Symbol::got_offset): Likewise.
15120 (Symbol::set_got_offset): Likewise.
15121 (Symbol::has_tls_got_offset): Removed.
15122 (Symbol::tls_got_offset): Removed.
15123 (Symbol::set_tls_got_offset): Removed.
15124 (Symbol::got_offset_): Removed.
15125 (Symbol::tls_mod_got_offset_): Removed.
15126 (Symbol::tls_pair_got_offset_): Removed.
15127 (Symbol::got_offsets_): New field.
15128 (Symbol::has_got_offset): Removed.
15129 (Symbol::has_tls_mod_got_offset): Removed.
15130 (Symbol::has_tls_pair_got_offset): Removed.
15131 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
15132 (Target_x86_64::Scan::local): Updated callers of Output_data_got
15133 member functions.
15134 (Target_x86_64::Scan::global): Likewise.
15135 (Target_x86_64::Relocate::relocate): Likewise.
15136 (Target_x86_64::Relocate::relocate_tls): Likewise.
15137
bd52eafb
BE
151382008-03-25 Ben Elliston <bje@au.ibm.com>
15139
15140 * yyscript.y: Fix spelling error in comment.
15141
8b105e34
ILT
151422008-03-24 Ian Lance Taylor <iant@google.com>
15143
8ed814a9
ILT
15144 * options.h (class General_options): Define build_id option.
15145 * layout.h (class Layout): Declare write_build_id, create_note,
15146 create_build_id. Add build_id_note_ member.
15147 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
15148 "libiberty.h", "md5.h", "sha1.h".
15149 (Layout::Layout): Initialize eh_frame_data_,
15150 eh_frame_hdr_section_, and build_id_note_.
15151 (Layout::finalize): Call create_build_id.
15152 (Layout::create_note): New function, broken out of
15153 Layout::create_gold_note.
15154 (Layout::create_gold_note): Call create_note.
15155 (Layout::create_build_id): New function.
15156 (Layout::write_build_id): New function.
15157 (Close_task_runner::run): Call write_build_id.
15158
8b105e34
ILT
15159 * x86_64.cc: Correct license to GPLv3.
15160
086a1841
ILT
151612008-03-23 Ian Lance Taylor <iant@google.com>
15162
15163 * options.cc: Include "demangle.h".
15164 (parse_optional_string): New function.
15165 (parse_long_option): Handle takes_optional_argument.
15166 (parse_short_option): Update dash_z initializer. Handle
15167 takes_optional_argument.
15168 (General_options::General_options): Initialize do_demangle_.
15169 (General_options::finalize): Set do_demangle_. Handle demangling
15170 style.
15171 * options.h (parse_optional_string): Declare.
15172 (struct One_option): Add optional_arg field. Update constructor.
15173 Update call constructor calls. Add takes_optional_argument
15174 function.
15175 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
15176 (DEFINE_optional_string): Define.
15177 (General_options::demangle): Change from DEFINE_bool to
15178 DEFINE_optional_string.
15179 (General_options::no_demangle): New function.
15180 (General_options::do_demangle): New function.
15181 (General_options::set_do_demangle): New function.
15182 (General_options::execstack_status_): Move definition to end of
15183 class definition.
15184 (General_options::static_): Likewise.
15185 (General_options::do_demangle_): New field.
15186 * object.cc (big_endian>::get_symbol_location_info): Call
15187 Options::do_demangle, not Options::demangle.
15188 * symtab.cc (demangle): Likewise.
15189
cbb93e63
ILT
151902008-03-22 Ian Lance Taylor <iant@google.com>
15191
15192 * gold.h: Include <cstddef> and <sys/types.h>
15193 * options.h: Include <cstring>.
15194
ec531623
ILT
151952008-03-21 Ian Lance Taylor <iant@google.com>
15196
15197 * Added source code to GNU binutils.
752937aa 15198\f
0c6e6c39 15199Copyright (C) 2008-2013 Free Software Foundation, Inc.
752937aa
NC
15200
15201Copying and distribution of this file, with or without modification,
15202are permitted in any medium without royalty provided the copyright
15203notice and this notice are preserved.
15204
15205Local Variables:
15206mode: change-log
15207left-margin: 8
15208fill-column: 74
15209version-control: never
15210End:
This page took 1.458859 seconds and 4 git commands to generate.